@expofp/floorplan 3.25.2 → 3.27.0

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 (226) hide show
  1. package/dist/browser/{Button-DZ5RJVoX.js → Button-e8P-AcfW.js} +6 -6
  2. package/dist/browser/{CookieConsent-CNE-7zNI.js → CookieConsent-DT6PZdD-.js} +8 -8
  3. package/dist/browser/{Debug-TDQ_xzea.js → Debug-Btnxv9GC.js} +8 -8
  4. package/dist/browser/DebugTools-CH_HoQal.js +1922 -0
  5. package/dist/browser/{Demo-A0X5mRqG.js → Demo-DZoFFss-.js} +10 -10
  6. package/dist/browser/{Free-BjYK0xDM.js → Free-DiFQkGSU.js} +10 -10
  7. package/dist/browser/{GalleryContainer-BsQuHOrj.js → GalleryContainer-aJ6EZ5I3.js} +11 -11
  8. package/dist/browser/{GpsLoader-DoutzmU_.js → GpsLoader-Bu9mBOam.js} +34 -34
  9. package/dist/browser/KioskStore-DUC4jNn0.js +241 -0
  10. package/dist/browser/{MaplibreAdapter-W1ZdQQ00.js → MaplibreAdapter-DIlDXt73.js} +2067 -2152
  11. package/dist/browser/{ModalContainer-BfZm0B_L.js → ModalContainer-CVRxdpt2.js} +11 -11
  12. package/dist/browser/{PermissionNotice-Cm6qrOC_.js → PermissionNotice-B5X5RQja.js} +7 -7
  13. package/dist/browser/SetKioskMode-BbDnU98F.js +48 -0
  14. package/dist/browser/{ShowKiosk-B0cj0p6h.js → ShowKiosk-B7HfONvN.js} +11 -11
  15. package/dist/browser/{ViewerMenuPanel-FFmV-n9m.js → ViewerMenuPanel-CT6kvVUw.js} +17 -17
  16. package/dist/browser/{add-debug-secret-listener-BOW3NQe7.js → add-debug-secret-listener-Dvv-Pg0-.js} +1 -1
  17. package/dist/browser/{adopt-global-settings-DNTNdr3z.js → adopt-global-settings-CXzCKJtp.js} +10 -10
  18. package/dist/browser/{boolean-editor-Bx4HLLyu.js → boolean-editor-CHMR9ZwP.js} +10 -10
  19. package/dist/browser/{bootIntercom-C_8HLvxg.js → bootIntercom-DQcGuly8.js} +3 -3
  20. package/dist/browser/bundle.json +77 -65
  21. package/dist/browser/camera-events-BkrzcISl.js +18 -0
  22. package/dist/browser/{classnames-DovQg6we.js → classnames-BYuGpzao.js} +2 -2
  23. package/dist/browser/{client-CadlVOps.js → client-hxMr1frV.js} +793 -992
  24. package/dist/browser/{components-BK-czcTL.js → components-DiB2l4Q7.js} +1934 -1986
  25. package/dist/browser/debug-context-CfyAAxAt.js +24315 -0
  26. package/dist/browser/{debug-overlay-vFTynZrP.js → debug-overlay-PYUvPcx-.js} +11 -11
  27. package/dist/browser/{debug-ui-BgSppEQg.js → debug-ui-BXRAYxv6.js} +7 -7
  28. package/dist/browser/dimming-Dj-1kBgQ.js +1108 -0
  29. package/dist/browser/{dist-C1WQpGAq.js → dist-30RVEJTr.js} +7 -7
  30. package/dist/browser/{dist-CkAU9dsV.js → dist-DgGMS59X.js} +6 -6
  31. package/dist/browser/{dist-gIYlJ33F.js → dist-opCvrhNh.js} +3 -3
  32. package/dist/browser/{efp-debug-init-CGEJSmuk.js → efp-debug-init-CYfrcz9M.js} +4 -4
  33. package/dist/browser/{enum-editor-BZXgS3I-.js → enum-editor-BYO96W3-.js} +5 -5
  34. package/dist/browser/{es5-DoqUhz95.js → es5-Bpzk_wCi.js} +2 -2
  35. package/dist/browser/{event-not-found-Dl66nXH1.js → event-not-found-DEepFxEc.js} +1 -1
  36. package/dist/browser/{exports-CK5UTqgq.js → exports-Bo5VUoiX.js} +1 -1
  37. package/dist/browser/{favicon-BnTLQysW.js → favicon-Bf88cI9_.js} +1 -1
  38. package/dist/browser/{fetch-retry.umd-D_tGjwEb.js → fetch-retry.umd-D2BnNN8g.js} +2 -2
  39. package/dist/browser/{flex-BCrAgMxK.js → flex-B5cqWC1b.js} +6 -6
  40. package/dist/browser/{floorplan.loader-DXJR9eeS.js → floorplan.loader-D3lRYRJS.js} +10 -10
  41. package/dist/browser/{floorplan.ready-C0sdmceF.js → floorplan.ready-CsdDpbEv.js} +343 -307
  42. package/dist/browser/{fuse-C7evxCwi.js → fuse-CzalO4Mu.js} +2 -2
  43. package/dist/browser/{i18n-Cp32ZzDq.js → i18n-D1sb3MoT.js} +5 -5
  44. package/dist/browser/index.js +14 -14
  45. package/dist/browser/{index.module-CeDH7KeK.js → index.module-JxYvexTC.js} +4 -4
  46. package/dist/browser/{integrateKiosk-JZG1AZBF.js → integrateKiosk-e4HqZu2W.js} +5 -5
  47. package/dist/browser/{is-webview-Be9due3O.js → is-webview-ChPDTaTY.js} +1 -1
  48. package/dist/browser/{jsx-runtime-DwNSQYOA.js → jsx-runtime-Ca1Wj_4-.js} +2 -2
  49. package/dist/browser/{kiosk-record-BMwfA16j.js → kiosk-record-C2cafcoW.js} +1 -1
  50. package/dist/browser/{lib-DeQ47J_S.js → lib-DXqE6M9Z.js} +3 -3
  51. package/dist/browser/{loadImage-DVBOry5-.js → loadImage-8qYzT9NG.js} +4 -4
  52. package/dist/browser/{logDeviceInfo-uPn7yfGH.js → logDeviceInfo-CF95RwQH.js} +9 -9
  53. package/dist/browser/{mobx-DFFcUY2e.js → mobx-B8aGIDdz.js} +7 -7
  54. package/dist/browser/{optional-boolean-editor-DfcaW7-l.js → optional-boolean-editor-D02Q8KUS.js} +4 -4
  55. package/dist/browser/{optional-enum-editor-SEARu4hs.js → optional-enum-editor-RV_EKfNQ.js} +5 -5
  56. package/dist/browser/{optional-string-editor-COLkp8EA.js → optional-string-editor-D_t_aZG2.js} +5 -5
  57. package/dist/browser/{particles.min-DHvuM5ou.js → particles.min-CDyH_67D.js} +2 -2
  58. package/dist/browser/{react-BNCBBLDK.js → react-CDmIhEY6.js} +2 -2
  59. package/dist/browser/{react-dom-ql8ZgjdB.js → react-dom-PGvJwDoR.js} +3 -3
  60. package/dist/browser/{rolldown-runtime-D0mAPq9J.js → rolldown-runtime-CwqkRsWu.js} +1 -1
  61. package/dist/browser/scheduler-MBFOnOYr.js +212 -0
  62. package/dist/browser/{select-CwB0Zi7C.js → select-2x53pvd0.js} +11 -11
  63. package/dist/browser/{settings-MzAuoQZ6.js → settings-BCkl8gdb.js} +2 -2
  64. package/dist/browser/{settings-item-Ca6s5CDf.js → settings-item-DT6Vnw06.js} +7 -7
  65. package/dist/browser/store-Dej5FGrq.js +31205 -0
  66. package/dist/browser/{string-editor-BjOeNcgJ.js → string-editor-w9YDgRoR.js} +5 -5
  67. package/dist/browser/{text-field-6Ccfbuuo.js → text-field-ricOc0h0.js} +6 -6
  68. package/dist/browser/{theme-XlV0fBPc.js → theme-Ce7vpk9b.js} +9 -9
  69. package/dist/browser/{ui-BopruaHZ.js → ui-PDV2rEkU.js} +9 -9
  70. package/dist/browser/{useRenderTarget-CdH-VI6E.js → useRenderTarget-DroCs5kL.js} +5 -5
  71. package/dist/browser/viewport-Jwms2MJD.js +41 -0
  72. package/dist/esm/components/Booth/Booth.js +1 -1
  73. package/dist/esm/components/Event.js +1 -1
  74. package/dist/esm/components/Exhibitor.js +1 -1
  75. package/dist/esm/components/Kiosk/KioskStore.d.ts +5 -2
  76. package/dist/esm/components/Kiosk/KioskStore.js +1 -1
  77. package/dist/esm/components/Kiosk/SetKioskMode.d.ts +1 -2
  78. package/dist/esm/components/Kiosk/SetKioskMode.js +1 -1
  79. package/dist/esm/components/Layout.js +1 -1
  80. package/dist/esm/components/Map/Map.d.ts +1 -1
  81. package/dist/esm/components/Map/Map.js +1 -1
  82. package/dist/esm/components/Map/MapCamera.d.ts +17 -0
  83. package/dist/esm/components/Map/MapCamera.js +1 -0
  84. package/dist/esm/components/Map/MapViewport.d.ts +12 -0
  85. package/dist/esm/components/Map/MapViewport.js +1 -0
  86. package/dist/esm/components/Map/booth-by-xy.d.ts +13 -0
  87. package/dist/esm/components/Map/booth-by-xy.js +1 -1
  88. package/dist/esm/components/Map/camera-events.d.ts +16 -0
  89. package/dist/esm/components/Map/camera-events.js +1 -0
  90. package/dist/esm/components/Map/camera.d.ts +48 -0
  91. package/dist/esm/components/Map/camera.js +1 -0
  92. package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +1 -1
  93. package/dist/esm/components/Map/drawing/config/config-all.d.ts +1 -2
  94. package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
  95. package/dist/esm/components/Map/drawing/config/config-bg.d.ts +1 -2
  96. package/dist/esm/components/Map/drawing/config/config-bg.js +1 -1
  97. package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +70 -3
  98. package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
  99. package/dist/esm/components/Map/drawing/config/config-booth-bg.d.ts +3 -6
  100. package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
  101. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +11 -7
  102. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
  103. package/dist/esm/components/Map/drawing/config/config-booth-border.d.ts +2 -3
  104. package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
  105. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +16 -3
  106. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
  107. package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +18 -4
  108. package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
  109. package/dist/esm/components/Map/drawing/config/config-booths.d.ts +1 -2
  110. package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
  111. package/dist/esm/components/Map/drawing/config/config-load-layer.d.ts +1 -2
  112. package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
  113. package/dist/esm/components/Map/drawing/config/config-markers.d.ts +23 -2
  114. package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
  115. package/dist/esm/components/Map/drawing/config/layer-images.d.ts +35 -0
  116. package/dist/esm/components/Map/drawing/config/layer-images.js +1 -0
  117. package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +38 -3
  118. package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
  119. package/dist/esm/components/Map/pointer.d.ts +73 -0
  120. package/dist/esm/components/Map/pointer.js +1 -0
  121. package/dist/esm/components/Map/scene.d.ts +20 -0
  122. package/dist/esm/components/Map/scene.js +1 -0
  123. package/dist/esm/components/Map/traffic/trafficLayers.d.ts +2 -7
  124. package/dist/esm/components/Map/traffic/trafficLayers.js +1 -1
  125. package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +4 -3
  126. package/dist/esm/components/Map/traffic/useBuildRoute.js +6 -6
  127. package/dist/esm/components/Map/traffic/useManageTraffic.d.ts +4 -3
  128. package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
  129. package/dist/esm/components/Map/viewport.d.ts +63 -0
  130. package/dist/esm/components/Map/viewport.js +1 -0
  131. package/dist/esm/components/Maplibre/MaplibreAdapter.d.ts +6 -2
  132. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  133. package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +30 -8
  134. package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
  135. package/dist/esm/components/Maplibre/useDimming.d.ts +2 -2
  136. package/dist/esm/components/Maplibre/useDimming.js +1 -1
  137. package/dist/esm/components/Maplibre/useKioskIdleEvents.d.ts +5 -6
  138. package/dist/esm/components/Maplibre/useLayerVisibilitySync.d.ts +2 -2
  139. package/dist/esm/components/Maplibre/useLayerVisibilitySync.js +1 -1
  140. package/dist/esm/components/Maplibre/usePoiMarkers.d.ts +1 -2
  141. package/dist/esm/components/Maplibre/useWayfindingAndMarkers.d.ts +8 -5
  142. package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -1
  143. package/dist/esm/components/Maplibre/utils/layer-defs.d.ts +8 -3
  144. package/dist/esm/components/Maplibre/utils/layer-defs.js +1 -1
  145. package/dist/esm/components/Maplibre/utils/poi-marker-hit-test.d.ts +3 -3
  146. package/dist/esm/components/Speaker.js +1 -1
  147. package/dist/esm/components/Ws.js +1 -1
  148. package/dist/esm/engine/defs.d.ts +30 -0
  149. package/dist/esm/engine/defs.js +3 -0
  150. package/dist/esm/engine/fonts.js +1 -0
  151. package/dist/esm/engine/update-def.d.ts +52 -0
  152. package/dist/esm/engine/update-def.js +1 -0
  153. package/dist/esm/engine/utils/rotation.d.ts +6 -0
  154. package/dist/esm/engine/utils/rotation.js +1 -0
  155. package/dist/esm/floorplan.ready.d.ts +2 -0
  156. package/dist/esm/floorplan.ready.js +1 -1
  157. package/dist/esm/services/url-sync.js +1 -1
  158. package/dist/esm/store/BoothStore.d.ts +11 -0
  159. package/dist/esm/store/HeatmapStore.d.ts +9 -0
  160. package/dist/esm/store/LayerStore.d.ts +2 -0
  161. package/dist/esm/store/LayerStore.js +1 -1
  162. package/dist/esm/store/RootStore.d.ts +0 -2
  163. package/dist/esm/store/RootStore.js +1 -1
  164. package/dist/esm/store/RouteStore.js +1 -1
  165. package/dist/esm/store/ShortcutRegistry.d.ts +14 -0
  166. package/dist/esm/store/ShortcutRegistry.js +1 -1
  167. package/dist/esm/store/UIState.js +1 -1
  168. package/dist/esm/store/details-events.d.ts +11 -0
  169. package/dist/esm/store/details-events.js +1 -0
  170. package/dist/esm/store/init/init-booths.js +1 -1
  171. package/dist/esm/store/providers/SessionsSubButtonProvider.d.ts +18 -0
  172. package/dist/esm/store/providers/SessionsSubButtonProvider.js +1 -1
  173. package/dist/esm/store/search-buttons/SearchButtonsActions.d.ts +15 -2
  174. package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
  175. package/dist/esm/store/search-buttons/SearchButtonsFactory.js +1 -1
  176. package/dist/esm/store/search-buttons/SearchButtonsStore.d.ts +3 -3
  177. package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
  178. package/dist/esm/tools/gtag.d.ts +1 -0
  179. package/dist/esm/tools/gtag.js +1 -1
  180. package/dist/esm/tools/telemetry.d.ts +2 -0
  181. package/dist/esm/tools/telemetry.js +1 -1
  182. package/dist/esm/tools/track-event.d.ts +26 -2
  183. package/dist/esm/tools/track-event.js +1 -1
  184. package/dist/esm/utils/dimming.d.ts +13 -2
  185. package/dist/esm/utils/dimming.js +1 -1
  186. package/dist/esm/utils/mobx.d.ts +2 -2
  187. package/dist/esm/utils/mobx.js +1 -1
  188. package/dist/esm/utils/scene-bounds.d.ts +1 -1
  189. package/dist/esm/utils/scene-bounds.js +1 -1
  190. package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
  191. package/dist/esm/wayfinding/createWayfinding.d.ts +19 -2
  192. package/dist/esm/wayfinding/createWayfinding.js +1 -1
  193. package/package.json +11 -10
  194. package/dist/browser/KioskStore-CRN9B487.js +0 -290
  195. package/dist/browser/SetKioskMode-BlmUmBkH.js +0 -57
  196. package/dist/browser/booth-by-xy-DgXTlV8u.js +0 -1130
  197. package/dist/browser/main-WTEdqNkt.js +0 -289
  198. package/dist/browser/store-B_c3r86U.js +0 -41370
  199. package/dist/esm/components/Map/pointInConvexQuad.d.ts +0 -3
  200. package/dist/esm/components/Map/pointInConvexQuad.js +0 -1
  201. package/dist/esm/components/Map/visibleArea.d.ts +0 -16
  202. package/dist/esm/components/Map/visibleArea.js +0 -1
  203. package/dist/esm/components/Maplibre/useRendererEvents.d.ts +0 -9
  204. package/dist/esm/components/Maplibre/useRendererEvents.js +0 -1
  205. package/dist/esm/components/Maplibre/utils/update-pump.d.ts +0 -18
  206. package/dist/esm/components/Maplibre/utils/update-pump.js +0 -1
  207. package/dist/esm/renderer/HandlerRegistry.d.ts +0 -18
  208. package/dist/esm/renderer/HandlerRegistry.js +0 -1
  209. package/dist/esm/renderer/RendererService.d.ts +0 -44
  210. package/dist/esm/renderer/RendererService.js +0 -1
  211. package/dist/esm/renderer/engine-core/defs.d.ts +0 -40
  212. package/dist/esm/renderer/engine-core/defs.js +0 -3
  213. package/dist/esm/renderer/engine-core/fonts.js +0 -1
  214. package/dist/esm/renderer/engine-core/settings.d.ts +0 -4
  215. package/dist/esm/renderer/engine-core/settings.js +0 -1
  216. package/dist/esm/renderer/engine-core/types.d.ts +0 -50
  217. package/dist/esm/renderer/engine-core/types.js +0 -1
  218. package/dist/esm/renderer/engine-core/update-def.d.ts +0 -12
  219. package/dist/esm/renderer/engine-core/update-def.js +0 -1
  220. package/dist/esm/renderer/engine-core/utils/rotation.d.ts +0 -17
  221. package/dist/esm/renderer/engine-core/utils/rotation.js +0 -1
  222. package/dist/esm/renderer/index.d.ts +0 -19
  223. package/dist/esm/renderer/index.js +0 -1
  224. /package/dist/esm/{renderer/engine-core → engine}/canvases.d.ts +0 -0
  225. /package/dist/esm/{renderer/engine-core → engine}/canvases.js +0 -0
  226. /package/dist/esm/{renderer/engine-core → engine}/fonts.d.ts +0 -0
@@ -1,12 +1,21 @@
1
1
  import Color from 'color';
2
2
  import { type GaEventActions } from '../tools/gtag';
3
3
  import { BoothBase } from './BoothStore';
4
+ import { Exhibitor } from './ExhibitorStore';
4
5
  import { type ListItem } from './types';
5
6
  export default class HeatmapStore {
6
7
  heatmapData: HeatmapData;
8
+ /**
9
+ * A booth view parked for the next `selectedExhibitor` reaction: a click on
10
+ * a booth with a single exhibitor opens that exhibitor's card, but counts as
11
+ * a view of the BOOTH. `exhibitor` is the selection it stands in for — the
12
+ * reaction honours the entry for that selection only, so one left behind by
13
+ * a click that changed nothing cannot mislabel a later, unrelated view.
14
+ */
7
15
  forceTrack: {
8
16
  action: GaEventActions;
9
17
  label: string;
18
+ exhibitor: Exhibitor;
10
19
  } | null;
11
20
  get minAndMaxClicks(): {
12
21
  min: number;
@@ -42,6 +42,8 @@ export default class LayerStore {
42
42
  get visible(): Layer[];
43
43
  get loaded(): Layer[];
44
44
  get rectangle(): Box | null;
45
+ /** Union of all layers' rects to use as a bounds for camera */
46
+ get bounds(): Box | undefined;
45
47
  get viewboxRectangle(): Box | null;
46
48
  get pathwayLayers(): Layer[];
47
49
  get floors(): (Floor & {
@@ -1 +1 @@
1
- import{__decorate as a}from"tslib";import{Box as d}from"@expofp/geometry";import{action as c,computed as f,observable as h,runInAction as m}from"mobx";import y from"../components/Map/drawing/config/config-load-layer";import{getFpSvgJs as w}from"../data/fp-payloads";import b from"../tools/settings";import{areLayersEnabled as v}from"../utils/areLayersEnabled";import{shortenName as g}from"../utils/shortenName";import n from".";const x=["money2020usa","rodion2","possible2025","2025virtuosotravelweek","zscalerskofy26","gamescom2025"];export var LayersMode;(function(s){s[s.Default=0]="Default",s[s.Separated=1]="Separated",s[s.Radio=2]="Radio",s[s.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(s){s[s.Unset=0]="Unset",s[s.AlwaysVisible=1]="AlwaysVisible",s[s.AlwaysHidden=2]="AlwaysHidden",s[s.TurnedOn=3]="TurnedOn",s[s.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));export class Layer{constructor(){this.basePriority=0,this.name="",this.description="",this.frozen=!1,this.rect=null,this.viewbox=null,this.configured=!1,this.childLayers=[],this.rootParent=null,this.mode=LayerMode.Unset,this.children=[],this.loaded=!1,this.visible=!1}get shortName(){return g(this.description)}}a([h],Layer.prototype,"loaded",void 0),a([h],Layer.prototype,"visible",void 0);export default class l{constructor(){this.layers=[],this.mode=LayersMode.Default,this.layersLoaded=!1,this.updateVisibilityTimeout=0,this.selectFloorTimeout=0}get visible(){return this.layers.filter(r=>r.frozen||r.visible)}get loaded(){return this.layers.filter(r=>r.loaded)}get rectangle(){const r=this.visible.filter(t=>!t.frozen).map(t=>t.viewbox??t.rect).filter(t=>!!t);return this.mode!==LayersMode.Radio||!r.length?null:d.fromUnion(...r)||null}get viewboxRectangle(){const r=this.visible.filter(t=>!t.frozen).map(t=>t.viewbox).filter(t=>!!t);return r.length&&d.fromUnion(...r)||null}get pathwayLayers(){return this.layers.filter(r=>r.pathway)}get floors(){if(!v())return[];const r=new Set(this.layers.filter(e=>e&&!e.frozen&&!e.rootParent&&!e.pathway).concat(n.routeStore.layers.filter(e=>e&&e.mode!==LayerMode.AlwaysHidden&&e.mode!==LayerMode.AlwaysVisible))),t=Array.from(r).reverse();return t.map((e,i)=>{const o=n.routeStore.layers.length>0&&n.routeStore.layers.indexOf(e)===-1,u=n.toursStore.tourLayers.length>0&&n.toursStore.tourLayers.indexOf(e)===-1;return{layer:e,name:e.name,shortName:e.shortName,description:e.description,active:e.visible,disabled:!!(o||u),index:e.floorIndex??t.length-i-1}})}selectFloor(r){if(this.selectFloorTimeout)return;this.selectFloorTimeout=window.setTimeout(()=>this.selectFloorTimeout=0,500);const t=this.layers.find(i=>i.description===r.description);if(!t)return;if(this.mode===LayersMode.Radio){if(this.updateVisibility(t,!0),n.maplibreStore.showMaplibre)return;if(!!w().__fpSettings?.fpVer||x.includes(b.EXPO)){const o=t.viewbox??t.rect;n.uiState.moveToRect=o}else{const o=this.layers.indexOf(this.layers.filter(p=>!p.frozen&&p.visible)[0]),u=this.layers.indexOf(t);if(o===u)return;n.uiState.zoomBy=u<o?.95:1.05}}else this.updateVisibility(t,!t.visible);const e=n.toursStore.getTourLayerInfo(t.name)||n.toursStore.getTourLayerInfo(t.description);if(e){this.showPathWay(e.id);return}n.toursStore.stopTour()}updateVisibility(r,t){if(this.mode===LayersMode.Radio&&!t)return;const e=r instanceof Layer?r:this.findLayer(r);if(!e||e.visible===t){e&&n.routeStore.currentRouteLayer!==e&&(n.routeStore.currentRouteLayer=e);return}y(e,n.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(i=>!i.pathway).forEach(i=>{i.name!==e.name&&!i.frozen&&i.visible&&(i.visible=!1,i.childLayers.forEach(o=>{o.visible=!1}))}),e&&(e.visible=t,e.childLayers.forEach(i=>{i.visible=t}),t&&(n.routeStore.currentRouteLayer=e),typeof n.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=window.setTimeout(()=>{const i=n.fp.getFloors();n.fp.onFloorActivated(i.find(o=>o.name===e.name))})))})}findLayer(r){if(r==null)return null;const t=this.layers.filter(o=>!o.rootParent);if(typeof r=="number"){const o=t.filter(u=>!u.frozen)[r];if(o)return o}const e=r.toString().toLowerCase(),i=t.find(o=>{const u=(o.name.match(/(-?[0-9]+)/)||"")[0];return e===o?.name.toLowerCase()||e===o?.description.toLowerCase()||e===o?.shortName.toLowerCase()||e===u});return i||(/\D/.test(e)?null:t.filter(o=>!o.frozen)[parseInt(e)]??null)}getPathwayList(){return this.layers.filter(r=>r.pathway)}async showPathWay(r){try{const t=this.findLayer(r);if(!t)throw new Error(`There is no pathway with this name. ${r}`);await y(t,n.rendererService);const e=this.getPathwayList();m(()=>{e.forEach(i=>{const o=i.name===r;i.visible=o,i.childLayers.forEach(u=>{u.visible=o})})})}catch(t){console.error("showPathWay",t)}}hidePathways(){this.getPathwayList().forEach(t=>{t.visible=!1,t.childLayers.forEach(e=>{e.visible=!1})})}}a([h],l.prototype,"layers",void 0),a([h],l.prototype,"defaultLayer",void 0),a([h],l.prototype,"mode",void 0),a([h],l.prototype,"layersLoaded",void 0),a([f({keepAlive:!0})],l.prototype,"visible",null),a([f({keepAlive:!0})],l.prototype,"loaded",null),a([f({keepAlive:!0})],l.prototype,"rectangle",null),a([f({keepAlive:!0})],l.prototype,"viewboxRectangle",null),a([f],l.prototype,"pathwayLayers",null),a([f],l.prototype,"floors",null),a([c],l.prototype,"selectFloor",null),a([c],l.prototype,"updateVisibility",null),a([c],l.prototype,"showPathWay",null),a([c],l.prototype,"hidePathways",null);
1
+ import{__decorate as n}from"tslib";import{Box as p}from"@expofp/geometry";import{action as c,computed as f,observable as h,runInAction as m}from"mobx";import y from"../components/Map/drawing/config/config-load-layer";import{getFpSvgJs as b}from"../data/fp-payloads";import w from"../tools/settings";import{areLayersEnabled as v}from"../utils/areLayersEnabled";import{shortenName as g}from"../utils/shortenName";import a from".";const x=["money2020usa","rodion2","possible2025","2025virtuosotravelweek","zscalerskofy26","gamescom2025"];export var LayersMode;(function(s){s[s.Default=0]="Default",s[s.Separated=1]="Separated",s[s.Radio=2]="Radio",s[s.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(s){s[s.Unset=0]="Unset",s[s.AlwaysVisible=1]="AlwaysVisible",s[s.AlwaysHidden=2]="AlwaysHidden",s[s.TurnedOn=3]="TurnedOn",s[s.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));export class Layer{constructor(){this.basePriority=0,this.name="",this.description="",this.frozen=!1,this.rect=null,this.viewbox=null,this.configured=!1,this.childLayers=[],this.rootParent=null,this.mode=LayerMode.Unset,this.children=[],this.loaded=!1,this.visible=!1}get shortName(){return g(this.description)}}n([h],Layer.prototype,"loaded",void 0),n([h],Layer.prototype,"visible",void 0);export default class l{constructor(){this.layers=[],this.mode=LayersMode.Default,this.layersLoaded=!1,this.updateVisibilityTimeout=0,this.selectFloorTimeout=0}get visible(){return this.layers.filter(r=>r.frozen||r.visible)}get loaded(){return this.layers.filter(r=>r.loaded)}get rectangle(){const r=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox??e.rect).filter(e=>!!e);return this.mode!==LayersMode.Radio||!r.length?null:p.fromUnion(...r)||null}get bounds(){const r=this.visible.map(e=>e.viewbox??e.rect).filter(Boolean);return r.length?p.fromUnion(...r):void 0}get viewboxRectangle(){const r=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox).filter(e=>!!e);return r.length&&p.fromUnion(...r)||null}get pathwayLayers(){return this.layers.filter(r=>r.pathway)}get floors(){if(!v())return[];const r=new Set(this.layers.filter(t=>t&&!t.frozen&&!t.rootParent&&!t.pathway).concat(a.routeStore.layers.filter(t=>t&&t.mode!==LayerMode.AlwaysHidden&&t.mode!==LayerMode.AlwaysVisible))),e=Array.from(r).reverse();return e.map((t,i)=>{const o=a.routeStore.layers.length>0&&a.routeStore.layers.indexOf(t)===-1,u=a.toursStore.tourLayers.length>0&&a.toursStore.tourLayers.indexOf(t)===-1;return{layer:t,name:t.name,shortName:t.shortName,description:t.description,active:t.visible,disabled:!!(o||u),index:t.floorIndex??e.length-i-1}})}selectFloor(r){if(this.selectFloorTimeout)return;this.selectFloorTimeout=window.setTimeout(()=>this.selectFloorTimeout=0,500);const e=this.layers.find(i=>i.description===r.description);if(!e)return;if(this.mode===LayersMode.Radio){if(this.updateVisibility(e,!0),a.maplibreStore.showMaplibre)return;if(!!b().__fpSettings?.fpVer||x.includes(w.EXPO)){const o=e.viewbox??e.rect;a.uiState.moveToRect=o}else{const o=this.layers.indexOf(this.layers.filter(d=>!d.frozen&&d.visible)[0]),u=this.layers.indexOf(e);if(o===u)return;a.uiState.zoomBy=u<o?.95:1.05}}else this.updateVisibility(e,!e.visible);const t=a.toursStore.getTourLayerInfo(e.name)||a.toursStore.getTourLayerInfo(e.description);if(t){this.showPathWay(t.id);return}a.toursStore.stopTour()}updateVisibility(r,e){if(this.mode===LayersMode.Radio&&!e)return;const t=r instanceof Layer?r:this.findLayer(r);if(!t||t.visible===e){t&&a.routeStore.currentRouteLayer!==t&&(a.routeStore.currentRouteLayer=t);return}y(t).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(i=>!i.pathway).forEach(i=>{i.name!==t.name&&!i.frozen&&i.visible&&(i.visible=!1,i.childLayers.forEach(o=>{o.visible=!1}))}),t&&(t.visible=e,t.childLayers.forEach(i=>{i.visible=e}),e&&(a.routeStore.currentRouteLayer=t),typeof a.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=window.setTimeout(()=>{const i=a.fp.getFloors();a.fp.onFloorActivated(i.find(o=>o.name===t.name))})))})}findLayer(r){if(r==null)return null;const e=this.layers.filter(o=>!o.rootParent);if(typeof r=="number"){const o=e.filter(u=>!u.frozen)[r];if(o)return o}const t=r.toString().toLowerCase(),i=e.find(o=>{const u=(o.name.match(/(-?[0-9]+)/)||"")[0];return t===o?.name.toLowerCase()||t===o?.description.toLowerCase()||t===o?.shortName.toLowerCase()||t===u});return i||(/\D/.test(t)?null:e.filter(o=>!o.frozen)[parseInt(t)]??null)}getPathwayList(){return this.layers.filter(r=>r.pathway)}async showPathWay(r){try{const e=this.findLayer(r);if(!e)throw new Error(`There is no pathway with this name. ${r}`);await y(e);const t=this.getPathwayList();m(()=>{t.forEach(i=>{const o=i.name===r;i.visible=o,i.childLayers.forEach(u=>{u.visible=o})})})}catch(e){console.error("showPathWay",e)}}hidePathways(){this.getPathwayList().forEach(e=>{e.visible=!1,e.childLayers.forEach(t=>{t.visible=!1})})}}n([h],l.prototype,"layers",void 0),n([h],l.prototype,"defaultLayer",void 0),n([h],l.prototype,"mode",void 0),n([h],l.prototype,"layersLoaded",void 0),n([f({keepAlive:!0})],l.prototype,"visible",null),n([f({keepAlive:!0})],l.prototype,"loaded",null),n([f({keepAlive:!0})],l.prototype,"rectangle",null),n([f({keepAlive:!0})],l.prototype,"bounds",null),n([f({keepAlive:!0})],l.prototype,"viewboxRectangle",null),n([f],l.prototype,"pathwayLayers",null),n([f],l.prototype,"floors",null),n([c],l.prototype,"selectFloor",null),n([c],l.prototype,"updateVisibility",null),n([c],l.prototype,"showPathWay",null),n([c],l.prototype,"hidePathways",null);
@@ -1,5 +1,4 @@
1
1
  import FloorPlanReady from '../floorplan.ready';
2
- import { RendererService } from '../renderer';
3
2
  import { URLFilterManager } from '../services/URLFilterManager';
4
3
  import BookmarksStore from './BookmarksStore';
5
4
  import BoothStore, { Booth } from './BoothStore';
@@ -53,7 +52,6 @@ export default class RootStore {
53
52
  readonly bookmarksStore: BookmarksStore;
54
53
  readonly urlFilterManager: URLFilterManager;
55
54
  readonly shortcutRegistry: ShortcutRegistry;
56
- readonly rendererService: RendererService;
57
55
  fp: FloorPlanReady;
58
56
  initialized: boolean;
59
57
  resetCameraFn: () => void;
@@ -1 +1 @@
1
- import{__decorate as i}from"tslib";import{action as s,computed as m,observable as u,runInAction as S}from"mobx";import{LANGUAGE_TYPE as d}from"../constants";import{RendererService as y}from"../renderer";import{URLFilterManager as w}from"../services/URLFilterManager";import{GaEventActions as b}from"../tools/gtag";import v from"../tools/logger";import{isWebGlSupported as g}from"../utils";import{resetLocale as k}from"../utils/i18n";import h from"../utils/is-mobile";import n from"../utils/is-webview";import{sanitizeSearch as x}from"../utils/sanitizeText";import B from"./BookmarksStore";import _,{BoothBase as c,RegularBooth as L}from"./BoothStore";import C from"./CategoryFilterStore";import E,{Category as T}from"./CategoryStore";import I,{EventItem as F}from"./EventStore";import M,{Exhibitor as p}from"./ExhibitorStore";import O from"./FuzzySearchEngineStore";import z from"./HeatmapStore";import R from"./IntercomStore";import A,{LayersMode as f}from"./LayerStore";import P from"./MaplibreStore";import V from"./OverlayStore";import G from"./PoiMarkerStore";import q from"./PoiTypeStore";import{SearchShortcutProvider as N}from"./providers/SearchShortcutProvider";import{SessionsShortcutProvider as U}from"./providers/SessionsShortcutProvider";import{SpeakerShortcutProvider as W}from"./providers/SpeakerShortcutProvider";import j from"./RoutePlannerStore";import H from"./RouteStore";import K from"./SearchButtonsStore";import Y from"./SearchStore";import $ from"./SessionsFilterStore";import{ShortcutRegistry as D}from"./ShortcutRegistry";import J from"./SpeakerFilterStore";import Q from"./SpeakerStore";import{SpeakerItem as X}from"./SpeakerStore";import Z from"./ToursStore";import tt from"./UIState";export default class e{setResetCameraFn(t){this.resetCameraFn=t}constructor(){this.rendererService=new y,this.initialized=!1,this.categoryStore=new E(this),this.exhibitorStore=new M(this),this.boothStore=new _(this),this.routeStore=new H(this),this.routePlannerStore=new j(this),this.toursStore=new Z(this),this.uiState=new tt(this),this.overlayStore=new V(this),this.maplibreStore=new P(this),this.layerStore=new A,this.intercomStore=new R,this.eventStore=new I(this),this.heatmapStore=new z,this.poiTypeStore=new q(this),this.poiMarkerStore=new G(this),this.fuzzySearchEngineStore=new O(["name","title","fullName","booths.name"]),this.categoryFilterStore=new C(this),this.sessionsFilterStore=new $(this),this.speakerStore=new Q(this),this.speakerFilterStore=new J(this),this.searchStore=new Y(this),this.searchButtonsStore=new K(this),this.bookmarksStore=new B(this),this.urlFilterManager=new w(this),this.shortcutRegistry=new D,this.registerShortcutProviders()}selectExhibitor(t,r=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var o=t.booths.filter(a=>a.visible),l=t.booths.filter(a=>!a.visible);!o.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),r&&setTimeout(()=>this.moveToList(t.booths.filter(a=>a.visible)),n||h?500:50)}selectBooth(t,r=!0){let o=Array.isArray(t)?t:[t];this.uiState.details=o[0],o.length===1&&o[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),o.length===1&&o[0].layer&&!o[0].visible&&this.layerStore.mode===f.Radio&&this.layerStore.updateVisibility(o[0].layer,!0),r&&setTimeout(()=>this.moveToList(o),n||h?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||k().then(()=>{S(()=>{this.selectSearch(""),this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{S(()=>{this.uiState.inIdle=!0})},100)})},1e3)}selectNone(){window.__resett&&window.__resett(),this.uiState.details=this.uiState.selectedCategory}selectBookmarks(){this.uiState.details=null,this.uiState.list={type:"bookmarks"}}selectVisited(){this.uiState.details=null,this.uiState.list={type:"visited"}}selectLanguage(){this.uiState.details=null,this.uiState.list={type:d}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(o=>o.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(o=>o.booths.find(l=>l.visible)).flatMap(o=>o.booths)},200)}selectEventItem(t,r=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&o.layer&&!o.visible&&this.layerStore.mode===f.Radio&&this.layerStore.updateVisibility(o.layer,!0)}r&&setTimeout(()=>{if(t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&this.moveToList([o])}},n||h?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:x(t,Object.keys(this.uiState.mapSettings).map(r=>`${r}=`)),focused:!1},this.uiState.activeListIndex=-1}clickBookmarks(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectBookmarks(),this.moveToList(),this.showMap()}clickVisited(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectVisited(),this.moveToList(),this.showMap()}clickLanguage(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectLanguage()}clickCategory(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(r=>r.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){if(this.uiState.menu=!1,this.uiState.list.type==="sessions"&&this.searchStore.selectSearch(),this.uiState.list.type==="speakers"&&this.searchStore.selectSearch(),this.uiState.list.type==="tours"&&this.searchStore.selectSearch(),this.uiState.list.type==="multi-point-tour"&&this.searchStore.selectSearch(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;else{this.uiState.details=null,this.fp.hidePathways(),this.uiState.list={type:"search",text:"",focused:!1},this.uiState.onBoothClick&&this.uiState.onBoothClick({target:null});return}if(this.uiState.onBoothClick){const r={name:"",description:""},o={target:{...t,layer:t.layer||r}};this.uiState.onBoothClick(o)}t.exhibitors.length===1&&t instanceof L?(this.heatmapStore.forceTrack={action:b.ViewBooth,label:t.name},this.selectExhibitor(t.exhibitors[0],!1)):this.selectBooth(t,!1),this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){this.uiState.overlayPosition==="bottom"&&g&&(this.uiState.desiredOverlaySize="medium")}showOverlay(){this.uiState.overlayPosition==="bottom"&&(this.uiState.desiredOverlaySize="full")}toggleMapOverlay(){this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize==="full"?this.uiState.desiredOverlaySize="medium":this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize!=="full"&&(this.uiState.desiredOverlaySize="full")}moveToList(t){t=t||this.uiState.listItems;const r=[];t.forEach(o=>{if(o instanceof p)r.push(...o.booths.filter(l=>l.visible));else if(o instanceof c)o.visible&&r.push(o);else if(o instanceof F&&o.boothId){const l=this.boothStore.boothById.get(o.boothId);l?.visible&&r.push(l)}else o instanceof X&&this.speakerStore.getEventsBySpeaker(o.id).forEach(l=>{if(!l.boothId)return;const a=this.boothStore.boothById.get(l.boothId);a?.visible&&r.push(a)})}),this.uiState.moveToBooths=r}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let r=this.uiState.activeListIndex+t;r=Math.max(0,Math.min(this.uiState.listItems.length-1,r)),this.uiState.activeListIndex=r}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(v.log("Opening",t),t instanceof p?this.clickExhibitor(t):t instanceof T?this.clickCategory(t):t instanceof c&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(r=>t.categories.some(o=>o.id===r.id)))}selectSessions(){this.uiState.list={type:"sessions",text:"",focused:!1},this.uiState.menu=!1,this.uiState.selectedTrack=null,this.searchButtonsStore.setSubButtonId(null),this.searchButtonsStore.subButtonsEnabled&&this.searchButtonsStore.showSubButtons("sessions"),h&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,r=!0){this.speakerStore.selectSpeaker(t,r)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new U(this)),this.shortcutRegistry.register(new W(this)),this.shortcutRegistry.register(new N(this))}}i([u],e.prototype,"initialized",void 0),i([u],e.prototype,"resetCameraFn",void 0),i([s],e.prototype,"setResetCameraFn",null),i([s],e.prototype,"selectExhibitor",null),i([s],e.prototype,"selectBooth",null),i([s],e.prototype,"reset",null),i([s],e.prototype,"selectNone",null),i([s],e.prototype,"selectBookmarks",null),i([s],e.prototype,"selectVisited",null),i([s],e.prototype,"selectLanguage",null),i([s],e.prototype,"selectCategory",null),i([s],e.prototype,"selectEventItem",null),i([s],e.prototype,"selectSearch",null),i([s],e.prototype,"clickBookmarks",null),i([s],e.prototype,"clickVisited",null),i([s],e.prototype,"clickLanguage",null),i([s],e.prototype,"clickCategory",null),i([s],e.prototype,"clickSeminars",null),i([s],e.prototype,"clickBoothInList",null),i([s],e.prototype,"clickBoothInList2",null),i([s],e.prototype,"clickBooth",null),i([s],e.prototype,"clickExhibitor2",null),i([s],e.prototype,"clickExhibitor",null),i([s],e.prototype,"showMap",null),i([s],e.prototype,"showOverlay",null),i([s],e.prototype,"toggleMapOverlay",null),i([s],e.prototype,"moveToList",null),i([s],e.prototype,"moveToExhibitor",null),i([s],e.prototype,"changeActiveListIndex",null),i([s],e.prototype,"toggleModal",null),i([s],e.prototype,"openGallery",null),i([s],e.prototype,"closeGallery",null),i([s],e.prototype,"openActiveListItem",null),i([s],e.prototype,"toggleCategoryFilter",null),i([s],e.prototype,"applyCategoryFilters",null),i([m],e.prototype,"filteredExhibitors",null),i([s],e.prototype,"selectSessions",null),i([s],e.prototype,"selectExhibitors",null),i([s],e.prototype,"selectTours",null),i([s],e.prototype,"selectSpeakers",null),i([s],e.prototype,"selectSpeaker",null),i([s],e.prototype,"resetFilters",null);
1
+ import{__decorate as o}from"tslib";import{action as s,computed as y,observable as S,runInAction as c}from"mobx";import{LANGUAGE_TYPE as w}from"../constants";import{URLFilterManager as v}from"../services/URLFilterManager";import{GaEventActions as n,sendEventToGa as p}from"../tools/gtag";import b from"../tools/logger";import{isWebGlSupported as g}from"../utils";import{resetLocale as k}from"../utils/i18n";import h from"../utils/is-mobile";import u from"../utils/is-webview";import{sanitizeSearch as x}from"../utils/sanitizeText";import B from"./BookmarksStore";import _,{BoothBase as f,RegularBooth as L}from"./BoothStore";import E from"./CategoryFilterStore";import C,{Category as T}from"./CategoryStore";import I,{EventItem as F}from"./EventStore";import M,{Exhibitor as m}from"./ExhibitorStore";import O from"./FuzzySearchEngineStore";import z from"./HeatmapStore";import A from"./IntercomStore";import R,{LayersMode as d}from"./LayerStore";import P from"./MaplibreStore";import V from"./OverlayStore";import G from"./PoiMarkerStore";import q from"./PoiTypeStore";import{SearchShortcutProvider as N}from"./providers/SearchShortcutProvider";import{SessionsShortcutProvider as U}from"./providers/SessionsShortcutProvider";import{SpeakerShortcutProvider as W}from"./providers/SpeakerShortcutProvider";import j from"./RoutePlannerStore";import D from"./RouteStore";import H from"./SearchButtonsStore";import K from"./SearchStore";import Y from"./SessionsFilterStore";import{ShortcutRegistry as $}from"./ShortcutRegistry";import J from"./SpeakerFilterStore";import Q from"./SpeakerStore";import{SpeakerItem as X}from"./SpeakerStore";import Z from"./ToursStore";import tt from"./UIState";export default class i{setResetCameraFn(t){this.resetCameraFn=t}constructor(){this.initialized=!1,this.categoryStore=new C(this),this.exhibitorStore=new M(this),this.boothStore=new _(this),this.routeStore=new D(this),this.routePlannerStore=new j(this),this.toursStore=new Z(this),this.uiState=new tt(this),this.overlayStore=new V(this),this.maplibreStore=new P(this),this.layerStore=new R,this.intercomStore=new A,this.eventStore=new I(this),this.heatmapStore=new z,this.poiTypeStore=new q(this),this.poiMarkerStore=new G(this),this.fuzzySearchEngineStore=new O(["name","title","fullName","booths.name"]),this.categoryFilterStore=new E(this),this.sessionsFilterStore=new Y(this),this.speakerStore=new Q(this),this.speakerFilterStore=new J(this),this.searchStore=new K(this),this.searchButtonsStore=new H(this),this.bookmarksStore=new B(this),this.urlFilterManager=new v(this),this.shortcutRegistry=new $,this.registerShortcutProviders()}selectExhibitor(t,r=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var e=t.booths.filter(a=>a.visible),l=t.booths.filter(a=>!a.visible);!e.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),r&&setTimeout(()=>this.moveToList(t.booths.filter(a=>a.visible)),u||h?500:50)}selectBooth(t,r=!0){let e=Array.isArray(t)?t:[t];this.uiState.details=e[0],e.length===1&&e[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),e.length===1&&e[0].layer&&!e[0].visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e[0].layer,!0),r&&setTimeout(()=>this.moveToList(e),u||h?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||k().then(()=>{c(()=>{this.selectSearch(""),this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{c(()=>{this.uiState.inIdle=!0})},100)})},1e3)}selectNone(){window.__resett&&window.__resett(),this.uiState.details=this.uiState.selectedCategory}selectBookmarks(){this.uiState.details=null,this.uiState.list={type:"bookmarks"}}selectVisited(){this.uiState.details=null,this.uiState.list={type:"visited"}}selectLanguage(){this.uiState.details=null,this.uiState.list={type:w}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(e=>e.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(e=>e.booths.find(l=>l.visible)).flatMap(e=>e.booths)},200)}selectEventItem(t,r=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&e.layer&&!e.visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e.layer,!0)}r&&setTimeout(()=>{if(t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&this.moveToList([e])}},u||h?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:x(t,Object.keys(this.uiState.mapSettings).map(r=>`${r}=`)),focused:!1},this.uiState.activeListIndex=-1}clickBookmarks(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectBookmarks(),this.moveToList(),this.showMap()}clickVisited(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectVisited(),this.moveToList(),this.showMap()}clickLanguage(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectLanguage()}clickCategory(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(r=>r.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){const r=this.uiState.details;if(this.uiState.menu=!1,this.uiState.list.type==="sessions"&&this.searchStore.selectSearch(),this.uiState.list.type==="speakers"&&this.searchStore.selectSearch(),this.uiState.list.type==="tours"&&this.searchStore.selectSearch(),this.uiState.list.type==="multi-point-tour"&&this.searchStore.selectSearch(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;else{this.uiState.details=null,this.fp.hidePathways(),this.uiState.list={type:"search",text:"",focused:!1},this.uiState.onBoothClick&&this.uiState.onBoothClick({target:null});return}if(this.uiState.onBoothClick){const e={name:"",description:""},l={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(l)}if(t.exhibitors.length===1&&t instanceof L){const e=t.exhibitors[0];r===e?p(n.ViewBooth,t.name):this.heatmapStore.forceTrack={action:n.ViewBooth,label:t.name,exhibitor:e},this.selectExhibitor(e,!1)}else r===t&&p(n.ViewBooth,t.name),this.selectBooth(t,!1);this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){this.uiState.overlayPosition==="bottom"&&g&&(this.uiState.desiredOverlaySize="medium")}showOverlay(){this.uiState.overlayPosition==="bottom"&&(this.uiState.desiredOverlaySize="full")}toggleMapOverlay(){this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize==="full"?this.uiState.desiredOverlaySize="medium":this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize!=="full"&&(this.uiState.desiredOverlaySize="full")}moveToList(t){t=t||this.uiState.listItems;const r=[];t.forEach(e=>{if(e instanceof m)r.push(...e.booths.filter(l=>l.visible));else if(e instanceof f)e.visible&&r.push(e);else if(e instanceof F&&e.boothId){const l=this.boothStore.boothById.get(e.boothId);l?.visible&&r.push(l)}else e instanceof X&&this.speakerStore.getEventsBySpeaker(e.id).forEach(l=>{if(!l.boothId)return;const a=this.boothStore.boothById.get(l.boothId);a?.visible&&r.push(a)})}),this.uiState.moveToBooths=r}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let r=this.uiState.activeListIndex+t;r=Math.max(0,Math.min(this.uiState.listItems.length-1,r)),this.uiState.activeListIndex=r}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(b.log("Opening",t),t instanceof m?this.clickExhibitor(t):t instanceof T?this.clickCategory(t):t instanceof f&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(r=>t.categories.some(e=>e.id===r.id)))}selectSessions(){this.uiState.list={type:"sessions",text:"",focused:!1},this.uiState.menu=!1,this.uiState.selectedTrack=null,this.searchButtonsStore.setSubButtonId(null),this.searchButtonsStore.subButtonsEnabled&&this.searchButtonsStore.showSubButtons("sessions"),h&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,r=!0){this.speakerStore.selectSpeaker(t,r)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new U(this)),this.shortcutRegistry.register(new W(this)),this.shortcutRegistry.register(new N(this))}}o([S],i.prototype,"initialized",void 0),o([S],i.prototype,"resetCameraFn",void 0),o([s],i.prototype,"setResetCameraFn",null),o([s],i.prototype,"selectExhibitor",null),o([s],i.prototype,"selectBooth",null),o([s],i.prototype,"reset",null),o([s],i.prototype,"selectNone",null),o([s],i.prototype,"selectBookmarks",null),o([s],i.prototype,"selectVisited",null),o([s],i.prototype,"selectLanguage",null),o([s],i.prototype,"selectCategory",null),o([s],i.prototype,"selectEventItem",null),o([s],i.prototype,"selectSearch",null),o([s],i.prototype,"clickBookmarks",null),o([s],i.prototype,"clickVisited",null),o([s],i.prototype,"clickLanguage",null),o([s],i.prototype,"clickCategory",null),o([s],i.prototype,"clickSeminars",null),o([s],i.prototype,"clickBoothInList",null),o([s],i.prototype,"clickBoothInList2",null),o([s],i.prototype,"clickBooth",null),o([s],i.prototype,"clickExhibitor2",null),o([s],i.prototype,"clickExhibitor",null),o([s],i.prototype,"showMap",null),o([s],i.prototype,"showOverlay",null),o([s],i.prototype,"toggleMapOverlay",null),o([s],i.prototype,"moveToList",null),o([s],i.prototype,"moveToExhibitor",null),o([s],i.prototype,"changeActiveListIndex",null),o([s],i.prototype,"toggleModal",null),o([s],i.prototype,"openGallery",null),o([s],i.prototype,"closeGallery",null),o([s],i.prototype,"openActiveListItem",null),o([s],i.prototype,"toggleCategoryFilter",null),o([s],i.prototype,"applyCategoryFilters",null),o([y],i.prototype,"filteredExhibitors",null),o([s],i.prototype,"selectSessions",null),o([s],i.prototype,"selectExhibitors",null),o([s],i.prototype,"selectTours",null),o([s],i.prototype,"selectSpeakers",null),o([s],i.prototype,"selectSpeaker",null),o([s],i.prototype,"resetFilters",null);
@@ -1 +1 @@
1
- import{__decorate as n}from"tslib";import{Box as k,boxContainsPoint as F,pointDistance as L}from"@expofp/geometry";import{action as f,computed as g,observable as u}from"mobx";import{getName as G}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as T,ORIENTATION_GRANTED_KEY as B}from"../constants";import E from"../data";import{fpGeo as P}from"../data/fpGeo";import{getLayerSvg as U,svgArea as h}from"../data/svg";import{GaEventActions as $,sendEventToGa as V}from"../tools/gtag";import w from"../tools/logger";import{areLayersEnabled as K}from"../utils/areLayersEnabled";import{calcSpeed as D}from"../utils/calcSpeed";import{calcTravelTime as A}from"../utils/calcTravelTime";import{calculateRelativeBearing as W,convertGpsToLocal as I,isValidPointCoords as b}from"../utils/gps";import{boothToEndpoint as C,buildRoute as Z,CURRENT_LOCATION_NAME as q,CURRENT_POSITION_POINT_ID as j,isWayfindingReady as X,KIOSK_ANCHOR_POINT_ID as Y,toArbitraryPoint as M}from"../wayfinding";import c,{layersStore as R,uiState as p}from".";import{BoothBase as y}from"./BoothStore";import{LayersMode as H}from"./LayerStore";import{revealLayer as N}from"./reveal-layer.js";function m(o){return typeof o=="string"?Number(o.replace(",",".")):o}export default class i{constructor(e){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tempToBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=T,this.isGpsTrackingEnabled=!0,this.rootStore=e,this.focusEnabled=!window.location.search}get canFindLocation(){return!!p.kioskData||!!this.currentPosition}selectRoute(e,t=!0,r=!1){if(t&&(p.list={type:"search",text:"",focused:!1}),e&&!e.from&&e.to){const s=this.resolveFallbackFrom();s&&(e=new Route(s,e.to,e.waypoints))}e?.from&&e?.to&&e.from===e.to&&(e=null);const l=[];e?.from&&e?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),e?.from instanceof y&&e.from.visible&&l.push(e.from),e?.to instanceof y&&e.to.visible&&(this.tempToBooth=null,l.push(e.to)),!e&&c.fp.onDirection&&c.fp.onDirection(null);const a=()=>{if(this.rootStore.moveToList(l),p.details=e,e&&(!e.from||!e.to)&&c.showOverlay(),e?.to&&e?.from){const s=J(e.from);s&&this.rootStore.layerStore.updateVisibility(s,!0)}if(!this.currentRouteLayer){const s=O(this.rootStore.layerStore,e?.from),d=O(this.rootStore.layerStore,e?.to);s?this.currentRouteLayer=s:d&&(this.currentRouteLayer=d)}t&&e?.from&&e?.to&&V($.ClickDirections,`${e?.from?"From "+e.from.name:""} ${e?.to?"To "+e.to.name:""}`)};r?a():setTimeout(a,200)}rebuildRouteFromPosition(e){const t=p.selectedRoute;t?.to&&this.selectRoute(new Route(e,t.to,t.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return M(this.currentPosition,q,j);const e=p.kioskData;return e?M({x:e.x,y:e.y,z:e.z??void 0},G(),Y):null}setStartPoint(e){const t=p.selectedRoute;if(t?.to&&!t?.from&&e){const r=new Route(e,t.to,t.waypoints);this.selectRoute(r)}}get pathLayers(){return c.routeStore.routeLines?.map(e=>e.p0.layer)?.filter((e,t,r)=>r.indexOf(e)===t).map((e,t)=>({id:t+1,layer:c.layerStore.findLayer(e)}))}getNearestBooth(e){if(!e)return null;const t=this.rootStore.layerStore.findLayer(e.z),r=P?.properties.config,l=!!(e.lat&&e.lng),a=r&&l?I(e,r):e;return!a||!b(a.x)||!b(a.y)?null:this.rootStore.boothStore.booths.filter(s=>R.mode===H.Default||!t?s.visible&&s.rect:s.rect&&(typeof e.z!="number"&&!e.z&&s.visible||t.name===s.layer?.name)).sort((s,d)=>L(a,s.rect.center)-L(a,d.rect.center))[0]||null}setMarkers(e){this.markersData.markers=(e?.markers??[]).map(Q),this.markersData.icons=e?.icons??[]}selectMarker(e,t){const r=this.markersData.markers.find(a=>a.id===e);this.markersData.markers.forEach(a=>a.active=!1),r&&(r.active=!0);const l=c.layerStore.findLayer(r?.z);if(t&&r){const a=c.rendererService.renderer;return l&&!l?.visible&&R.updateVisibility(l,!0),a?a.controls.panTo(r.x,r.y):(w.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(e=>e.active)}get layers(){const e=[];return c.routeStore.routeLines?.map(t=>t.p0.layer).forEach(t=>{e.indexOf(t)===-1&&e.push(t)}),e.map(t=>c.layerStore.layers.find(r=>r.name===t)).filter(t=>!!t)}clickRoute(e,t){window.__resett&&window.__resett(),this.rootStore.uiState.menu=!1,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(e,t))}selectCurrentPosition(e,t=!0,r){clearTimeout(this.cpTimeout),e&&(e.x=m(e.x),e.y=m(e.y),e.lat!==void 0&&(e.lat=m(e.lat)),e.lng!==void 0&&(e.lng=m(e.lng)),K()||(e.z=void 0));const l=t&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=t&&!l&&(this.focusEnabled||this.prevZ!=e?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=e?.z?.toString()??null,this.iconType=r?1:0;const s=e?ee(e):null;if(!e||!s){this.currentPosition=null;return}const d=c.layerStore.findLayer(e.z),x=new CurrentPosition(s.x,s.y,d?.name||this.currentRouteLayer?.name,W(s),e.lat,e.lng);let S=!this.routeLines?.length;d&&this.routeLines?.length&&(S=!!this.routeLines.find(v=>v.p0.layer===d.name||v.p1.layer===d.name));const _=a&&S;this.currentPosition=x,_&&this.focusOnPosition(x,d),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const e=this.currentPosition??p.kioskData;e&&(this.currentPosition&&localStorage.getItem(B)==="false"&&(c.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=N({layer:c.layerStore.findLayer(e.z),show:t=>R.updateVisibility(t,!0),then:()=>{p.moveToRect=this.findLocationRect(e)}}))}findLocationRect(e){const t=k.fromCenter(e,{x:100,y:100});if(t.intersects(h))return t;const r=Math.max(h.min.x,Math.min(e.x,h.max.x)),l=Math.max(h.min.y,Math.min(e.y,h.max.y)),a=Math.min(h.size.width,h.size.height)*.3,s=k.fromCenter({x:r,y:l},{x:a,y:a}).intersection(h);return s?k.fromUnion(t,s):t}focusOnPosition(e,t){this.pendingReveal?.(),this.pendingReveal=N({layer:t,show:r=>R.updateVisibility(r,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}const r=c.rendererService.renderer;if(!r){w.warn("Renderer is not initialized. Cannot pan to current position.");return}r.controls.panTo(e.x,e.y)}})}get routeInfo(){const e=this.routeDistance,t=this.routeUnits;return e?{distance:`${e}${t}`,units:t,time:A(e,D(t))}:null}updateRoute(e,t){!e?.length&&!this.routeLines.length||(this.routeLines=e,this.updateRoutePoints())}updateRouteDistance(e){if(e==null)return;const t=U(),r=(t.getAttribute("units")||T).toLowerCase?.().trim(),l=t.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(e/(l?1:10)),this.routeUnits=r,this.updateRoutePoints()}updateRoutePoints(){const e=p.selectedRoute,t=this.routeDistance,r=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:z(e?.from??null),to:z(e?.to??null),lines:this.routeLines,distance:t==null?"":`${t}${r}`,units:r,time:A(t??0,D(r))})},200)}checkRoutes(){if(!X()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const e=c.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let t=0;t<e.length;t++){const r=e[t];for(let l=t+1;l<e.length;l++){const a=e[l];Z(C(r),C(a)).lines.length||console.warn(`No route found from ${r.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(e){this.isGpsTrackingEnabled=e}get gpsEnabled(){return E.autoTrackingGps&&this.isGpsTrackingEnabled&&!E.enableIPS}setOnlyAccessible(e){this.onlyAccessible=e}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tempToBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([g],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([g({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([g({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([g({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([g],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([g({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function J(o){if(o)return o instanceof y?o.layer?.name:o.layer}function O(o,e){return e?e instanceof y?e.layer??null:o.findLayer(e.layer):null}function Q(o){return{...o,x:m(o.x),y:m(o.y),lat:o.lat===void 0?void 0:m(o.lat),lng:o.lng===void 0?void 0:m(o.lng)}}function ee(o){const e=P?.properties.config??null;let t=null;return e&&F({min:e.p0,max:e.p2},o)?t={...o}:e&&b(o.lat)&&b(o.lng)?t=I(o,e):e||(t=o),t||null}export function findBooth(o){return c.boothStore.findBooth(o)||c.exhibitorStore.findExhibitor(o)?.booths[0]}export function findEntityByExternalId(o){const e=c.boothStore.boothByExternalId.get(o);if(e)return{type:"booth",entity:e};const t=c.exhibitorStore.exhibitorByExternalId.get(o);if(t)return{type:"exhibitor",entity:t}}export function separateExternalIds(o){const e=[],t=[];for(const r of o){const l=findEntityByExternalId(r);l&&(l.type==="booth"?e.push(r):t.push(r))}return{boothExternalIds:e,exhibitorExternalIds:t}}export function extractRoute(o,e,t){return new Route(findBooth(o)??null,findBooth(e)??null,t?.map(r=>findBooth(r)).filter(r=>!!r))}export class Route{constructor(e,t,r){this.from=e,this.to=t,this.waypoints=r;const l=e instanceof y?e.id:void 0,a=t instanceof y?t.id:void 0;this.waypoints=r?.filter(s=>s&&s.id!==l&&s.id!==a)}}function z(o){return o?o instanceof y?{id:o.id,name:o.name,externalId:o.externalId,layer:{name:o.layer?.name,description:o.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:o.name,externalId:void 0,layer:{name:o.layer,description:void 0}}:null}export class CurrentPosition{constructor(e,t,r,l,a,s){this.x=e,this.y=t,this.z=r,this.angle=l,this.lat=a,this.lng=s}}
1
+ import{__decorate as n}from"tslib";import{Box as x,boxContainsPoint as G,pointDistance as L}from"@expofp/geometry";import{action as f,computed as g,observable as u}from"mobx";import{getName as B}from"../components/Kiosk/SetKiosk";import{mapCamera as T}from"../components/Map/camera";import{DEFAULT_UNITS as E,ORIENTATION_GRANTED_KEY as U}from"../constants";import P from"../data";import{fpGeo as w}from"../data/fpGeo";import{getLayerSvg as $,svgArea as m}from"../data/svg";import{GaEventActions as V,sendEventToGa as K}from"../tools/gtag";import D from"../tools/logger";import{areLayersEnabled as W}from"../utils/areLayersEnabled";import{calcSpeed as A}from"../utils/calcSpeed";import{calcTravelTime as I}from"../utils/calcTravelTime";import{calculateRelativeBearing as Z,convertGpsToLocal as C,isValidPointCoords as b}from"../utils/gps";import{boothToEndpoint as M,buildRoute as q,CURRENT_LOCATION_NAME as j,CURRENT_POSITION_POINT_ID as X,isWayfindingReady as Y,KIOSK_ANCHOR_POINT_ID as H,toArbitraryPoint as N}from"../wayfinding";import c,{layersStore as R,uiState as p}from".";import{BoothBase as y}from"./BoothStore";import{LayersMode as J}from"./LayerStore";import{revealLayer as O}from"./reveal-layer.js";function d(o){return typeof o=="string"?Number(o.replace(",",".")):o}export default class i{constructor(t){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tempToBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=E,this.isGpsTrackingEnabled=!0,this.rootStore=t,this.focusEnabled=!window.location.search}get canFindLocation(){return!!p.kioskData||!!this.currentPosition}selectRoute(t,e=!0,r=!1){if(e&&(p.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const s=this.resolveFallbackFrom();s&&(t=new Route(s,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);const l=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof y&&t.from.visible&&l.push(t.from),t?.to instanceof y&&t.to.visible&&(this.tempToBooth=null,l.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const a=()=>{if(this.rootStore.moveToList(l),p.details=t,t&&(!t.from||!t.to)&&c.showOverlay(),t?.to&&t?.from){const s=Q(t.from);s&&this.rootStore.layerStore.updateVisibility(s,!0)}if(!this.currentRouteLayer){const s=_(this.rootStore.layerStore,t?.from),h=_(this.rootStore.layerStore,t?.to);s?this.currentRouteLayer=s:h&&(this.currentRouteLayer=h)}e&&t?.from&&t?.to&&K(V.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)};r?a():setTimeout(a,200)}rebuildRouteFromPosition(t){const e=p.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return N(this.currentPosition,j,X);const t=p.kioskData;return t?N({x:t.x,y:t.y,z:t.z??void 0},B(),H):null}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const r=new Route(t,e.to,e.waypoints);this.selectRoute(r)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,r)=>r.indexOf(t)===e).map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;const e=this.rootStore.layerStore.findLayer(t.z),r=w?.properties.config,l=!!(t.lat&&t.lng),a=r&&l?C(t,r):t;return!a||!b(a.x)||!b(a.y)?null:this.rootStore.boothStore.booths.filter(s=>R.mode===J.Default||!e?s.visible&&s.rect:s.rect&&(typeof t.z!="number"&&!t.z&&s.visible||e.name===s.layer?.name)).sort((s,h)=>L(a,s.rect.center)-L(a,h.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(tt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const r=this.markersData.markers.find(a=>a.id===t);this.markersData.markers.forEach(a=>a.active=!1),r&&(r.active=!0);const l=c.layerStore.findLayer(r?.z);if(e&&r){l&&!l?.visible&&R.updateVisibility(l,!0);const a=T();return a?a.api.panTo({x:r.x,y:r.y}):(D.warn("Map camera is not mounted. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){const t=[];return c.routeStore.routeLines?.map(e=>e.p0.layer).forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(r=>r.name===e)).filter(e=>!!e)}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=!1,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,r){clearTimeout(this.cpTimeout),t&&(t.x=d(t.x),t.y=d(t.y),t.lat!==void 0&&(t.lat=d(t.lat)),t.lng!==void 0&&(t.lng=d(t.lng)),W()||(t.z=void 0));const l=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=e&&!l&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString()??null,this.iconType=r?1:0;const s=t?et(t):null;if(!t||!s){this.currentPosition=null;return}const h=c.layerStore.findLayer(t.z),k=new CurrentPosition(s.x,s.y,h?.name||this.currentRouteLayer?.name,Z(s),t.lat,t.lng);let v=!this.routeLines?.length;h&&this.routeLines?.length&&(v=!!this.routeLines.find(S=>S.p0.layer===h.name||S.p1.layer===h.name));const F=a&&v;this.currentPosition=k,F&&this.focusOnPosition(k,h),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const t=this.currentPosition??p.kioskData;t&&(this.currentPosition&&localStorage.getItem(U)==="false"&&(c.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=O({layer:c.layerStore.findLayer(t.z),show:e=>R.updateVisibility(e,!0),then:()=>{p.moveToRect=this.findLocationRect(t)}}))}findLocationRect(t){const e=x.fromCenter(t,{x:100,y:100});if(e.intersects(m))return e;const r=Math.max(m.min.x,Math.min(t.x,m.max.x)),l=Math.max(m.min.y,Math.min(t.y,m.max.y)),a=Math.min(m.size.width,m.size.height)*.3,s=x.fromCenter({x:r,y:l},{x:a,y:a}).intersection(m);return s?x.fromUnion(e,s):e}focusOnPosition(t,e){this.pendingReveal?.(),this.pendingReveal=O({layer:e,show:r=>R.updateVisibility(r,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}const r=T();if(r){r.api.panTo({x:t.x,y:t.y});return}D.warn("Map camera is not mounted. Cannot pan to current position.")}})}get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:I(t,A(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=$(),r=(e.getAttribute("units")||E).toLowerCase?.().trim(),l=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(l?1:10)),this.routeUnits=r,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,r=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:z(t?.from??null),to:z(t?.to??null),lines:this.routeLines,distance:e==null?"":`${e}${r}`,units:r,time:I(e??0,A(r))})},200)}checkRoutes(){if(!Y()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const t=c.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const r=t[e];for(let l=e+1;l<t.length;l++){const a=t[l];q(M(r),M(a)).lines.length||console.warn(`No route found from ${r.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return P.autoTrackingGps&&this.isGpsTrackingEnabled&&!P.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tempToBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([g],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([g({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([g({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([g({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([g],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([g({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function Q(o){if(o)return o instanceof y?o.layer?.name:o.layer}function _(o,t){return t?t instanceof y?t.layer??null:o.findLayer(t.layer):null}function tt(o){return{...o,x:d(o.x),y:d(o.y),lat:o.lat===void 0?void 0:d(o.lat),lng:o.lng===void 0?void 0:d(o.lng)}}function et(o){const t=w?.properties.config??null;let e=null;return t&&G({min:t.p0,max:t.p2},o)?e={...o}:t&&b(o.lat)&&b(o.lng)?e=C(o,t):t||(e=o),e||null}export function findBooth(o){return c.boothStore.findBooth(o)||c.exhibitorStore.findExhibitor(o)?.booths[0]}export function findEntityByExternalId(o){const t=c.boothStore.boothByExternalId.get(o);if(t)return{type:"booth",entity:t};const e=c.exhibitorStore.exhibitorByExternalId.get(o);if(e)return{type:"exhibitor",entity:e}}export function separateExternalIds(o){const t=[],e=[];for(const r of o){const l=findEntityByExternalId(r);l&&(l.type==="booth"?t.push(r):e.push(r))}return{boothExternalIds:t,exhibitorExternalIds:e}}export function extractRoute(o,t,e){return new Route(findBooth(o)??null,findBooth(t)??null,e?.map(r=>findBooth(r)).filter(r=>!!r))}export class Route{constructor(t,e,r){this.from=t,this.to=e,this.waypoints=r;const l=t instanceof y?t.id:void 0,a=e instanceof y?e.id:void 0;this.waypoints=r?.filter(s=>s&&s.id!==l&&s.id!==a)}}function z(o){return o?o instanceof y?{id:o.id,name:o.name,externalId:o.externalId,layer:{name:o.layer?.name,description:o.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:o.name,externalId:void 0,layer:{name:o.layer,description:void 0}}:null}export class CurrentPosition{constructor(t,e,r,l,a,s){this.x=t,this.y=e,this.z=r,this.angle=l,this.lat=a,this.lng=s}}
@@ -7,6 +7,20 @@ export declare class ShortcutRegistry {
7
7
  getShortcuts(interfaceId: string): ShortcutConfig[];
8
8
  private sortShortcuts;
9
9
  handleShortcutClick(interfaceId: string, shortcutId: string): void;
10
+ /**
11
+ * Reports a chip click to stats, using the `action` each provider already
12
+ * declares rather than guessing from `active`:
13
+ *
14
+ * - `toggle` — `active` IS the filter, so only the click that turns it on is
15
+ * a view of it; turning it off is not.
16
+ * - `custom` — opens a panel or a list on every click, while `active` says
17
+ * whether a filter happens to be set. Reading `active` here would drop
18
+ * every re-open made after the first selection.
19
+ *
20
+ * Tagged `shortcut` so these stay separable from the main button row, whose
21
+ * `sbtnview` carries no subtype.
22
+ */
23
+ private reportClick;
10
24
  private isShortcutActive;
11
25
  handleShortcutReset(interfaceId: string, shortcutId: string): void;
12
26
  private updateActivationOrder;
@@ -1 +1 @@
1
- export class ShortcutRegistry{constructor(){this.providers=new Map,this.activationOrder=new Map}register(t){if(!t?.id)throw new Error("Provider must have a valid id");this.providers.set(t.id,t)}unregister(t){this.providers.delete(t),this.activationOrder.delete(t)}getShortcuts(t){const e=this.providers.get(t);if(!e)return[];const i=e.createShortcuts(),r=this.activationOrder.get(t);return r?this.sortShortcuts(i,r):i}sortShortcuts(t,e){const i=new Map(e.map((r,s)=>[r,s]));return t.sort((r,s)=>{if(r.active!==s.active)return r.active?-1:1;if(r.active&&s.active){const o=i.get(r.id),n=i.get(s.id);return o!==void 0&&n!==void 0?o-n:(o!==void 0?-1:0)-(n!==void 0?-1:0)}return 0})}handleShortcutClick(t,e){const i=this.providers.get(t);if(!i)return;const r=this.isShortcutActive(i,e);i.handleShortcutClick(e);const s=this.isShortcutActive(i,e);r!==s&&this.updateActivationOrder(t,e,r,s)}isShortcutActive(t,e){return t.createShortcuts().find(r=>r.id===e)?.active??!1}handleShortcutReset(t,e){const i=this.providers.get(t);if(!i?.handleShortcutReset)return;i.handleShortcutReset(e),this.activationOrder.get(t)?.includes(e)&&this.updateActivationOrder(t,e,!0,!1)}updateActivationOrder(t,e,i,r){const s=this.activationOrder.get(t)||[];let o;if(!i&&r)o=s.includes(e)?s:[...s,e];else if(i&&!r)o=s.filter(n=>n!==e);else return;o.length>0?this.activationOrder.set(t,o):this.activationOrder.delete(t)}updateActivationOrderFromState(t,e,i,r){this.updateActivationOrder(t,e,i,r)}shouldShowShortcuts(t){return this.providers.get(t)?.shouldShowShortcuts?.()??!0}getRegisteredProviders(){return Array.from(this.providers.keys())}isProviderRegistered(t){return this.providers.has(t)}clear(){this.providers.clear(),this.activationOrder.clear()}}
1
+ import c from"../tools/track-event";export class ShortcutRegistry{constructor(){this.providers=new Map,this.activationOrder=new Map}register(t){if(!t?.id)throw new Error("Provider must have a valid id");this.providers.set(t.id,t)}unregister(t){this.providers.delete(t),this.activationOrder.delete(t)}getShortcuts(t){const e=this.providers.get(t);if(!e)return[];const r=e.createShortcuts(),i=this.activationOrder.get(t);return i?this.sortShortcuts(r,i):r}sortShortcuts(t,e){const r=new Map(e.map((i,s)=>[i,s]));return t.sort((i,s)=>{if(i.active!==s.active)return i.active?-1:1;if(i.active&&s.active){const o=r.get(i.id),n=r.get(s.id);return o!==void 0&&n!==void 0?o-n:(o!==void 0?-1:0)-(n!==void 0?-1:0)}return 0})}handleShortcutClick(t,e){const r=this.providers.get(t);if(!r)return;const i=r.createShortcuts().find(n=>n.id===e),s=i?.active??!1;r.handleShortcutClick(e);const o=this.isShortcutActive(r,e);this.reportClick(i,s,o),s!==o&&this.updateActivationOrder(t,e,s,o)}reportClick(t,e,r){if(!t||!(t.action==="custom"||!e&&r))return;const s=t.label||t.id;s&&c("sbtnview",s,"shortcut")}isShortcutActive(t,e){return t.createShortcuts().find(i=>i.id===e)?.active??!1}handleShortcutReset(t,e){const r=this.providers.get(t);if(!r?.handleShortcutReset)return;r.handleShortcutReset(e),this.activationOrder.get(t)?.includes(e)&&this.updateActivationOrder(t,e,!0,!1)}updateActivationOrder(t,e,r,i){const s=this.activationOrder.get(t)||[];let o;if(!r&&i)o=s.includes(e)?s:[...s,e];else if(r&&!i)o=s.filter(n=>n!==e);else return;o.length>0?this.activationOrder.set(t,o):this.activationOrder.delete(t)}updateActivationOrderFromState(t,e,r,i){this.updateActivationOrder(t,e,r,i)}shouldShowShortcuts(t){return this.providers.get(t)?.shouldShowShortcuts?.()??!0}getRegisteredProviders(){return Array.from(this.providers.keys())}isProviderRegistered(t){return this.providers.has(t)}clear(){this.providers.clear(),this.activationOrder.clear()}}
@@ -1 +1 @@
1
- import{__decorate as e}from"tslib";import{Box as ot,Point as it}from"@expofp/geometry";import{action as d,computed as n,observable as a}from"mobx";import{setKioskUrlParams as st}from"../components/Kiosk/kioskUrlParam";import{LANGUAGE_TYPE as E,LEGACY_PREVIEW_MODE_STORAGE_KEY as rt,LEGACY_UI_SCALE_STORAGE_KEY as U,LEGACY_VIEWER_MODE_STORAGE_KEY as lt,MOBILE_BREAKPOINT as at,PREVIEW_MODE_STORAGE_KEY as nt,UI_SCALE_STORAGE_KEY as H,VIEWER_MODE_STORAGE_KEY as ht,VISIBILITY_STORAGE_KEY as $}from"../constants";import k from"../data";import{svgArea as _,svgAreaExplicit as ct}from"../data/svg";import{readFreeBannerDismissed as pt}from"../tools/freeBanner";import{hasUserConsent as dt}from"../tools/gtag";import{hasHtmlTags as W}from"../tools/has-html-tags";import ut from"../tools/logger";import L from"../tools/settings";import{stripHtml as j}from"../tools/strip-html";import{remsToPixels as F}from"../utils";import X from"../utils/browser";import{getLocale as ft,getLocales as yt,t as S}from"../utils/i18n";import{isLocalStorageAvailable as B}from"../utils/localStorage";import{getResponsiveClass as mt}from"../utils/responsiveClass";import{sanitizeStr as Z}from"../utils/sanitizeText";import{fitRectIsFraming as gt,getVenueFitMarginPercent as St,resolveVenueFitRect as vt}from"../utils/scene-bounds";import{uiState as w}from".";import{BoothBase as I,RegularBooth as A,SpecialBooth as V}from"./BoothStore";import{EventItem as O}from"./EventStore";import{Exhibitor as x}from"./ExhibitorStore";import{findEntityByExternalId as bt,Route as M}from"./RouteStore";import{SpeakerItem as K}from"./SpeakerStore";const It=["dimensions25"];export default class t{setSelectedCategoryFilters(o){this.selectedCategoryFilters=o}resetCategoryFilter(){this.selectedCategoryFilters=[],this.categoryFilterOpen=!1}setSearchClearMode(o){this.searchClearMode=o}setRouteTitle(o){this.routeTitle=o}setRouteDescription(o){this.routeDescription=o}setIsMultiPointRoute(o){this.isMultiPointRoute=o}setTourTitle(o){this.tourTitle=o}setTourDescription(o){this.tourDescription=o}setIsMultiPointTour(o){this.isMultiPointTour=o}setPathwayOnlyMode(o){this.pathwayOnlyMode=o}setMultiPointTourList(o){this.list={type:"multi-point-tour",tourId:o}}get activePathwayLayers(){return this.list?.type==="multi-point-tour"?this.rootStore.toursStore.getTourById(this.list.tourId)?.layers?.map(s=>s.id)||[]:[]}get highlightedBooths(){const o=new Set(this.rootStore.exhibitorStore.highlightedByExternalIds),s=new Set(this.rootStore.boothStore.highlightedByExternalIds),i=new Set([this.rootStore.exhibitorStore.exhibitors.filter(r=>o.has(r.externalId)).flatMap(r=>r.booths.filter(l=>l instanceof A)).map(r=>r.id.toString()),this.rootStore.boothStore.booths.filter(r=>s.has(r.externalId)).map(r=>r.id.toString())].flat());if(this.list?.type==="search"&&this.list?.text?.trim().length){i.clear();const r=this.fuzzySearchItems.filter(l=>l.score===0).map(l=>l.item);r.length?D(r,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(l=>i.add(l.id.toString())):this.listBooths.forEach(l=>i.add(l.id.toString()))}if(this.list?.type==="filter"&&(i.clear(),this.list.items.flatMap(r=>r.booths.filter(l=>l instanceof A)).forEach(r=>i.add(r.id.toString()))),this.categoryFilterOpen&&this.selectedCategoryFilters.length>0?(i.clear(),this.selectedCategoryFilters.forEach(r=>{r.exhibitors.flatMap(l=>l.booths).forEach(l=>i.add(l.id.toString()))})):this.list?.type==="category"&&(i.clear(),this.list.category.exhibitors.flatMap(r=>r.booths).forEach(r=>i.add(r.id.toString()))),this.list?.type==="bookmarks"&&(i.clear(),D(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(r=>i.add(r.id.toString()))),this.list?.type==="visited"&&(i.clear(),D(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(r=>i.add(r.id.toString()))),this.list?.type==="exhibitors"){i.clear();const r=this.list.text?.toLowerCase().trim();let l=this.rootStore.exhibitorStore.exhibitors;r&&(l=l.filter(u=>u.name.toLowerCase().includes(r))),l.flatMap(u=>u.booths.filter(g=>g instanceof A)).forEach(u=>i.add(u.id.toString()))}if(this.selectedPoiTypeFilters.length>0&&(i.clear(),this.selectedPoiTypeFilters.forEach(r=>{this.rootStore.boothStore.booths.filter(l=>l.poiTypeId===r.id).forEach(l=>i.add(l.id.toString()))})),this.details instanceof M&&(i.clear(),this.details.from instanceof I&&i.add(this.details.from.id.toString()),this.details.to instanceof I&&i.add(this.details.to.id.toString()),this.details.waypoints?.forEach(r=>i.add(r.id.toString()))),this.details instanceof I&&(i.clear(),i.add(this.details.id.toString())),this.details instanceof x&&(i.clear(),this.details.booths.filter(r=>r instanceof A).forEach(r=>i.add(r.id.toString()))),this.details instanceof O){const r=this.details;if(r.boothId){i.clear();const l=this.rootStore.boothStore.booths.find(u=>u.id===r.boothId);l&&i.add(l.id.toString())}}return i}constructor(o){this.interfaceMetadata=Object.freeze([{id:"menu",className:"efp-overlay-menu",priority:80,isActive:()=>this.menu,searchBoxConfig:()=>({mode:"interface",title:S("Menu")})},{id:"exhibitor",className:"efp-overlay-exhibitor",priority:70,isActive:()=>this.details instanceof x,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"booth",className:"efp-overlay-booth",priority:70,isActive:()=>this.details instanceof I,searchBoxConfig:()=>{const s=this.details;return{mode:"details",title:s.title||s.name}}},{id:"event",className:"efp-overlay-event",priority:70,isActive:()=>this.details instanceof O,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"route",className:"efp-overlay-route",priority:70,isActive:()=>this.details instanceof M,searchBoxConfig:()=>({mode:"details",title:S("Directions")})},{id:"search",className:"efp-overlay-search",priority:60,isActive:()=>!this.details&&!this.menu&&this.list.type==="search"&&(this.rootStore.fp.alwaysShowSidebar&&!this.overlayOnDemand||this.heatmap||this.searchFocused||this.list.text.length>0||this.searchClearMode),searchBoxConfig:()=>({mode:"search",title:S("Search")})},{id:"exhibitors",className:"efp-overlay-exhibitors",priority:50,isActive:()=>this.list.type==="exhibitors"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Exhibitors")})},{id:"filter",className:"efp-overlay-filter",priority:50,isActive:()=>this.list.type==="filter"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Filter")})},{id:"bookmarks",className:"efp-overlay-bookmarks",priority:50,isActive:()=>this.list.type==="bookmarks"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:S("Bookmarks"),badge:this.rootStore.bookmarksStore.total})},{id:"visited",className:"efp-overlay-visited",priority:50,isActive:()=>this.list.type==="visited"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:S("Visited"),badge:this.rootStore.exhibitorStore.visited.length})},{id:E,className:"efp-overlay-language",priority:50,isActive:()=>this.list.type===E,searchBoxConfig:()=>({mode:"interface",title:S("Language")})},{id:"category",className:"efp-overlay-category",priority:50,isActive:()=>!w.menu&&!!w.selectedCategory,searchBoxConfig:()=>({mode:"interface",title:this.list.type==="category"&&this.list.category?.name||S("Categories")})},{id:"sessions",className:"efp-overlay-sessions",priority:50,isActive:()=>this.list.type==="sessions"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Sessions"),subtitle:this.selectedTrack?this.selectedTrack.name:void 0})},{id:"speakers",className:"efp-overlay-speakers",priority:50,isActive:()=>this.list.type==="speakers"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Speakers")})},{id:"speaker",className:"efp-overlay-speaker",priority:50,isActive:()=>this.details instanceof K,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"tours",className:"efp-overlay-tours",priority:50,isActive:()=>this.list.type==="tours"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Guided Tours")})},{id:"multi-point-wayfinding",className:"efp-overlay-multi-point",priority:75,isActive:()=>!!(this.isMultiPointRoute&&this.selectedRoute&&this.list.type!=="route-planner"),searchBoxConfig:()=>({mode:"interface",title:this.routeTitle||S("Multi-point route")})},{id:"multi-point-tour",className:"efp-overlay-multi-point-tour",priority:75,isActive:()=>this.list.type==="multi-point-tour"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:this.tourTitle||S("Multi-point route")})},{id:"route-planner",className:"efp-overlay-route-planner",priority:76,isActive:()=>this.list.type==="route-planner"&&(!this.details||this.details instanceof M),searchBoxConfig:()=>({mode:"interface",title:S("Route planner")})}].sort((s,i)=>i.priority-s.priority)),this.list={type:"search",text:"",focused:!1},this.details=null,this.hoveredExhibitor=null,this.hoveredBooth=null,this.zoomBy=null,this.rollReset=!1,this.moveToBooths=null,this.moveToRect=null,this.moveToRectPaddingPercent=null,this.moveToLocation=!1,this.menu=!1,this.searchFocused=!1,this.searchClearMode=!1,this.printingPdf=!1,this.screenSize=new it(window.innerWidth,window.innerHeight),this.overlayShowsAll=!1,this.centerMap=!1,this.zoomAfTransformK=1,this.activeListIndex=-1,this.devicePixelRatio=window.devicePixelRatio,this.previewExhibitor=null,this.wsStarted=!1,this.canvasStarted=!1,this.kiosk=!1,this.inIdle=!1,this.modalActive={share:!1},this.galleryActive=!1,this.hideOverlay=!1,this.searchButtonsOverride=null,this.hideCookieConsent=!!dt(),this.hideHeaderLogo=!1,this.hideLogoInBooth=!1,this.disableBookmarked=!1,this.hideLanguage=!1,this.monochrome=!1,this.heatmap=!1,this.heatmapYah=!1,this.rootElement=null,this.debugCircles=[],this.mapControlsHidden=!1,this.floorsControlHidden=!1,this.hideFreeOrDemo=!1,this.freeBannerDismissed=pt(sessionStorage),this.currentBanner=null,this.sceneDefReady=!1,this.categoryFilterOpen=!1,this.selectedCategoryFilters=[],this.selectedPoiTypeFilters=[],this.selectedTrack=null,this.subButtonsVisible=!1,this.searchBoxMode="search",this.searchBoxTitle="",this.isMultiPointRoute=!1,this.isMultiPointTour=!1,this.pathwayOnlyMode=!1,this.isOverlayScrolled=!1,this.listScrollTop=0,this.listScrollItemId=null,this.listScrollIndex=0,this.scrollPositions=new Map,this.scrollItemIds=new Map,this._customUIScale=null,this.searchFilterHeightPx=54,this.searchInputHeightPx=54,this.overlayUISizePx=390,this.overlayKioskSizePx=450,this.overlayMediumHeightRems=10,this.forceDim=!1,this.mapSettings={...this.defaultMapSettings},this.forceShowDetails=!1,this.buildRoute=!1,this.globalErrorMessages=[],this.minUIScale=.8,this.maxUIScale=1.4,this.setKioskModeEnabled=!1,this.kioskData=null,this.rootStore=o,this.initializeUIScale()}get rtl(){const o=ft();return o==="ar"||o==="he"}get noOverlay(){return this.rootStore.fp.noOverlay||this.hideOverlay}get overlayOnDemand(){return this.noOverlay&&this.searchButtonsOverride===!0}get overlayHiddenNow(){return this.noOverlay&&!(this.overlayOnDemand&&this.isOverlayOpen)}get onBoothClick(){return this.rootStore.fp.onBoothClick}get onMarkerClick(){return this.rootStore.fp.onMarkerClick}get onBookmarkClick(){return this.rootStore.fp.onBookmarkClick}get onVisitedClick(){return this.rootStore.fp.onVisitedClick}get onCategoryClick(){return this.rootStore.fp.onCategoryClick}get onDirection(){return this.rootStore.fp.onDirection}get onDetails(){return this.rootStore.fp.onDetails}get onExhibitorCustomButtonClick(){return this.rootStore.fp.onExhibitorCustomButtonClick}get onGetCoordsClick(){return this.rootStore.fp.onGetCoordsClick}get selectedExhibitor(){return this.details instanceof x?this.details:null}get selectedBooth(){return this.details instanceof I?this.details:null}get selectedCategory(){return this.list.type==="category"?this.list.category:null}get selectedRoute(){return this.details instanceof M?this.details:null}get selectedSpeaker(){return this.details instanceof K?this.details:null}get uiScale(){return this._customUIScale!==null?this._customUIScale:this.kiosk?1.2:1}get isGuidedToursActive(){return this.rootStore.toursStore.isActive}get getRouteNextFloor(){const o=this.rootStore.routeStore.pathLayers,s=this.rootStore.routeStore.currentRouteLayer?.name;if(!s)return null;const i=o.findIndex(c=>c.layer?.name===s);return i===-1?null:o[i+1]?.layer?.name??null}get headerHeightRem(){return 0}get headerHeightPx(){return F(this.headerHeightRem)}get overlayPosition(){return this.screenSize.width>at||this.kiosk?"left":"bottom"}get overlayCollapsed(){return this.kiosk&&this.overlayPosition==="left"&&!this.searchFocused&&!this.menu&&!this.details&&!this.selectedCategory&&!this.selectedExhibitor&&this.list.type!=="bookmarks"&&this.list.type!==E&&!this.list.text?.length}get overlaySize(){return this.overlayLeft?"full":this.desiredOverlaySize}get overlayBottom(){return this.overlayPosition==="bottom"}get overlayLeft(){return this.overlayPosition==="left"}get overlayWidthPx(){return this.overlayHiddenNow?0:this.overlayLeft?this.kiosk?this.overlayKioskSizePx:this.overlayUISizePx:F(this.screenSize.width)}get wsImageHeightPx(){return 44}get wsPaddingPx(){return F(.25)}get wsOccupiedHeightPx(){return this.wsShown?this.wsImageHeightPx+this.wsPaddingPx*2:0}get wsShown(){return!this.hideHeaderLogo&&this.rootStore.exhibitorStore.advertised.length>0}get wsDesktopPosition(){return L.EXPO==="cbresupplypartner"?"bottom":"top"}get wsPosition(){return this.overlayBottom?"top":this.wsDesktopPosition}get responsiveClass(){return mt(this.screenSize.width)}get mapVisibleTop(){return(this.wsPosition==="top"?this.wsOccupiedHeightPx:0)+this.headerHeightPx}get mapVisibleBottom(){return this.overlayLeft||this.overlayHiddenNow?this.wsPosition==="bottom"?this.wsOccupiedHeightPx:0:F(this.overlayMediumHeightRems)}get mapVisibleStart(){return 0}get searchActionsHeightPx(){return this.overlayPosition==="bottom"?this.searchInputHeightPx+this.searchFilterHeightPx:this.searchInputHeightPx}get shouldShowSearchButtons(){return this.rootStore.searchButtonsStore.hasAnySearchButtons&&!this.details&&!this.menu&&![E,"filter"].includes(this.list.type)}get shouldShowMobileToggle(){const o=this.list.type==="route-planner";return this.overlayPosition==="bottom"&&(o||!this.details&&!this.menu&&this.list.type!==E&&this.list.type!=="bookmarks"&&this.list.type!=="sessions")}get mobileToggleIsListMode(){return!this.isOverlayOpen||this.overlaySize!=="full"}get canvasVisibleRectPx(){const o=this.screenSize;return ot.fromMinMax({x:w.rtl?0:this.mapVisibleStart,y:this.mapVisibleTop+this.searchActionsHeightPx},{x:w.rtl?o.width-this.mapVisibleStart:o.width,y:o.height-this.mapVisibleBottom})}get shouldShiftMapRect(){return this.overlayPosition==="left"&&(this.details||this.hasAppliedFilters||this.selectedRoute)}get hasAppliedFilters(){return this.selectedCategoryFilters.length>0||this.selectedPoiTypeFilters.length>0}get canvasVisibleRectPt(){return this.canvasVisibleRectPx.scale(this.devicePixelRatio,{x:0,y:0})}get canvasSizePt(){return this.screenSize.multiply(this.devicePixelRatio)}get shouldUseBackdrop(){if(w.overlayCollapsed)return!1;if(B&&localStorage.getItem("forcebackdrop")==="1")return!0;if(this.overlayBottom||this.selectedExhibitor?.leadingImageUrl&&!this.selectedExhibitor?.leadingImageLinkUrl)return!1;const o=X.satisfies({safari:">=13"}),s=X.satisfies({chrome:">=77"});return/(android)/i.test(navigator.userAgent)?!1:o||s&&w.canvasSizePt.height*w.canvasSizePt.width<3e6}setForceDim(o){this.forceDim=o}get dimmed(){return this.forceDim||this.pathwayOnlyMode?!0:this.highlightedBooths.size>0||this.list?.type==="search"&&this.list?.text?.trim().length>0||this.list?.type==="exhibitors"}get defaultSearchItems(){const{exhibitorStore:o,categoryStore:s,boothStore:i,heatmapStore:c}=this.rootStore;let r=o.exhibitors;const l=s.categories.filter(f=>f.exhibitors.length),u=i.booths;this.selectedPoiTypeFilters.length>0&&(r=r.filter(f=>f.booths.some(y=>this.selectedPoiTypeFilters.some(v=>y.poiTypeId===v.id))));let g=[];const C=!this.selectedCategoryFilters.length&&k.showCategories?l.filter(f=>It.includes(L.EXPO)?!f.name.includes("/"):!0):[],T=u.filter(f=>f instanceof V);return this.selectedCategoryFilters.length>0?g=[...r]:(k.showCompaniesAndBooths&&(g=g.concat(r)),k.showOtherSpaces&&(g=g.concat(T))),this.heatmap?[...r,...u].sort((y,v)=>c.getClicksByType(v)-c.getClicksByType(y)):this.heatmapYah?c.heatmapData?.yah?.sort((f,y)=>c.getClicksByType(y)-c.getClicksByType(f))||[]:r.length===0?u:[...C,...g.sort((f,y)=>{const v=f instanceof x&&f.featured!==void 0,z=y instanceof x&&y.featured!==void 0;if(v!==z)return v?-1:1;const R=f instanceof V&&f.title?f.title:f.name,N=y instanceof V&&y.title?y.title:y.name;return R.localeCompare(N,void 0,{sensitivity:"base",numeric:!0})})]}get searchItems(){if(this.list.type!=="search")return[];const o=this.list.text?.trim().toLowerCase()||"",{exhibitorStore:s,boothStore:i,eventStore:c,speakerStore:r,heatmapStore:l}=this.rootStore;let u=s.exhibitors;const g=i.booths,C=c.eventItems,T=r.speakers;if(this.selectedCategoryFilters.length>0&&(u=u.filter(h=>this.selectedCategoryFilters.some(p=>h.categories.some(m=>m.id===p.id)))),this.selectedPoiTypeFilters.length>0&&(u=u.filter(h=>h.booths.some(p=>this.selectedPoiTypeFilters.some(m=>p.poiTypeId===m.id)))),!o)return this.defaultSearchItems;const f=[o.replace(/&[^&=]+=[^&]+/g,"")];if(this.heatmapYah)return(l.heatmapData.yah??[]).filter(p=>Number.isNaN(Number(o))?p:p.viewCount>=Number(o)).sort((p,m)=>l.getClicksByType(m)-l.getClicksByType(p));const y=[],v=new Set,z=new Set,R=new Set,N=new Set;function G(h){return h?h.replace(/[!@#$%^*\-.,()^#$%:?_+'"/]/g," ").replace(/\s\s+/g," "):""}function b(h,p){return!h||!p?!1:G(h).toLowerCase().includes(G(p).toLowerCase())}function Y(h,p){return h?b(h,p)||b(k.levelTerm+" "+h,p):!1}u.forEach(h=>{f.some(p=>b(h.name,p)||h.booths.some(m=>!p&&b(m.name,p)||Y(m.layer?.name??null,p)))&&v.add(h)}),this.selectedCategoryFilters.length>0&&g.forEach(h=>{(this.heatmap||!(h instanceof A)||!Array.from(v).find(m=>m.booths.includes(h)))&&f.some(m=>b(h.title||"",m)||b(h.name,m)||b(h.fullName,m)||Y(h.layer?.name??null,m))&&z.add(h)});const q=C,tt=T;if(q.forEach(h=>{f.some(p=>b(h.name||"",p)||b(h.description||"",p))&&R.add(h)}),tt.forEach(h=>{f.some(p=>b(h.name,p)||b(h.company,p)||b(h.jobTitle,p))&&N.add(h)}),y.push(...R),y.push(...v),this.heatmap)return y.sort((h,p)=>l.getClicksByType(p)-l.getClicksByType(h));const et=new Map(y.map(h=>[h.id,h]));return y.map(h=>{if(!h.name)return null;const p=Z(h instanceof I&&h.fullName.toLowerCase()||h.name.toLowerCase()),m=p.indexOf(Z(o));if(m===-1)return null;const Q={id:h.id,position:m,lowerCaseName:p,featured:!1};return h instanceof x&&(Q.featured=h.featured),Q}).filter(h=>!!h).sort((h,p)=>(h.featured||p.featured)&&h.featured!==p.featured?h.featured?-1:1:h.position!==p.position?h.position-p.position:h.lowerCaseName.localeCompare(p.lowerCaseName)||String(h.id).localeCompare(String(p.id))).map(({id:h})=>et.get(h)).filter(h=>!!h)}get searchList(){return[...this.rootStore.eventStore.eventItems,...this.rootStore.speakerStore.speakers,...this.rootStore.categoryStore.categories.filter(o=>o.exhibitors.length),...this.rootStore.exhibitorStore.exhibitors,...this.rootStore.boothStore.booths]}get foundInDescription(){if(this.list?.type!=="search")return[];const o=this.list?.text?.trim().toLowerCase();if(!o)return[];const s=this.fuzzySearchItems.map(({item:l})=>l),i=new Set(s.map(l=>l.name)),c=this.categoryFilteredSearchList.filter(l=>!i.has(l.name)),r=[];for(const l of c){const u=J(l);if(!u)continue;const C=(W(u)?j(u):u).toLowerCase().indexOf(o);C!==-1&&r.push({item:l,pos:C})}return r.sort((l,u)=>l.pos-u.pos),r.map(l=>l.item)}get foundInDescriptionStruct(){const o={};if(this.list?.type!=="search")return o;const s=this.list?.text?.trim().toLowerCase();return this.foundInDescription.forEach(i=>{let c=J(i);if(!c)return;W(c)&&(c=j(c));const r=c.toLowerCase().indexOf(s);if(r===-1)return;const l=3,u=r>l?r-l:0,g=c.substring(u).trim();o[i.id]=r>0?`...${g}`:g}),o}get categoryFilteredSearchList(){return this.selectedCategoryFilters.length===0?this.searchList:this.searchList.filter(o=>o instanceof x&&this.selectedCategoryFilters.some(s=>o.categories.some(i=>i.id===s.id)))}get fuzzySearchItems(){if(this.list?.type!=="search")return[];const o=this.list?.text?.trim().toLowerCase();if(!o)return this.defaultSearchItems.map(r=>({item:r,score:0,matches:[]}));const s=this.rootStore.fuzzySearchEngineStore.search(this.categoryFilteredSearchList,o),i=[],c=[];for(const r of s){const l=r.item,u=l.entity.type,g=u==="booth"?l:null,C=u==="exhibitor"?l:null,T=[l.name?.toLowerCase()??"",g?.title?.toLowerCase()??"",g?.fullName?.toLowerCase()??"",...C?.booths?.map(y=>y.name?.toLowerCase()??"")??[]];let f=1/0;for(const y of T){const v=y.indexOf(o);v!==-1&&v<f&&(f=v)}f!==1/0?i.push({result:{item:l,score:0},pos:f}):c.push(r)}return i.sort((r,l)=>r.pos-l.pos),[...i.map(r=>r.result),...c]}get listItems(){if(this.details instanceof M&&this.list.type!=="multi-point-tour")return[this.details.from,this.details.to].filter(o=>o instanceof I);switch(this.list.type){case"search":{let o=!(this.heatmap||this.heatmapYah)&&this.rootStore.fuzzySearchEngineStore.engine?this.fuzzySearchItems.map(({item:s})=>s).concat(this.foundInDescription):this.searchItems;return o=o.filter(s=>s.entity.type==="booth"?!s.exhibitors.length:!0),this.hasAppliedFilters?o.filter(s=>{if(this.selectedCategoryFilters.length>0&&s instanceof x&&!this.selectedCategoryFilters.some(i=>s.categories.some(c=>c.id===i.id)))return!1;if(this.selectedPoiTypeFilters.length>0){if(s instanceof x&&!s.booths.some(i=>this.selectedPoiTypeFilters.some(c=>i.poiTypeId===c.id))||s instanceof I&&!this.selectedPoiTypeFilters.some(i=>s.poiTypeId===i.id))return!1;if(s instanceof O&&s.boothId){const i=this.rootStore.boothStore.booths.find(c=>c.id===s.boothId);if(!i||!this.selectedPoiTypeFilters.some(c=>i.poiTypeId===c.id))return!1}}return!0}):o}case"bookmarks":return[...this.rootStore.exhibitorStore.bookmarked,...this.rootStore.eventStore.bookmarked,...this.rootStore.speakerStore.bookmarked,...this.rootStore.boothStore.booths.filter(o=>o.exhibitors.length===0&&o.bookmarkedDirectly)];case"visited":return[...this.rootStore.exhibitorStore.visited,...this.rootStore.eventStore.visited];case"category":return this.list.category.exhibitors;case E:return yt();case"filter":return this.list.items;case"sessions":return this.rootStore.eventStore.eventItems;case"exhibitors":{const o=this.rootStore.exhibitorStore.exhibitors,s=this.list.text?.toLowerCase().trim();return s?o.filter(i=>i.name.toLowerCase().includes(s)):o}case"multi-point-tour":{const o=this.rootStore.toursStore.getTourById(this.list.tourId);return o?!o.points||o.points.length===0?[]:o.points.map(s=>{const i=parseInt(s);if(!isNaN(i)){const r=this.rootStore.boothStore.boothById.get(i);if(r)return r}return bt(s)?.entity||null}).filter(s=>!!s):[]}case"route-planner":return this.rootStore.routePlannerStore.resolvedBooths}throw new Error("Unknown list.type")}get listBooths(){return D(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems)}get selectedBooths(){let o=[];this.selectedExhibitor?o=this.selectedExhibitor.booths:this.selectedBooth&&(o=[this.selectedBooth]);const s=this.selectedRoute,i=[s?.from,s?.to,...s?.waypoints??[]].filter(c=>c instanceof I);return o.push(...i),new Set(o)}get hoveredBooths(){let o=[];return this.hoveredBooth?o=[this.hoveredBooth]:this.hoveredExhibitor&&(o=this.hoveredExhibitor.booths),new Set(o)}get visibility(){return{controls:!this.mapControlsHidden,levels:!this.floorsControlHidden,header:this.wsShown,overlay:!this.hideOverlay,searchButtons:this.searchButtonsOverride??!this.hideOverlay}}setVisibility(o){const s=["controls","levels","header","overlay"],i={...s.reduce((r,l)=>({...r,[l]:!0}),{}),...s.filter(r=>r in o).reduce((r,l)=>({...r,[l]:o[l]}),{})},c=typeof o.searchButtons=="boolean"?o.searchButtons:null;B&&(Object.values(i).every(Boolean)&&c===null?localStorage.removeItem($):localStorage.setItem($,JSON.stringify(c===null?i:{...i,searchButtons:c}))),this.mapControlsHidden=!i.controls,this.floorsControlHidden=!i.levels,this.hideHeaderLogo=!i.header,this.hideFreeOrDemo=!i.header,this.hideOverlay=!i.overlay,this.searchButtonsOverride=c}toggleMapOverlay(){this.overlayPosition==="bottom"&&this.overlaySize==="full"?this.desiredOverlaySize="medium":this.overlayPosition==="bottom"&&this.overlaySize!=="full"&&(this.desiredOverlaySize="full")}changeZoom(o){this.zoomBy=o}zoomIn(){this.changeZoom(1.5)}zoomOut(){this.changeZoom(.66)}fitBounds(){const{rect:o,source:s}=vt({layerViewbox:this.rootStore.layerStore.viewboxRectangle,explicitArea:ct?_:null,layerRectangle:this.rootStore.layerStore.rectangle,sceneDef:this.rootStore.rendererService.scene,svgArea:_});this.moveToRect=o,this.moveToRectPaddingPercent=gt(s)?0:St(o,_),this.rollReset=!0}get previewMode(){const o=B?localStorage.getItem(nt)??localStorage.getItem(rt):null;return o==="true"||o==="1"||this.rootStore.fp.previewMode}get viewerMode(){const o=B?localStorage.getItem(ht)??localStorage.getItem(lt):null;return o==="true"||o==="1"||this.rootStore.fp.viewerMode}get selectedEventItem(){return this.details instanceof O?this.details:null}get defaultMapSettings(){return{zoomtime:500,center:void 0,centerxy:void 0,z:void 0,bearing:0,roll:1}}setMapSettings(o){const s={};for(const i of Object.keys(o)){const c=o[i];c!=null&&(i==="zoomtime"?s.zoomtime=Math.min(Math.max(o.zoomtime||this.mapSettings.zoomtime||0,500),5e3):Object.assign(s,{[i]:c}))}this.mapSettings={...this.mapSettings,...s}}resetMapSettings(){this.mapSettings={...this.defaultMapSettings}}get baseQRCodeUrl(){return`https://${L.EXPO}.expofp.com`}get viewMapOnPhoneQRCodeUrl(){if(k?.customKioskQrCodeUrl)return k.customKioskQrCodeUrl;const o=new URL(this.baseQRCodeUrl);o.search=window.location.search;const s=o.toString();return console.log("View Map On Phone QR Code Url",s),s}get routeQRCodeUrl(){const o=new URL(this.baseQRCodeUrl),s=this.selectedRoute?.from,i=this.selectedRoute?.to,c=s instanceof I?s.slug:"",r=i instanceof I?i.slug:"";o.search=`?route%3A${encodeURIComponent(r)}%3A${encodeURIComponent(c)}%3Afalse`,st(o.searchParams,this.kioskData);const l=o.toString();return console.log("Route QR Code Url",l),l}get isFeaturedExhibitorActive(){return this.details instanceof x&&!!this.details.featured}get activeInterfaceData(){for(const o of this.interfaceMetadata)if(o.isActive())return o;return null}get searchBoxConfig(){const o=this.activeInterfaceData;return!o||!o.searchBoxConfig?{mode:"search",title:"",subtitle:void 0,badge:void 0,icon:void 0}:o.searchBoxConfig()||{mode:"search",title:"",subtitle:void 0,badge:void 0,icon:void 0}}get searchBoxActions(){return this.activeInterfaceData?.actions?.()??[]}get overlayInterfaceClasses(){const o=[],s=this.activeInterfaceData;return s&&(o.push(s.className),s.additionalClasses&&o.push(...s.additionalClasses())),this.details&&o.push("overlay-has-details"),this.list.type&&o.push(`overlay-list-${this.list.type}`),this.isFeaturedExhibitorActive&&o.push("overlay-exhibitor-featured"),o}get isOverlayOpen(){return this.noOverlay&&!this.overlayOnDemand?!1:this.activeInterfaceData!==null}setOverlayScrolled(o){this.isOverlayScrolled=o}setListScrollTop(o,s){this.listScrollTop=s,this.scrollPositions.set(o,s)}setListScrollItemId(o,s){this.listScrollItemId=s,this.scrollItemIds.set(o,s)}getListScrollTop(o){return this.scrollPositions.get(o)||0}getListScrollItemId(o){return this.scrollItemIds.get(o)||null}clearListScroll(o){this.scrollPositions.delete(o),this.scrollItemIds.delete(o),this.list.type===o&&(this.listScrollTop=0,this.listScrollItemId=null)}get bannerType(){return this.hideFreeOrDemo||this.heatmap?null:L.EXPO==="expo"?"demo":k.expoFpAd||k.isTrial?"free":null}get isBannerVisible(){return this.bannerType!==null}setCurrentBanner(o){this.currentBanner=o}setForceShowDetails(o){this.forceShowDetails=o}get showRouteInstantly(){return!!(this.kiosk&&!this.forceShowDetails)}startBuildRoute(){this.rootStore.selectSearch(""),this.mapControlsHidden=!0,this.floorsControlHidden=!0,this.hideHeaderLogo=!0,this.hideFreeOrDemo=!0,this.hideOverlay=!0,this.hideCookieConsent=!0,this.buildRoute=!0}setGlobalErrorMessage(o){this.globalErrorMessages.push(o)}popGlobalErrorMessage(){this.globalErrorMessages.pop()}initializeUIScale(){if(new URLSearchParams(window.location.search).get("kiosk")!=="0"&&B){const s=localStorage.getItem(H)??localStorage.getItem(U);if(s){const i=parseFloat(s);!isNaN(i)&&i>=.8&&i<=1.4&&(this._customUIScale=i)}}}setUIScale(o,s=!0){if(o===void 0||isNaN(o)||o<this.minUIScale||o>this.maxUIScale){ut.warn(`Invalid ui-scale value: ${o}. Must be between ${this.minUIScale} and ${this.maxUIScale}.`);return}this._customUIScale=o,s&&B&&(localStorage.setItem(H,o.toString()),localStorage.removeItem(U))}resetUIScale(){this._customUIScale=null,B&&(localStorage.removeItem(H),localStorage.removeItem(U))}enableSetKioskMode(o){this.setKioskModeEnabled=o}setKioskData(o){this.kioskData=o}}e([a.struct],t.prototype,"list",void 0),e([a.ref],t.prototype,"details",void 0),e([a.ref],t.prototype,"hoveredExhibitor",void 0),e([a.ref],t.prototype,"hoveredBooth",void 0),e([a],t.prototype,"zoomBy",void 0),e([a],t.prototype,"rollReset",void 0),e([a],t.prototype,"moveToBooths",void 0),e([a],t.prototype,"moveToRect",void 0),e([a],t.prototype,"moveToRectPaddingPercent",void 0),e([a],t.prototype,"moveToLocation",void 0),e([a],t.prototype,"menu",void 0),e([a],t.prototype,"searchFocused",void 0),e([a],t.prototype,"searchClearMode",void 0),e([a],t.prototype,"printingPdf",void 0),e([a.struct],t.prototype,"screenSize",void 0),e([a],t.prototype,"desiredOverlaySize",void 0),e([a],t.prototype,"overlayShowsAll",void 0),e([a],t.prototype,"centerMap",void 0),e([a],t.prototype,"zoomAfTransformK",void 0),e([a],t.prototype,"activeListIndex",void 0),e([a],t.prototype,"devicePixelRatio",void 0),e([a],t.prototype,"wsStarted",void 0),e([a],t.prototype,"canvasStarted",void 0),e([a],t.prototype,"kiosk",void 0),e([a],t.prototype,"inIdle",void 0),e([a],t.prototype,"modalActive",void 0),e([a],t.prototype,"galleryActive",void 0),e([a],t.prototype,"hideOverlay",void 0),e([a],t.prototype,"searchButtonsOverride",void 0),e([a],t.prototype,"hideCookieConsent",void 0),e([a],t.prototype,"hideHeaderLogo",void 0),e([a],t.prototype,"hideLogoInBooth",void 0),e([a],t.prototype,"disableBookmarked",void 0),e([a],t.prototype,"hideLanguage",void 0),e([a],t.prototype,"monochrome",void 0),e([a],t.prototype,"heatmap",void 0),e([a],t.prototype,"heatmapYah",void 0),e([a],t.prototype,"debugCircles",void 0),e([a],t.prototype,"mapControlsHidden",void 0),e([a],t.prototype,"floorsControlHidden",void 0),e([a],t.prototype,"hideFreeOrDemo",void 0),e([a],t.prototype,"freeBannerDismissed",void 0),e([a],t.prototype,"currentBanner",void 0),e([a],t.prototype,"sceneDefReady",void 0),e([a],t.prototype,"categoryFilterOpen",void 0),e([a],t.prototype,"selectedCategoryFilters",void 0),e([a],t.prototype,"selectedPoiTypeFilters",void 0),e([a],t.prototype,"selectedTrack",void 0),e([a],t.prototype,"subButtonsVisible",void 0),e([a],t.prototype,"searchBoxMode",void 0),e([a],t.prototype,"searchBoxTitle",void 0),e([a],t.prototype,"searchBoxSubtitle",void 0),e([a],t.prototype,"routeTitle",void 0),e([a],t.prototype,"routeDescription",void 0),e([a],t.prototype,"isMultiPointRoute",void 0),e([a],t.prototype,"tourTitle",void 0),e([a],t.prototype,"tourDescription",void 0),e([a],t.prototype,"isMultiPointTour",void 0),e([a],t.prototype,"pathwayOnlyMode",void 0),e([a],t.prototype,"isOverlayScrolled",void 0),e([a],t.prototype,"listScrollTop",void 0),e([a],t.prototype,"listScrollItemId",void 0),e([a],t.prototype,"listScrollIndex",void 0),e([a],t.prototype,"_customUIScale",void 0),e([d],t.prototype,"setSelectedCategoryFilters",null),e([d],t.prototype,"resetCategoryFilter",null),e([d],t.prototype,"setSearchClearMode",null),e([d],t.prototype,"setRouteTitle",null),e([d],t.prototype,"setRouteDescription",null),e([d],t.prototype,"setIsMultiPointRoute",null),e([d],t.prototype,"setTourTitle",null),e([d],t.prototype,"setTourDescription",null),e([d],t.prototype,"setIsMultiPointTour",null),e([d],t.prototype,"setPathwayOnlyMode",null),e([d],t.prototype,"setMultiPointTourList",null),e([n],t.prototype,"activePathwayLayers",null),e([n],t.prototype,"highlightedBooths",null),e([n],t.prototype,"rtl",null),e([n({keepAlive:!0})],t.prototype,"noOverlay",null),e([n],t.prototype,"overlayOnDemand",null),e([n],t.prototype,"overlayHiddenNow",null),e([n({keepAlive:!0})],t.prototype,"selectedExhibitor",null),e([n({keepAlive:!0})],t.prototype,"selectedBooth",null),e([n({keepAlive:!0})],t.prototype,"selectedCategory",null),e([n({keepAlive:!0})],t.prototype,"selectedRoute",null),e([n({keepAlive:!0})],t.prototype,"selectedSpeaker",null),e([n({keepAlive:!0})],t.prototype,"uiScale",null),e([n({keepAlive:!0})],t.prototype,"isGuidedToursActive",null),e([n({keepAlive:!0})],t.prototype,"getRouteNextFloor",null),e([n],t.prototype,"headerHeightRem",null),e([n],t.prototype,"headerHeightPx",null),e([n],t.prototype,"overlayPosition",null),e([n],t.prototype,"overlayCollapsed",null),e([n],t.prototype,"overlaySize",null),e([n],t.prototype,"overlayBottom",null),e([n],t.prototype,"overlayLeft",null),e([n],t.prototype,"overlayWidthPx",null),e([n({keepAlive:!0})],t.prototype,"wsImageHeightPx",null),e([n],t.prototype,"wsPaddingPx",null),e([n],t.prototype,"wsOccupiedHeightPx",null),e([n({keepAlive:!0})],t.prototype,"wsShown",null),e([n],t.prototype,"wsDesktopPosition",null),e([n],t.prototype,"wsPosition",null),e([n],t.prototype,"responsiveClass",null),e([n],t.prototype,"mapVisibleTop",null),e([n],t.prototype,"mapVisibleBottom",null),e([n],t.prototype,"mapVisibleStart",null),e([n],t.prototype,"searchActionsHeightPx",null),e([n],t.prototype,"shouldShowSearchButtons",null),e([n],t.prototype,"shouldShowMobileToggle",null),e([n],t.prototype,"mobileToggleIsListMode",null),e([n],t.prototype,"canvasVisibleRectPx",null),e([n],t.prototype,"shouldShiftMapRect",null),e([n],t.prototype,"hasAppliedFilters",null),e([n],t.prototype,"canvasVisibleRectPt",null),e([n],t.prototype,"canvasSizePt",null),e([n({keepAlive:!0})],t.prototype,"shouldUseBackdrop",null),e([a],t.prototype,"forceDim",void 0),e([d],t.prototype,"setForceDim",null),e([n],t.prototype,"dimmed",null),e([n],t.prototype,"defaultSearchItems",null),e([n],t.prototype,"searchItems",null),e([n],t.prototype,"searchList",null),e([n],t.prototype,"foundInDescription",null),e([n],t.prototype,"foundInDescriptionStruct",null),e([n],t.prototype,"categoryFilteredSearchList",null),e([n],t.prototype,"fuzzySearchItems",null),e([n],t.prototype,"listItems",null),e([n({keepAlive:!0})],t.prototype,"listBooths",null),e([n({keepAlive:!0})],t.prototype,"selectedBooths",null),e([n({keepAlive:!0})],t.prototype,"hoveredBooths",null),e([n],t.prototype,"visibility",null),e([d],t.prototype,"setVisibility",null),e([d],t.prototype,"toggleMapOverlay",null),e([d],t.prototype,"changeZoom",null),e([d],t.prototype,"zoomIn",null),e([d],t.prototype,"zoomOut",null),e([d],t.prototype,"fitBounds",null),e([n({keepAlive:!0})],t.prototype,"selectedEventItem",null),e([a],t.prototype,"mapSettings",void 0),e([d],t.prototype,"setMapSettings",null),e([d],t.prototype,"resetMapSettings",null),e([n],t.prototype,"baseQRCodeUrl",null),e([n],t.prototype,"viewMapOnPhoneQRCodeUrl",null),e([n],t.prototype,"routeQRCodeUrl",null),e([n],t.prototype,"isFeaturedExhibitorActive",null),e([n],t.prototype,"activeInterfaceData",null),e([n],t.prototype,"searchBoxConfig",null),e([n],t.prototype,"searchBoxActions",null),e([n],t.prototype,"overlayInterfaceClasses",null),e([n],t.prototype,"isOverlayOpen",null),e([d],t.prototype,"setOverlayScrolled",null),e([d],t.prototype,"setListScrollTop",null),e([d],t.prototype,"setListScrollItemId",null),e([d],t.prototype,"getListScrollTop",null),e([d],t.prototype,"getListScrollItemId",null),e([d],t.prototype,"clearListScroll",null),e([n],t.prototype,"bannerType",null),e([n],t.prototype,"isBannerVisible",null),e([d],t.prototype,"setCurrentBanner",null),e([a],t.prototype,"forceShowDetails",void 0),e([d],t.prototype,"setForceShowDetails",null),e([n],t.prototype,"showRouteInstantly",null),e([a],t.prototype,"buildRoute",void 0),e([d],t.prototype,"startBuildRoute",null),e([a],t.prototype,"globalErrorMessages",void 0),e([d],t.prototype,"setGlobalErrorMessage",null),e([d],t.prototype,"popGlobalErrorMessage",null),e([d],t.prototype,"initializeUIScale",null),e([d],t.prototype,"setUIScale",null),e([d],t.prototype,"resetUIScale",null),e([a],t.prototype,"setKioskModeEnabled",void 0),e([d],t.prototype,"enableSetKioskMode",null),e([a],t.prototype,"kioskData",void 0),e([d],t.prototype,"setKioskData",null);function J(P){return"description"in P&&typeof P.description=="string"?P.description:void 0}function D(P,o,s=[]){const i=[];return P.forEach(c=>{if(c instanceof x)i.push(...c.booths);else if(c instanceof I)i.push(c);else if(c instanceof O){const r=o.find(l=>l.id===c.boothId);c.boothId&&r&&i.push(r)}else c instanceof K&&s.filter(r=>r.speakers.some(l=>l.id===c.id)&&r.boothId).forEach(r=>{const l=o.find(u=>u.id===r.boothId);l&&i.push(l)})}),new Set(i.filter(Boolean))}
1
+ import{__decorate as e}from"tslib";import{Box as ot,Point as it}from"@expofp/geometry";import{action as d,computed as n,observable as a}from"mobx";import{setKioskUrlParams as st}from"../components/Kiosk/kioskUrlParam";import{mapScene as rt}from"../components/Map/scene";import{LANGUAGE_TYPE as E,LEGACY_PREVIEW_MODE_STORAGE_KEY as lt,LEGACY_UI_SCALE_STORAGE_KEY as U,LEGACY_VIEWER_MODE_STORAGE_KEY as at,MOBILE_BREAKPOINT as nt,PREVIEW_MODE_STORAGE_KEY as ht,UI_SCALE_STORAGE_KEY as H,VIEWER_MODE_STORAGE_KEY as ct,VISIBILITY_STORAGE_KEY as $}from"../constants";import k from"../data";import{svgArea as _,svgAreaExplicit as pt}from"../data/svg";import{readFreeBannerDismissed as dt}from"../tools/freeBanner";import{hasUserConsent as ut}from"../tools/gtag";import{hasHtmlTags as W}from"../tools/has-html-tags";import ft from"../tools/logger";import L from"../tools/settings";import{stripHtml as j}from"../tools/strip-html";import{remsToPixels as F}from"../utils";import X from"../utils/browser";import{getLocale as yt,getLocales as mt,t as S}from"../utils/i18n";import{isLocalStorageAvailable as B}from"../utils/localStorage";import{getResponsiveClass as gt}from"../utils/responsiveClass";import{sanitizeStr as Z}from"../utils/sanitizeText";import{fitRectIsFraming as St,getVenueFitMarginPercent as vt,resolveVenueFitRect as bt}from"../utils/scene-bounds";import{uiState as w}from".";import{BoothBase as I,RegularBooth as A,SpecialBooth as V}from"./BoothStore";import{EventItem as O}from"./EventStore";import{Exhibitor as x}from"./ExhibitorStore";import{findEntityByExternalId as It,Route as M}from"./RouteStore";import{SpeakerItem as K}from"./SpeakerStore";const xt=["dimensions25"];export default class t{setSelectedCategoryFilters(o){this.selectedCategoryFilters=o}resetCategoryFilter(){this.selectedCategoryFilters=[],this.categoryFilterOpen=!1}setSearchClearMode(o){this.searchClearMode=o}setRouteTitle(o){this.routeTitle=o}setRouteDescription(o){this.routeDescription=o}setIsMultiPointRoute(o){this.isMultiPointRoute=o}setTourTitle(o){this.tourTitle=o}setTourDescription(o){this.tourDescription=o}setIsMultiPointTour(o){this.isMultiPointTour=o}setPathwayOnlyMode(o){this.pathwayOnlyMode=o}setMultiPointTourList(o){this.list={type:"multi-point-tour",tourId:o}}get activePathwayLayers(){return this.list?.type==="multi-point-tour"?this.rootStore.toursStore.getTourById(this.list.tourId)?.layers?.map(s=>s.id)||[]:[]}get highlightedBooths(){const o=new Set(this.rootStore.exhibitorStore.highlightedByExternalIds),s=new Set(this.rootStore.boothStore.highlightedByExternalIds),i=new Set([this.rootStore.exhibitorStore.exhibitors.filter(r=>o.has(r.externalId)).flatMap(r=>r.booths.filter(l=>l instanceof A)).map(r=>r.id.toString()),this.rootStore.boothStore.booths.filter(r=>s.has(r.externalId)).map(r=>r.id.toString())].flat());if(this.list?.type==="search"&&this.list?.text?.trim().length){i.clear();const r=this.fuzzySearchItems.filter(l=>l.score===0).map(l=>l.item);r.length?D(r,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(l=>i.add(l.id.toString())):this.listBooths.forEach(l=>i.add(l.id.toString()))}if(this.list?.type==="filter"&&(i.clear(),this.list.items.flatMap(r=>r.booths.filter(l=>l instanceof A)).forEach(r=>i.add(r.id.toString()))),this.categoryFilterOpen&&this.selectedCategoryFilters.length>0?(i.clear(),this.selectedCategoryFilters.forEach(r=>{r.exhibitors.flatMap(l=>l.booths).forEach(l=>i.add(l.id.toString()))})):this.list?.type==="category"&&(i.clear(),this.list.category.exhibitors.flatMap(r=>r.booths).forEach(r=>i.add(r.id.toString()))),this.list?.type==="bookmarks"&&(i.clear(),D(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(r=>i.add(r.id.toString()))),this.list?.type==="visited"&&(i.clear(),D(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems).forEach(r=>i.add(r.id.toString()))),this.list?.type==="exhibitors"){i.clear();const r=this.list.text?.toLowerCase().trim();let l=this.rootStore.exhibitorStore.exhibitors;r&&(l=l.filter(u=>u.name.toLowerCase().includes(r))),l.flatMap(u=>u.booths.filter(g=>g instanceof A)).forEach(u=>i.add(u.id.toString()))}if(this.selectedPoiTypeFilters.length>0&&(i.clear(),this.selectedPoiTypeFilters.forEach(r=>{this.rootStore.boothStore.booths.filter(l=>l.poiTypeId===r.id).forEach(l=>i.add(l.id.toString()))})),this.details instanceof M&&(i.clear(),this.details.from instanceof I&&i.add(this.details.from.id.toString()),this.details.to instanceof I&&i.add(this.details.to.id.toString()),this.details.waypoints?.forEach(r=>i.add(r.id.toString()))),this.details instanceof I&&(i.clear(),i.add(this.details.id.toString())),this.details instanceof x&&(i.clear(),this.details.booths.filter(r=>r instanceof A).forEach(r=>i.add(r.id.toString()))),this.details instanceof O){const r=this.details;if(r.boothId){i.clear();const l=this.rootStore.boothStore.booths.find(u=>u.id===r.boothId);l&&i.add(l.id.toString())}}return i}constructor(o){this.interfaceMetadata=Object.freeze([{id:"menu",className:"efp-overlay-menu",priority:80,isActive:()=>this.menu,searchBoxConfig:()=>({mode:"interface",title:S("Menu")})},{id:"exhibitor",className:"efp-overlay-exhibitor",priority:70,isActive:()=>this.details instanceof x,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"booth",className:"efp-overlay-booth",priority:70,isActive:()=>this.details instanceof I,searchBoxConfig:()=>{const s=this.details;return{mode:"details",title:s.title||s.name}}},{id:"event",className:"efp-overlay-event",priority:70,isActive:()=>this.details instanceof O,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"route",className:"efp-overlay-route",priority:70,isActive:()=>this.details instanceof M,searchBoxConfig:()=>({mode:"details",title:S("Directions")})},{id:"search",className:"efp-overlay-search",priority:60,isActive:()=>!this.details&&!this.menu&&this.list.type==="search"&&(this.rootStore.fp.alwaysShowSidebar&&!this.overlayOnDemand||this.heatmap||this.searchFocused||this.list.text.length>0||this.searchClearMode),searchBoxConfig:()=>({mode:"search",title:S("Search")})},{id:"exhibitors",className:"efp-overlay-exhibitors",priority:50,isActive:()=>this.list.type==="exhibitors"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Exhibitors")})},{id:"filter",className:"efp-overlay-filter",priority:50,isActive:()=>this.list.type==="filter"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Filter")})},{id:"bookmarks",className:"efp-overlay-bookmarks",priority:50,isActive:()=>this.list.type==="bookmarks"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:S("Bookmarks"),badge:this.rootStore.bookmarksStore.total})},{id:"visited",className:"efp-overlay-visited",priority:50,isActive:()=>this.list.type==="visited"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:S("Visited"),badge:this.rootStore.exhibitorStore.visited.length})},{id:E,className:"efp-overlay-language",priority:50,isActive:()=>this.list.type===E,searchBoxConfig:()=>({mode:"interface",title:S("Language")})},{id:"category",className:"efp-overlay-category",priority:50,isActive:()=>!w.menu&&!!w.selectedCategory,searchBoxConfig:()=>({mode:"interface",title:this.list.type==="category"&&this.list.category?.name||S("Categories")})},{id:"sessions",className:"efp-overlay-sessions",priority:50,isActive:()=>this.list.type==="sessions"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Sessions"),subtitle:this.selectedTrack?this.selectedTrack.name:void 0})},{id:"speakers",className:"efp-overlay-speakers",priority:50,isActive:()=>this.list.type==="speakers"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Speakers")})},{id:"speaker",className:"efp-overlay-speaker",priority:50,isActive:()=>this.details instanceof K,searchBoxConfig:()=>({mode:"details",title:this.details.name})},{id:"tours",className:"efp-overlay-tours",priority:50,isActive:()=>this.list.type==="tours"&&!this.details,searchBoxConfig:()=>({mode:"search",title:S("Guided Tours")})},{id:"multi-point-wayfinding",className:"efp-overlay-multi-point",priority:75,isActive:()=>!!(this.isMultiPointRoute&&this.selectedRoute&&this.list.type!=="route-planner"),searchBoxConfig:()=>({mode:"interface",title:this.routeTitle||S("Multi-point route")})},{id:"multi-point-tour",className:"efp-overlay-multi-point-tour",priority:75,isActive:()=>this.list.type==="multi-point-tour"&&!this.details,searchBoxConfig:()=>({mode:"interface",title:this.tourTitle||S("Multi-point route")})},{id:"route-planner",className:"efp-overlay-route-planner",priority:76,isActive:()=>this.list.type==="route-planner"&&(!this.details||this.details instanceof M),searchBoxConfig:()=>({mode:"interface",title:S("Route planner")})}].sort((s,i)=>i.priority-s.priority)),this.list={type:"search",text:"",focused:!1},this.details=null,this.hoveredExhibitor=null,this.hoveredBooth=null,this.zoomBy=null,this.rollReset=!1,this.moveToBooths=null,this.moveToRect=null,this.moveToRectPaddingPercent=null,this.moveToLocation=!1,this.menu=!1,this.searchFocused=!1,this.searchClearMode=!1,this.printingPdf=!1,this.screenSize=new it(window.innerWidth,window.innerHeight),this.overlayShowsAll=!1,this.centerMap=!1,this.zoomAfTransformK=1,this.activeListIndex=-1,this.devicePixelRatio=window.devicePixelRatio,this.previewExhibitor=null,this.wsStarted=!1,this.canvasStarted=!1,this.kiosk=!1,this.inIdle=!1,this.modalActive={share:!1},this.galleryActive=!1,this.hideOverlay=!1,this.searchButtonsOverride=null,this.hideCookieConsent=!!ut(),this.hideHeaderLogo=!1,this.hideLogoInBooth=!1,this.disableBookmarked=!1,this.hideLanguage=!1,this.monochrome=!1,this.heatmap=!1,this.heatmapYah=!1,this.rootElement=null,this.debugCircles=[],this.mapControlsHidden=!1,this.floorsControlHidden=!1,this.hideFreeOrDemo=!1,this.freeBannerDismissed=dt(sessionStorage),this.currentBanner=null,this.sceneDefReady=!1,this.categoryFilterOpen=!1,this.selectedCategoryFilters=[],this.selectedPoiTypeFilters=[],this.selectedTrack=null,this.subButtonsVisible=!1,this.searchBoxMode="search",this.searchBoxTitle="",this.isMultiPointRoute=!1,this.isMultiPointTour=!1,this.pathwayOnlyMode=!1,this.isOverlayScrolled=!1,this.listScrollTop=0,this.listScrollItemId=null,this.listScrollIndex=0,this.scrollPositions=new Map,this.scrollItemIds=new Map,this._customUIScale=null,this.searchFilterHeightPx=54,this.searchInputHeightPx=54,this.overlayUISizePx=390,this.overlayKioskSizePx=450,this.overlayMediumHeightRems=10,this.forceDim=!1,this.mapSettings={...this.defaultMapSettings},this.forceShowDetails=!1,this.buildRoute=!1,this.globalErrorMessages=[],this.minUIScale=.8,this.maxUIScale=1.4,this.setKioskModeEnabled=!1,this.kioskData=null,this.rootStore=o,this.initializeUIScale()}get rtl(){const o=yt();return o==="ar"||o==="he"}get noOverlay(){return this.rootStore.fp.noOverlay||this.hideOverlay}get overlayOnDemand(){return this.noOverlay&&this.searchButtonsOverride===!0}get overlayHiddenNow(){return this.noOverlay&&!(this.overlayOnDemand&&this.isOverlayOpen)}get onBoothClick(){return this.rootStore.fp.onBoothClick}get onMarkerClick(){return this.rootStore.fp.onMarkerClick}get onBookmarkClick(){return this.rootStore.fp.onBookmarkClick}get onVisitedClick(){return this.rootStore.fp.onVisitedClick}get onCategoryClick(){return this.rootStore.fp.onCategoryClick}get onDirection(){return this.rootStore.fp.onDirection}get onDetails(){return this.rootStore.fp.onDetails}get onExhibitorCustomButtonClick(){return this.rootStore.fp.onExhibitorCustomButtonClick}get onGetCoordsClick(){return this.rootStore.fp.onGetCoordsClick}get selectedExhibitor(){return this.details instanceof x?this.details:null}get selectedBooth(){return this.details instanceof I?this.details:null}get selectedCategory(){return this.list.type==="category"?this.list.category:null}get selectedRoute(){return this.details instanceof M?this.details:null}get selectedSpeaker(){return this.details instanceof K?this.details:null}get uiScale(){return this._customUIScale!==null?this._customUIScale:this.kiosk?1.2:1}get isGuidedToursActive(){return this.rootStore.toursStore.isActive}get getRouteNextFloor(){const o=this.rootStore.routeStore.pathLayers,s=this.rootStore.routeStore.currentRouteLayer?.name;if(!s)return null;const i=o.findIndex(c=>c.layer?.name===s);return i===-1?null:o[i+1]?.layer?.name??null}get headerHeightRem(){return 0}get headerHeightPx(){return F(this.headerHeightRem)}get overlayPosition(){return this.screenSize.width>nt||this.kiosk?"left":"bottom"}get overlayCollapsed(){return this.kiosk&&this.overlayPosition==="left"&&!this.searchFocused&&!this.menu&&!this.details&&!this.selectedCategory&&!this.selectedExhibitor&&this.list.type!=="bookmarks"&&this.list.type!==E&&!this.list.text?.length}get overlaySize(){return this.overlayLeft?"full":this.desiredOverlaySize}get overlayBottom(){return this.overlayPosition==="bottom"}get overlayLeft(){return this.overlayPosition==="left"}get overlayWidthPx(){return this.overlayHiddenNow?0:this.overlayLeft?this.kiosk?this.overlayKioskSizePx:this.overlayUISizePx:F(this.screenSize.width)}get wsImageHeightPx(){return 44}get wsPaddingPx(){return F(.25)}get wsOccupiedHeightPx(){return this.wsShown?this.wsImageHeightPx+this.wsPaddingPx*2:0}get wsShown(){return!this.hideHeaderLogo&&this.rootStore.exhibitorStore.advertised.length>0}get wsDesktopPosition(){return L.EXPO==="cbresupplypartner"?"bottom":"top"}get wsPosition(){return this.overlayBottom?"top":this.wsDesktopPosition}get responsiveClass(){return gt(this.screenSize.width)}get mapVisibleTop(){return(this.wsPosition==="top"?this.wsOccupiedHeightPx:0)+this.headerHeightPx}get mapVisibleBottom(){return this.overlayLeft||this.overlayHiddenNow?this.wsPosition==="bottom"?this.wsOccupiedHeightPx:0:F(this.overlayMediumHeightRems)}get mapVisibleStart(){return 0}get searchActionsHeightPx(){return this.overlayPosition==="bottom"?this.searchInputHeightPx+this.searchFilterHeightPx:this.searchInputHeightPx}get shouldShowSearchButtons(){return this.rootStore.searchButtonsStore.hasAnySearchButtons&&!this.details&&!this.menu&&![E,"filter"].includes(this.list.type)}get shouldShowMobileToggle(){const o=this.list.type==="route-planner";return this.overlayPosition==="bottom"&&(o||!this.details&&!this.menu&&this.list.type!==E&&this.list.type!=="bookmarks"&&this.list.type!=="sessions")}get mobileToggleIsListMode(){return!this.isOverlayOpen||this.overlaySize!=="full"}get canvasVisibleRectPx(){const o=this.screenSize;return ot.fromMinMax({x:w.rtl?0:this.mapVisibleStart,y:this.mapVisibleTop+this.searchActionsHeightPx},{x:w.rtl?o.width-this.mapVisibleStart:o.width,y:o.height-this.mapVisibleBottom})}get shouldShiftMapRect(){return this.overlayPosition==="left"&&(this.details||this.hasAppliedFilters||this.selectedRoute)}get hasAppliedFilters(){return this.selectedCategoryFilters.length>0||this.selectedPoiTypeFilters.length>0}get canvasVisibleRectPt(){return this.canvasVisibleRectPx.scale(this.devicePixelRatio,{x:0,y:0})}get canvasSizePt(){return this.screenSize.multiply(this.devicePixelRatio)}get shouldUseBackdrop(){if(w.overlayCollapsed)return!1;if(B&&localStorage.getItem("forcebackdrop")==="1")return!0;if(this.overlayBottom||this.selectedExhibitor?.leadingImageUrl&&!this.selectedExhibitor?.leadingImageLinkUrl)return!1;const o=X.satisfies({safari:">=13"}),s=X.satisfies({chrome:">=77"});return/(android)/i.test(navigator.userAgent)?!1:o||s&&w.canvasSizePt.height*w.canvasSizePt.width<3e6}setForceDim(o){this.forceDim=o}get dimmed(){return this.forceDim||this.pathwayOnlyMode?!0:this.highlightedBooths.size>0||this.list?.type==="search"&&this.list?.text?.trim().length>0||this.list?.type==="exhibitors"}get defaultSearchItems(){const{exhibitorStore:o,categoryStore:s,boothStore:i,heatmapStore:c}=this.rootStore;let r=o.exhibitors;const l=s.categories.filter(f=>f.exhibitors.length),u=i.booths;this.selectedPoiTypeFilters.length>0&&(r=r.filter(f=>f.booths.some(y=>this.selectedPoiTypeFilters.some(v=>y.poiTypeId===v.id))));let g=[];const C=!this.selectedCategoryFilters.length&&k.showCategories?l.filter(f=>xt.includes(L.EXPO)?!f.name.includes("/"):!0):[],T=u.filter(f=>f instanceof V);return this.selectedCategoryFilters.length>0?g=[...r]:(k.showCompaniesAndBooths&&(g=g.concat(r)),k.showOtherSpaces&&(g=g.concat(T))),this.heatmap?[...r,...u].sort((y,v)=>c.getClicksByType(v)-c.getClicksByType(y)):this.heatmapYah?c.heatmapData?.yah?.sort((f,y)=>c.getClicksByType(y)-c.getClicksByType(f))||[]:r.length===0?u:[...C,...g.sort((f,y)=>{const v=f instanceof x&&f.featured!==void 0,z=y instanceof x&&y.featured!==void 0;if(v!==z)return v?-1:1;const R=f instanceof V&&f.title?f.title:f.name,N=y instanceof V&&y.title?y.title:y.name;return R.localeCompare(N,void 0,{sensitivity:"base",numeric:!0})})]}get searchItems(){if(this.list.type!=="search")return[];const o=this.list.text?.trim().toLowerCase()||"",{exhibitorStore:s,boothStore:i,eventStore:c,speakerStore:r,heatmapStore:l}=this.rootStore;let u=s.exhibitors;const g=i.booths,C=c.eventItems,T=r.speakers;if(this.selectedCategoryFilters.length>0&&(u=u.filter(h=>this.selectedCategoryFilters.some(p=>h.categories.some(m=>m.id===p.id)))),this.selectedPoiTypeFilters.length>0&&(u=u.filter(h=>h.booths.some(p=>this.selectedPoiTypeFilters.some(m=>p.poiTypeId===m.id)))),!o)return this.defaultSearchItems;const f=[o.replace(/&[^&=]+=[^&]+/g,"")];if(this.heatmapYah)return(l.heatmapData.yah??[]).filter(p=>Number.isNaN(Number(o))?p:p.viewCount>=Number(o)).sort((p,m)=>l.getClicksByType(m)-l.getClicksByType(p));const y=[],v=new Set,z=new Set,R=new Set,N=new Set;function G(h){return h?h.replace(/[!@#$%^*\-.,()^#$%:?_+'"/]/g," ").replace(/\s\s+/g," "):""}function b(h,p){return!h||!p?!1:G(h).toLowerCase().includes(G(p).toLowerCase())}function Y(h,p){return h?b(h,p)||b(k.levelTerm+" "+h,p):!1}u.forEach(h=>{f.some(p=>b(h.name,p)||h.booths.some(m=>!p&&b(m.name,p)||Y(m.layer?.name??null,p)))&&v.add(h)}),this.selectedCategoryFilters.length>0&&g.forEach(h=>{(this.heatmap||!(h instanceof A)||!Array.from(v).find(m=>m.booths.includes(h)))&&f.some(m=>b(h.title||"",m)||b(h.name,m)||b(h.fullName,m)||Y(h.layer?.name??null,m))&&z.add(h)});const q=C,tt=T;if(q.forEach(h=>{f.some(p=>b(h.name||"",p)||b(h.description||"",p))&&R.add(h)}),tt.forEach(h=>{f.some(p=>b(h.name,p)||b(h.company,p)||b(h.jobTitle,p))&&N.add(h)}),y.push(...R),y.push(...v),this.heatmap)return y.sort((h,p)=>l.getClicksByType(p)-l.getClicksByType(h));const et=new Map(y.map(h=>[h.id,h]));return y.map(h=>{if(!h.name)return null;const p=Z(h instanceof I&&h.fullName.toLowerCase()||h.name.toLowerCase()),m=p.indexOf(Z(o));if(m===-1)return null;const Q={id:h.id,position:m,lowerCaseName:p,featured:!1};return h instanceof x&&(Q.featured=h.featured),Q}).filter(h=>!!h).sort((h,p)=>(h.featured||p.featured)&&h.featured!==p.featured?h.featured?-1:1:h.position!==p.position?h.position-p.position:h.lowerCaseName.localeCompare(p.lowerCaseName)||String(h.id).localeCompare(String(p.id))).map(({id:h})=>et.get(h)).filter(h=>!!h)}get searchList(){return[...this.rootStore.eventStore.eventItems,...this.rootStore.speakerStore.speakers,...this.rootStore.categoryStore.categories.filter(o=>o.exhibitors.length),...this.rootStore.exhibitorStore.exhibitors,...this.rootStore.boothStore.booths]}get foundInDescription(){if(this.list?.type!=="search")return[];const o=this.list?.text?.trim().toLowerCase();if(!o)return[];const s=this.fuzzySearchItems.map(({item:l})=>l),i=new Set(s.map(l=>l.name)),c=this.categoryFilteredSearchList.filter(l=>!i.has(l.name)),r=[];for(const l of c){const u=J(l);if(!u)continue;const C=(W(u)?j(u):u).toLowerCase().indexOf(o);C!==-1&&r.push({item:l,pos:C})}return r.sort((l,u)=>l.pos-u.pos),r.map(l=>l.item)}get foundInDescriptionStruct(){const o={};if(this.list?.type!=="search")return o;const s=this.list?.text?.trim().toLowerCase();return this.foundInDescription.forEach(i=>{let c=J(i);if(!c)return;W(c)&&(c=j(c));const r=c.toLowerCase().indexOf(s);if(r===-1)return;const l=3,u=r>l?r-l:0,g=c.substring(u).trim();o[i.id]=r>0?`...${g}`:g}),o}get categoryFilteredSearchList(){return this.selectedCategoryFilters.length===0?this.searchList:this.searchList.filter(o=>o instanceof x&&this.selectedCategoryFilters.some(s=>o.categories.some(i=>i.id===s.id)))}get fuzzySearchItems(){if(this.list?.type!=="search")return[];const o=this.list?.text?.trim().toLowerCase();if(!o)return this.defaultSearchItems.map(r=>({item:r,score:0,matches:[]}));const s=this.rootStore.fuzzySearchEngineStore.search(this.categoryFilteredSearchList,o),i=[],c=[];for(const r of s){const l=r.item,u=l.entity.type,g=u==="booth"?l:null,C=u==="exhibitor"?l:null,T=[l.name?.toLowerCase()??"",g?.title?.toLowerCase()??"",g?.fullName?.toLowerCase()??"",...C?.booths?.map(y=>y.name?.toLowerCase()??"")??[]];let f=1/0;for(const y of T){const v=y.indexOf(o);v!==-1&&v<f&&(f=v)}f!==1/0?i.push({result:{item:l,score:0},pos:f}):c.push(r)}return i.sort((r,l)=>r.pos-l.pos),[...i.map(r=>r.result),...c]}get listItems(){if(this.details instanceof M&&this.list.type!=="multi-point-tour")return[this.details.from,this.details.to].filter(o=>o instanceof I);switch(this.list.type){case"search":{let o=!(this.heatmap||this.heatmapYah)&&this.rootStore.fuzzySearchEngineStore.engine?this.fuzzySearchItems.map(({item:s})=>s).concat(this.foundInDescription):this.searchItems;return o=o.filter(s=>s.entity.type==="booth"?!s.exhibitors.length:!0),this.hasAppliedFilters?o.filter(s=>{if(this.selectedCategoryFilters.length>0&&s instanceof x&&!this.selectedCategoryFilters.some(i=>s.categories.some(c=>c.id===i.id)))return!1;if(this.selectedPoiTypeFilters.length>0){if(s instanceof x&&!s.booths.some(i=>this.selectedPoiTypeFilters.some(c=>i.poiTypeId===c.id))||s instanceof I&&!this.selectedPoiTypeFilters.some(i=>s.poiTypeId===i.id))return!1;if(s instanceof O&&s.boothId){const i=this.rootStore.boothStore.booths.find(c=>c.id===s.boothId);if(!i||!this.selectedPoiTypeFilters.some(c=>i.poiTypeId===c.id))return!1}}return!0}):o}case"bookmarks":return[...this.rootStore.exhibitorStore.bookmarked,...this.rootStore.eventStore.bookmarked,...this.rootStore.speakerStore.bookmarked,...this.rootStore.boothStore.booths.filter(o=>o.exhibitors.length===0&&o.bookmarkedDirectly)];case"visited":return[...this.rootStore.exhibitorStore.visited,...this.rootStore.eventStore.visited];case"category":return this.list.category.exhibitors;case E:return mt();case"filter":return this.list.items;case"sessions":return this.rootStore.eventStore.eventItems;case"exhibitors":{const o=this.rootStore.exhibitorStore.exhibitors,s=this.list.text?.toLowerCase().trim();return s?o.filter(i=>i.name.toLowerCase().includes(s)):o}case"multi-point-tour":{const o=this.rootStore.toursStore.getTourById(this.list.tourId);return o?!o.points||o.points.length===0?[]:o.points.map(s=>{const i=parseInt(s);if(!isNaN(i)){const r=this.rootStore.boothStore.boothById.get(i);if(r)return r}return It(s)?.entity||null}).filter(s=>!!s):[]}case"route-planner":return this.rootStore.routePlannerStore.resolvedBooths}throw new Error("Unknown list.type")}get listBooths(){return D(this.listItems,this.rootStore.boothStore.booths,this.rootStore.eventStore.eventItems)}get selectedBooths(){let o=[];this.selectedExhibitor?o=this.selectedExhibitor.booths:this.selectedBooth&&(o=[this.selectedBooth]);const s=this.selectedRoute,i=[s?.from,s?.to,...s?.waypoints??[]].filter(c=>c instanceof I);return o.push(...i),new Set(o)}get hoveredBooths(){let o=[];return this.hoveredBooth?o=[this.hoveredBooth]:this.hoveredExhibitor&&(o=this.hoveredExhibitor.booths),new Set(o)}get visibility(){return{controls:!this.mapControlsHidden,levels:!this.floorsControlHidden,header:this.wsShown,overlay:!this.hideOverlay,searchButtons:this.searchButtonsOverride??!this.hideOverlay}}setVisibility(o){const s=["controls","levels","header","overlay"],i={...s.reduce((r,l)=>({...r,[l]:!0}),{}),...s.filter(r=>r in o).reduce((r,l)=>({...r,[l]:o[l]}),{})},c=typeof o.searchButtons=="boolean"?o.searchButtons:null;B&&(Object.values(i).every(Boolean)&&c===null?localStorage.removeItem($):localStorage.setItem($,JSON.stringify(c===null?i:{...i,searchButtons:c}))),this.mapControlsHidden=!i.controls,this.floorsControlHidden=!i.levels,this.hideHeaderLogo=!i.header,this.hideFreeOrDemo=!i.header,this.hideOverlay=!i.overlay,this.searchButtonsOverride=c}toggleMapOverlay(){this.overlayPosition==="bottom"&&this.overlaySize==="full"?this.desiredOverlaySize="medium":this.overlayPosition==="bottom"&&this.overlaySize!=="full"&&(this.desiredOverlaySize="full")}changeZoom(o){this.zoomBy=o}zoomIn(){this.changeZoom(1.5)}zoomOut(){this.changeZoom(.66)}fitBounds(){const{rect:o,source:s}=bt({layerViewbox:this.rootStore.layerStore.viewboxRectangle,explicitArea:pt?_:null,layerRectangle:this.rootStore.layerStore.rectangle,sceneDef:rt()??null,svgArea:_});this.moveToRect=o,this.moveToRectPaddingPercent=St(s)?0:vt(o,_),this.rollReset=!0}get previewMode(){const o=B?localStorage.getItem(ht)??localStorage.getItem(lt):null;return o==="true"||o==="1"||this.rootStore.fp.previewMode}get viewerMode(){const o=B?localStorage.getItem(ct)??localStorage.getItem(at):null;return o==="true"||o==="1"||this.rootStore.fp.viewerMode}get selectedEventItem(){return this.details instanceof O?this.details:null}get defaultMapSettings(){return{zoomtime:500,center:void 0,centerxy:void 0,z:void 0,bearing:0,roll:1}}setMapSettings(o){const s={};for(const i of Object.keys(o)){const c=o[i];c!=null&&(i==="zoomtime"?s.zoomtime=Math.min(Math.max(o.zoomtime||this.mapSettings.zoomtime||0,500),5e3):Object.assign(s,{[i]:c}))}this.mapSettings={...this.mapSettings,...s}}resetMapSettings(){this.mapSettings={...this.defaultMapSettings}}get baseQRCodeUrl(){return`https://${L.EXPO}.expofp.com`}get viewMapOnPhoneQRCodeUrl(){if(k?.customKioskQrCodeUrl)return k.customKioskQrCodeUrl;const o=new URL(this.baseQRCodeUrl);o.search=window.location.search;const s=o.toString();return console.log("View Map On Phone QR Code Url",s),s}get routeQRCodeUrl(){const o=new URL(this.baseQRCodeUrl),s=this.selectedRoute?.from,i=this.selectedRoute?.to,c=s instanceof I?s.slug:"",r=i instanceof I?i.slug:"";o.search=`?route%3A${encodeURIComponent(r)}%3A${encodeURIComponent(c)}%3Afalse`,st(o.searchParams,this.kioskData);const l=o.toString();return console.log("Route QR Code Url",l),l}get isFeaturedExhibitorActive(){return this.details instanceof x&&!!this.details.featured}get activeInterfaceData(){for(const o of this.interfaceMetadata)if(o.isActive())return o;return null}get searchBoxConfig(){const o=this.activeInterfaceData;return!o||!o.searchBoxConfig?{mode:"search",title:"",subtitle:void 0,badge:void 0,icon:void 0}:o.searchBoxConfig()||{mode:"search",title:"",subtitle:void 0,badge:void 0,icon:void 0}}get searchBoxActions(){return this.activeInterfaceData?.actions?.()??[]}get overlayInterfaceClasses(){const o=[],s=this.activeInterfaceData;return s&&(o.push(s.className),s.additionalClasses&&o.push(...s.additionalClasses())),this.details&&o.push("overlay-has-details"),this.list.type&&o.push(`overlay-list-${this.list.type}`),this.isFeaturedExhibitorActive&&o.push("overlay-exhibitor-featured"),o}get isOverlayOpen(){return this.noOverlay&&!this.overlayOnDemand?!1:this.activeInterfaceData!==null}setOverlayScrolled(o){this.isOverlayScrolled=o}setListScrollTop(o,s){this.listScrollTop=s,this.scrollPositions.set(o,s)}setListScrollItemId(o,s){this.listScrollItemId=s,this.scrollItemIds.set(o,s)}getListScrollTop(o){return this.scrollPositions.get(o)||0}getListScrollItemId(o){return this.scrollItemIds.get(o)||null}clearListScroll(o){this.scrollPositions.delete(o),this.scrollItemIds.delete(o),this.list.type===o&&(this.listScrollTop=0,this.listScrollItemId=null)}get bannerType(){return this.hideFreeOrDemo||this.heatmap?null:L.EXPO==="expo"?"demo":k.expoFpAd||k.isTrial?"free":null}get isBannerVisible(){return this.bannerType!==null}setCurrentBanner(o){this.currentBanner=o}setForceShowDetails(o){this.forceShowDetails=o}get showRouteInstantly(){return!!(this.kiosk&&!this.forceShowDetails)}startBuildRoute(){this.rootStore.selectSearch(""),this.mapControlsHidden=!0,this.floorsControlHidden=!0,this.hideHeaderLogo=!0,this.hideFreeOrDemo=!0,this.hideOverlay=!0,this.hideCookieConsent=!0,this.buildRoute=!0}setGlobalErrorMessage(o){this.globalErrorMessages.push(o)}popGlobalErrorMessage(){this.globalErrorMessages.pop()}initializeUIScale(){if(new URLSearchParams(window.location.search).get("kiosk")!=="0"&&B){const s=localStorage.getItem(H)??localStorage.getItem(U);if(s){const i=parseFloat(s);!isNaN(i)&&i>=.8&&i<=1.4&&(this._customUIScale=i)}}}setUIScale(o,s=!0){if(o===void 0||isNaN(o)||o<this.minUIScale||o>this.maxUIScale){ft.warn(`Invalid ui-scale value: ${o}. Must be between ${this.minUIScale} and ${this.maxUIScale}.`);return}this._customUIScale=o,s&&B&&(localStorage.setItem(H,o.toString()),localStorage.removeItem(U))}resetUIScale(){this._customUIScale=null,B&&(localStorage.removeItem(H),localStorage.removeItem(U))}enableSetKioskMode(o){this.setKioskModeEnabled=o}setKioskData(o){this.kioskData=o}}e([a.struct],t.prototype,"list",void 0),e([a.ref],t.prototype,"details",void 0),e([a.ref],t.prototype,"hoveredExhibitor",void 0),e([a.ref],t.prototype,"hoveredBooth",void 0),e([a],t.prototype,"zoomBy",void 0),e([a],t.prototype,"rollReset",void 0),e([a],t.prototype,"moveToBooths",void 0),e([a],t.prototype,"moveToRect",void 0),e([a],t.prototype,"moveToRectPaddingPercent",void 0),e([a],t.prototype,"moveToLocation",void 0),e([a],t.prototype,"menu",void 0),e([a],t.prototype,"searchFocused",void 0),e([a],t.prototype,"searchClearMode",void 0),e([a],t.prototype,"printingPdf",void 0),e([a.struct],t.prototype,"screenSize",void 0),e([a],t.prototype,"desiredOverlaySize",void 0),e([a],t.prototype,"overlayShowsAll",void 0),e([a],t.prototype,"centerMap",void 0),e([a],t.prototype,"zoomAfTransformK",void 0),e([a],t.prototype,"activeListIndex",void 0),e([a],t.prototype,"devicePixelRatio",void 0),e([a],t.prototype,"wsStarted",void 0),e([a],t.prototype,"canvasStarted",void 0),e([a],t.prototype,"kiosk",void 0),e([a],t.prototype,"inIdle",void 0),e([a],t.prototype,"modalActive",void 0),e([a],t.prototype,"galleryActive",void 0),e([a],t.prototype,"hideOverlay",void 0),e([a],t.prototype,"searchButtonsOverride",void 0),e([a],t.prototype,"hideCookieConsent",void 0),e([a],t.prototype,"hideHeaderLogo",void 0),e([a],t.prototype,"hideLogoInBooth",void 0),e([a],t.prototype,"disableBookmarked",void 0),e([a],t.prototype,"hideLanguage",void 0),e([a],t.prototype,"monochrome",void 0),e([a],t.prototype,"heatmap",void 0),e([a],t.prototype,"heatmapYah",void 0),e([a],t.prototype,"debugCircles",void 0),e([a],t.prototype,"mapControlsHidden",void 0),e([a],t.prototype,"floorsControlHidden",void 0),e([a],t.prototype,"hideFreeOrDemo",void 0),e([a],t.prototype,"freeBannerDismissed",void 0),e([a],t.prototype,"currentBanner",void 0),e([a],t.prototype,"sceneDefReady",void 0),e([a],t.prototype,"categoryFilterOpen",void 0),e([a],t.prototype,"selectedCategoryFilters",void 0),e([a],t.prototype,"selectedPoiTypeFilters",void 0),e([a],t.prototype,"selectedTrack",void 0),e([a],t.prototype,"subButtonsVisible",void 0),e([a],t.prototype,"searchBoxMode",void 0),e([a],t.prototype,"searchBoxTitle",void 0),e([a],t.prototype,"searchBoxSubtitle",void 0),e([a],t.prototype,"routeTitle",void 0),e([a],t.prototype,"routeDescription",void 0),e([a],t.prototype,"isMultiPointRoute",void 0),e([a],t.prototype,"tourTitle",void 0),e([a],t.prototype,"tourDescription",void 0),e([a],t.prototype,"isMultiPointTour",void 0),e([a],t.prototype,"pathwayOnlyMode",void 0),e([a],t.prototype,"isOverlayScrolled",void 0),e([a],t.prototype,"listScrollTop",void 0),e([a],t.prototype,"listScrollItemId",void 0),e([a],t.prototype,"listScrollIndex",void 0),e([a],t.prototype,"_customUIScale",void 0),e([d],t.prototype,"setSelectedCategoryFilters",null),e([d],t.prototype,"resetCategoryFilter",null),e([d],t.prototype,"setSearchClearMode",null),e([d],t.prototype,"setRouteTitle",null),e([d],t.prototype,"setRouteDescription",null),e([d],t.prototype,"setIsMultiPointRoute",null),e([d],t.prototype,"setTourTitle",null),e([d],t.prototype,"setTourDescription",null),e([d],t.prototype,"setIsMultiPointTour",null),e([d],t.prototype,"setPathwayOnlyMode",null),e([d],t.prototype,"setMultiPointTourList",null),e([n],t.prototype,"activePathwayLayers",null),e([n],t.prototype,"highlightedBooths",null),e([n],t.prototype,"rtl",null),e([n({keepAlive:!0})],t.prototype,"noOverlay",null),e([n],t.prototype,"overlayOnDemand",null),e([n],t.prototype,"overlayHiddenNow",null),e([n({keepAlive:!0})],t.prototype,"selectedExhibitor",null),e([n({keepAlive:!0})],t.prototype,"selectedBooth",null),e([n({keepAlive:!0})],t.prototype,"selectedCategory",null),e([n({keepAlive:!0})],t.prototype,"selectedRoute",null),e([n({keepAlive:!0})],t.prototype,"selectedSpeaker",null),e([n({keepAlive:!0})],t.prototype,"uiScale",null),e([n({keepAlive:!0})],t.prototype,"isGuidedToursActive",null),e([n({keepAlive:!0})],t.prototype,"getRouteNextFloor",null),e([n],t.prototype,"headerHeightRem",null),e([n],t.prototype,"headerHeightPx",null),e([n],t.prototype,"overlayPosition",null),e([n],t.prototype,"overlayCollapsed",null),e([n],t.prototype,"overlaySize",null),e([n],t.prototype,"overlayBottom",null),e([n],t.prototype,"overlayLeft",null),e([n],t.prototype,"overlayWidthPx",null),e([n({keepAlive:!0})],t.prototype,"wsImageHeightPx",null),e([n],t.prototype,"wsPaddingPx",null),e([n],t.prototype,"wsOccupiedHeightPx",null),e([n({keepAlive:!0})],t.prototype,"wsShown",null),e([n],t.prototype,"wsDesktopPosition",null),e([n],t.prototype,"wsPosition",null),e([n],t.prototype,"responsiveClass",null),e([n],t.prototype,"mapVisibleTop",null),e([n],t.prototype,"mapVisibleBottom",null),e([n],t.prototype,"mapVisibleStart",null),e([n],t.prototype,"searchActionsHeightPx",null),e([n],t.prototype,"shouldShowSearchButtons",null),e([n],t.prototype,"shouldShowMobileToggle",null),e([n],t.prototype,"mobileToggleIsListMode",null),e([n],t.prototype,"canvasVisibleRectPx",null),e([n],t.prototype,"shouldShiftMapRect",null),e([n],t.prototype,"hasAppliedFilters",null),e([n],t.prototype,"canvasVisibleRectPt",null),e([n],t.prototype,"canvasSizePt",null),e([n({keepAlive:!0})],t.prototype,"shouldUseBackdrop",null),e([a],t.prototype,"forceDim",void 0),e([d],t.prototype,"setForceDim",null),e([n],t.prototype,"dimmed",null),e([n],t.prototype,"defaultSearchItems",null),e([n],t.prototype,"searchItems",null),e([n],t.prototype,"searchList",null),e([n],t.prototype,"foundInDescription",null),e([n],t.prototype,"foundInDescriptionStruct",null),e([n],t.prototype,"categoryFilteredSearchList",null),e([n],t.prototype,"fuzzySearchItems",null),e([n],t.prototype,"listItems",null),e([n({keepAlive:!0})],t.prototype,"listBooths",null),e([n({keepAlive:!0})],t.prototype,"selectedBooths",null),e([n({keepAlive:!0})],t.prototype,"hoveredBooths",null),e([n],t.prototype,"visibility",null),e([d],t.prototype,"setVisibility",null),e([d],t.prototype,"toggleMapOverlay",null),e([d],t.prototype,"changeZoom",null),e([d],t.prototype,"zoomIn",null),e([d],t.prototype,"zoomOut",null),e([d],t.prototype,"fitBounds",null),e([n({keepAlive:!0})],t.prototype,"selectedEventItem",null),e([a],t.prototype,"mapSettings",void 0),e([d],t.prototype,"setMapSettings",null),e([d],t.prototype,"resetMapSettings",null),e([n],t.prototype,"baseQRCodeUrl",null),e([n],t.prototype,"viewMapOnPhoneQRCodeUrl",null),e([n],t.prototype,"routeQRCodeUrl",null),e([n],t.prototype,"isFeaturedExhibitorActive",null),e([n],t.prototype,"activeInterfaceData",null),e([n],t.prototype,"searchBoxConfig",null),e([n],t.prototype,"searchBoxActions",null),e([n],t.prototype,"overlayInterfaceClasses",null),e([n],t.prototype,"isOverlayOpen",null),e([d],t.prototype,"setOverlayScrolled",null),e([d],t.prototype,"setListScrollTop",null),e([d],t.prototype,"setListScrollItemId",null),e([d],t.prototype,"getListScrollTop",null),e([d],t.prototype,"getListScrollItemId",null),e([d],t.prototype,"clearListScroll",null),e([n],t.prototype,"bannerType",null),e([n],t.prototype,"isBannerVisible",null),e([d],t.prototype,"setCurrentBanner",null),e([a],t.prototype,"forceShowDetails",void 0),e([d],t.prototype,"setForceShowDetails",null),e([n],t.prototype,"showRouteInstantly",null),e([a],t.prototype,"buildRoute",void 0),e([d],t.prototype,"startBuildRoute",null),e([a],t.prototype,"globalErrorMessages",void 0),e([d],t.prototype,"setGlobalErrorMessage",null),e([d],t.prototype,"popGlobalErrorMessage",null),e([d],t.prototype,"initializeUIScale",null),e([d],t.prototype,"setUIScale",null),e([d],t.prototype,"resetUIScale",null),e([a],t.prototype,"setKioskModeEnabled",void 0),e([d],t.prototype,"enableSetKioskMode",null),e([a],t.prototype,"kioskData",void 0),e([d],t.prototype,"setKioskData",null);function J(P){return"description"in P&&typeof P.description=="string"?P.description:void 0}function D(P,o,s=[]){const i=[];return P.forEach(c=>{if(c instanceof x)i.push(...c.booths);else if(c instanceof I)i.push(c);else if(c instanceof O){const r=o.find(l=>l.id===c.boothId);c.boothId&&r&&i.push(r)}else c instanceof K&&s.filter(r=>r.speakers.some(l=>l.id===c.id)&&r.boothId).forEach(r=>{const l=o.find(u=>u.id===r.boothId);l&&i.push(l)})}),new Set(i.filter(Boolean))}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Publishes the SDK's `onDetails` event from the store's `details` selection.
3
+ *
4
+ * Lifted out of the legacy `Map` component, where it lived only because everything did: nothing
5
+ * here touches a renderer, and the event must fire in every mode — the MapLibre embed included,
6
+ * which unmounts the plan's own map entirely. Bound once per `load()`, beside the rest of the
7
+ * SDK wiring, and disposed with it.
8
+ * @returns A disposer.
9
+ */
10
+ export declare function bindDetailsEvents(): () => void;
11
+ //# sourceMappingURL=details-events.d.ts.map
@@ -0,0 +1 @@
1
+ import{reaction as l}from"mobx";import s,{uiState as i}from"../store";import u from"../tools/settings";import{BoothBase as p}from"./BoothStore";import{Category as d}from"./CategoryStore";import{Exhibitor as m}from"./ExhibitorStore";import{Route as h}from"./RouteStore";export function bindDetailsEvents(){return l(()=>i.details,()=>{if(!i.onDetails)return;if(!i.details){i.onDetails(null);return}let t=i.details;if(u.EXPO==="wineparis"&&(t instanceof m&&(t=t.booths[0]),!t))return;let o=null,r=[];t instanceof m?(o="exhibitor",r=t.booths.map(e=>e.name).sort((e,a)=>e==s.routeStore.tempToBooth?.name?-1:a==s.routeStore.tempToBooth?.name?1:0)):t instanceof p?(o="booth",r=[t.name]):t instanceof h?(o="route",r=[t.from?.name,t.to?.name].filter(e=>!!e)):t instanceof d&&(o="category",r=t.exhibitors.map(e=>e.booths.map(a=>a.name)).flat());const n=t,f={type:o,name:n?.name,id:n?.id,externalId:n?.externalId,boothsNames:r};i.onDetails({...f,...o==="route"?{routeInfo:s.routeStore.routeInfo??void 0}:{}})})}
@@ -1 +1 @@
1
- import{Box as v,degToRad as S,radToDeg as R}from"@expofp/geometry";import M from"color";import*as W from"d3-selection";import{autorun as O}from"mobx";import w from"../../data";import{getLayerSvg as T,getTrianglesFromFpPaths as V}from"../../data/svg";import{getNextId as G}from"../../tools/id";import y from"../../tools/logger";import P from"../../tools/settings";import{generateUniqueSlug as E}from"../../tools/slug";import{sortByName as $}from"../../utils";import{areLayersEnabled as U}from"../../utils/areLayersEnabled";import{getStorage as z,saveStorage as j}from"../../utils/entity-storage";import{extractMetaFromString as q}from"../../utils/extractMetaFromString";import{RegularBooth as C,SpecialBooth as L}from"../BoothStore";import{uiState as H}from"../index";const k=new Map,x=[];export function iniAllBooths(e){k.clear(),x.length=0;for(const l of w.booths||[]){const{text:d,meta:b}=q(l.name),r=l.special?new L:new C;Object.assign(r,l),r.meta=b,r.slug=E(r.name),k.set(r.name.toLowerCase(),r),K(r);const n=r;n.exhibitors=[];for(const m of l.exhibitors??[]){const p=e.exhibitorStore.exhibitorById.get(m);p&&(n.exhibitors.push(p),p.booths.push(n))}r.schedule=e.eventStore.eventItems.filter(m=>m.boothId===r.id),r.name=d,x.push(r)}x.sort((l,d)=>l.name.localeCompare(d.name,void 0,{sensitivity:"base",numeric:!0}));for(const l of e.exhibitorStore.exhibitors)$(l.booths);e.boothStore.booths=x,y.log("initBooths",e.boothStore.booths.length),X(e)}function X(e){const b=(z("bookmarked").booths||[]).filter(r=>{const n=e.boothStore.boothById.get(r);return n&&n.exhibitors.length===0});e.boothStore.replaceBookmarked(b),O(()=>{const r=z("bookmarked"),n=e.boothStore.booths.filter(m=>m.exhibitors.length===0&&m.bookmarkedDirectly).map(m=>m.id);j("bookmarked",{exhibitors:r.exhibitors,events:r.events,speakers:r.speakers,booths:n})})}export default function J(e,l){const d=l.name,{boothStore:b,layerStore:r}=e,n=[],m=U(),p=W.select(T(l)).selectAll(`[data-layer='${d}'] > [data-tagname='efp-booth'], [data-layer='${d}'] > g[id^=b], [data-layer='${d}'] > rect[id^=b]`).nodes();for(const o of p){const F=o.closest("svg > [data-layer]").getAttribute("data-layer");if(!F)continue;let a,I=!1;o.tagName==="rect"?a=o:(a=Array.from(o.children).find(h=>h.tagName==="rect"),I=a===o.firstElementChild);const N=o.id||o.getAttribute("data-name");if(!N){y.error("SVG booth element has neither id nor data-name:",o);continue}const u=N.substring(1).toLowerCase();let t=k.get(u),i=t instanceof C?t:null;const A=t instanceof L?t:null;if(t||(y.error("SVG booth rect not found in the event data:",u),t=i=new C,t.id=G(),t.name=u.toUpperCase(),t.slug=E(u),t.error=!0,t.exhibitors=[],k.set(u,t)),n.push(t),t.layer=m?r.layers.find(h=>h.name===F):null,t.borderColor=a?.getAttribute("stroke")||a?.style.stroke||P.boothBorderColor||"#FFFFFF",t.borderWidth=parseFloat(a?.getAttribute("stroke-width")||a?.style.strokeWidth),isNaN(t.borderWidth)&&(t.borderWidth=b.borderWidth),!H.heatmap)t.labelColor=a?.getAttribute("data-label-color");else{const h=e.heatmapStore.getTotalClicksByBooth(t),f=M(e.heatmapStore.getColorByClicks(h));t.labelColor=f.darken(.3).isLight()?"#555":"#fff"}t.rect=a?v.fromSvg(a):null,t.noLabels=!!a?.dataset.nolabel||a?.id.startsWith("no"),i?(i.availColor=o.getAttribute("data-avail-color")||a?.getAttribute("data-avail-color")||i.availColor,i.soldColor=o.getAttribute("data-sold-color")||a?.getAttribute("data-sold-color")||i.soldColor,i.holdColor=o.getAttribute("data-hold-color")||a?.getAttribute("data-hold-color")||i.holdColor,i.size=w.dimensionless?null:i.size||o.getAttribute("data-size"),i.status==="reserved"?i.reserved=!0:i.status==="onhold"&&(i.onHold=!0)):A&&(A.color=(parseInt(a.getAttribute("data-poi-type")??"")>0?a.style?.fill:o.getAttribute("data-color")||a.getAttribute("data-color"))||A.color);const g=a?.getAttribute("transform");if(g){const h=g.match(/translate\(([-0-9.]+) ([-0-9.]+)\) rotate\(([-0-9.]+)\)/);if(h){const s=parseFloat(h[3]);t.rotate=S(s)}else{const s=g.match(/rotate\(([-0-9.]+).*\)/);if(s){const c=parseFloat(s[1]);t.rotate=S(c)}else{const c=g.match(/matrix\(\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*\)/);c&&(t.rotate=Math.asin(parseFloat(c[2])))}}if(Math.abs(R(t.rotate))>180){t.rotate+=S(90);const s=t.rect;t.rect=new v(s.center.x-s.size.height/2,s.center.y-s.size.width/2,s.size.height,s.size.width)}}if(o.tagName==="g"){t.paths=[],t.pathsWithRect=I;const h=[];for(const f of W.select(o).selectAll("path, rect").nodes())if(f.tagName==="path"){const s=f;if(s.tagName!=="path")continue;const c=parseInt(s.getAttribute("data-index")??""),D=!!s.getAttribute("data-unblinking");t.paths.push({index:c,color:s.style.fill,unblinking:D}),a||h.push(...V(c,d))}if(h.length){const f=h.flatMap(s=>s.map(c=>({x:c[0],y:c[1]})));t.rect=v.fromPoints(f),t.noLabels=!0}}}const B=n.filter(o=>o.rect?!0:(y.error("event data booth not found in SVG:",o.name,o),!1));for(const o of B)o.store=b;return B}function K(e){P.EXPO==="cbresupplypartner"&&e instanceof C&&!e.availColor&&e.type&&(e.type.indexOf("Premium A - 2m height restriction Passport")!==-1?e.availColor="#939393":e.type.indexOf("No free-standing")!==-1?e.availColor="#BA3DC8":e.type.endsWith("Passport")?e.availColor="#939393":e.type.startsWith("Premium A - 2m")?e.availColor="#FF9E4E":e.type.startsWith("Premium A - 4m")?e.availColor="#EA4335":e.type.startsWith("Premium B - 2m")?e.availColor="#523BC0":e.type.startsWith("Premium C - 2.4m")&&(e.availColor="#3ECC78"))}
1
+ import{Box as A,degToRad as S,radToDeg as R}from"@expofp/geometry";import M from"color";import*as W from"d3-selection";import{autorun as O}from"mobx";import w from"../../data";import{getLayerSvg as T,getTrianglesFromFpPaths as V}from"../../data/svg";import{getNextId as G}from"../../tools/id";import y from"../../tools/logger";import P from"../../tools/settings";import{generateUniqueSlug as E}from"../../tools/slug";import{sortByName as $}from"../../utils";import{areLayersEnabled as U}from"../../utils/areLayersEnabled";import{getStorage as z,saveStorage as j}from"../../utils/entity-storage";import{extractMetaFromString as q}from"../../utils/extractMetaFromString";import{RegularBooth as C,SpecialBooth as L}from"../BoothStore";import{uiState as H}from"../index";const k=new Map,x=[];export function iniAllBooths(e){k.clear(),x.length=0;for(const l of w.booths||[]){const{text:d,meta:b}=q(l.name),a=l.special?new L:new C;Object.assign(a,l),a.meta=b,a.slug=E(a.name),k.set(a.name.toLowerCase(),a),K(a);const n=a;n.exhibitors=[];for(const m of l.exhibitors??[]){const p=e.exhibitorStore.exhibitorById.get(m);p&&(n.exhibitors.push(p),p.booths.push(n))}a.schedule=e.eventStore.eventItems.filter(m=>m.boothId===a.id),a.name=d,x.push(a)}x.sort((l,d)=>l.name.localeCompare(d.name,void 0,{sensitivity:"base",numeric:!0}));for(const l of e.exhibitorStore.exhibitors)$(l.booths);e.boothStore.booths=x,y.log("initBooths",e.boothStore.booths.length),X(e)}function X(e){const b=(z("bookmarked").booths||[]).filter(a=>{const n=e.boothStore.boothById.get(a);return n&&n.exhibitors.length===0});e.boothStore.replaceBookmarked(b),O(()=>{const a=z("bookmarked"),n=e.boothStore.booths.filter(m=>m.exhibitors.length===0&&m.bookmarkedDirectly).map(m=>m.id);j("bookmarked",{exhibitors:a.exhibitors,events:a.events,speakers:a.speakers,booths:n})})}export default function J(e,l){const d=l.name,{boothStore:b,layerStore:a}=e,n=[],m=U(),p=W.select(T(l)).selectAll(`[data-layer='${d}'] > [data-tagname='efp-booth'], [data-layer='${d}'] > g[id^=b], [data-layer='${d}'] > rect[id^=b]`).nodes();for(const o of p){const F=o.closest("svg > [data-layer]").getAttribute("data-layer");if(!F)continue;let r,I=!1;o.tagName==="rect"?r=o:(r=Array.from(o.children).find(h=>h.tagName==="rect"),I=r===o.firstElementChild);const N=o.id||o.getAttribute("data-name");if(!N){y.error("SVG booth element has neither id nor data-name:",o);continue}const u=N.substring(1).toLowerCase();let t=k.get(u),i=t instanceof C?t:null;const v=t instanceof L?t:null;if(t||(y.error("SVG booth rect not found in the event data:",u),t=i=new C,t.id=G(),t.name=u.toUpperCase(),t.slug=E(u),t.error=!0,t.exhibitors=[],k.set(u,t)),n.push(t),t.layer=m?a.layers.find(h=>h.name===F):null,t.borderColor=r?.getAttribute("stroke")||r?.style.stroke||P.boothBorderColor||"#FFFFFF",t.borderWidth=parseFloat(r?.getAttribute("stroke-width")||r?.style.strokeWidth),isNaN(t.borderWidth)&&(t.borderWidth=b.borderWidth),!H.heatmap)t.labelColor=r?.getAttribute("data-label-color");else{const h=e.heatmapStore.getTotalClicksByBooth(t),f=M(e.heatmapStore.getColorByClicks(h));t.labelColor=f.darken(.3).isLight()?"#555":"#fff"}t.rect=r?A.fromSvg(r):null,t.elevation=parseFloat(r?.dataset.elev)||0,t.noLabels=!!r?.dataset.nolabel||r?.id.startsWith("no"),i?(i.availColor=o.getAttribute("data-avail-color")||r?.getAttribute("data-avail-color")||i.availColor,i.soldColor=o.getAttribute("data-sold-color")||r?.getAttribute("data-sold-color")||i.soldColor,i.holdColor=o.getAttribute("data-hold-color")||r?.getAttribute("data-hold-color")||i.holdColor,i.size=w.dimensionless?null:i.size||o.getAttribute("data-size"),i.status==="reserved"?i.reserved=!0:i.status==="onhold"&&(i.onHold=!0)):v&&(v.color=(parseInt(r.getAttribute("data-poi-type")??"")>0?r.style?.fill:o.getAttribute("data-color")||r.getAttribute("data-color"))||v.color);const g=r?.getAttribute("transform");if(g){const h=g.match(/translate\(([-0-9.]+) ([-0-9.]+)\) rotate\(([-0-9.]+)\)/);if(h){const s=parseFloat(h[3]);t.rotate=S(s)}else{const s=g.match(/rotate\(([-0-9.]+).*\)/);if(s){const c=parseFloat(s[1]);t.rotate=S(c)}else{const c=g.match(/matrix\(\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*(?:,|\s)\s*([-0-9.]+)\s*\)/);c&&(t.rotate=Math.asin(parseFloat(c[2])))}}if(Math.abs(R(t.rotate))>180){t.rotate+=S(90);const s=t.rect;t.rect=new A(s.center.x-s.size.height/2,s.center.y-s.size.width/2,s.size.height,s.size.width)}}if(o.tagName==="g"){t.paths=[],t.pathsWithRect=I;const h=[];for(const f of W.select(o).selectAll("path, rect").nodes())if(f.tagName==="path"){const s=f;if(s.tagName!=="path")continue;const c=parseInt(s.getAttribute("data-index")??""),D=!!s.getAttribute("data-unblinking");t.paths.push({index:c,color:s.style.fill,unblinking:D}),r||h.push(...V(c,d))}if(h.length){const f=h.flatMap(s=>s.map(c=>({x:c[0],y:c[1]})));t.rect=A.fromPoints(f),t.noLabels=!0}}}const B=n.filter(o=>o.rect?!0:(y.error("event data booth not found in SVG:",o.name,o),!1));for(const o of B)o.store=b;return B}function K(e){P.EXPO==="cbresupplypartner"&&e instanceof C&&!e.availColor&&e.type&&(e.type.indexOf("Premium A - 2m height restriction Passport")!==-1?e.availColor="#939393":e.type.indexOf("No free-standing")!==-1?e.availColor="#BA3DC8":e.type.endsWith("Passport")?e.availColor="#939393":e.type.startsWith("Premium A - 2m")?e.availColor="#FF9E4E":e.type.startsWith("Premium A - 4m")?e.availColor="#EA4335":e.type.startsWith("Premium B - 2m")?e.availColor="#523BC0":e.type.startsWith("Premium C - 2.4m")&&(e.availColor="#3ECC78"))}
@@ -9,6 +9,24 @@ export declare class SessionsSubButtonProvider extends BaseSubButtonProvider {
9
9
  createSubButtons(): SearchSubButtonConfig[];
10
10
  handleSubButtonClick(subButtonId: string): void;
11
11
  shouldShowSubButtons(): boolean;
12
+ /**
13
+ * Reports a sub-button click to stats. Must run BEFORE the handler mutates
14
+ * state, because it compares against the sub-button currently selected — a
15
+ * click on the one already selected is not a new view of it. (The store's
16
+ * `handleSubButtonClick` guards the same case the same way, but the UI calls
17
+ * the `onClick` baked into each config and never reaches that guard.)
18
+ *
19
+ * Deliberately NOT the button's own `active`: `sessions_show_all` is also
20
+ * active whenever no sub-button and no track are selected — the state every
21
+ * path that opens the sessions list leaves behind — which made the first
22
+ * "All Tracks" click, the most common one there is, structurally impossible
23
+ * to report.
24
+ *
25
+ * Captions are data (`track.name`) or a plain literal, never `t()`, so the
26
+ * value is stable across locales. Tagged `subbutton` to keep this row
27
+ * separable from the main button row.
28
+ */
29
+ private reportActivation;
12
30
  private handleSessionsShowAllClick;
13
31
  private handleSessionsTrackClick;
14
32
  }
@@ -1 +1 @@
1
- import{__decorate as r}from"tslib";import{computed as i}from"mobx";import{BaseSubButtonProvider as n}from"../SubButtonProvider";export class SessionsSubButtonProvider extends n{constructor(t){super(),this.rootStore=t,this.id="sessions"}get computedSubButtons(){const t=[];return t.push({id:"sessions_show_all",label:"All Tracks",text:"All Tracks",enabled:!0,active:this.rootStore.searchButtonsStore.activeSubButtonId==="sessions_show_all"||!this.rootStore.searchButtonsStore.activeSubButtonId&&!this.rootStore.uiState.selectedTrack,parentButtonId:"sessions",type:"show_all",onClick:()=>this.handleSessionsShowAllClick()}),this.rootStore.eventStore.tracks.forEach(s=>{const e=this.rootStore.eventStore.getEventsByTrack(s.id).length;t.push({id:`sessions_track_${s.id}`,label:s.name,text:s.name,enabled:!0,active:this.rootStore.searchButtonsStore.activeSubButtonId===`sessions_track_${s.id}`,parentButtonId:"sessions",type:"track",data:s,count:e,onClick:()=>this.handleSessionsTrackClick(s)})}),t}createSubButtons(){return this.computedSubButtons}handleSubButtonClick(t){if(t==="sessions_show_all")this.handleSessionsShowAllClick();else if(t.startsWith("sessions_track_")){const s=parseInt(t.replace("sessions_track_","")),e=this.rootStore.eventStore.tracks.find(o=>o.id===s);e&&this.handleSessionsTrackClick(e)}}shouldShowSubButtons(){return this.rootStore.eventStore.tracks.length>0}handleSessionsShowAllClick(){this.rootStore.uiState.list={type:"sessions",text:"",focused:!1},this.rootStore.uiState.selectedTrack=null,this.rootStore.searchButtonsStore.setSubButtonId("sessions_show_all")}handleSessionsTrackClick(t){this.rootStore.uiState.list={type:"sessions",text:"",focused:!1},this.rootStore.uiState.selectedTrack=t,this.rootStore.searchButtonsStore.setSubButtonId(`sessions_track_${t.id}`)}}r([i],SessionsSubButtonProvider.prototype,"computedSubButtons",null);
1
+ import{__decorate as r}from"tslib";import{computed as i}from"mobx";import n from"../../tools/track-event";import{BaseSubButtonProvider as a}from"../SubButtonProvider";export class SessionsSubButtonProvider extends a{constructor(t){super(),this.rootStore=t,this.id="sessions"}get computedSubButtons(){const t=[];return t.push({id:"sessions_show_all",label:"All Tracks",text:"All Tracks",enabled:!0,active:this.rootStore.searchButtonsStore.activeSubButtonId==="sessions_show_all"||!this.rootStore.searchButtonsStore.activeSubButtonId&&!this.rootStore.uiState.selectedTrack,parentButtonId:"sessions",type:"show_all",onClick:()=>this.handleSessionsShowAllClick()}),this.rootStore.eventStore.tracks.forEach(s=>{const e=this.rootStore.eventStore.getEventsByTrack(s.id).length;t.push({id:`sessions_track_${s.id}`,label:s.name,text:s.name,enabled:!0,active:this.rootStore.searchButtonsStore.activeSubButtonId===`sessions_track_${s.id}`,parentButtonId:"sessions",type:"track",data:s,count:e,onClick:()=>this.handleSessionsTrackClick(s)})}),t}createSubButtons(){return this.computedSubButtons}handleSubButtonClick(t){if(t==="sessions_show_all")this.handleSessionsShowAllClick();else if(t.startsWith("sessions_track_")){const s=parseInt(t.replace("sessions_track_","")),e=this.rootStore.eventStore.tracks.find(o=>o.id===s);e&&this.handleSessionsTrackClick(e)}}shouldShowSubButtons(){return this.rootStore.eventStore.tracks.length>0}reportActivation(t){if(this.rootStore.searchButtonsStore.activeSubButtonId===t)return;const s=this.computedSubButtons.find(e=>e.id===t);!s||!s.label||n("sbtnview",s.label,"subbutton")}handleSessionsShowAllClick(){this.reportActivation("sessions_show_all"),this.rootStore.uiState.list={type:"sessions",text:"",focused:!1},this.rootStore.uiState.selectedTrack=null,this.rootStore.searchButtonsStore.setSubButtonId("sessions_show_all")}handleSessionsTrackClick(t){this.reportActivation(`sessions_track_${t.id}`),this.rootStore.uiState.list={type:"sessions",text:"",focused:!1},this.rootStore.uiState.selectedTrack=t,this.rootStore.searchButtonsStore.setSubButtonId(`sessions_track_${t.id}`)}}r([i],SessionsSubButtonProvider.prototype,"computedSubButtons",null);
@@ -6,10 +6,23 @@ export declare class SearchButtonsActions {
6
6
  private state;
7
7
  private filters;
8
8
  constructor(rootStore: RootStore, state: SearchButtonsState, filters: SearchButtonsFilters);
9
- handleSearchButtonClick(searchButtonId: string): void;
9
+ /**
10
+ * Reports a search-button click to stats. Called only from the branch of a
11
+ * handler that turns the button ON: the click that switches a filter off is
12
+ * not a view of it. Deriving that from the button's `active` prop instead
13
+ * would be wrong — `active` is a display flag whose meaning differs per
14
+ * button (for Categories it means "filters are applied", not "panel open"),
15
+ * so only the handler knows what its own click did.
16
+ *
17
+ * `caption` is the button's configured name, NOT the rendered label: the
18
+ * label is run through `tIfExists`, so reporting it would split one button
19
+ * into one analytics series per locale.
20
+ */
21
+ private reportActivation;
22
+ handleSearchButtonClick(searchButtonId: string, caption?: string): void;
10
23
  handleExtendedSearchButtonClick(buttonId: string): void;
11
24
  handleMainButtonClick(buttonId: string): void;
12
- handleSessionsClick(): void;
25
+ handleSessionsClick(caption?: string): void;
13
26
  togglePoiType(poiTypeId: number): void;
14
27
  clearAllFilters(): void;
15
28
  showSubButtons(parentButtonId: string): void;