@expofp/floorplan 3.0.0-alpha.10 → 3.0.0-alpha.12
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.
- package/dist/browser/{Debug-BGF41rXu.js → Debug-DfbBpzaA.js} +2 -2
- package/dist/browser/{Demo-BrPx_J5D.js → Demo-9nX3Ze8t.js} +3 -3
- package/dist/browser/{Free-CKUe-HME.js → Free-CcNlU68J.js} +3 -3
- package/dist/browser/{Gallery-DObanysV.js → Gallery-BZojDfZ5.js} +3 -3
- package/dist/browser/{GpsLoader-DG4eTFey.js → GpsLoader-DtvpmRK_.js} +3 -3
- package/dist/browser/KioskStore-9CgKZ7_Y.js +216 -0
- package/dist/browser/{Mapbox-DYPXhDbE.js → Mapbox-DNt1naKj.js} +4 -4
- package/dist/browser/{SetKioskMode-CVHaNTJA.js → SetKioskMode-D-4L7JoE.js} +4 -4
- package/dist/browser/{ShowKiosk-DWrKae-X.js → ShowKiosk-ULNAsz__.js} +3 -3
- package/dist/browser/{ThreeComponent-BHyMRhbK.js → ThreeComponent-BStWIWLA.js} +4 -4
- package/dist/browser/{boolean-editor-CAqnfiK8.js → boolean-editor-CSqyOu_X.js} +3 -3
- package/dist/browser/bundle.json +26 -29
- package/dist/browser/{client-BD3CUDfs.js → client-Ca3SQ9bO.js} +2 -2
- package/dist/browser/{data-BybaFPM_.js → data-BiWncDmi.js} +2 -2
- package/dist/browser/{debug-overlay-B7Y95oUy.js → debug-overlay-CzQ4hWUN.js} +4 -4
- package/dist/browser/{debug-ui-LqMFZltk.js → debug-ui-DMGPYlVK.js} +3 -3
- package/dist/browser/{fetch-retry.umd-B-1h1K-1.js → fetch-retry.umd-CYEtSlH7.js} +1 -1
- package/dist/browser/{flex-D6Z-8vET.js → flex-BFGvV1iS.js} +2 -2
- package/dist/browser/{floorplan.ready-BKm4W0PM.js → floorplan.ready-BrEhyuTm.js} +19050 -18909
- package/dist/browser/{index-Ft1QAc66.js → index-BC6Y3-P3.js} +1 -1
- package/dist/browser/{index-B3N1nXdW.js → index-BeFIoJ6b.js} +2 -2
- package/dist/browser/{index-BejLpHKw.js → index-BqB89tei.js} +3 -3
- package/dist/browser/{index-DZpYGOZi.js → index-BuqxEypR.js} +4 -4
- package/dist/browser/{index-D0rE2o5K.js → index-DGktAn6-.js} +1 -1
- package/dist/browser/{index-BlQ8_wWj.js → index-Du62yX73.js} +2 -2
- package/dist/browser/index-k8Qo-0Dy.js +10220 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/{particles.min-BJIwccE3.js → particles.min-Bo4ztMtY.js} +1 -1
- package/dist/esm/_misc_to_move/manifest.d.ts +13 -0
- package/dist/esm/_misc_to_move/ref.d.ts +6 -0
- package/dist/esm/_misc_to_move/ref.js +1 -0
- package/dist/esm/components/Bookmarks.d.ts +0 -1
- package/dist/esm/components/Bookmarks.js +1 -1
- package/dist/esm/components/Kiosk/KioskStore.d.ts +3 -3
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Map/Map.d.ts +0 -23
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-bg.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bg.d.ts +5 -5
- package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +5 -5
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-border.d.ts +3 -3
- package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +6 -6
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +5 -5
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-scaled.d.ts +3 -3
- package/dist/esm/components/Map/drawing/config/config-booth-scaled.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booths.d.ts +2 -2
- package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-load-layer.d.ts +2 -2
- package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-markers.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-wf.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/config-wf.js +1 -1
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +3 -5
- package/dist/esm/components/Map/traffic/useBuildRoute.js +6 -6
- package/dist/esm/components/Map/traffic/useManageTraffic.d.ts +3 -5
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/components/Menu.js +1 -2
- package/dist/esm/components/SearchBox.js +1 -1
- package/dist/esm/components/SidebarActions.d.ts +3 -0
- package/dist/esm/components/SidebarActions.js +1 -1
- package/dist/esm/components/Wayfinding.js +1 -1
- package/dist/esm/data/tours.json +74 -0
- package/dist/esm/floorplan.loader.d.ts +3 -0
- package/dist/esm/floorplan.loader.js +1 -1
- package/dist/esm/floorplan.ready.d.ts +5 -2
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/load.d.ts +2 -1
- package/dist/esm/offline/offlineManager.js +1 -1
- package/dist/esm/renderer/HandlerRegistry.d.ts +18 -0
- package/dist/esm/renderer/HandlerRegistry.js +1 -0
- package/dist/esm/renderer/RendererService.d.ts +26 -0
- package/dist/esm/renderer/RendererService.js +1 -0
- package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/canvases.d.ts +1 -1
- package/dist/esm/renderer/engine-core/canvases.js +1 -0
- package/dist/esm/renderer/engine-core/fonts.js +1 -0
- package/dist/esm/renderer/engine-core/types.js +1 -0
- package/dist/esm/{components/Map/drawing/config/engine-core → renderer}/index.d.ts +10 -10
- package/dist/esm/renderer/index.js +1 -0
- package/dist/esm/store/BookmarksStore.d.ts +12 -0
- package/dist/esm/store/BookmarksStore.js +2 -0
- package/dist/esm/store/LayerStore.js +1 -1
- package/dist/esm/store/RootStore.d.ts +8 -8
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/SearchStore.d.ts +2 -0
- package/dist/esm/store/SearchStore.js +1 -1
- package/dist/esm/store/UIState.d.ts +6 -4
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/init/index.js +1 -1
- package/dist/esm/store/init/init-bookmarks.d.ts +7 -0
- package/dist/esm/store/init/init-bookmarks.js +1 -0
- package/dist/esm/store/init/init-events.d.ts +1 -1
- package/dist/esm/store/init/init-events.js +1 -1
- package/dist/esm/store/init/init-exhibitors.d.ts +1 -1
- package/dist/esm/store/init/init-exhibitors.js +1 -1
- package/dist/esm/store/init/init-speakers.d.ts +1 -1
- package/dist/esm/store/init/init-speakers.js +1 -1
- package/dist/esm/store/types.d.ts +6 -0
- package/dist/esm/utils/mapEntity.js +1 -1
- package/dist/esm/utils/shortenName.js +1 -1
- package/dist/esm/utils/useRenderTarget.js +1 -1
- package/dist/esm/utils/wayfinding.d.ts +1 -1
- package/dist/esm/utils/wayfinding.js +1 -1
- package/package.json +3 -8
- package/dist/browser/KioskStore-BG54vG5v.js +0 -216
- package/dist/browser/index-DBxr4rdm.js +0 -12530
- package/dist/browser/sw.js +0 -2
- package/dist/esm/components/Map/drawing/config/engine-core/canvases.js +0 -1
- package/dist/esm/components/Map/drawing/config/engine-core/fonts.js +0 -1
- package/dist/esm/components/Map/drawing/config/engine-core/index.js +0 -1
- package/dist/esm/components/Map/drawing/config/engine-core/renderer.d.ts +0 -4
- package/dist/esm/components/Map/drawing/config/engine-core/renderer.js +0 -1
- package/dist/esm/expofp-debug.d.ts +0 -5
- package/dist/esm/expofp-debug.js +0 -1
- package/dist/esm/offline/sw.d.ts +0 -2
- package/dist/esm/offline/sw.js +0 -1
- package/dist/stats.html +0 -4950
- /package/dist/esm/{components/Map/drawing/config/engine-core/types.js → _misc_to_move/manifest.js} +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/animation.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/animation.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/defs.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/defs.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/fonts.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/settings.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/settings.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/types.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/update-def.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/update-def.js +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/utils/rotation.d.ts +0 -0
- /package/dist/esm/{components/Map/drawing/config → renderer}/engine-core/utils/rotation.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import c,{boothStore as C}from"../../../../store";import O from"../../../../store/init/init-booths";import{LayersMode as T}from"../../../../store/LayerStore";import{loadJs as x}from"../../../../tools/loaders";import M,{BOOTHS_CHUNK_SIZE as D}from"./config-booths";import{chunkArray as H}from"../../../../utils";import{BOOTHS_PAINTER_MARKER as k,SEPARATOR as m}from"../../../../constants";import{Rect as G}from"@expofp/renderer";import K,{BG_LAYER_NAME as w,FG_LAYER_NAME as B}from"./config-bg";import{getChildLayers as U}from"../../../../store/init/init-layers";import{createImageDef as Y,createLayerDef as j}from"../../../../renderer";import{getImageLayerName as v,getLayerIcons as F}from"./loadBoothsImages";import{loadIcons as J}from"../../../../utils/imageloader";import{degToRad as Z}from"three/src/math/MathUtils";function q(e){return e.childLayers.length?e.childLayers:U(e,e.basePriority,15).layers}function P(e,t,h){return new Promise(async f=>{let n=[];const s=O(c,t),a=await K(t),i=[],d=H(s,D);C.booths.filter(o=>o.rect&&(!o.layer||o.layer===t||o.layer.childLayers.includes(t))&&o.exhibitors.find(r=>!!r.logoInBooth&&!!r.logo)&&!c.uiState.hideLogoInBooth).forEach(o=>o.noLabels=!0),s.length&&d.forEach((o,r)=>{i.push(M(e,`${t.name}${m}${k}${m}${r}`,o))}),t.loaded=!0;const g=a.children.find(o=>o.name===w),y=a.children.find(o=>o.name===B),u=v(t.name),l=F(t),p={name:u,children:[]};l.length&&e.onLayerImages(u,async()=>{const o=await J(l),r=[];for(const I of o.filter(Boolean)){const{bounds:{x:L,y:$,height:b,angle:E,width:A},htmlImage:R}=I,S=new G({x:L,y:$},{x:L+A,y:$+b},Z(E)),N=Y(R,S);r.push({shape:N})}return{layer:p,children:r}}),g&&n.push({...g,name:`${a.name}${m}${w}`}),i.length&&n.push(...i),y&&n.push({...y,name:`${a.name}${m}${B}`}),l.length&&n.push(p);const _=t.childLayers.sort((o,r)=>o.basePriority-r.basePriority).map(async o=>P(e,o,!0));Promise.all(_).then(o=>{const r=o.flat();r.length&&n.push(...r),f(j(t.name,n,{hidden:!h}))})})}export default async function z(e,t){return e.configured?Promise.resolve({name:e.name,children:e.children}):new Promise(async(h,f)=>{if(c.layerStore.mode!==T.Default&&!window[`__fpPaths${e.name}`]&&!e.rootParent)try{await x(`${window.__dataUrlBase}fp.svg.${e.name}.js`)}catch{return f()}const n=q(e);n.length&&(e.childLayers=n);const{layers:s}=c.layerStore;c.layerStore.layers=[...s,...n.filter(i=>!s.some(d=>d.name===i.name))];const a=await P(t,e,e.visible);h(a)})}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MapRenderer } from "../../Map";
|
|
1
|
+
import { RendererService } from "../../../../renderer";
|
|
3
2
|
export declare const MARKER_LAYER_NAME = "markers";
|
|
4
|
-
export declare function configMarkers(
|
|
3
|
+
export declare function configMarkers(rendererService: RendererService): () => void;
|
|
5
4
|
export declare function getMarkerFromClick(x: number, y: number, scale: number): import("../../../../store/RouteStore").Marker | null;
|
|
6
5
|
//# sourceMappingURL=config-markers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import u,{layersStore as
|
|
1
|
+
import u,{layersStore as I}from"../../../../store";import{reaction as v}from"mobx";import{createImageCanvas as C}from"./canvases";import{createImageDef as x,getBounds as R}from"../../../../renderer";import{toRadians as F}from"../../../../utils/toRadians";const L="_selected";export const MARKER_LAYER_NAME="markers";export function configMarkers(a){const h=[],l=new Map,s=new Map;let n=[];const m=a.scene.rootLayer.children.find(e=>e.name===MARKER_LAYER_NAME);async function k(e){const o=[];e.forEach(c=>{const{name:i,content:t,width:r,height:g,scale:y}=c;if(l.has(i))return;const f=new Image,M=new Promise((D,w)=>{f.onload=()=>{l.set(i,{img:f,width:r,height:g,scale:y}),D()},f.onerror=S=>{w(S)}});o.push(M),f.src=t,f.crossOrigin="anonymous"}),await Promise.all(o)}const d=e=>`marker-ptScaleHandlers-${e.id}`,E=e=>`marker-rollHandlers-${e.id}`,P=(e,o)=>{a.onPtScale(o,c=>{const{center:i,rotation:t}=e.bounds,{width:r,height:g}=e.source;return e.bounds=R(i.x,i.y,r,g,c,t),e})},H=(e,o)=>{a.onRoll(o,c=>(e.bounds.rotation=c,e))};function $(){const e=u.routeStore.markersData.markers;if(!e.length)return;n=[];const o=a.getCameraState(),c=o?.ptScale||1,i=F(o?.roll)||0;e.forEach(t=>{const r=l.get(t.icon);if(!r)return;const g=r.scale||window.devicePixelRatio,y=t.icon;if(!s.has(y)){const b=C(r.img,r.width,r.height,g);s.set(y,b)}const f=s.get(y),M=l.get(t.selectedIcon),D=t.selectedIcon;if(!s.has(D)){const b=C(r.img,M.width,M.height,g);s.set(D,b)}const w=s.get(D),S=I.findLayer(t.z)?.visible??!0,_=R(t.x,t.y,f.width,f.height,c,i),z=R(t.x,t.y,w.width,w.height,c,i);let p;switch(t.position){case"lefttop":p=[0,0];break;case"centertop":p=[.5,0];break;case"centerbottom":p=[.5,1];break;default:p=[.5,.5]}const A={...x(f,_,{hidden:!S,origin:p}),id:t.id,scale:g},K={...x(w,z,{hidden:!(S&&t.active),origin:p}),id:`${t.id}${L}`,scale:g};n.push(A,K)}),m.children=n,n.forEach(t=>{P(t,d(t)),H(t,E(t))})}function B(){n.forEach(e=>{a.ptScaleRegistry.unregisterByName(d(e)),a.rollRegistry.unregisterByName(E(e))}),m.children=[],n=[]}function N(){const e=u.routeStore.markersData.markers;e.length&&e.forEach(o=>{const c=n.find(r=>r.id===o.id),i=n.find(r=>r.id===`${o.id}${L}`);if(!c)return;const t=I.findLayer(o.z)?.visible??!0;o.active?(c.hidden=!0,i.hidden=!(t&&o.active)):(c.hidden=!t,i.hidden=!0)})}return h.push(v(()=>[u.routeStore.selectedMarkers,u.layerStore.visible],()=>{if(!u.routeStore.markersData.markers.length){B(),a.update(m);return}N(),a.update(...n)})),h.push(v(()=>u.routeStore.markersData.markers,()=>{k(u.routeStore.markersData.icons).then(()=>{$(),a.update(m)})})),function(){h.forEach(o=>o()),h.length=0}}export function getMarkerFromClick(a,h,l){for(const s of u.routeStore.markersData.markers){const n=u.routeStore.markersData.icons.find(d=>d.name===s.icon);if(!n)continue;const m=n.width*l*devicePixelRatio,k=n.height*l*devicePixelRatio;if(O(a,h,s.x,s.y,m,k)){const d=u.layerStore.findLayer(s.z);if(!d||d&&d.visible)return s}}return null}function O(a,h,l,s,n,m){const k=a>=l-n&&a<=l+n,d=h>=s-m&&h<=s+m;return k&&d}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Point, Line } from "simple-geometry";
|
|
2
|
-
import {
|
|
3
|
-
import { MapRenderer } from "../../Map";
|
|
2
|
+
import { RendererService } from "../../../../renderer";
|
|
4
3
|
export declare const WF_TRAIL_LAYER_NAME = "wf-trail-points";
|
|
5
4
|
export declare const WF_POINTS_LAYER_NAME = "wf-points";
|
|
6
5
|
export declare const WF_CURRENT_POSITION_NAME = "wf-current-position";
|
|
7
6
|
export declare const WF_LINES_LAYER_NAME = "wf-lines";
|
|
8
7
|
export declare const WF_LINES_ANIMATED_LAYER_NAME = "wf-lines-animated";
|
|
9
|
-
export default function configWf(
|
|
8
|
+
export default function configWf(rendererService: RendererService): () => void;
|
|
10
9
|
export declare function splitPolyLine(lines: Line[], interval: number): Point[];
|
|
11
10
|
//# sourceMappingURL=config-wf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import ft from"color";import{observable as pt,reaction as st}from"mobx";import{lineLength as bt}from"simple-geometry";import Ot from"../../../../core/Rect";import s,{layersStore as vt,uiState as g}from"../../../../store";import{LayersMode as Ct}from"../../../../store/LayerStore";import{getGraphLines as kt,getRouteLength as gt,RoutePoint as ht}from"../../../../utils/wayfinding";import{strEqual as k}from"../../../../utils/strEqual";import{createArrowCurrentCanvas as It,createCurrentCanvas as xt,createImageCanvas as et,createTargetCanvas as qt,createYahCanvas as Ut}from"./canvases";import{toRadians as Et}from"../../../../utils/toRadians";import{areLayersEnabled as Tt}from"../../../../utils/areLayersEnabled";import{createImageDef as nt,createLineDef as Rt,updateRenderer as K,createCircleCanvas as Wt,getBounds as b,getRotation as Xt}from"./engine-core";import{animateLineSegments as $t}from"./engine-core/animation";import{splitRouteByPoint as Gt,snapPositionToRoute as Kt,getThresholdSafe as jt,getThresholdFromMetersToSvg as Jt,SNAP_THRESHOLD_METERS as Qt}from"./route-snapping";import{fpGeo as At}from"../../../Mapbox/utils/fpGeo";const C=devicePixelRatio;let z=[],at=null,F=[],yt=ft("#00A2FF"),Vt=ft("#FF9F06"),_t="#A4CCE2",Zt="#0794EA";const ct=34;let j,J,Q,V,ot,Lt,Dt,Mt,dt,T,A,q,U,Z,St=[];function te(){z=[];const t=s.routeStore.currentRouteLayer?.name;at=oe();const o=at&&(Tt()?k(t,at.destination?.layer):!0);if(at){const d=at?.routePoint;d&&k(t,d.layer)&&(z=ie(d,z))}let n=[],i=[];for(let d=0;d<F.length;d++){let L=F[d],y=s.layerStore.mode==Ct.Default?!0:s.layerStore.layers.find(a=>a.name==t&&t===L.p0.layer)?.visible||!1;!L.virtual&&y&&n.push(L),(L.virtual||!y||d===F.length-1)&&n.length&&(i=n.map(({p0:a,p1:r})=>(z.push({x:a.x,y:a.y},{x:r.x,y:r.y}),{p0:a,p1:r})))}z.length||(A.hidden=!0,T.hidden=!0);let l=1e6,u=1e6,p=0,m=0;z.forEach(d=>{d.x<l&&(l=d.x),d.y<u&&(u=d.y),d.x>p&&(p=d.x),d.y>m&&(m=d.y)});const h=Ot.fromX1y1x2y2(l,u,p,m);return{rect:z.length&&(h.w||h.h)?h.withPadding(h.w,h.h):null,lines:i,addTrailPoints:o}}export const WF_TRAIL_LAYER_NAME="wf-trail-points",WF_POINTS_LAYER_NAME="wf-points",WF_CURRENT_POSITION_NAME="wf-current-position",WF_LINES_LAYER_NAME="wf-lines",WF_LINES_ANIMATED_LAYER_NAME="wf-lines-animated";export default function ee(t,o){let n=null;const i=[];let l=null,u=pt.box([]),p=pt.box([],{deep:!1}),m=pt.box([],{deep:!1});const h=o.rootLayer.children,d=h.find(e=>e.name===WF_POINTS_LAYER_NAME),L=h.find(e=>e.name===WF_CURRENT_POSITION_NAME),y=h.find(e=>e.name===WF_LINES_LAYER_NAME),a=h.find(e=>e.name===WF_TRAIL_LAYER_NAME),r=h.find(e=>e.name===WF_LINES_ANIMATED_LAYER_NAME),x=jt(At?.properties?.config?.snapThreshold)||Qt,S=Jt({thresholdInMeters:x,gpsConfig:At?.properties?.config});let v=[];const W=s.fp.icons.get("destination");W?(W.id="destination",J=et(W,ct,ct,C)):J=qt(C,Vt.hex()),A=nt(J,b(0,0,J.width,J.height),{hidden:!0});const I=s.fp.icons.get("departure");I?(I.id="departure",j=et(I,ct,ct,C)):j=xt(C,yt.hex()),T=nt(j,b(0,0,j.width,j.height),{hidden:!0}),Q=xt(C,yt.hex()),Q.id="current-location",q=nt(Q,b(0,0,Q.width,Q.height),{hidden:!0,origin:[.5,.5]});const R=s.fp.icons.get("transition");R?(R.id="transition",Lt=et(R,34,34,C)):Lt=xt(C,yt.hex());const _=s.fp.icons.get("transition_up");_&&(_.id="transition_up",Dt=et(_,56,34,C));const Y=s.fp.icons.get("transition_down");Y&&(Y.id="transition_down",Mt=et(Y,56,34,C));const tt=s.fp.icons.get("direction");tt?(tt.id="direction",V=et(tt,ct,ct,C)):V=It(C,yt.hex()),U=nt(V,b(0,0,V.width,V.height),{hidden:!0});const B=s.fp.icons.get("yah");B?ot=et(B,mt(64,32),mt(90,32),C):ot=Ut(C,"#ff4343"),ot.id="current-location-2",Z=nt(ot,b(0,0,ot.width,ot.height),{hidden:!0,origin:[.5,1]}),dt=Wt(4,ft("#b5b7bc").hex());function N(e=null){const f=s.layerStore.visible.map(c=>c.name);if(z=[],u.set([]),e||(F=[]),f.length&&g.selectedRoute?.from?.rect&&g.selectedRoute?.to?.rect){let c=g.selectedRoute.from,w=g.selectedRoute.to;if(!F.length&&!e&&(F=kt(c,w,s.routeStore.onlyAccessible,g.selectedRoute.waypoints)),!F.length){if(s.routeStore.updateRoute(F),s.routeStore.updateRouteDistance(0),c.name!==w.name)throw new Error(`Route not found. From: ${c.name} to: ${w.name}`);return}const{rect:E,lines:O,addTrailPoints:P}=te();O.length&&(ne(t.scale),re(t.scale,p),Ft(t,a,!P)),v=O,ut(),E&&(g.moveToRect=E)}else T.hidden=!0,A.hidden=!0;s.routeStore.updateRoute(F.filter(c=>!c.virtual)),u.get()||(T.hidden=!0,A.hidden=!0)}function X(){const e=s.routeStore.currentPosition,f=e?.angle?Et(e.angle):null,c=s.routeStore.currentRouteLayer?.name,w=F.filter(M=>s.layerStore.mode==Ct.Default?!0:s.layerStore.layers.find(Bt=>Bt.name==c&&c===M.p0.layer)?.visible).filter(M=>!M.virtual);if(g.kioskData&&g.selectedRoute?.from){const M=s.routeStore.currentRouteLayer;T.hidden=g.selectedRoute?.from?.entity?.type==="route-cut-in"&&M?.name===g.selectedRoute?.from?.layer?.name,A.hidden=g.selectedRoute?.to?.entity?.type==="route-cut-in"&&M?.name===g.selectedRoute?.to?.layer?.name}if(e){const M=vt.findLayer(e.z)?.visible??!0;s.routeStore.iconType===0||g.selectedRoute?.from&&g.selectedRoute?.to?(Z.hidden=!0,q.hidden=!M,q.dim=!M,q.bounds=b(e.x,e.y,Q.width,Q.height,t.scale),f!=null?(q.hidden=!0,U.hidden=!M,U.dim=!M,U.bounds=b(e.x,e.y,V.width,V.height,t.scale,f)):U.hidden=!0):(q.hidden=!0,U.hidden=!0,Z.dim=!M,Z.hidden=!M,Z.bounds=b(e.x,e.y,ot.width,ot.height,t.scale))}else q.hidden=!0,Z.hidden=!0,U.hidden=!0,it(),ut();if(!e||!z.length){K(t,U,q,Z);return}const E=g.selectedRoute?.to,O=g.selectedRoute?.from,P=new ht(O?.layer?.name,T.bounds.center.x,T.bounds.center.y),D=new ht(E?.layer?.name,A.bounds.center.x,A.bounds.center.y),$=Kt(e,w,{snapThreshold:S,fromPoint:P,toPoint:D,fromRect:O?.rect,toRect:E?.rect}),G=$.snapped?$.snappedPoint:e;ut($,!0),U.bounds=b(G.x,G.y,V.width,V.height,t.scale,f),q.bounds=b(G.x,G.y,Q.width,Q.height,t.scale,f),K(t,U,q,Z)}function lt(){const e=[U,q,Z];L.children=e,e.forEach(f=>rt(f)),K(t,L)}function H(e=!1){const f=[T,A,...p.get(),...m.get()];e&&(Ht(!0),a.children=[],f.forEach(c=>{c.source.id.includes("kiosk")||(c.hidden=!0)})),d.children=f,K(t,d,a)}function it(e,f){const c=F.filter(D=>!D.virtual),w=gt(c);if(!e?.snapped){s.routeStore.updateRouteDistance(w);return}const E=g.selectedRoute?.to,O=gt(f);let P;if(e.snappedPoint?.layer===E?.layer?.name||E?.layer?.name===s.routeStore.currentRouteLayer?.name)P=O;else if(e.snappedPoint?.layer!==E?.layer?.name&&e.snappedPoint?.layer===s.routeStore.currentRouteLayer?.name){const D=c.filter(G=>G.p0.layer!==e?.snappedPoint?.layer&&G.p1.layer!==e?.snappedPoint?.layer),$=gt(D);P=O+$}P&&s.routeStore.updateRouteDistance(P)}function ut(e,f=!1){const c=g.selectedRoute?.from,w=g.selectedRoute?.to;if(!c||!w)return;const E=ae(F,v,new ht(c?.layer?.name,c?.rect.cx,c?.rect.cy),new ht(w?.layer?.name,w?.rect.cx,w?.rect.cy));if(!e?.snapped){const D=E.map($=>Rt($,_t));s.routeStore.currentPosition&&s.routeStore.currentRouteLayer&&s.routeStore.currentPosition?.z?.toString()===s.routeStore.currentRouteLayer?.name.toString()&&it(),Pt([],D,f);return}const{passed:O,remaining:P}=Gt(E,e.snappedPoint);P.length&&(P[0]={...P[0],p0:e.snappedPoint}),it(e,P),Pt(O.map(D=>Rt(D,"#B5B7BC")),P.map(D=>Rt(D,_t)),f)}const rt=(e,f)=>{t.ptScaleHandlers.push({fn:c=>(e.hidden||(e.bounds=b(e.bounds.center.x,e.bounds.center.y,e.source.width,e.source.height,c,e.bounds.rotation)),e),name:f})},wt=(e,f)=>{t.rollHandlers.push({fn:c=>{const w=Xt(c,e.bounds.rotation);return w!==void 0&&(e.bounds.rotation=e.bounds.rotation+w),e},name:f})};function Ht(e){n&&(n.stop(),n=null),r.children=[],e&&(y.children=[]),K(t,r,y)}function Pt(e=[],f=[],c=!1){let w=0;if(n&&(c&&(w=n.getProgress()),n.stop(),n=null),y.children=[...e,...f],!f.length){r.children=[],K(t,r,y);return}const E=f.map(P=>({...P,color:Zt}));n=$t(E,(P,D,$)=>{if($)r.children=[];else{const G=E.slice(0,D);r.children=[...G,P]}K(t,r)},()=>t.scale,w)??null,K(t,y)}i.push(st(()=>[s.layerStore.layersLoaded],()=>{N(),X(),H()}));const zt=st(()=>[s.routeStore.currentRouteLayer,g.getRouteNextFloor],()=>{s.layerStore.layersLoaded&&(l!==null&&clearTimeout(l),l=setTimeout(()=>{N(s.routeStore.currentRouteLayer),X(),H(),l=null},0))});i.push(()=>{l!==null&&(clearTimeout(l),l=null),zt()}),i.push(st(()=>[g.selectedRoute,s.routeStore.onlyAccessible],()=>{N(),X(),H(!g.selectedRoute)})),i.push(st(()=>s.routeStore.currentPosition,()=>{X(),H()})),i.push(st(()=>p.get(),e=>{const f="transitionPoints";t.ptScaleHandlers=t.ptScaleHandlers.filter(c=>c.name!==f),e.length&&e.forEach(c=>{rt(c,f),wt(c,f)})})),i.push(st(()=>[m.get()],()=>{const e=m.get(),f="kioskArrows";t.ptScaleHandlers=t.ptScaleHandlers.filter(c=>c.name!==f),e.length&&e.forEach(c=>rt(c,f))})),i.push(st(()=>[g.kioskData,vt.floors.find(e=>e.active),g.selectedRoute],([e,f])=>{m.set([]);const c=Tt()?e?.z===f?.name:!0;e&&c&&se(e,{skipdim:!0,visible:!0,pixelRatio:C},t.scale,m),H()})),[T,A].forEach(e=>{rt(e),wt(e)}),H(),X(),lt();function Yt(){n&&(n.stop(),n=null),i.forEach(e=>e()),i.length=0}return Yt}function ne(t){const o=s.routeStore.currentRouteLayer?.name,n=z;let i=g.selectedRoute?.from,l=g.selectedRoute?.to;const u=g.selectedRoute?.waypoints;if(i?.entity.type==="route-cut-in"&&(i=null),l?.entity.type==="route-cut-in"&&(l=null),!n.length)return;const p=[{key:"sourceLocation",rect:i?.rect,index:void 0},{key:"destinationLocation",rect:l?.rect,index:void 0}];u&&p.push(...u?.map((y,a)=>({key:`waypoint-${y.externalId}`,index:a,rect:y.rect})));const m=o?k(o,i?.layer?.name):!0,h=o?k(o,l?.layer?.name):!0;let d=!1,L=!1;n.forEach(({x:y,y:a})=>{for(const{key:r,rect:x,index:S}of p)if(x?.containsPoint(y,a)){r==="sourceLocation"&&(T.bounds=b(y,a,j.width,j.height,t),T.hidden=!m,T.dim=!m,d=m),r==="destinationLocation"&&(A.bounds=b(y,a,J.width,J.height,t),A.hidden=!h,A.dim=!h,L=h);break}}),d||(T.bounds=b(n[n.length-1].x,n[n.length-1].y,j.width,j.height,t),T.hidden=!1,T.dim=!1),L||(A.bounds=b(n[0].x,n[0].y,J.width,J.height,t),A.hidden=!h,A.dim=!h)}function oe(){const{from:t,to:o}=s.uiState.selectedRoute||{},n="route-cut-in";return t&&t?.entity.type===n||o&&o?.entity.type===n?s.routeStore.defaultFrom:null}function ie(t,o){if(!t||!o.length)return o;const n=o.reduce((i,l,u)=>bt(t,l)<bt(t,o[i])?u:i,0);return n<=o.length/2?o.slice(n):o.slice(0,n)}function re(t,o){const n=s.routeStore.currentRouteLayer?.name,i=g.getRouteNextFloor,l=s.layerStore.floors.map(a=>a.name),u=(a,r)=>a.findIndex(x=>k(x,r)),p=u(l,n),m=u(l,i),h=m!==-1,d=F.filter(a=>n?a.virtual&&(k(a.p0.layer,n)||k(a.p1.layer,n))&&(k(a.p0.layer,i)||k(a.p1.layer,i)):a.virtual).flatMap(a=>[a.p0,a.p1]),L=[];let y;d.forEach(a=>{if(i&&!k(a.layer,i)&&(h&&m>p&&s.fp.icons.get("transition_up")?y=Mt:h&&m<p&&s.fp.icons.get("transition_down")?y=Dt:y=Lt),y){const r=k(n,a.layer),x=b(a.x,a.y,y.width,y.height,t),S=nt(y,x,{hidden:!r,dim:!1});L.push(S)}}),o.set(L)}function se(t,o,n=1,i){if(!t)return;const l=s.fp.icons.get("kiosk");l.id="kiosk";let u;if(l){const m=t?.iconSizePercent?t.iconSizePercent/100:1,h=55;u=et(l,mt(199*m,h),mt(152*m,h),C)}else u=It(C,ft("#ee4422").hex());const p=nt(u,b(t.x,t.y,u.width,u.height,n,Et(t.heading||0)),{hidden:!o.visible,dim:!o.skipdim});i.set([...i.get(),p])}function mt(t,o){return t*(1-o/100)}function Ft(t,o,n=!1){t.ptScaleHandlers=t.ptScaleHandlers.filter(S=>S.name!==o.name);let i=z.length-1;if(g.selectedRoute?.to?.entity.type==="route-cut-in"&&(i=0),n){St=[],o.children=[],K(t,o);return}const l=t.scale,u=z[i],p=at?.destination;if(!u||!p)return;const m=dt.width,h=splitPolyLine([{p0:u,p1:p}],m*2*l);if(h.length<2)return;const d=p.x-u.x,L=p.y-u.y,y=Math.hypot(d,L),a={x:(u.x+p.x)/2,y:(u.y+p.y)/2-y*.2},r=[u,a,p],x=h.map((S,v,W)=>{const I=(v+1)/(W.length+1),R=Nt(r,I);return nt(dt,b(R.x,R.y,dt.width,dt.height,l),{hidden:!1,dim:!1})})||[];return o.children=x,t.ptScaleHandlers.push({fn:S=>{t.scale=S;const v=Ft(t,o)||[];return o.children=v,St=v,o},name:o.name}),St=x,x}function Nt(t,o){if(t.length===1)return t[0];const n=[];for(let i=0;i<t.length-1;i++){const l=(1-o)*t[i].x+o*t[i+1].x,u=(1-o)*t[i].y+o*t[i+1].y;n.push({x:l,y:u})}return Nt(n,o)}export function splitPolyLine(t,o){if(t.length===0)return[];const n=[];let i=0;for(let m=0;m<t.length;m++){const h=t[m],d=h.p0,L=h.p1,y=L.x-d.x,a=L.y-d.y,r=Math.sqrt(y*y+a*a);if(r===0)continue;const x=y/r,S=a/r;let v=0;for(;i+v*o<=r;){const R=i+v*o,_=d.x+x*R,Y=d.y+S*R;n.push({x:_,y:Y}),v++}const W=i+(v-1)*o;let I=r-W;if(I=Math.max(I,0),m<t.length-1){const R=t[m+1],_=R.p0,Y=R.p1,tt=Y.x-_.x,B=Y.y-_.y,N=Math.sqrt(tt*tt+B*B);if(N===0)i=0;else{const X=tt/N,lt=B/N,H=x*X+S*lt,it=I*H;i=o-it}}else i=o-I;i=Math.max(i,0)}const l=t[0].p0;(n.length===0||!n[0]||n[0].x!==l.x||n[0].y!==l.y)&&n.unshift(l);const u=t[t.length-1].p1,p=n[n.length-1];return(n.length===0||!p||p.x!==u.x||p.y!==u.y)&&n.push(u),n}function ae(t,o,n,i){if(!o.length)return o;const l=new Array(t.length);let u=0;for(let r=0;r<t.length;r++){const x=t[r],S=Math.hypot(x.p1.x-x.p0.x,x.p1.y-x.p0.y);l[r]=S,u+=S}const p=r=>r?String(r):null;function m(r){let x=0,S=1/0,v=1/0;const W=p(r.layer);for(let I=0;I<t.length;I++){const R=t[I],_=l[I],Y=p(R.p0.layer);if(!(W===null||Y===null||Y===W)){x+=_;continue}const B=R.p1.x-R.p0.x,N=R.p1.y-R.p0.y,X=B*B+N*N;if(X===0){x+=_;continue}const lt=((r.x-R.p0.x)*B+(r.y-R.p0.y)*N)/X,H=Math.max(0,Math.min(1,lt)),it=R.p0.x+B*H,ut=R.p0.y+N*H,rt=Math.hypot(r.x-it,r.y-ut);rt<S&&(S=rt,v=x+_*H),x+=_}return{found:v!==1/0,fromStart:v,total:u}}const h=m(n),d=h.found?h:m(i);if(!d.found)return o;const L=d.fromStart,y=d.total-d.fromStart;return(h.found?y<L:L<y)?o.slice().reverse().map(r=>({...r,p0:r.p1,p1:r.p0})):o}
|
|
1
|
+
import dt from"color";import{observable as mt,reaction as it}from"mobx";import{lineLength as Pt}from"simple-geometry";import Yt from"../../../../core/Rect";import s,{layersStore as bt,uiState as g}from"../../../../store";import{LayersMode as St}from"../../../../store/LayerStore";import{getGraphLines as $t,getRouteLength as pt,RoutePoint as ft}from"../../../../utils/wayfinding";import{strEqual as O}from"../../../../utils/strEqual";import{createArrowCurrentCanvas as Ct,createCurrentCanvas as gt,createImageCanvas as Z,createTargetCanvas as Ot,createYahCanvas as kt}from"./canvases";import{toRadians as It}from"../../../../utils/toRadians";import{areLayersEnabled as Et}from"../../../../utils/areLayersEnabled";import{createImageDef as tt,createLineDef as xt,createCircleCanvas as Ht,getBounds as S,getRotation as qt}from"../../../../renderer";import{animateLineSegments as Ut}from"../../../../renderer/engine-core/animation";import{splitRouteByPoint as Wt,snapPositionToRoute as Xt,getThresholdSafe as Gt,getThresholdFromMetersToSvg as Kt,SNAP_THRESHOLD_METERS as jt}from"./route-snapping";import{fpGeo as Tt}from"../../../Mapbox/utils/fpGeo";const I=devicePixelRatio;let z=[],at=null,v=[],ht=dt("#00A2FF"),Jt=dt("#FF9F06"),At="#A4CCE2",Qt="#0794EA";const ct=34;let K,j,J,Q,et,Rt,_t,Dt,lt,A,_,k,H,V,Lt=[];function Vt(){z=[];const t=s.routeStore.currentRouteLayer?.name;at=ee();const n=at&&(Et()?O(t,at.destination?.layer):!0);if(at){const l=at?.routePoint;l&&O(t,l.layer)&&(z=ne(l,z))}let o=[],i=[];for(let l=0;l<v.length;l++){let x=v[l],d=s.layerStore.mode==St.Default?!0:s.layerStore.layers.find(r=>r.name==t&&t===x.p0.layer)?.visible||!1;!x.virtual&&d&&o.push(x),(x.virtual||!d||l===v.length-1)&&o.length&&(i=o.map(({p0:r,p1:u})=>(z.push({x:r.x,y:r.y},{x:u.x,y:u.y}),{p0:r,p1:u})))}z.length||(_.hidden=!0,A.hidden=!0);let h=1e6,c=1e6,y=0,m=0;z.forEach(l=>{l.x<h&&(h=l.x),l.y<c&&(c=l.y),l.x>y&&(y=l.x),l.y>m&&(m=l.y)});const p=Yt.fromX1y1x2y2(h,c,y,m);return{rect:z.length&&(p.w||p.h)?p.withPadding(p.w,p.h):null,lines:i,addTrailPoints:n}}export const WF_TRAIL_LAYER_NAME="wf-trail-points",WF_POINTS_LAYER_NAME="wf-points",WF_CURRENT_POSITION_NAME="wf-current-position",WF_LINES_LAYER_NAME="wf-lines",WF_LINES_ANIMATED_LAYER_NAME="wf-lines-animated";export default function Zt(t){let n=null;const o=[];let i=null,h=mt.box([]),c=mt.box([],{deep:!1}),y=mt.box([],{deep:!1});const m=t.scene.rootLayer.children,p=m.find(e=>e.name===WF_POINTS_LAYER_NAME),l=m.find(e=>e.name===WF_CURRENT_POSITION_NAME),x=m.find(e=>e.name===WF_LINES_LAYER_NAME),d=m.find(e=>e.name===WF_TRAIL_LAYER_NAME),r=m.find(e=>e.name===WF_LINES_ANIMATED_LAYER_NAME),u=Gt(Tt?.properties?.config?.snapThreshold)||jt,R=Kt({thresholdInMeters:u,gpsConfig:Tt?.properties?.config});let E=[];const D=s.fp.icons.get("destination");D?(D.id="destination",j=Z(D,ct,ct,I)):j=Ot(I,Jt.hex()),_=tt(j,S(0,0,j.width,j.height),{hidden:!0});const q=s.fp.icons.get("departure");q?(q.id="departure",K=Z(q,ct,ct,I)):K=gt(I,ht.hex()),A=tt(K,S(0,0,K.width,K.height),{hidden:!0}),J=gt(I,ht.hex()),J.id="current-location",k=tt(J,S(0,0,J.width,J.height),{hidden:!0,origin:[.5,.5]});const T=s.fp.icons.get("transition");T?(T.id="transition",Rt=Z(T,34,34,I)):Rt=gt(I,ht.hex());const L=s.fp.icons.get("transition_up");L&&(L.id="transition_up",_t=Z(L,56,34,I));const M=s.fp.icons.get("transition_down");M&&(M.id="transition_down",Dt=Z(M,56,34,I));const Y=s.fp.icons.get("direction");Y?(Y.id="direction",Q=Z(Y,ct,ct,I)):Q=Ct(I,ht.hex()),H=tt(Q,S(0,0,Q.width,Q.height),{hidden:!0});const nt=s.fp.icons.get("yah");nt?et=Z(nt,yt(64,32),yt(90,32),I):et=kt(I,"#ff4343"),et.id="current-location-2",V=tt(et,S(0,0,et.width,et.height),{hidden:!0,origin:[.5,1]}),lt=Ht(4,dt("#b5b7bc").hex());function B(e=null){const a=s.layerStore.visible.map(f=>f.name);if(z=[],h.set([]),e||(v=[]),a.length&&g.selectedRoute?.from?.rect&&g.selectedRoute?.to?.rect){let f=g.selectedRoute.from,w=g.selectedRoute.to;if(!v.length&&!e&&(v=$t(f,w,s.routeStore.onlyAccessible,g.selectedRoute.waypoints)),!v.length){if(s.routeStore.updateRoute(v),s.routeStore.updateRouteDistance(0),f.name!==w.name)throw new Error(`Route not found. From: ${f.name} to: ${w.name}`);return}const{rect:b,lines:$,addTrailPoints:P}=Vt();$.length?(te(t.scale),oe(t.scale,c),Nt(t,d,!P),t.ptScaleRegistry.unregisterByName(d.name),P&&t.onPtScale(d.name,()=>{const C=Nt(t,d)||[];return d.children=C,Lt=C,d})):t.ptScaleRegistry.unregisterByName(d.name),E=$,ot(),b&&(g.moveToRect=b)}else A.hidden=!0,_.hidden=!0;s.routeStore.updateRoute(v.filter(f=>!f.virtual)),h.get()||(A.hidden=!0,_.hidden=!0)}function N(){const e=s.routeStore.currentPosition,a=e?.angle?It(e.angle):null,f=s.routeStore.currentRouteLayer?.name,w=v.filter(F=>s.layerStore.mode==St.Default?!0:s.layerStore.layers.find(zt=>zt.name==f&&f===F.p0.layer)?.visible).filter(F=>!F.virtual);if(g.kioskData&&g.selectedRoute?.from){const F=s.routeStore.currentRouteLayer;A.hidden=g.selectedRoute?.from?.entity?.type==="route-cut-in"&&F?.name===g.selectedRoute?.from?.layer?.name,_.hidden=g.selectedRoute?.to?.entity?.type==="route-cut-in"&&F?.name===g.selectedRoute?.to?.layer?.name}if(e){const F=bt.findLayer(e.z)?.visible??!0;s.routeStore.iconType===0||g.selectedRoute?.from&&g.selectedRoute?.to?(V.hidden=!0,k.hidden=!F,k.dim=!F,k.bounds=S(e.x,e.y,J.width,J.height,t.scale),a!=null?(k.hidden=!0,H.hidden=!F,H.dim=!F,H.bounds=S(e.x,e.y,Q.width,Q.height,t.scale,a)):H.hidden=!0):(k.hidden=!0,H.hidden=!0,V.dim=!F,V.hidden=!F,V.bounds=S(e.x,e.y,et.width,et.height,t.scale))}else k.hidden=!0,V.hidden=!0,H.hidden=!0,W(),ot();if(!e||!z.length){t.update(H,k,V);return}const b=g.selectedRoute?.to,$=g.selectedRoute?.from,P=new ft($?.layer?.name,A.bounds.center.x,A.bounds.center.y),C=new ft(b?.layer?.name,_.bounds.center.x,_.bounds.center.y),X=Xt(e,w,{snapThreshold:R,fromPoint:P,toPoint:C,fromRect:$?.rect,toRect:b?.rect}),G=X.snapped?X.snappedPoint:e;ot(X,!0),H.bounds=S(G.x,G.y,Q.width,Q.height,t.scale,a),k.bounds=S(G.x,G.y,J.width,J.height,t.scale,a),t.update(H,k,V)}function rt(){const e=[{point:H,name:"wf-current-arrow"},{point:k,name:"wf-current-location"},{point:V,name:"wf-current-location-2"}];l.children=e.map(({point:a})=>a),e.forEach(({point:a,name:f})=>st(a,f)),t.update(l)}function U(e=!1){const a=[A,_,...c.get(),...y.get()];e&&(Ft(!0),d.children=[],a.forEach(f=>{f.source.id.includes("kiosk")||(f.hidden=!0)})),p.children=a,t.update(p,d)}function W(e,a){const f=v.filter(C=>!C.virtual),w=pt(f);if(!e?.snapped){s.routeStore.updateRouteDistance(w);return}const b=g.selectedRoute?.to,$=pt(a);let P;if(e.snappedPoint?.layer===b?.layer?.name||b?.layer?.name===s.routeStore.currentRouteLayer?.name)P=$;else if(e.snappedPoint?.layer!==b?.layer?.name&&e.snappedPoint?.layer===s.routeStore.currentRouteLayer?.name){const C=f.filter(G=>G.p0.layer!==e?.snappedPoint?.layer&&G.p1.layer!==e?.snappedPoint?.layer),X=pt(C);P=$+X}P&&s.routeStore.updateRouteDistance(P)}function ot(e,a=!1){const f=g.selectedRoute?.from,w=g.selectedRoute?.to;if(!f||!w)return;const b=re(v,E,new ft(f?.layer?.name,f?.rect.cx,f?.rect.cy),new ft(w?.layer?.name,w?.rect.cx,w?.rect.cy));if(!e?.snapped){const C=b.map(X=>xt(X,At));s.routeStore.currentPosition&&s.routeStore.currentRouteLayer&&s.routeStore.currentPosition?.z?.toString()===s.routeStore.currentRouteLayer?.name.toString()&&W(),wt([],C,a);return}const{passed:$,remaining:P}=Wt(b,e.snappedPoint);P.length&&(P[0]={...P[0],p0:e.snappedPoint}),W(e,P),wt($.map(C=>xt(C,"#B5B7BC")),P.map(C=>xt(C,At)),a)}const st=(e,a)=>t.onPtScale(a,f=>(e.hidden||(e.bounds=S(e.bounds.center.x,e.bounds.center.y,e.source.width,e.source.height,f,e.bounds.rotation)),e)),ut=(e,a)=>t.onRoll(a,f=>{const w=qt(f,e.bounds.rotation);return w!==void 0&&(e.bounds.rotation=e.bounds.rotation+w),e});function Ft(e){n&&(n.stop(),n=null),r.children=[],e&&(x.children=[]),t.update(r,x)}function wt(e=[],a=[],f=!1){let w=0;if(n&&(f&&(w=n.getProgress()),n.stop(),n=null),x.children=[...e,...a],!a.length){r.children=[],t.update(r,x);return}const b=a.map(P=>({...P,color:Qt}));n=Ut(b,(P,C,X)=>{if(X)r.children=[];else{const G=b.slice(0,C);r.children=[...G,P]}t.update(r)},()=>t.scale,w)??null,t.update(x)}o.push(it(()=>[s.layerStore.layersLoaded],()=>{B(),N(),U()}));const vt=it(()=>[s.routeStore.currentRouteLayer,g.getRouteNextFloor],()=>{s.layerStore.layersLoaded&&(i!==null&&clearTimeout(i),i=setTimeout(()=>{B(s.routeStore.currentRouteLayer),N(),U(),i=null},0))});o.push(()=>{i!==null&&(clearTimeout(i),i=null),vt()}),o.push(it(()=>[g.selectedRoute,s.routeStore.onlyAccessible],()=>{B(),N(),U(!g.selectedRoute)})),o.push(it(()=>s.routeStore.currentPosition,()=>{N(),U()})),o.push(it(()=>c.get(),e=>{const a="transitionPoints";t.ptScaleRegistry.unregisterByPrefix(a),t.rollRegistry.unregisterByPrefix(a),e.length&&e.forEach((f,w)=>{const b=`${a}-${w}`;st(f,b),ut(f,b)})})),o.push(it(()=>[y.get()],()=>{const e=y.get(),a="kioskArrows";t.ptScaleRegistry.unregisterByPrefix(a),e.length&&e.forEach((f,w)=>st(f,`${a}-${w}`))})),o.push(it(()=>[g.kioskData,bt.floors.find(e=>e.active),g.selectedRoute],([e,a])=>{y.set([]);const f=Et()?e?.z===a?.name:!0;e&&f&&ie(e,{skipdim:!0,visible:!0,pixelRatio:I},t.scale,y),U()})),[{point:A,name:"wf-source"},{point:_,name:"wf-destination"}].forEach(({point:e,name:a})=>{st(e,a),ut(e,a)}),U(),N(),rt();function Bt(){n&&(n.stop(),n=null),o.forEach(e=>e()),o.length=0}return Bt}function te(t){const n=s.routeStore.currentRouteLayer?.name,o=z;let i=g.selectedRoute?.from,h=g.selectedRoute?.to;const c=g.selectedRoute?.waypoints;if(i?.entity.type==="route-cut-in"&&(i=null),h?.entity.type==="route-cut-in"&&(h=null),!o.length)return;const y=[{key:"sourceLocation",rect:i?.rect,index:void 0},{key:"destinationLocation",rect:h?.rect,index:void 0}];c&&y.push(...c?.map((d,r)=>({key:`waypoint-${d.externalId}`,index:r,rect:d.rect})));const m=n?O(n,i?.layer?.name):!0,p=n?O(n,h?.layer?.name):!0;let l=!1,x=!1;o.forEach(({x:d,y:r})=>{for(const{key:u,rect:R,index:E}of y)if(R?.containsPoint(d,r)){u==="sourceLocation"&&(A.bounds=S(d,r,K.width,K.height,t),A.hidden=!m,A.dim=!m,l=m),u==="destinationLocation"&&(_.bounds=S(d,r,j.width,j.height,t),_.hidden=!p,_.dim=!p,x=p);break}}),l||(A.bounds=S(o[o.length-1].x,o[o.length-1].y,K.width,K.height,t),A.hidden=!1,A.dim=!1),x||(_.bounds=S(o[0].x,o[0].y,j.width,j.height,t),_.hidden=!p,_.dim=!p)}function ee(){const{from:t,to:n}=s.uiState.selectedRoute||{},o="route-cut-in";return t&&t?.entity.type===o||n&&n?.entity.type===o?s.routeStore.defaultFrom:null}function ne(t,n){if(!t||!n.length)return n;const o=n.reduce((i,h,c)=>Pt(t,h)<Pt(t,n[i])?c:i,0);return o<=n.length/2?n.slice(o):n.slice(0,o)}function oe(t,n){const o=s.routeStore.currentRouteLayer?.name,i=g.getRouteNextFloor,h=s.layerStore.floors.map(r=>r.name),c=(r,u)=>r.findIndex(R=>O(R,u)),y=c(h,o),m=c(h,i),p=m!==-1,l=v.filter(r=>o?r.virtual&&(O(r.p0.layer,o)||O(r.p1.layer,o))&&(O(r.p0.layer,i)||O(r.p1.layer,i)):r.virtual).flatMap(r=>[r.p0,r.p1]),x=[];let d;l.forEach(r=>{if(i&&!O(r.layer,i)&&(p&&m>y&&s.fp.icons.get("transition_up")?d=Dt:p&&m<y&&s.fp.icons.get("transition_down")?d=_t:d=Rt),d){const u=O(o,r.layer),R=S(r.x,r.y,d.width,d.height,t),E=tt(d,R,{hidden:!u,dim:!1});x.push(E)}}),n.set(x)}function ie(t,n,o=1,i){if(!t)return;const h=s.fp.icons.get("kiosk");h.id="kiosk";let c;if(h){const m=t?.iconSizePercent?t.iconSizePercent/100:1,p=55;c=Z(h,yt(199*m,p),yt(152*m,p),I)}else c=Ct(I,dt("#ee4422").hex());const y=tt(c,S(t.x,t.y,c.width,c.height,o,It(t.heading||0)),{hidden:!n.visible,dim:!n.skipdim});i.set([...i.get(),y])}function yt(t,n){return t*(1-n/100)}function Nt(t,n,o=!1){let i=z.length-1;if(g.selectedRoute?.to?.entity.type==="route-cut-in"&&(i=0),o){Lt=[],n.children=[],t.update(n);return}const h=t.scale,c=z[i],y=at?.destination;if(!c||!y)return;const m=lt.width,p=splitPolyLine([{p0:c,p1:y}],m*2*h);if(p.length<2)return;const l=y.x-c.x,x=y.y-c.y,d=Math.hypot(l,x),r={x:(c.x+y.x)/2,y:(c.y+y.y)/2-d*.2},u=[c,r,y],R=p.map((E,D,q)=>{const T=(D+1)/(q.length+1),L=Mt(u,T);return tt(lt,S(L.x,L.y,lt.width,lt.height,h),{hidden:!1,dim:!1})})||[];return n.children=R,Lt=R,R}function Mt(t,n){if(t.length===1)return t[0];const o=[];for(let i=0;i<t.length-1;i++){const h=(1-n)*t[i].x+n*t[i+1].x,c=(1-n)*t[i].y+n*t[i+1].y;o.push({x:h,y:c})}return Mt(o,n)}export function splitPolyLine(t,n){if(t.length===0)return[];const o=[];let i=0;for(let m=0;m<t.length;m++){const p=t[m],l=p.p0,x=p.p1,d=x.x-l.x,r=x.y-l.y,u=Math.sqrt(d*d+r*r);if(u===0)continue;const R=d/u,E=r/u;let D=0;for(;i+D*n<=u;){const L=i+D*n,M=l.x+R*L,Y=l.y+E*L;o.push({x:M,y:Y}),D++}const q=i+(D-1)*n;let T=u-q;if(T=Math.max(T,0),m<t.length-1){const L=t[m+1],M=L.p0,Y=L.p1,nt=Y.x-M.x,B=Y.y-M.y,N=Math.sqrt(nt*nt+B*B);if(N===0)i=0;else{const rt=nt/N,U=B/N,W=R*rt+E*U,ot=T*W;i=n-ot}}else i=n-T;i=Math.max(i,0)}const h=t[0].p0;(o.length===0||!o[0]||o[0].x!==h.x||o[0].y!==h.y)&&o.unshift(h);const c=t[t.length-1].p1,y=o[o.length-1];return(o.length===0||!y||y.x!==c.x||y.y!==c.y)&&o.push(c),o}function re(t,n,o,i){if(!n.length)return n;const h=new Array(t.length);let c=0;for(let u=0;u<t.length;u++){const R=t[u],E=Math.hypot(R.p1.x-R.p0.x,R.p1.y-R.p0.y);h[u]=E,c+=E}const y=u=>u?String(u):null;function m(u){let R=0,E=1/0,D=1/0;const q=y(u.layer);for(let T=0;T<t.length;T++){const L=t[T],M=h[T],Y=y(L.p0.layer);if(!(q===null||Y===null||Y===q)){R+=M;continue}const B=L.p1.x-L.p0.x,N=L.p1.y-L.p0.y,rt=B*B+N*N;if(rt===0){R+=M;continue}const U=((u.x-L.p0.x)*B+(u.y-L.p0.y)*N)/rt,W=Math.max(0,Math.min(1,U)),ot=L.p0.x+B*W,st=L.p0.y+N*W,ut=Math.hypot(u.x-ot,u.y-st);ut<E&&(E=ut,D=R+M*W),R+=M}return{found:D!==1/0,fromStart:D,total:c}}const p=m(o),l=p.found?p:m(i);if(!l.found)return n;const x=l.fromStart,d=l.total-l.fromStart;return(p.found?d<x:x<d)?n.slice().reverse().map(u=>({...u,p0:u.p1,p1:u.p0})):n}
|
|
@@ -2,9 +2,8 @@ import { ImageUrls } from "../../../../utils/loadImagesInBatches";
|
|
|
2
2
|
import { Img } from "../../../../utils/imageloader";
|
|
3
3
|
import type { Booth } from "../../../../store/BoothStore";
|
|
4
4
|
import type { Layer } from "../../../../store/LayerStore";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export declare function loadLayersImages(renderer: MapRenderer, scene: SceneDef): Promise<void>;
|
|
5
|
+
import { RendererService } from "../../../../renderer";
|
|
6
|
+
export declare function loadLayersImages(rendererService: RendererService): Promise<void>;
|
|
8
7
|
export declare const getImageLayerName: (layerName: string) => string;
|
|
9
8
|
export declare function mapBoothsLogos(booths: Booth[]): Map<number, ImageUrls>;
|
|
10
9
|
export declare function getLayerIcons(layer: Layer): SVGImageElement[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getLayerSvg as
|
|
1
|
+
import{getLayerSvg as f}from"../../../../data/svg";import{select as h}from"d3";import{getLogoUrl as d}from"../../../../utils/getLogoUrl";import{flipImageDef as u,isInnerInsideOuter as y}from"../../../../renderer";import{SEPARATOR as w}from"../../../../constants";import{rotateImageDef as x}from"../../../../renderer/engine-core/utils/rotation";export async function loadLayersImages(t){const n=t.layerImagesRegistry.invoke();await Promise.all(n.map(async e=>{const l=await e;if(!l)return;const{layer:i,children:o}=l;if(o.length){const a=[];for(let r=0;r<o.length;r++){const{shape:s,parentRect:c}=o[r],g=y(s.bounds,c);if(!i.name.includes("Pathway_")){const m=g?"image-rotate":"image-flip";t.onRoll(`${m}-${name}-${r}`,g?p=>x(s,p):p=>u(s,p))}a.push(s)}i.children.push(...a),t.update(i)}}))}export const getImageLayerName=t=>`${t}${w}images`;export function mapBoothsLogos(t){return new Map(t.map(n=>{const e=n.rect&&n.exhibitors.find(l=>l.logoInBooth&&l.logo);return e?[n.id,{preferred:d(e.logo),fallback:e.logo}]:null}).filter(Boolean))}export function getLayerIcons(t){const n=h(f(t)).select(`[data-layer="${t.name}"]`);return(window.__fpVersion>5?n.selectAll(":scope > image, :scope > g:not([data-layer]) image").nodes():n.selectAll(":scope > g[data-is-editable='false'] image").nodes()).filter(Boolean)}export function createBoothImg(t,n){const e=t.rect,l=e.h?e.w/e.h:1,i=n.height?n.width/n.height:1;let o,a,r;const s=.9;l>i?(a=e.h*s,o=a*i):(o=e.w*s,a=o/i);const c=t.rotate||0;i>=2&&!c&&e.h>=e.w*2?(a=e.w*s,o=a*i,r=-90):r=-c*180/Math.PI,o>e.w&&(o=e.w,a=o/i),a>e.h&&(a=e.h,o=a*i);const g=e.cx-o/2,m=e.cy-a/2;return{name:t.slug,bounds:{x:g,y:m,width:o,height:a,angle:r},htmlImage:n,booth:t}}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RendererService } from "../../../renderer";
|
|
2
2
|
export interface BuildRouteParams {
|
|
3
3
|
enabled: boolean;
|
|
4
|
-
|
|
5
|
-
scene: SceneDef;
|
|
6
|
-
initialScale: number;
|
|
4
|
+
rendererService: RendererService;
|
|
7
5
|
cb?: () => void;
|
|
8
6
|
}
|
|
9
|
-
export declare function useBuildRoute({ enabled,
|
|
7
|
+
export declare function useBuildRoute({ enabled, rendererService }: BuildRouteParams): void;
|
|
10
8
|
//# sourceMappingURL=useBuildRoute.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as x,useEffect as M,useMemo as _,useRef as v}from"react";import{BUILD_ROUTE_DOTS as U,BUILD_ROUTE_LINES as $}from"./trafficLayers";import{createCircleCanvas as S,getBounds as I}from"../../../renderer/engine-core/canvases";import{UpdateQueue as A}from"./UpdateQueue";const E=49,C=`hsl(257, 76%, ${E}%)`,K=`hsl(339.903, 82%, ${E}%)`,T=`hsl(257, 76%, ${Math.round(E*1.82)}%)`,O=4,H=O,R="U",D="R",b="S",N="P";class Y{_state=[[]];index=0;pointHashSet=new Set;locked=!1;storageKey="expofp_build_route_state";_selected=0;get points(){return this._state[this.index]}set points(t){this._state.push(t),this.setIndex(),this.save()}setIndex(){this.index=Math.max(this._state.length-1,0)}genPointHash(t){return`${t.x},${t.y}`}add(t){const a=this.genPointHash(t);this.pointHashSet.has(a)||(this.pointHashSet.add(a),this.points=[...this.points,t])}undo(){this.index&&(this._state.pop(),this.setIndex(),this.save(),this.select(this.points.length-1))}execute(t){try{if(this.locked)return;this.locked=!0,t()}finally{requestAnimationFrame(()=>{this.locked=!1})}}log(t,a=12){console.log(`%c${t}`,`color: black; font-size: ${a}px; background: LemonChiffon;`)}instruct(){this.log(`How to Build a Route:
|
|
2
2
|
Add Point: Click on the map.
|
|
3
|
-
Apply Smoothing: Press ${
|
|
4
|
-
Apply Simplification: Press ${
|
|
5
|
-
Undo: Press ${
|
|
6
|
-
Enable/Disable Preview: Press ${
|
|
7
|
-
`,16)}applyChaikinSmoothing(t,
|
|
3
|
+
Apply Smoothing: Press ${D}.
|
|
4
|
+
Apply Simplification: Press ${b}.
|
|
5
|
+
Undo: Press ${R}.
|
|
6
|
+
Enable/Disable Preview: Press ${N}.
|
|
7
|
+
`,16)}applyChaikinSmoothing(t,a,d){let c=[];if(d>=1&&t.length>=2){c=[t[0]];for(let h=1;h<t.length;h++){const s=t[h-1],u=t[h];for(let o=1;o<=d;o++){const n=o/(d+1);c.push({x:s.x+(u.x-s.x)*n,y:s.y+(u.y-s.y)*n})}c.push(u)}}else c=t.slice();for(let h=0;h<a&&!(c.length<2);h++){const s=[{...c[0]}];for(let u=1;u<c.length;u++){const o=c[u-1],n=c[u];s.push({x:.75*o.x+.25*n.x,y:.75*o.y+.25*n.y}),s.push({x:.25*o.x+.75*n.x,y:.25*o.y+.75*n.y})}s.push({...c[c.length-1]}),c=s}return c}applySmoothing(){this.points.length<3||(this.points=this.applyChaikinSmoothing(this.points,1,0),this.select(this.points.length-1))}save(){try{this.points.length?sessionStorage.setItem(this.storageKey,JSON.stringify(this.points)):sessionStorage.removeItem(this.storageKey)}catch(t){console.warn(t)}}restore(){try{const t=sessionStorage.getItem(this.storageKey);if(!t)return;const a=JSON.parse(t);if(!Array.isArray(a))return;a.forEach(d=>this.add(d)),this.select(this.points.length-1)}catch(t){console.warn(t)}}topologyPreservingSimplify(t,a){if(t.length<=2)return t.map(o=>({...o}));const d=(o,n,y)=>{const g=o.x,f=o.y,e=n.x,i=n.y,r=y.x,l=y.y,m=Math.abs((l-i)*g-(r-e)*f+r*i-l*e),p=Math.sqrt((l-i)**2+(r-e)**2);return m/(p||1e-10)},c=(o,n,y,g)=>{const f=(e,i,r)=>(r.y-e.y)*(i.x-e.x)-(i.y-e.y)*(r.x-e.x);return f(o,y,g)*f(n,y,g)<0&&f(y,o,n)*f(g,o,n)<0},h=new Array(t.length).fill(!1);h[0]=h[h.length-1]=!0;const s=[],u=(o,n)=>{if(n<=o+1)return;const y=t[o],g=t[n];let f=0,e=0;for(let i=o+1;i<n;i++){const r=d(t[i],y,g);r>f&&(f=r,e=i)}if(f>a){const i=t[e];let r=!0;for(let l=0;l<s.length-1;l++)if(c(s[l],s[l+1],y,i)||c(s[l],s[l+1],i,g)){r=!1;break}r&&(h[e]=!0,u(o,e),u(e,n))}};return u(0,t.length-1),t.filter((o,n)=>h[n])}applySimplification(){this.points=this.topologyPreservingSimplify(this.points,.5),this.select(this.points.length-1)}get selected(){return this._selected}select(t){this._selected=Math.max(0,Math.min(t,this.points.length-1))}}export function useBuildRoute({enabled:w,rendererService:t}){const a=v(!1),d=v(),c=_(()=>S(O,C),[]),h=_(()=>S(O,K),[]),s=_(()=>new Y,[]),u=v(new A),o=_(()=>{if(!t.scene)return{};const e=t.scene.rootLayer.children,i=e.find(l=>l.name===$),r=e.find(l=>l.name===U);return{linesLayer:i,pointsLayer:r}},[t.scene]),n=x(()=>{if(!t?.renderer||!o||!c||!h)return;const{linesLayer:e,pointsLayer:i}=o;if(!e||!i)return;const r=s.points,l=a.current;l?i.children.length=0:i.children=r.map(({x:p,y:L},k)=>{const P=k==s.selected?h:c;return{source:P,bounds:I(p,L,P.width,P.height,d.current)}});const m=[];for(let p=1;p<r.length;p++){const L=r[p-1],k=r[p];m.push({points:[L,k],color:l?C:T,width:H})}m.length?e.children=m:e.children.length=0,u.current.add(()=>t.update(i,e)),s.instruct(),s.log(JSON.stringify(s.points))},[t,s,o,c,h]),y=x(e=>{const i=e.key.toUpperCase();s.execute(()=>{switch(i){case R:e.preventDefault(),s.undo(),a.current=!1,n();break;case D:e.preventDefault(),s.applySmoothing(),a.current=!1,n();break;case b:e.preventDefault(),s.applySimplification(),a.current=!1,n();break;case N:e.preventDefault(),a.current=!a.current,n();break}})},[s,n]),g=x(e=>{if(!t?.renderer||!o)return;const{pointsLayer:i}=o;i&&(d.current=e,s.execute(()=>{const r=i.children,l=[];for(let m=0;m<r.length;m++){const p=r[m];p.bounds=I(p.bounds.center.x,p.bounds.center.y,p.source.width,p.source.height,d.current),l.push(p)}u.current.add(()=>t.update(...l))}))},[t,o,s]),f=x(e=>{s.execute(()=>{s.add({x:e.point.x,y:e.point.y}),s.select(s.points.length-1),n()})},[s,n]);M(()=>{const e=t.renderer;if(!(!w||!e))return d.current=t.getCameraState().ptScale||window.devicePixelRatio,s.execute(()=>{s.restore(),n()}),e.events.addEventListener("pointer:click",f),e.events.addEventListener("viewport:ptscale",g),window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y),e.events.removeEventListener("pointer:click",f),e.events.removeEventListener("viewport:ptscale",g),u.current.destroy()}},[w,t,s,n,f,g,y])}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RendererService } from "../../../renderer";
|
|
2
2
|
export interface ManageTrafficParams {
|
|
3
3
|
permission: boolean;
|
|
4
|
-
|
|
5
|
-
scene: SceneDef;
|
|
4
|
+
rendererService: RendererService;
|
|
6
5
|
dataJsonUrl: string;
|
|
7
6
|
websocketUrl: string;
|
|
8
|
-
initialScale: number;
|
|
9
7
|
}
|
|
10
|
-
export declare function useManageTraffic({ permission,
|
|
8
|
+
export declare function useManageTraffic({ permission, rendererService, dataJsonUrl, websocketUrl }: ManageTrafficParams): void;
|
|
11
9
|
//# sourceMappingURL=useManageTraffic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as
|
|
1
|
+
import{useEffect as yt,useRef as L}from"react";import{getBounds as k}from"../../../renderer";import{getRouteLayerRegex as pt,getRouteStopLayerRegex as wt,TRAFFIC_VEHICLES as xt}from"./trafficLayers";import{loadImage as Et}from"../../../utils/loadImage";import{createImageCanvas as It}from"../drawing/config/canvases";import{UpdateQueue as Mt}from"./UpdateQueue";import Lt from"../../../tools/base-runtime-url";import{toRadians as bt}from"../../../utils/toRadians";const tt=2,Rt=tt*3.5,G=tt*12,at=G*.7,Ft=8,At="transport_locations",Tt=150,et="#a4aab6",it=1e3,Pt=2e4,ut=500;export function useManageTraffic({permission:e,rendererService:n,dataJsonUrl:c,websocketUrl:a}){const t=L(window.devicePixelRatio),s=L(new Map),o=L(new Map),r=L(),d=L(),f=L(performance.now()),M=L(1),x=L(new Mt),A=L(new Map),I=L(),g=L(it),y=L(new Map),i=L();yt(()=>{async function O(){if(!(!e||!n.scene))try{let h;try{h=await(await fetch(c,{method:"GET",headers:{"Content-Type":"application/json"}})).json()}catch(u){console.warn("useManageTraffic failed to get JSON",u)}if(!h||h?.disabled||h?.error)return;t.current=lt(n.getCameraState().ptScale);const V=new Map(h.routes.map(({id:u,color:m})=>[u,m])),_=n.scene.rootLayer.children,W=new Map;V.forEach(u=>{W.set(u,Ct({radius:Rt,color:u,scale:window.devicePixelRatio}))});const z=pt(),Y=_.filter(u=>z.test(u.name)),B=wt(),U=_.filter(u=>B.test(u.name));h.routes.slice(0,Y.length).forEach(({id:u,color:m,path:T,stops:R,hiddenPoints:p},w)=>{A.current.set(u,T);const E=Y[w];if(E){const S=new Map(p?.map(l=>[ot(l),l])??[]);for(let l=1;l<T.length;l++){const D=T[l-1],H=T[l];S.has(ot(D))||S.has(ot(H))||E.children.push({points:[D,H],color:m,width:tt})}E.children.length&&x.current.add(()=>n.update(E))}const N=U[w];if(N&&R?.length){const S=W.get(m);R.forEach(l=>{N.children.push({source:S,bounds:k(l.x,l.y,S.width,S.height,t.current)})}),N.children.length&&x.current.add(()=>n.update(N))}});const $=_.find(u=>u.name===xt),X=new Map;I.current=u=>{try{t.current=lt(u);const m=[];for(let R=0;R<U.length;R++){const p=U[R].children;for(let w=0;w<p.length;w++){const E=p[w];E.bounds=k(E.bounds.center.x,E.bounds.center.y,E.source.width,E.source.height,t.current,E.bounds.rotation),m.push(E)}}const T=[...s.current.values()];for(let R=0;R<T.length;R++){const p=T[R];p.bounds=k(p.bounds.center.x,p.bounds.center.y,p.source.width,p.source.height,t.current,p.bounds.rotation)}x.current.add(()=>n.update(...m,...T))}catch(m){console.error("ptscale",m)}},n.renderer.events.addEventListener("viewport:ptscale",I.current),V.forEach((u,m)=>{X.set(m,ht({id:m,width:G,height:G,color:u,scale:window.devicePixelRatio}))}),X.set(et,ht({id:"orphan",width:G,height:G,color:et,scale:window.devicePixelRatio}));let j=null;try{const u=await Et(`${Lt}icons/bus-white.svg`);j=It(u,at,at,window.devicePixelRatio)}catch(u){console.error(u)}d.current=u=>{try{const m=JSON.parse(u.data);if(m.type!==At)return;const T=u.timeStamp||performance.now();M.current=Math.round(T-f.current),f.current=T;const R=Math.max(M.current??ut,ut),p=o.current,w=s.current,E=$.children,N=x.current;let S=!1;m.data.forEach(({id:l,x:D,y:H,route_id:ct,hidden:gt})=>{if(p.has(l)&&(p.get(l)?.(),p.delete(l)),gt&&w.has(l)&&w.has(Q(l))){const P=w.get(l);P.hidden=!0;const F=w.get(Q(l));F.hidden=!0,N.add(()=>n.update(P,F));return}if(y.current.set(l,performance.now()),!w.has(l)){const P=X.get(ct)||X.get(et),F={id:l,source:P,bounds:k(D,H,P.width,P.height,t.current,0)};if(w.set(l,F),j){const q=Q(l),rt={id:q,source:j,bounds:k(D,H,j.width,j.height,t.current,0)};j.setAttribute("id",q),w.set(q,rt),E.push(F,rt)}else E.push(F);S=!0;return}const Z=w.get(l),st=w.get(Q(l)),mt=Z.bounds.center,K=Nt(mt,{x:D,y:H},A.current.get(ct));if(K.reduce((P,F,q)=>q===0?P:P+nt(K[q-1],F),0)>=Tt||document.hidden)dt({rendererService:n,updateQueue:N,vehicle:Z,vehicleFinery:st,x:D,y:H,scale:t.current,angle:vt(Z.bounds.center,{x:D,y:H})});else{const P=St(K,R,F=>{dt({rendererService:n,updateQueue:N,vehicle:Z,vehicleFinery:st,x:F.x,y:F.y,scale:t.current,angle:F.angle})});p.set(l,P)}}),S&&N.add(()=>n.update($))}catch(m){console.error("handleSocketMessage",m)}},v(),C(h.config?(Number(h.config.vehicle_inactive_interval)||20)*1e3:Pt)}catch(h){console.warn(h)}}O();function v(){r.current?.readyState===WebSocket.OPEN||r.current?.readyState===WebSocket.CONNECTING||(r.current=new WebSocket(a),r.current.onmessage=d.current,r.current.onopen=()=>{g.current=it},r.current.onclose=()=>{if(!navigator.onLine)return;setTimeout(v,g.current);const h=3e4;g.current=Math.min(g.current*2,h)})}function b(){v()}window.addEventListener("online",b);function C(h){clearInterval(i.current),i.current=window.setInterval(()=>{const V=performance.now(),_=[],W=[];y.current.forEach((z,Y)=>{if(V-z<h)return;const B=s.current.get(Y);B&&(B.hidden=!0,W.push(B),_.push(Y));const U=Q(Y),$=s.current.get(U);$&&($.hidden=!0,W.push($),_.push(U))}),W.length&&x.current.add(()=>n.update(...W)),_.forEach(z=>y.current.delete(z))},h)}return()=>{I.current&&n.renderer&&n.renderer.events.removeEventListener("viewport:ptscale",I.current),o.current.forEach(h=>h?.()),o.current.clear(),s.current.clear(),x.current.destroy(),window.removeEventListener("online",b),clearInterval(i.current)}},[e,n,c,a])}function lt(e){return Math.min(e||window.devicePixelRatio,Ft)}function vt(e,n){return Math.atan2(n.y-e.y,n.x-e.x)}function Ct({radius:e,scale:n,color:c}){const a=document.createElement("canvas"),t=a.getContext("2d");t.imageSmoothingEnabled=!1;const s=Math.ceil(e*2*n),o=s/2,r=e*.78,d=e*.33;return a.width=s,a.height=s,t.translate(o,o),t.scale(n,n),t.beginPath(),t.arc(0,0,e,0,2*Math.PI),t.fillStyle="#FFFFFF",t.fill(),t.beginPath(),t.arc(0,0,r,0,2*Math.PI),t.fillStyle=c,t.fill(),t.beginPath(),t.arc(0,0,d,0,2*Math.PI),t.fillStyle="#FFFFFF",t.fill(),a}function ht({id:e,width:n,height:c,color:a,scale:t}){const s=2*t,o=n/2*t,r=c*t,d=.6,f=.01,M=r*d,x=r,A=8*t,I=x+s+M/2+A*2,g=o*2+M+s+A*2,y=document.createElement("canvas");y.setAttribute("id",e),y.width=I,y.height=g;const i=y.getContext("2d"),O=I/2,v=g/2;i.save(),i.translate(O,v),i.rotate(-Math.PI/2),i.translate(-O,-v);const b=O,C=v-x/2+o,h=C+M;return i.shadowColor="rgba(16, 24, 40, 0.2)",i.shadowBlur=A/2,i.beginPath(),i.arc(b,C,o,Math.PI,0,!1),i.bezierCurveTo(b+o,C+r*.3,b+f*o,h,b,h),i.bezierCurveTo(b-f*o,h,b-o,C+r*.3,b-o,C),i.closePath(),i.fillStyle=a,i.fill(),i.strokeStyle="#FFFFFF",i.lineWidth=s,i.stroke(),i.restore(),y}function nt(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}function Q(e){return`${e}_finery`}function dt({rendererService:e,updateQueue:n,vehicle:c,vehicleFinery:a,x:t,y:s,scale:o,angle:r}){if(c.bounds=k(t,s,c.source.width,c.source.height,o,r),c.hidden=!1,a){const d=e.getCameraState();a.bounds=k(t,s,a.source.width,a.source.height,o,bt(d.roll||0)),a.hidden=!1,n.add(()=>e.update(a,c))}else n.add(()=>e.update(c))}function J(e,n,c){return{x:e.x+(n.x-e.x)*c,y:e.y+(n.y-e.y)*c}}function ft(e,n){let c=1/0,a={index:0,t:0};for(let t=0;t<n.length-1;t++){const s=n[t],o=n[t+1],r=o.x-s.x,d=o.y-s.y,f=r*r+d*d,M=f?((e.x-s.x)*r+(e.y-s.y)*d)/f:0,x=Math.max(0,Math.min(1,M)),A=J(s,o,x),I=nt(e,A);I<c&&(c=I,a={index:t,t:x})}return a}function _t(e,n,c){const a=nt(e,n),t=Math.max(2,Math.ceil(a/c)+1),s=[];for(let o=0;o<t;o++){const r=o/(t-1),d=J(e,n,r);s.push({x:d.x,y:d.y})}return s}function Nt(e,n,c){if(!c||!c.length)return _t(e,n,10);const a=ft(e,c),t=ft(n,c),s=[],o=r=>s.push({x:r.x,y:r.y});a.index+1<c.length?o(J(c[a.index],c[a.index+1],a.t)):o(c[a.index]);for(let r=a.index+1;r<=t.index&&r<c.length;r++)o(c[r]);return t.index+1<c.length?o(J(c[t.index],c[t.index+1],t.t)):o(c[t.index]),s}function St(e,n,c,a){if(e.length<2)return()=>{};let t=null,s;const o=[];let r=0;for(let f=0;f<e.length-1;f++){const M=Math.hypot(e[f+1].x-e[f].x,e[f+1].y-e[f].y);o.push(M),r+=M}const d=f=>{t||(t=f);const M=f-t,x=Math.min(M/n,1),A=x*r;let I=0,g=0;for(;g<o.length&&I+o[g]<A;)I+=o[g],g++;g>=o.length&&(g=o.length-1);const y=e[g],i=e[Math.min(g+1,e.length-1)],O=o[g]||0,v=O===0?0:(A-I)/O,b=y.x+(i.x-y.x)*v,C=y.y+(i.y-y.y)*v,h=i.x-y.x,V=i.y-y.y,_=h===0&&V===0?0:Math.atan2(V,h);c({x:b,y:C,angle:_}),x<1?s=requestAnimationFrame(d):a&&a()};return s=requestAnimationFrame(d),()=>{s&&cancelAnimationFrame(s)}}function ot(e){return`${e.x},${e.y}`}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
`+s("Open it on another device to import bookmarks")+".")}function N(e){e.preventDefault(),r.clickLanguage()}return v(()=>{if(!t.menu)return null;const e=r.boothStore.booths.filter(i=>i.bookmarked).map(i=>i.name),d=r.eventStore.eventItems.length>0,k=b.exhibitors.filter(i=>i.bookmarked).length+r.eventStore.bookmarked.length,u=window.__fpSettings?.fpVer?`https://api-v2.expofp.com/export/v2/${w.EXPO}/pdf`:`https://api.expofp.com/service/convert/${w.EXPO}/pdf`;return m("div",{className:`menu ${a.shown?"shown":""}`,children:[g?o("div",{className:"menu__cover -empty"}):o("div",{className:"menu__cover",children:o("a",{href:n.homeUrl,target:"_blank",rel:"noopener noreferrer",onClick:y,children:o("img",{src:p,onError:()=>a.logoVisibility="hidden",style:{visibility:a.logoVisibility},alt:"",crossOrigin:"anonymous"})})}),m("div",{className:"menu__content",children:[o("a",{href:"/#",onClick:S,className:"menu__item",children:s("Search")}),!n.hideEventHomeLink&&!t.kiosk&&!g&&!!n.homeUrl&&m("a",{href:n.homeUrl,target:"_blank",className:"menu__item",rel:"noopener noreferrer",children:[s("Event Home").replace(/ /g,"\xA0"),"\xA0",o("i",{className:"icon-link-external"})]}),!n.hideRegisterToAttendLink&&!t.kiosk&&!g&&!!n.registerUrl&&m("a",{href:n.registerUrl,target:"_blank",className:"menu__item",rel:"noopener noreferrer",children:[s("Register to Attend").replace(/ /g,"\xA0"),"\xA0",o("i",{className:"icon-link-external"})]}),!t.hideLanguage&&!n.hideLanguage&&!n.hideLanguageLink&&m("a",{href:"?language",onClick:N,className:"menu__item -language",children:[m("span",{children:[s("Language")," "]}),m("span",{className:"menu__icons",children:[o(I,{variant:"gray",size:"md",noMargins:!0,children:r.languageStore.language?.name}),o("i",{className:"icon-chevron-right"})]})]}),!n.hideDownloadPdfLink&&!t.kiosk&&o("a",{className:"menu__item -pdf",target:"_blank",rel:"noopener noreferrer",href:`${u}/?exhibitors=true&bookmarks=${e.join(",")}&layers=${(r.layerStore.layers.length>=r.layerStore.visible.length?r.layerStore.visible.map(i=>i.name).join(","):"").replace(/&/g,"%26")}`,children:s("Download PDF")}),l===void 0&&c&&o("a",{href:"/#",className:"menu__item -cookie-consent",onClick:i=>{i.preventDefault(),t.hideCookieConsent=!1},children:s("Review Cookie Consent")})]})]})});function f(){t.menu=!1}}export default({isGDPR:l,allowConsent:c})=>v(()=>o(x,{children:t.menu?o(U,{isGDPR:l,allowConsent:c}):null}));
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as b}from"react/jsx-runtime";import{useLocalStore as y,useObserver as g}from"mobx-react-lite";import{autorun as N}from"mobx";import{t as m}from"../utils/i18n";import o from"../data";import u from"../utils/is-iframe";import t,{uiState as n}from"../store";import S from"./Badge";import h from"../tools/logger";import f from"../tools/settings";import"./Menu.scss";import"./Menu_custom.scss";const d=/^https?:\/\//i.test(o.logo)?o.logo:window.__dataUrlBase+o.logo;h.log("Logo url: ",d),window.setTimeout(function(){const a=new Image;a.onload=()=>{h.log("Logo image loaded")},a.crossOrigin="anonymous",a.src=d},1500);function C({allowConsent:a,isGDPR:c}){const i=y(()=>({logoVisibility:"visible",shown:!1,shownTimeout:void 0,modalOpen:!1,selectedCategoryIds:(n.selectedCategoryFilters||[]).map(r=>Number(r.id)),pendingSelectedIds:(n.selectedCategoryFilters||[]).map(r=>Number(r.id))}));N(()=>{n.menu?(i.shownTimeout=window.setTimeout(()=>i.shown=!0,1),n.list.type==="sessions"&&t.searchStore.selectSearch()):(i.shown=!1,i.shownTimeout&&window.clearTimeout(i.shownTimeout))});function p(r){if(n.kiosk)return r.preventDefault()}function k(r){r.preventDefault(),v(),t.searchStore.selectSearch()}function _(r){r.preventDefault(),t.clickLanguage()}return g(()=>{if(!n.menu)return null;const r=t.boothStore.booths.filter(s=>s.bookmarked).map(s=>s.name),w=window.__fpSettings?.fpVer?`https://api-v2.expofp.com/export/v2/${f.EXPO}/pdf`:`https://api.expofp.com/service/convert/${f.EXPO}/pdf`;return l("div",{className:`menu ${i.shown?"shown":""}`,children:[u?e("div",{className:"menu__cover -empty"}):e("div",{className:"menu__cover",children:e("a",{href:o.homeUrl,target:"_blank",rel:"noopener noreferrer",onClick:p,children:e("img",{src:d,onError:()=>i.logoVisibility="hidden",style:{visibility:i.logoVisibility},alt:"",crossOrigin:"anonymous"})})}),l("div",{className:"menu__content",children:[e("a",{href:"/#",onClick:k,className:"menu__item",children:m("Search")}),!o.hideEventHomeLink&&!n.kiosk&&!u&&!!o.homeUrl&&l("a",{href:o.homeUrl,target:"_blank",className:"menu__item",rel:"noopener noreferrer",children:[m("Event Home").replace(/ /g,"\xA0"),"\xA0",e("i",{className:"icon-link-external"})]}),!o.hideRegisterToAttendLink&&!n.kiosk&&!u&&!!o.registerUrl&&l("a",{href:o.registerUrl,target:"_blank",className:"menu__item",rel:"noopener noreferrer",children:[m("Register to Attend").replace(/ /g,"\xA0"),"\xA0",e("i",{className:"icon-link-external"})]}),!n.hideLanguage&&!o.hideLanguage&&!o.hideLanguageLink&&l("a",{href:"?language",onClick:_,className:"menu__item -language",children:[l("span",{children:[m("Language")," "]}),l("span",{className:"menu__icons",children:[e(S,{variant:"gray",size:"md",noMargins:!0,children:t.languageStore.language?.name}),e("i",{className:"icon-chevron-right"})]})]}),!o.hideDownloadPdfLink&&!n.kiosk&&e("a",{className:"menu__item -pdf",target:"_blank",rel:"noopener noreferrer",href:`${w}/?exhibitors=true&bookmarks=${r.join(",")}&layers=${(t.layerStore.layers.length>=t.layerStore.visible.length?t.layerStore.visible.map(s=>s.name).join(","):"").replace(/&/g,"%26")}`,children:m("Download PDF")}),a===void 0&&c&&e("a",{href:"/#",className:"menu__item -cookie-consent",onClick:s=>{s.preventDefault(),n.hideCookieConsent=!1},children:m("Review Cookie Consent")})]})]})});function v(){n.menu=!1}}export default({isGDPR:a,allowConsent:c})=>g(()=>e(b,{children:n.menu?e(C,{isGDPR:a,allowConsent:c}):null}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a,jsxs as f}from"react/jsx-runtime";import b from"classnames";import{useObserver as D}from"mobx-react-lite";import k,{useEffect as C,useRef as v,useCallback as T}from"react";import s,{searchStore as e}from"../store";import{t as i}from"../utils/i18n";import{useAutorun as l}from"../utils/mobx";import z from"../tools/debounce";import{GaEventActions as j,sendEventToGa as K}from"../tools/gtag";import{handleCustomCommand as L}from"../utils/customCommands";import{Badge as P}from"./";import"./SearchBox.scss";const G=1e3;function R({className:g}){const B=v(),p=v(null);function I(t){let o=0;switch(t.key){case"Down":case"ArrowDown":o=1;break;case"Up":case"ArrowUp":o=-1;break;case"Enter":t.preventDefault(),s.openActiveListItem();const n=c();n&&L(n.value,!0);return;case"Escape":t.preventDefault(),e.closeSearch();return}o&&(t.preventDefault(),s.changeActiveListIndex(o))}function c(){return p.current}const[w,u]=k.useState(""),[h,E]=k.useState(!1);l(()=>{E(s.uiState.kiosk&&s.uiState.inIdle)}),C(()=>{if(!h){u("");return}const t=[i("Find Companies..."),i("Find Categories..."),i("Find Sessions..."),i("Search...")];let o=0,n=0,r=!1,S;const _=()=>{const d=t[o];r?(u(d.substring(0,n-1)),n--):(u(d.substring(0,n+1)),n++);let m=r?50:100;!r&&n===d.length?(r=!0,m=2e3):r&&n===0&&(r=!1,o=(o+1)%t.length,m=500),S=setTimeout(_,m)};return _(),()=>clearTimeout(S)},[h]),l(()=>{const t=document.activeElement;s.uiState.overlaySize!=="full"&&t===c()&&!e.isFocused&&c()?.blur()}),l(()=>{s.uiState.menu&&s.uiState.kiosk&&e.setFocused(!1)}),l(()=>{const t=c(),o=document.activeElement;t&&e.isFocused&&o!==t&&!e.skipInputFocus&&t.focus()}),C(()=>{s.fuzzySearchEngineStore.loadEngine()},[]);const N=T(z(()=>{e.searchText&&K(j.Search,e.searchText),window.__resett?.()},G),[]);function y(){e.setSearchText(c()?.value||""),N()}function A(){e.setFocused(!0),window.__resett?.()}function F(){e.isFocused||(e.handleSearchAction(),setTimeout(()=>{c()?.focus()},100))}function M(){e.handleBackAction()}function x(){e.closeSearch()}return D(()=>f("div",{className:b("search-box",g,e.searchBoxClass,{"efp-semi-transparent":s.uiState.setKioskModeEnabled}),ref:B,children:[a("button",{className:b("search-box__button","search-box__button--back",{"is-mobile-details":e.isMobileDetailsMode}),onClick:M,type:"button","aria-label":e.backMode==="back"?i("Go back"):i("Main menu"),children:a("i",{className:e.backMode==="back"?"icon-chevron-left":"icon-menu"})}),a("div",{className:"search-box__input-wrapper",children:e.shouldShowSearchInput?a("input",{ref:p,type:"search",className:"search-box__input",placeholder:h?w:e.placeholder,"aria-label":"Search",value:e.searchText,onChange:y,onKeyDown:I,onFocus:A,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:s.uiState.setKioskModeEnabled}):f("div",{className:"search-box__title",children:[e.searchBoxIcon&&a("i",{className:b("search-box__title-icon",e.searchBoxIcon)}),f("div",{className:"search-box__title-content",children:[a("strong",{className:"search-box__title-text",children:e.searchBoxTitle}),e.searchBoxSubtitle&&a("span",{className:"search-box__title-subtitle",children:e.searchBoxSubtitle})]}),e.searchBoxBadge?a(P,{variant:"lightgray",size:"md",rounded:!0,noMargins:!0,children:e.searchBoxBadge}):null]})}),!e.shouldShowSearchInput&&e.searchBoxActions.map(t=>a("button",{className:"search-box__button search-box__button--ui-action",onClick:t.handler,type:"button","aria-label":t.label,title:t.label,children:a("i",{className:t.icon})},t.id)),a("button",{className:"search-box__button search-box__button--action",onClick:e.shouldShowSearchInput?e.shouldShowCloseButton?x:F:x,type:"button","aria-label":e.ariaLabel,children:a("i",{className:e.actionButtonIcon})})]}))}export default R;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./SidebarActions.scss";
|
|
3
3
|
export interface SidebarActionsProps {
|
|
4
|
+
className?: string;
|
|
4
5
|
inBookmark?: boolean;
|
|
5
6
|
visited?: boolean;
|
|
6
7
|
showVisited?: boolean;
|
|
7
8
|
showBookmark?: boolean;
|
|
8
9
|
showDirections?: boolean;
|
|
10
|
+
showRoutePlanner?: boolean;
|
|
9
11
|
showShare?: boolean;
|
|
10
12
|
onClickBookmark?: () => void;
|
|
11
13
|
onClickVisited?: () => void;
|
|
12
14
|
onClickDirections?: () => void;
|
|
15
|
+
onClickRoutePlanner?: () => void;
|
|
13
16
|
onClickShare?: () => void;
|
|
14
17
|
}
|
|
15
18
|
declare const SidebarActions: React.FC<SidebarActionsProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useState as C}from"react";import s from"classnames";import"./SidebarActions.scss";import{t as e}from"../utils/i18n";import r from"i18next";import S from"./CheckboxButton";const v=({className:l,inBookmark:a=!1,visited:o=!1,showVisited:c=!1,showBookmark:m=!0,showDirections:u=!0,showRoutePlanner:d=!1,showShare:p=!0,onClickBookmark:f,onClickVisited:b,onClickDirections:h,onClickRoutePlanner:k,onClickShare:N})=>{const[B,n]=C(!1),x=()=>{n(!0),f(),setTimeout(()=>{n(!1)},320)};return i("div",{className:s("efp-sidebarActions",l),role:"toolbar","aria-label":e("Sidebar Actions"),children:[u&&i("button",{type:"button",className:"efp-actionButton efp-actionButton--directions",onClick:h,title:e("Directions"),"aria-label":e("Directions"),children:[t("i",{className:"icon-directions","aria-hidden":"true"}),e("Directions")]}),c&&t(S,{className:"efp-visited-btn","aria-label":o?r.t("Visited"):r.t("Not visited"),"aria-pressed":o,checked:o,label:r.t("Visited"),onClick:b??(()=>{})}),m&&t("button",{type:"button",className:s("efp-actionButton","efp-actionButton--bookmark",{isActive:a,animate:B}),title:a?e("Remove from Bookmarks"):e("Save to Bookmarks"),"aria-label":a?e("Remove from Bookmarks"):e("Save to Bookmarks"),"aria-pressed":a,onClick:x,children:t("i",{className:a?"icon-bookmark-solid":"icon-bookmark","aria-hidden":"true"})}),d&&i("button",{type:"button",className:"efp-actionButton efp-actionButton--route-planner",title:e("Route planner"),"aria-label":e("Route planner"),onClick:k,children:[t("i",{className:"icon-route-solid","aria-hidden":"true"}),e("Route planner")]}),p&&t("button",{type:"button",className:"efp-actionButton efp-actionButton--share",title:e("Share"),"aria-label":e("Share"),onClick:N,children:t("i",{className:"icon-share","aria-hidden":"true"})})]})};export default v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as f,jsxs as U}from"react/jsx-runtime";import x from"classnames";import{useObserver as C}from"mobx-react-lite";import{useEffect as m,useMemo as B,useState as V,useRef as _}from"react";import z from"../data";import{getLayerSvg as $}from"../data/svg";import r,{boothStore as F,exhibitorStore as K,uiState as e}from"../store";import{RegularBooth as L}from"../store/BoothStore";import{Route as S}from"../store/RouteStore";import I from"../tools/settings";import{t as y}from"../utils/i18n";import Q from"./EntityList";import X from"./WayfindingTemplate";import{calcSpeed as q}from"../utils/calcSpeed";import{calcTravelTime as G}from"../utils/calcTravelTime";import{DEFAULT_UNITS as H}from"../constants";import"./Wayfinding.scss";function J(){const k=_(null),a=B(()=>r.routeStore.pathLayers.map(i=>({id:i.id,name:i.layer?.shortName,description:i.layer?.description,basePriority:i.layer?.basePriority??0})),[r.routeStore.pathLayers]),[b,R]=V();m(()=>{b||R(a[0])},[r.routeStore.pathLayers,a]),m(()=>{const i=a.find(u=>u.description?.toLowerCase()===r.routeStore.currentRouteLayer?.description?.toLowerCase());i&&R(i)},[r.routeStore.currentRouteLayer,a]),m(()=>{const i=e.selectedRoute;if(!i){e.setIsMultiPointRoute(!1);return}const c=(i.waypoints?.length||0)>0;e.setIsMultiPointRoute(c)},[e.selectedRoute]);const T=()=>{const{from:i,to:u}=e.selectedRoute;return!!(i&&u)},N=()=>e.overlaySize==="full",D=()=>!!(T()&&!N()),g=()=>{const i=e.selectedRoute;return i?(i.waypoints?.length||0)>0?"multi":"simple":"none"},M=()=>e.routeTitle;return m(()=>{g()==="multi"&&e.selectedRoute},[e.selectedRoute]),C(()=>{const i=g(),u=M();if(i==="multi")return U("div",{className:x("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:[e.routeDescription&&f("div",{className:"efp-wayfinding-description",children:e.routeDescription}),f(Q,{updatedScrollableRef:k})]});const c=[],p=()=>r.routeStore.defaultFrom?F.booths.concat([r.routeStore.defaultFrom]):F.booths,A=p().filter(t=>t instanceof L),E=p().filter(t=>!(t instanceof L)),w=()=>{let t=[];return K.exhibitors.forEach(o=>{c.push(...o.booths.map(s=>s.id)),t.push(...o.booths.map(s=>({value:s.id.toString(),label:o.name+" - "+s.fullName})))}),E.filter(o=>c.indexOf(o.id)===-1).forEach(o=>{t.push({value:o.id.toString(),label:o.fullName})}),t=t.sort((o,s)=>o.label.localeCompare(s.label,void 0,{sensitivity:"base"})),A.filter(o=>c.indexOf(o.id)===-1).forEach(o=>{t.push({value:o.id.toString(),label:o.fullName})}),t},v=(t,o=!0)=>{const s=p().filter(d=>d.id.toString()===t)[0],{from:n,to:l}=e.selectedRoute;o?r.routeStore.selectRoute(new S(s||null,l)):r.routeStore.selectRoute(new S(n,s||null))},O=t=>{const o=[],s=$().getAttribute("units")||H,n=G(t,q(s));let l=new Date;l.setMinutes(l.getMinutes()+n/60);const d=l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return o.push({title:y("Travel time"),text:n<60?"< 1 min":`~ ${Math.round(n/60)} min`},{title:y("Distance"),text:Math.round(t)+` ${s}`},{title:y("Est arrival"),text:d}),o},W=()=>{const{from:t,to:o}=e.selectedRoute;r.routeStore.selectRoute(new S(o,t))},P=e.selectedRoute?.from&&e.selectedRoute?.to&&!r.routeStore.routeLines.length;return f("div",{className:x("main-wayfinding",{hidden:e.kiosk&&e.selectedRoute?.from&&e.selectedRoute?.to}),children:f(X,{showForm:!D(),showInfo:!!(!z.hideWayInformation&&I.EXPO!=="bloomberg"&&e.selectedRoute?.from&&e.selectedRoute?.to),floors:a,currentFloor:b,onClickFloor:t=>{const o=r.routeStore.pathLayers.find(s=>s.id===t.id);o?.layer&&r.layerStore.updateVisibility(o.layer,!0)},routeFound:!P,options:w(),fromValue:e.selectedRoute?.from?.id?.toString()||"",toValue:e.selectedRoute?.to?.id?.toString()||"",onChangeFrom:t=>v(t,!0),onChangeTo:t=>v(t,!1),onSwitch:W,infoItems:O(r.routeStore.routeDistance),infoAccessible:r.routeStore.onlyAccessible,showAccessible:r.routeStore.showAccessible,onAccessibleCheck:t=>r.routeStore.onlyAccessible=t,onClickInfo:()=>r.showOverlay(),routeUrl:e.routeQRCodeUrl,isKiosk:e.kiosk,showDetailsIcon:e.showRouteInstantly,onDetailsIconClick:()=>{const t=r.routeStore.defaultFrom?.id,{from:o,to:s}=e.selectedRoute||{},n=[s,o].find(l=>l?.id!==t);if(n){const d=w().find(h=>h.value===n.id.toString()),j=n.exhibitors.find(h=>d.label.includes(h.name));e.details=j||n}}})})})}function Y(){return C(()=>I.wayfinding&&!e.menu&&e.selectedRoute&&e.list.type!=="route-planner"&&f(J,{}))}export default Y;
|
package/dist/esm/data/tours.json
CHANGED
|
@@ -144,5 +144,79 @@
|
|
|
144
144
|
"15552470"
|
|
145
145
|
]
|
|
146
146
|
}
|
|
147
|
+
],
|
|
148
|
+
"fdhw2026": [
|
|
149
|
+
{
|
|
150
|
+
"id": "association-of-convenience-stores-trail",
|
|
151
|
+
"layers": [{ "floor": "1", "id": "Pathway_1" }],
|
|
152
|
+
"name": "Association of Convenience Stores Trail",
|
|
153
|
+
"description": "Show: IFE.\nData Types Allowed to View: IFE Visitors / IFE Suppliers / IFE Press / IFEM Visitors / IFEM Suppliers / IFEM Press.",
|
|
154
|
+
"points": ["16282530", "16282664", "16572191", "16282882", "16572254", "16282294", "16282527", "16282319", "16445163"]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"id": "newbies-at-the-pub-show",
|
|
158
|
+
"layers": [{ "floor": "1", "id": "Pathway_2" }],
|
|
159
|
+
"name": "Newbies at The Pub Show",
|
|
160
|
+
"description": "Show: The Pub Show.\nData Types Allowed to View: Pub Visitor / Pub Supplier / Pub Press / HRC Visitor / HRC Supplier / HRC Press.",
|
|
161
|
+
"points": [
|
|
162
|
+
"16282289",
|
|
163
|
+
"16282507",
|
|
164
|
+
"16282613",
|
|
165
|
+
"16282283",
|
|
166
|
+
"16282382",
|
|
167
|
+
"16282792",
|
|
168
|
+
"16830654",
|
|
169
|
+
"16282656",
|
|
170
|
+
"16282309",
|
|
171
|
+
"16282902",
|
|
172
|
+
"16282450",
|
|
173
|
+
"16283034",
|
|
174
|
+
"16282743",
|
|
175
|
+
"16572201",
|
|
176
|
+
"16282279",
|
|
177
|
+
"16369552",
|
|
178
|
+
"16282392",
|
|
179
|
+
"16282603"
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "chef-steve-munkley-mbe-s-top-picks",
|
|
184
|
+
"layers": [{ "floor": "1", "id": "Pathway_3" }],
|
|
185
|
+
"name": "Chef Steve Munkley MBE's Top Picks",
|
|
186
|
+
"description": "Show: HRC.\nData Types Allowed to View: Pub Visitor / Pub Supplier / Pub Press / HRC Visitor / HRC Supplier / HRC Press.",
|
|
187
|
+
"points": [
|
|
188
|
+
"16282438",
|
|
189
|
+
"16282525",
|
|
190
|
+
"16282753",
|
|
191
|
+
"16282554",
|
|
192
|
+
"16282784",
|
|
193
|
+
"16282440",
|
|
194
|
+
"16282479",
|
|
195
|
+
"16282833",
|
|
196
|
+
"PastryHQ | S1290",
|
|
197
|
+
"16282914",
|
|
198
|
+
"16282776"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"id": "radford-chancellor-s-must-see-exhibitors",
|
|
203
|
+
"layers": [{ "floor": "1", "id": "Pathway_4" }],
|
|
204
|
+
"name": "Radford Chancellor's Must See Exhibitors",
|
|
205
|
+
"description": "Show: HRC.\nData Types Allowed to View: Pub Visitor / Pub Supplier / Pub Press / HRC Visitor / HRC Supplier / HRC Press.",
|
|
206
|
+
"points": ["16282429", "16283073", "16600529"]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "anna-sebastian-s-top-tipples",
|
|
210
|
+
"layers": [{ "floor": "1", "id": "Pathway_5" }],
|
|
211
|
+
"name": "Anna Sebastian's Top Tipples",
|
|
212
|
+
"description": "Show: HRC & The Pub Show.\nData Types Allowed to View: Pub Visitor / Pub Supplier / Pub Press / HRC Visitor / HRC Supplier / HRC Press.",
|
|
213
|
+
"points": ["16282311", "16445141", "16837929", "16369552", "16282279", "16282289", "16282603"]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"id": "fcsi-members-trail",
|
|
217
|
+
"layers": [{ "floor": "1", "id": "Pathway_6" }],
|
|
218
|
+
"name": " FCSI Members Trail",
|
|
219
|
+
"points": ["16282429", "16600529", "16282606", "16282806", "16282745", "16282964"]
|
|
220
|
+
}
|
|
147
221
|
]
|
|
148
222
|
}
|
|
@@ -97,6 +97,9 @@ export default class FloorPlanLoader implements FloorPlan {
|
|
|
97
97
|
changeLanguage(langId: string): void;
|
|
98
98
|
isGpsTrackingEnabled(): boolean;
|
|
99
99
|
setGpsTrackingEnabled(value: boolean): void;
|
|
100
|
+
deselectCurrentPosition(): void;
|
|
101
|
+
deselectRoute(): void;
|
|
102
|
+
reset(): void;
|
|
100
103
|
constructor(options?: FloorPlanOptions);
|
|
101
104
|
}
|
|
102
105
|
//# sourceMappingURL=floorplan.loader.d.ts.map
|