@expofp/floorplan 3.13.1 → 3.13.2
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/{Button-CKiBkbgb.js → Button-C5DLguTW.js} +6 -6
- package/dist/browser/{CookieConsent-CSTxsO7b.js → CookieConsent-CPXxoJkz.js} +8 -8
- package/dist/browser/{Debug-VJg8Kv3w.js → Debug-bxMz-HDF.js} +8 -8
- package/dist/browser/{Demo-DK7aO8n7.js → Demo-CGCZqU_8.js} +10 -10
- package/dist/browser/{Free-Dc9anWmM.js → Free-I-EGiu3o.js} +10 -10
- package/dist/browser/{Gallery-Dnm4hSmm.js → Gallery-Bce2fubu.js} +31 -25
- package/dist/browser/{GpsLoader-DQmIKYxp.js → GpsLoader-CnPH3rxE.js} +12 -12
- package/dist/browser/{KioskStore-Do9vKaRP.js → KioskStore-K0Ps7wq6.js} +4 -4
- package/dist/browser/{MaplibreAdapter-bY-ABtGS.js → MaplibreAdapter-DKa1N9-7.js} +85 -57
- package/dist/browser/{ModalContainer-DnYcW0A9.js → ModalContainer-BxCJTxBS.js} +11 -11
- package/dist/browser/{PermissionNotice-BfOksslN.js → PermissionNotice-BS53dDaS.js} +7 -7
- package/dist/browser/{SetKioskMode-vTpieU9t.js → SetKioskMode-P2g_TnCr.js} +10 -10
- package/dist/browser/{ShowKiosk-CdNxtqFI.js → ShowKiosk-Bz-7t-PL.js} +12 -12
- package/dist/browser/{TouchHand-B9X_pexY.js → TouchHand-Dm3c6gpk.js} +5 -5
- package/dist/browser/{ViewerMenuPanel-Cwhfqk7r.js → ViewerMenuPanel-COyljU8V.js} +10 -10
- package/dist/browser/{add-debug-secret-listener-mWeM9pHG.js → add-debug-secret-listener-DQjjtobD.js} +1 -1
- package/dist/browser/{reset-all-settings-C4_ors4k.js → adopt-global-settings-DIJsf94E.js} +12 -17
- package/dist/browser/{boolean-editor-CGPZFexF.js → boolean-editor-D4Y66mgk.js} +46 -46
- package/dist/browser/{bootIntercom-CaST_jNX.js → bootIntercom-DUPbX22l.js} +3 -3
- package/dist/browser/{booth-by-xy-BO6naDgy.js → booth-by-xy-DKyMJwg9.js} +13 -13
- package/dist/browser/bundle.json +67 -70
- package/dist/browser/{classnames-ClEJC3j4.js → classnames-CTiheKEO.js} +2 -2
- package/dist/browser/{client-DXdbQp9r.js → client-B0g0Q0fu.js} +9 -9
- package/dist/browser/{components-Bowa21U1.js → components-DUbHmBQ6.js} +60 -53
- package/dist/browser/{debug-overlay-Y5npuuWR.js → debug-overlay-CKXL3Z9z.js} +470 -464
- package/dist/browser/{debug-ui-D1g5i_jy.js → debug-ui-D2GPuJSX.js} +7 -7
- package/dist/browser/{dist-Cn9LPy1P.js → dist-BFVoy_zB.js} +7 -7
- package/dist/browser/{dist-BSvcUdys.js → dist-CFY_dc-C.js} +5 -5
- package/dist/browser/{dist-aJ-8azal.js → dist-CZH-D_bo.js} +66 -67
- package/dist/browser/{efp-debug-init-Brk9OaSQ.js → efp-debug-init-pd2smy4A.js} +4 -4
- package/dist/browser/{enum-editor-BZ9LwkZ8.js → enum-editor-a07SOXXi.js} +5 -5
- package/dist/browser/{es5-XJHAF1nV.js → es5-jDwWZhmf.js} +2 -2
- package/dist/browser/{event-not-found-_rTvDWyj.js → event-not-found-CPqO_ew-.js} +1 -1
- package/dist/browser/{exports-DWUH8uau.js → exports-8JcxTO7_.js} +567 -566
- package/dist/browser/{favicon-5J-1eJZd.js → favicon-BhTDecsz.js} +1 -1
- package/dist/browser/{fetch-retry.umd-Br7VuO9v.js → fetch-retry.umd-BuEcG130.js} +2 -2
- package/dist/browser/{flex-B3O1z4v3.js → flex-FVc6l8VM.js} +17 -17
- package/dist/browser/{floorplan.loader-sk15sA3u.js → floorplan.loader-DM3BoMUa.js} +1372 -1298
- package/dist/browser/{floorplan.ready-B4ahF1S7.js → floorplan.ready-DQAk0-bE.js} +294 -294
- package/dist/browser/{fuse-Ci_KKUTa.js → fuse-hiNWVTid.js} +2 -2
- package/dist/browser/{i18n-99DQd2vS.js → i18n-DmUQ2csh.js} +2399 -2412
- package/dist/browser/index.js +36 -36
- package/dist/browser/{index.module-DAnhLbye.js → index.module-Ce5K5GHH.js} +6 -6
- package/dist/browser/{integrateKiosk-DZXpUrOj.js → integrateKiosk-DLY98yHT.js} +4 -4
- package/dist/browser/{is-webview-DpONzc0i.js → is-webview-DYW7jMPo.js} +1 -1
- package/dist/browser/{jsx-runtime-CaS3omHd.js → jsx-runtime-Cn7VZCRr.js} +4 -4
- package/dist/browser/{lib-BiZuekek.js → lib-DKxIjoGs.js} +155 -112
- package/dist/browser/{loadImage-CjXrDhKo.js → loadImage-CFRF6nKm.js} +5 -5
- package/dist/browser/{logDeviceInfo-BYL9Ek4m.js → logDeviceInfo-B2xD643p.js} +9 -9
- package/dist/browser/{main-C5obpH9n.js → main-BE7HSdfx.js} +1 -1
- package/dist/browser/{mobx-DUuRiBpm.js → mobx-Dss6V0uv.js} +5 -5
- package/dist/browser/{optional-boolean-editor-vmPQV7dq.js → optional-boolean-editor-BDWvD6R3.js} +4 -4
- package/dist/browser/{optional-enum-editor-CAafO0D2.js → optional-enum-editor-DzJSD274.js} +5 -5
- package/dist/browser/{optional-string-editor-CnDprvv4.js → optional-string-editor-DvQrsAvN.js} +5 -5
- package/dist/browser/{particles.min-Bw-lHwaG.js → particles.min-0GINFlmD.js} +2 -2
- package/dist/browser/{react-DIEnjHSI.js → react-CQIXbbli.js} +5 -5
- package/dist/browser/{react-dom-CK-QaYaJ.js → react-dom-DB3HP1L3.js} +6 -6
- package/dist/browser/{rolldown-runtime-Dfh5_zpq.js → rolldown-runtime-CBbNE2KV.js} +1 -1
- package/dist/browser/select-DkvD6Ont.js +1367 -0
- package/dist/browser/{settings-CkTeZAPn.js → settings-3RnELfMa.js} +3 -3
- package/dist/browser/{settings-item-Bdmu0-LD.js → settings-item-wgFS4pwq.js} +16 -16
- package/dist/browser/{store-C8eFtLML.js → store-Bh1UUDBZ.js} +2883 -2883
- package/dist/browser/{string-editor-CM26hetz.js → string-editor-DIG3V4Iv.js} +5 -5
- package/dist/browser/{text-field-CdM7a_e4.js → text-field-Ce1nLpTL.js} +25 -25
- package/dist/browser/{theme-Byin1YOk.js → theme-DE94e68B.js} +949 -946
- package/dist/browser/{ui-Bso8uSzX.js → ui-DKrc1LYz.js} +11 -11
- package/dist/browser/{useRenderTarget-C16k6iot.js → useRenderTarget-DwEjrRiD.js} +5 -5
- package/dist/esm/components/AutocompleteContainer.d.ts +1 -1
- package/dist/esm/components/Bookmarks.d.ts +1 -1
- package/dist/esm/components/Bookmarks.js +1 -1
- package/dist/esm/components/Booth/Booth.js +1 -1
- package/dist/esm/components/Category.d.ts +1 -1
- package/dist/esm/components/Debug.d.ts +1 -1
- package/dist/esm/components/Debug.js +1 -1
- package/dist/esm/components/ErrorBoundary.d.ts +1 -1
- package/dist/esm/components/ErrorBoundary.js +1 -1
- package/dist/esm/components/Event.js +1 -1
- package/dist/esm/components/Exhibitor.d.ts +1 -1
- package/dist/esm/components/Exhibitor.js +1 -1
- package/dist/esm/components/Filter.d.ts +1 -1
- package/dist/esm/components/Filter.js +1 -1
- package/dist/esm/components/Gallery/GalleryBadges/GalleryBadges.js +1 -1
- package/dist/esm/components/Gallery/GalleryPreLoader.js +1 -1
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Kiosk/SetKiosk/SetKioskComponent.js +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/drawing/config/BoothDrawerBase.js +1 -1
- package/dist/esm/components/Map/drawing/config/BoothShape.js +1 -1
- package/dist/esm/components/Map/drawing/config/TextFitter.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/traffic/UpdateQueue.js +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.js +1 -1
- package/dist/esm/components/Menu.d.ts +1 -1
- package/dist/esm/components/Menu.js +1 -1
- package/dist/esm/components/ModalContainer.d.ts +4 -4
- package/dist/esm/components/RebookingNotesContainer.d.ts +1 -1
- package/dist/esm/components/RebookingRadioGroupContainer.d.ts +1 -1
- package/dist/esm/components/RoutePlanner/RoutePlannerStopItem.js +1 -1
- package/dist/esm/components/Schedule.js +1 -1
- package/dist/esm/components/Search.d.ts +1 -1
- package/dist/esm/components/Search.js +1 -1
- package/dist/esm/components/Toast/ToastContainer.d.ts +1 -1
- package/dist/esm/components/TourPoints.d.ts +1 -1
- package/dist/esm/components/Tours.js +1 -1
- package/dist/esm/components/Visited.d.ts +1 -1
- package/dist/esm/components/WayfindingTemplate.js +1 -1
- package/dist/esm/components/Ws.d.ts +1 -1
- package/dist/esm/floorplan.loader.js +1 -1
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/renderer/HandlerRegistry.js +1 -1
- package/dist/esm/renderer/RendererService.js +1 -1
- package/dist/esm/services/URLFilterManager.js +1 -1
- package/dist/esm/store/BaseFilterStore.js +1 -1
- package/dist/esm/store/BookmarksStore.js +2 -2
- package/dist/esm/store/BoothStore.js +1 -1
- package/dist/esm/store/CategoryFilterStore.js +1 -1
- package/dist/esm/store/CategoryStore.d.ts +1 -1
- package/dist/esm/store/CategoryStore.js +1 -1
- package/dist/esm/store/EventStore.d.ts +2 -2
- package/dist/esm/store/EventStore.js +1 -1
- package/dist/esm/store/ExhibitorStore.d.ts +1 -1
- package/dist/esm/store/ExhibitorStore.js +1 -1
- package/dist/esm/store/FuzzySearchEngineStore.js +1 -1
- package/dist/esm/store/HeatmapStore.d.ts +1 -1
- package/dist/esm/store/HeatmapStore.js +1 -1
- package/dist/esm/store/IntercomStore.js +1 -1
- package/dist/esm/store/LayerStore.js +1 -1
- package/dist/esm/store/MaplibreStore.js +1 -1
- package/dist/esm/store/PoiTypeStore.js +1 -1
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RoutePlannerStore.js +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/SearchStore.d.ts +1 -1
- package/dist/esm/store/SearchStore.js +1 -1
- package/dist/esm/store/SessionsFilterStore.js +1 -1
- package/dist/esm/store/ShortcutRegistry.js +1 -1
- package/dist/esm/store/SpeakerFilterStore.js +1 -1
- package/dist/esm/store/SpeakerStore.d.ts +2 -2
- package/dist/esm/store/SpeakerStore.js +1 -1
- package/dist/esm/store/SubButtonRegistry.js +1 -1
- package/dist/esm/store/ToursStore.js +1 -1
- package/dist/esm/store/UIState.d.ts +2 -2
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/providers/SearchShortcutProvider.js +1 -1
- package/dist/esm/store/providers/SessionsShortcutProvider.js +1 -1
- package/dist/esm/store/providers/SessionsSubButtonProvider.js +1 -1
- package/dist/esm/store/providers/SpeakerShortcutProvider.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsFactory.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsFilters.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsState.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
- package/dist/esm/store/search-buttons/constants.d.ts +8 -8
- package/dist/esm/tools/expofpUrl.d.ts +2 -2
- package/dist/esm/tools/logger.js +1 -1
- package/dist/esm/tools/settings.js +1 -1
- package/dist/esm/ui/Autocomplete/Autocomplete.js +1 -1
- package/dist/esm/ui/EntityItem/EntityItem.js +1 -1
- package/dist/esm/ui/EventBadge/EventBadge.js +1 -1
- package/dist/esm/ui/Share/Share.js +1 -1
- package/dist/esm/utils/dimming.d.ts +1 -1
- package/dist/esm/utils/is-from-designer.d.ts +1 -1
- package/dist/esm/utils/silence-mobx-react-lite-warning.d.ts +1 -0
- package/dist/esm/utils/silence-mobx-react-lite-warning.js +1 -1
- package/package.json +17 -17
- package/dist/browser/prop-types-Bw2U3Pyj.js +0 -57
- package/dist/browser/select-CGbkxHY8.js +0 -1360
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Rect as E}from"@expofp/geometry";import{reaction as W}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as N,FONT_WEIGHT_PRIMARY_EXHIBITOR as U,FONT_WEIGHT_SECONDARY_BOOTH as
|
|
1
|
+
import{Rect as E}from"@expofp/geometry";import{reaction as W}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as N,FONT_WEIGHT_PRIMARY_EXHIBITOR as U,FONT_WEIGHT_SECONDARY_BOOTH as X,FONT_WEIGHT_SECONDARY_EXHIBITOR as V}from"../../../../constants";import p from"../../../../data";import{createShapeDot as Z,createTextDef as G,createTextDefLines as Y,DEFAULT_FONT_LIGHT_URL as $,DEFAULT_FONT_URL as B,getRollValue as k,getRotation as q,updateLinesScale as j,updateRectRotation as J,updateTextDefRotation as K}from"../../../../renderer";import{layersStore as M,uiState as u}from"../../../../store";import{RegularBooth as Q,SpecialBooth as ee}from"../../../../store/BoothStore";import x from"../../../../tools/settings";import{t as v}from"../../../../utils/i18n";import te from"../../../../utils/is-mobile";import ie from"../../../../utils/is-webview";import{isArabicText as se}from"../../../../utils/rtl";import{BoothDrawerBaseWithoutPainter as ne}from"./BoothDrawerBase";import{getFont as _}from"./canvases";let z=x.boothLabelColor;x.EXPO==="tqs2021"&&(z="#000");const b=te||ie,D=r=>r.replace(" ","").substring(0,4).replace(/[0-9]/g,"3").replace(/[A-Z]/gi,"A"),I=document.createElement("canvas").getContext("2d");export default function oe(r,e){if(!(!(e instanceof Q)||e.noLabels))return new BoothLabelDrawer(r,e)}export function getMinZoomFactorForDot(r){return Array.isArray(r)&&r.length>0?Math.max(...r.map(e=>e)):typeof r=="number"?r:-0}export const isDirectionsMode=()=>!!(u.selectedRoute?.from&&u.selectedRoute?.to);export function getFontUrlByWeight(r,e=[],t="normal"){return[...e,{weight:500,url:B,style:"normal"},{weight:300,url:$,style:"normal"}].find(i=>+i.weight===r&&i.style===t)?.url||B}function S(r,e){return Number(getComputedStyle(document.body).getPropertyValue(r))||e}export function getBoothLabelWeights(){return{main:S(N,500),details:S(X,300)}}export function getExhibitorLabelWeights(){return{main:S(U,500),details:S(V,300)}}export function getBadgeFontWeight(){return getExhibitorLabelWeights().details}const F="Details";export class BoothLabelDrawer extends ne{constructor(e,t){if(super(t),this.rendererService=e,this.canvasRect=new E(t.rect.center,t.rect.size,t.rotate),this.paddingScaled=[4,4],this.padding=(t.borderWidth||x.boothBorderWidth)/2,this.topLeftAlignment={horizontal:u.rtl?"right":"left",vertical:"top"},this.centerAlignment={horizontal:"center",vertical:"center"},this.prefixes=b?[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:16,name:F,short:!1}]:[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:12,name:"M",short:!0},{fontSize:14,name:"L",short:!0},{fontSize:18,name:F,short:!1}],t instanceof ee)return;this.exh=p.hideExhibitors?[]:p.onlyFeaturedExhibitors?t.exhibitors.filter(i=>i.featured):t.exhibitors,b&&this.optimizationLevel()>=3&&(this.prefixes=this.prefixes.filter(i=>i.name!=="S")),this.createLines(),this.calculateFontSizeFactors(),this.shapeLabel=G(Y(this.lines,this.booth.labelColor||z,0,this.fontUrls),new E(this.booth.rect.center,this.booth.rect.size,this.booth.rotate),[...this.paddingScaled],{horizontal:"left",vertical:"top"}),this.getShapeDot();const o=i=>{const n=this.lines[1]??[],s=this.fontSizes[1]??[];if(x.EXPO!=="wineparis2026"){const m=this.exh.length?this.topLeftAlignment:n.length?i<s[s.length-1].scaleFactor?this.topLeftAlignment:this.centerAlignment:this.topLeftAlignment;this.shapeLabel.alignment=m}if(!j(this.shapeLabel.lines,i,this.fontSizes,this.booth.name))return;const l=this.paddingScaled[0]*i+this.padding,d=this.paddingScaled[1]*i+this.padding;return this.shapeLabel.padding[0]=l,this.shapeLabel.padding[1]=d,this.shapeLabel},h=i=>{const n=i>=this.minZoomDotVisible&&i<=this.maxZoomDotVisible,s=this.shapeDot.source.width*i,a=this.shapeDot.source.height*i;if(!(!n&&this.shapeDot.hidden))return this.shapeDot.bounds.size={x:s,y:a},this.shapeDot.hidden=!n,this.shapeDot};W(()=>[this.booth.skipDim,u.selectedRoute,M.layersLoaded],()=>{if(!M.layersLoaded)return;const i=isDirectionsMode();this.shapeLabel.dim=i||this.booth.skipDim?!1:void 0,this.shapeDot.dim=i||this.booth.skipDim?!1:void 0,this.rendererService.update(this.shapeLabel,this.shapeDot)}),W(()=>u.mapSettings,({roll:i})=>{k(i)&&this.rendererService.onRoll(`booth-roll-${t.id}`,n=>{const s=q(n,this.shapeLabel.bounds.rotation),{size:a}=this.canvasRect;return s!==void 0&&(this.shapeLabel=K(this.shapeLabel,s),!this.shapeLabel.hidden&&!this.exh.length&&a.x!==a.y&&(this.canvasRect=J(this.canvasRect,s),this.calculateFontSizeFactors(),o(this.rendererService.scale),h(this.rendererService.scale))),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0}),this.rendererService.onPtScale(`booth-label-${t.id}`,o),this.rendererService.onPtScale(`booth-dot-${t.id}`,h)}getShape(){return[this.shapeLabel,this.shapeDot]}getShapeDot(){this.shapeDot=Z(this.canvasRect,this.booth.labelColor||z),this.shapeDot.hidden=!0,this.maxZoomDotVisible=Math.min(this.canvasRect.size.x/this.shapeDot.source.width,this.canvasRect.size.y/this.shapeDot.source.height)}createLines(){const e=this.booth,t=[],o=[],h=b&&this.optimizationLevel()>=3?1:3;if(this.exh.length){const i=e.exhibitors.filter(s=>s.order===0),n=e.exhibitors.filter(s=>s.order);if(i.length>0)t.push(...i.map(s=>s.name));else if(p.onlyFeaturedExhibitors)t.push(...e.exhibitors.filter(s=>s.featured).map(s=>s.name));else if(n.length>0){t.push(...n.map(a=>a.name));const s=e.exhibitors.filter(a=>a.order===void 0);s.length>0&&t.push(v("and {{moreCount}} more",{moreCount:s.length}))}else e.exhibitors.length>h?t.push(`${e.exhibitors.length} ${p.exhibitorTermPlural}`):t.push(...e.exhibitors.map(s=>s.name));o.push(e.title||e.name)}else{const i=!!e.exhibitors.length;t.push(e.title||e.name),e.onHold?o.push(v("On Hold")):e.reserved?o.push(v("Reserved")):i||o.push(...e.exhibitors.map(n=>n.name).sort((n,s)=>n>s?1:-1)),e.size&&o.push(e.size.indexOf("/")>-1?e.size.substring(0,e.size.indexOf("/")).trim():e.size),e.price&&e.price!=="0"&&!u.previewMode&&o.push(e.price)}u.rtl&&t.forEach((i,n)=>{(i.endsWith(".")||i.endsWith("!")||i.endsWith("?"))&&(t[n]=t[n]+"\u200F"),se(i)&&(t[n]=t[n]+" ")}),this.lines=[t,o]}calculateFontSizeFactors(){let[e,t]=this.lines;const o=this.canvasRect,h=[],i=[],n=this.prefixes.slice(0,this.exh.length?this.prefixes.length:this.prefixes.length-1),{main:s,details:a}=this.exh.length?getExhibitorLabelWeights():getBoothLabelWeights();for(const{fontSize:l,short:d}of n){const m=l*devicePixelRatio,R=.9*l*devicePixelRatio,f=_(m,s),T=_(R,a),y=p.hideExhibitorBoothNumber||d;let w,A,L,g;if(this.exh.length)d?t=[]:t=this.lines[1],L=Math.max(...e.map(c=>this.measureText(c,f).width),...t.map(c=>this.measureText(c,T).width)),w=Math.max(...e.map(c=>this.exh.length?this.measureText(D(c),f).width:this.measureText(D(c),f).width+3+3),...t.map(c=>this.measureText(D(c),T).width)),g=m*e.length+R*t.length+devicePixelRatio*(e.length+t.length)+3,A=y?g/e.length:null;else{const c=e[0].replace(/[0-9]/g,"3").replace(/[A-Z]/g,"A"),C=4;L=this.measureText(c,f).width+3+3,g=m+C}const H=o.size.x/(w||L),P=o.size.y/(A||g),O=Math.min(H,P);h.push({scaleFactor:O,value:l}),!y&&i.push({scaleFactor:O,value:.9*l})}if(!this.exh.length){const l=h[h.length-1],d=this.prefixes.find(m=>m.name===F);h.push({scaleFactor:l.scaleFactor/1.8,value:d.fontSize}),i.push({scaleFactor:l.scaleFactor/1.8,value:d.fontSize*(b?1:.9)})}this.fontUrls=[getFontUrlByWeight(s,this.rendererService.fontUrls),getFontUrlByWeight(a,this.rendererService.fontUrls)],this.minZoomDotVisible=getMinZoomFactorForDot(h.map(l=>l.scaleFactor)),this.fontSizes=[h,i]}calcArea(e,t){return Math.floor(Math.max(0,e)*Math.max(0,t)/1e3)}optimizationLevel(){return Math.min(p.viewOptimizationLevel?p.viewOptimizationLevel:Math.floor(this.calcArea(this.canvasRect.size.x,this.canvasRect.size.y)/5e3),3)}measureText(e,t){return I.font=t,I.measureText(e)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class UpdateQueue{queue=[]
|
|
1
|
+
export class UpdateQueue{constructor(){this.queue=[],this.isProcessing=!1,this.rafId=null,this.CHUNK_SIZE=100,this.TIME_BUDGET=4}add(e){this.queue.push(e),this.scheduleProcessing()}scheduleProcessing(){this.isProcessing||this.queue.length===0||(this.isProcessing=!0,this.queue.length<=this.CHUNK_SIZE*2?Promise.resolve().then(()=>this.processMicrotaskQueue()):this.rafId=requestAnimationFrame(e=>{this.processQueue(e)}))}processMicrotaskQueue(){const e=performance.now();let s=0;for(;this.queue.length>0&&s<this.CHUNK_SIZE;){const t=this.queue.shift();try{t()}catch(i){console.warn("UpdateQueue task error:",i)}if(s++,performance.now()-e>this.TIME_BUDGET)break}this.queue.length>0?Promise.resolve().then(()=>this.processMicrotaskQueue()):this.isProcessing=!1}processQueue(e){this.rafId=null;let s=0;for(;this.queue.length>0&&s<this.CHUNK_SIZE;){const t=this.queue.shift();try{t()}catch(i){console.warn("UpdateQueue task error:",i)}if(s++,performance.now()-e>this.TIME_BUDGET)break}this.queue.length>0?this.rafId=requestAnimationFrame(t=>this.processQueue(t)):this.isProcessing=!1}destroy(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.queue=[],this.isProcessing=!1}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{lineIntersection as M}from"@expofp/geometry";import{useCallback as x,useEffect as T,useMemo as _,useRef as P}from"react";import{rectToRenderer as O}from"../../../renderer";import{createCircleCanvas as S,getBounds as b}from"../../../renderer/engine-core/canvases";import{isDefaultScene as U,pickDefaultScene as $}from"../../../renderer/engine-core/defs";import{BUILD_ROUTE_DOTS as K,BUILD_ROUTE_LINES as H}from"./trafficLayers";import{UpdateQueue as B}from"./UpdateQueue";const v=49,C=`hsl(257, 76%, ${v}%)`,Y=`hsl(339.903, 82%, ${v}%)`,J=`hsl(257, 76%, ${Math.round(v*1.82)}%)`,I=4,j=I,R="U",D="R",A="S",N="P";class q{_state=[[]]
|
|
1
|
+
import{lineIntersection as M}from"@expofp/geometry";import{useCallback as x,useEffect as T,useMemo as _,useRef as P}from"react";import{rectToRenderer as O}from"../../../renderer";import{createCircleCanvas as S,getBounds as b}from"../../../renderer/engine-core/canvases";import{isDefaultScene as U,pickDefaultScene as $}from"../../../renderer/engine-core/defs";import{BUILD_ROUTE_DOTS as K,BUILD_ROUTE_LINES as H}from"./trafficLayers";import{UpdateQueue as B}from"./UpdateQueue";const v=49,C=`hsl(257, 76%, ${v}%)`,Y=`hsl(339.903, 82%, ${v}%)`,J=`hsl(257, 76%, ${Math.round(v*1.82)}%)`,I=4,j=I,R="U",D="R",A="S",N="P";class q{constructor(){this._state=[[]],this.index=0,this.pointHashSet=new Set,this.locked=!1,this.storageKey="expofp_build_route_state",this._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
3
|
Apply Smoothing: Press ${D}.
|
|
4
4
|
Apply Simplification: Press ${A}.
|
|
@@ -6,6 +6,6 @@ interface MenuProps {
|
|
|
6
6
|
isGDPR: boolean;
|
|
7
7
|
consent: Consent;
|
|
8
8
|
}
|
|
9
|
-
declare const _default: ({ isGDPR, consent }: MenuProps) => React.JSX.Element;
|
|
10
9
|
export default _default;
|
|
10
|
+
declare function _default({ isGDPR, consent }: MenuProps): React.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as s
|
|
1
|
+
import{Fragment as L,jsx as e,jsxs as s}from"react/jsx-runtime";import{autorun as N}from"mobx";import{useLocalStore as S,useObserver as f}from"mobx-react-lite";import C,{Suspense as x}from"react";import r from"../data";import{getFpSvgJs as D}from"../data/fp-payloads";import t,{uiState as n}from"../store";import E from"../ui/Badge";import{getLocale as T,getLocales as U,t as m}from"../utils/i18n";import d from"../utils/is-iframe";const j=C.lazy(()=>import("./ViewerMenuPanel"));import"./Menu.scss";import"./Menu_custom.scss";import h from"../tools/logger";import g from"../tools/settings";const u=r.logo;h.log("Logo url: ",u),window.setTimeout(function(){const l=new Image;l.onload=()=>{h.log("Logo image loaded")},l.crossOrigin="anonymous",l.src=u},1500);function F({consent:l,isGDPR:c}){const a=S(()=>({logoVisibility:"visible",shown:!1,shownTimeout:void 0,modalOpen:!1,selectedCategoryIds:(n.selectedCategoryFilters||[]).map(o=>Number(o.id)),pendingSelectedIds:(n.selectedCategoryFilters||[]).map(o=>Number(o.id))}));N(()=>{n.menu?(a.shownTimeout=window.setTimeout(()=>a.shown=!0,1),n.list.type==="sessions"&&t.searchStore.selectSearch()):(a.shown=!1,a.shownTimeout&&window.clearTimeout(a.shownTimeout))});function p(o){if(n.kiosk)return o.preventDefault()}function v(o){o.preventDefault(),w(),t.searchStore.selectSearch()}function k(o){o.preventDefault(),t.fp?.onLeaveEvent?.()}function _(o){o.preventDefault(),t.clickLanguage()}return f(()=>{if(!n.menu)return null;const o=t.boothStore.booths.filter(i=>i.bookmarked).map(i=>i.name),b=D().__fpSettings?.fpVer?`https://d2.expofp.com/export/v2/${g.EXPO}/pdf`:`https://api.expofp.com/service/convert/${g.EXPO}/pdf`,y=n.viewerMode&&typeof t.fp?.onLeaveEvent=="function";return s("div",{className:`menu ${a.shown?"shown":""}`,children:[d?e("div",{className:"menu__cover -empty"}):e("div",{className:"menu__cover",children:e("a",{href:r.homeUrl,target:"_blank",rel:"noopener noreferrer",onClick:p,children:e("img",{src:u,onError:()=>a.logoVisibility="hidden",style:{visibility:a.logoVisibility},alt:"",crossOrigin:"anonymous"})})}),s("div",{className:"menu__content",children:[n.viewerMode&&e(x,{fallback:null,children:e(j,{})}),!n.viewerMode&&e("a",{href:"/#",onClick:v,className:"menu__item",children:m("Search")}),!r.hideEventHomeLink&&!n.kiosk&&!d&&!!r.homeUrl&&s("a",{href:r.homeUrl,target:"_blank",className:"menu__item",rel:"noopener noreferrer",children:[m("Event Home").replace(/ /g,"\xA0"),e("i",{className:"icon-link-external"})]}),!r.hideRegisterToAttendLink&&!n.kiosk&&!d&&!!r.registerUrl&&s("a",{href:r.registerUrl,target:"_blank",className:"menu__item",rel:"noopener noreferrer",children:[m("Register to Attend").replace(/ /g,"\xA0"),e("i",{className:"icon-link-external"})]}),!n.hideLanguage&&!r.hideLanguage&&!r.hideLanguageLink&&s("a",{href:"?language",onClick:_,className:"menu__item -language",children:[s("span",{children:[m("Language")," "]}),s("span",{className:"menu__icons",children:[e(E,{variant:"gray",size:"md",noMargins:!0,rounded:!0,children:U().find(i=>i.id===T())?.name}),e("i",{className:"icon-chevron-right"})]})]}),!r.hideDownloadPdfLink&&!n.kiosk&&e("a",{className:"menu__item -pdf",target:"_blank",rel:"noopener noreferrer",href:`${b}/?exhibitors=true&bookmarks=${o.join(",")}&layers=${(t.layerStore.layers.length>=t.layerStore.visible.length?t.layerStore.visible.map(i=>i.name).join(","):"").replace(/&/g,"%26")}`,children:m("Download PDF")}),l==="ask"&&c&&e("a",{href:"/#",className:"menu__item -cookie-consent",onClick:i=>{i.preventDefault(),n.hideCookieConsent=!1},children:m("Review Cookie Consent")}),y&&e("div",{className:"menu__item-leave",children:e("a",{href:"/#",className:"menu__item -leave-event menu__leave-link",onClick:k,children:m("Select another event")})})]})]})});function w(){n.menu=!1}}export default({isGDPR:l,consent:c})=>f(()=>e(L,{children:n.menu?e(F,{isGDPR:l,consent:c}):null}));
|
|
@@ -11,8 +11,8 @@ declare const ModalContainer: import("react").FunctionComponent<Omit<{
|
|
|
11
11
|
renderTarget?: HTMLElement | null;
|
|
12
12
|
footerLeft?: {
|
|
13
13
|
label: string;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
variant?: import(".").ButtonVariant;
|
|
15
|
+
disabled?: boolean;
|
|
16
16
|
onClick: () => void;
|
|
17
17
|
}[];
|
|
18
18
|
footerRight?: import("../ui/Modal").ModalButton[];
|
|
@@ -30,8 +30,8 @@ declare const ModalContainer: import("react").FunctionComponent<Omit<{
|
|
|
30
30
|
renderTarget?: HTMLElement | null;
|
|
31
31
|
footerLeft?: {
|
|
32
32
|
label: string;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
variant?: import(".").ButtonVariant;
|
|
34
|
+
disabled?: boolean;
|
|
35
35
|
onClick: () => void;
|
|
36
36
|
}[];
|
|
37
37
|
footerRight?: import("../ui/Modal").ModalButton[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type RebookingNotesProps } from '../ui/RebookingNotes';
|
|
2
|
-
declare const RebookingNotesContainer: import("react").FunctionComponent<Omit<RebookingNotesProps, "noteLabel" | "
|
|
2
|
+
declare const RebookingNotesContainer: import("react").FunctionComponent<Omit<RebookingNotesProps, "noteLabel" | "saveButtonAriaLabel" | "saveButtonLabel">>;
|
|
3
3
|
export default RebookingNotesContainer;
|
|
4
4
|
//# sourceMappingURL=RebookingNotesContainer.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RebookingRadioGroupProps } from '../ui/RebookingRadioGroup';
|
|
2
|
-
declare const RebookingRadioGroupContainer: import("react").FunctionComponent<Omit<RebookingRadioGroupProps, "
|
|
2
|
+
declare const RebookingRadioGroupContainer: import("react").FunctionComponent<Omit<RebookingRadioGroupProps, "options" | "title"> & {
|
|
3
3
|
showTitle?: boolean;
|
|
4
4
|
}>;
|
|
5
5
|
export default RebookingRadioGroupContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as x,jsx as o,jsxs as l}from"react/jsx-runtime";import _ from"classnames";import r from"../../store";import u from"../../ui/Badge";const N={exhibitor:"icon-exhibitor-solid",event:"icon-event-solid",booth:"icon-booth-solid"},p=s=>/^\d+$/.test(s),y=({item:s,isLast:m})=>{const{type:n,entity:c,booth:t}=s,f=N[n]||"icon-booth-solid",h=c.name??"",i=(n==="exhibitor"||n==="event")&&t?t.name:null,e=t?.layer?.shortName??null,b=i||e,v=[h,i,e?p(e)?`Level ${e}`:e:null].filter(Boolean).join(", "),d=()=>{n==="exhibitor"?r.selectExhibitor(c):t&&r.selectBooth(t),r.showMap()};return l("div",{className:_("efp-planner__stop",{"is-last":m}),children:[o("div",{className:"efp-planner__stop-timeline",children:o("div",{className:"efp-planner__stop-icon",style:{"--dot-color":`var(--color-${n})`},children:o("i",{className:f})})}),l("div",{className:"efp-planner__stop-content",role:"button",tabIndex:0,"aria-label":v,onClick:d,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),d())},children:[o("strong",{children:h}),b&&l(u,{variant:"location",size:"xs",inline:!0,noMargins:!0,children:[i&&o("span",{children:i}),e&&l("span",{children:[p(e)&&o(x,{children:"Level\xA0"}),e]})]})]})]})};export default y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n,jsxs as i
|
|
1
|
+
import{Fragment as C,jsx as n,jsxs as i}from"react/jsx-runtime";import"./Schedule.scss";import D from"classnames";import h from"dateformat";import{observer as H}from"mobx-react-lite";import{useEffect as I,useState as B}from"react";import v from"../store";import{t as G}from"../utils/i18n";import O from"../utils/sanitizeHtml";import{EventBadgeContainer as A}from"./";import z from"./ShowMoreButtonContainer";function W(l,d){const m=new Date;return l<=m&&m<=d}function q(l){const d=new Date;return new Date(l)<d}const J=H(({events:l=[],descriptionMaxLength:d=200,showBooths:m=!1,isSessions:_=!1,onEventClick:p})=>{const[k,w]=B({}),g=new Date,S=l.filter(e=>(e.endDate?new Date(e.endDate):new Date(e.startDate))>g),j=l.filter(e=>(e.endDate?new Date(e.endDate):new Date(e.startDate))<=g),f=S.reduce((e,t)=>{const[s]=t.startDate.split("T");return e[s]?e[s].push(t):e[s]=[t],e},{}),u=j.reduce((e,t)=>{const[s]=t.startDate.split("T");return e[s]?e[s].push(t):e[s]=[t],e},{});I(()=>{const e={};for(const t in f)e[t]=f[t].map(()=>({showFullDescription:!1}));for(const t in u)e[t]=u[t].map(()=>({showFullDescription:!1}));w(e)},[l.map(e=>e.id).join(",")]);const E=(e,t,s)=>{e.preventDefault(),e.stopPropagation(),w(a=>{const o={...a};return Array.isArray(o[t])||(o[t]=[]),o[t][s]||(o[t][s]={showFullDescription:!1}),o[t][s].showFullDescription=!o[t][s].showFullDescription,o})},P=(e,t)=>e.length>d&&!t?e.slice(0,d)+"...":e,F=e=>{const t=v.sessionsFilterStore.state.filters.use24hFormat.value,s=new Date(e);return h(s,t?"HH:MM":"h:MMtt")},$=e=>{const[t,s,a]=e.split("-"),o=new Date(parseInt(t),parseInt(s)-1,parseInt(a));return{day:a,month:h(o,"mmm"),weekday:h(o,"ddd"),full:h(o,"dddd, mmmm d")}},M=({children:e,link:t,current:s,ended:a,event:o})=>{const r=c=>{p&&(c.preventDefault(),p(o))};return t?n("a",{href:t,className:D("efp-schedule__event",s,a),target:"_blank",rel:"noopener noreferrer",onClick:r,children:e}):n("div",{className:D("efp-schedule__event",{ended:a}),onClick:r,children:e})},y=(e,t=!1)=>Object.entries(e).map(([s,a])=>{const o=$(s);return i("div",{className:"efp-schedule__item",children:[n("div",{className:"efp-schedule__date","aria-label":`Date: ${o.full}`,children:i("div",{className:"efp-schedule__date-sticky",children:[n("div",{children:o.day}),n("div",{children:o.month}),n("div",{children:o.weekday})]})}),n("div",{className:"efp-schedule__events",role:"list",children:a.map((r,c)=>{const N=r.boothId?v.boothStore.boothById.get(Number(r.boothId)):null,b=k[s]?.[c]?.showFullDescription??!1;return n("div",{role:"listitem","data-event-id":r.id,onClick:()=>p?.(r),style:{cursor:p?"pointer":"default"},children:i(M,{link:"",ended:r.isEnded||q(r.endDate||r.startDate),current:W(r.startDate,r.endDate),event:r,children:[i("span",{children:[F(r.startDate),r.endDate?` - ${F(r.endDate)}`:null]}),i("strong",{children:[r.name,n(A,{event:r})]}),n("div",{className:"efp-schedule__event-booth-and-tracks",children:N&&m&&n("div",{className:"efp-schedule__event-booth",children:n("div",{children:N.name})})}),r.logoFile&&n("div",{className:"efp-schedule__event-logo",children:n("img",{src:r.logoFile,alt:r.name,crossOrigin:"anonymous"})}),r.description&&!_&&i("div",{className:"efp-schedule__event-desc",children:[n("div",{id:`event-desc-${s}-${c}`,dangerouslySetInnerHTML:{__html:O(P(r.description,b))}}),r.description.length>d&&n(z,{expanded:b,onClick:T=>E(T,s,c),"aria-controls":`event-desc-${s}-${c}`})]})]})},r.id)})})]},s)});return i("div",{className:D("efp-schedule",{"is-sessions":_}),children:[y(f),Object.keys(u).length>0&&i(C,{children:[n("div",{className:"efp-schedule__past-events-header",children:G("Past Sessions")}),y(u,!0)]})]})});export default J;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fragment as s,jsx as t,jsxs as a}from"react/jsx-runtime";import"./Search.scss";import{useLocalStore as c,useObserver as o}from"mobx-react-lite";import{useCallback as p,useEffect as d,useRef as f}from"react";import l,{uiState as e}from"../store";import h from"./EntityList";import{ShortcutsToolbar as m}from"./Shortcuts";function n(){const i=f(),r=c(()=>({updateOverlayContent:null,get text(){return e.list.type==="search"||e.list.type==="exhibitors"?e.list.text:""},get showClose(){return!!this.text},get backMode(){return this.text?"back":"menu"}}));d(()=>{l.fuzzySearchEngineStore.loadEngine()},[]);const u=p(()=>{r.updateOverlayContent&&r.updateOverlayContent()},[r.updateOverlayContent]);return o(()=>a(s,{children:[t(m,{interfaceId:"search",showFiltersButton:!1}),t(h,{updateScroll:u,updatedScrollableRef:i})]}))}export default()=>o(()=>a(s,{children:[!e.details&&!e.menu&&e.list.type==="exhibitors"?t(n,{}):null,!e.details&&!e.menu&&e.list.type==="search"&&(l.fp.alwaysShowSidebar||e.heatmap||e.searchFocused||e.list.text.length>0||e.searchClearMode)?t(n,{}):null]}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as r,jsxs as a}from"react/jsx-runtime";import"./Tours.scss";import T from"fuse.js";import{useObserver as v}from"mobx-react-lite";import{observer as l}from"mobx-react-lite";import{useMemo as x}from"react";import e,{uiState as d}from"../store";import{t as n}from"../utils/i18n";import{ToursList as N}from"./";const S=l(()=>{const o=e.toursStore.tourItems,m=e.toursStore.hasTours,p=e.toursStore.currentExpo,c=e.toursStore.toursLoadError,i=x(()=>{let t=o;const s=e.searchStore.searchText;if(s){const u={keys:["name"],threshold:.3,ignoreLocation:!0,includeScore:!0};t=new T(t,u).search(s).map(h=>h.item)}return t},[o,e.searchStore.searchText]),f=(t,s,u)=>{e.toursStore.launchTour(t,s,u)};return v(()=>c?r("div",{className:"efp-tours-content",children:r("div",{className:"efp-tours-empty",children:a("p",{children:[n("Error loading Guided Tours"),": ",c]})})}):m?i.length===0?r("div",{className:"efp-tours-content",children:r("div",{className:"efp-tours-empty",children:r("p",{children:n("No Guided Tours found matching your search")})})}):r("div",{className:"efp-tours-content",children:r(N,{tours:i,onTourClick:f})}):r("div",{className:"efp-tours-content",children:r("div",{className:"efp-tours-empty",children:a("p",{children:[n("No Guided Tours available for")," ",p]})})}))}),y=l(o=>d.list.type!=="tours"||d.details?null:r(S,{...o}));export default y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i
|
|
1
|
+
import{Fragment as R,jsx as e,jsxs as i}from"react/jsx-runtime";import"./WayfindingTemplate.scss";import M from"classnames";import Z from"../ui/ToggleSwitch";import{t as l}from"../utils/i18n";import s from"./AutocompleteContainer";import B from"./RouteQR";import E from"./WayfindingFloorSelectorContainer";import j from"./WayInformation";const D=({options:n=[],fromValue:d,toValue:r,showForm:o=!0,showAccessible:c=!1,showInfo:f=!1,routeFound:m=!1,infoItems:h=[],infoAccessible:a,floors:t=[],currentFloor:p,routeUrl:C,isKiosk:g,onChangeFrom:w,onChangeTo:v,onSwitch:y,onClickInfo:_,onClickFloor:u,onAccessibleCheck:F,showDetailsIcon:N,onDetailsIconClick:x})=>i("div",{className:M("efp-wayfinding",{isCollapsed:!o}),children:[o&&i("div",{className:"efp-wayfinding__top",children:[i("div",{className:"efp-wayfindingForm",children:[i("div",{className:"efp-wayfindingForm__icons",children:[e("div",{className:"efp-wayfindingForm__from",children:i("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M18 9C18 13.9706 13.9706 18 9 18C4.02944 18 0 13.9706 0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9Z",fill:"white"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 13.375C11.4162 13.375 13.375 11.4162 13.375 9C13.375 6.58375 11.4162 4.625 9 4.625C6.58375 4.625 4.625 6.58375 4.625 9C4.625 11.4162 6.58375 13.375 9 13.375ZM9 16C12.866 16 16 12.866 16 9C16 5.13401 12.866 2 9 2C5.13401 2 2 5.13401 2 9C2 12.866 5.13401 16 9 16Z",fill:"#30AFEB"})]})}),e("div",{className:"efp-wayfindingForm__to",children:i("svg",{width:"18",height:"25",viewBox:"0 0 18 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 24.1571L10.5475 22.267C11.0023 21.7114 11.4571 21.1656 11.9041 20.6291C13.2939 18.9611 14.6088 17.3829 15.6182 15.8814C16.988 13.8436 18 11.668 18 9.125C18 4.09562 14.0267 0 9 0C3.97332 0 0 4.09562 0 9.125C0 11.668 1.01202 13.8436 2.38182 15.8814C3.39116 17.3829 4.70613 18.9611 6.09588 20.6291C6.54291 21.1656 6.99767 21.7114 7.45249 22.267L9 24.1571Z",fill:"white"}),e("path",{d:"M9 2C5.11111 2 2 5.16667 2 9.125C2 13.0833 5.11111 16.25 9 21C12.8889 16.25 16 13.0833 16 9.125C16 5.16667 12.8889 2 9 2ZM9 6.75C10.2911 6.75 11.3333 7.81083 11.3333 9.125C11.3333 10.4392 10.2911 11.5 9 11.5C7.70889 11.5 6.66667 10.4392 6.66667 9.125C6.66667 7.81083 7.70889 6.75 9 6.75Z",fill:"#FF9E2C"})]})}),e("div",{className:"efp-wayfindingForm__dots",children:i("svg",{width:"4",height:"18",viewBox:"0 0 4 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("circle",{cx:"2",cy:"2",r:"2",fill:"#DCDFE9"}),e("circle",{cx:"2",cy:"16",r:"2",fill:"#DCDFE9"})]})})]}),i("div",{className:"efp-wayfindingForm__controls",children:[e("div",{style:{marginBottom:10},children:e(s,{placeholder:l("Choose starting point"),options:n,value:d,onChange:w})}),e("div",{children:e(s,{placeholder:l("Choose destination point"),options:n,value:r,onChange:v})})]}),i("div",{className:"efp-wayfindingForm__actions",children:[e("button",{type:"button",className:"efp-wayfindingForm__switch",onClick:y}),N&&e("button",{type:"button",className:"efp-wayfindingForm__details",onClick:x})]})]}),c&&e("div",{className:"efp-wayfindingForm__accessible",children:e(Z,{name:"onlyAccessible",label:l("Accessible"),value:a,onChange:b=>F(b)})})]}),t.length>1&&e(E,{floors:t,value:p,onSelect:u}),f&&e("div",{className:"efp-wayfindingInfo",children:m?i(R,{children:[e(j,{items:h,accessible:a,onClick:_}),g&&e(B,{url:C})]}):e("div",{className:"efp-wayfindingError",children:l("Route not found")})})]});export default D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getConfig as v}from"@expofp/config";import{PREVIEW_MODE_ATTRIBUTE as
|
|
1
|
+
import{getConfig as v}from"@expofp/config";import{PREVIEW_MODE_ATTRIBUTE as T}from"./constants";import c from"./tools/base-runtime-url";import{loadCss as x,loadFont as m}from"./tools/loaders";import R from"./tools/logger";import{initSentry as j}from"./tools/sentry";import{heatmapEnabled as D}from"./utils/heatmap-enabled";import{initI18n as F}from"./utils/i18n";import A from"./utils/is-debug";import V from"./utils/is-localhost";import _ from"./utils/is-webview";import{loadCustomCss as z}from"./utils/loadCustomCss";import{loadIcons as G}from"./utils/loadIcons";import E from"./utils/use-shadow";function e(){throw new Error("FloorPlan not ready")}export default class H{get ready(){return this._ready}get previewMode(){return v().previewMode||this.element.hasAttribute(T)}get allowConsent(){return this.consent==="ask"?void 0:this.consent==="granted"}selectBooth(t){e()}selectExhibitor(t){e()}selectRoute(t,i){e()}getOptimizedRoutes(t){e()}selectCurrentPosition(t,i,s){e()}setBookmarks(t){e()}setEntitiesBookmarks(t){e()}setEntitiesVisited(t){e()}setMarkers(t){e()}updateLayerVisibility(t,i){e()}getCenterCoordinates(){e()}applyParameters(t){e()}exhibitorsList(){e()}boothsList(){e()}categoriesList(){e()}selectCategory(t){e()}select(t){e()}showList(t){e()}selectTour(t){e()}openPlanner(t){e()}startBuildRoute(){e()}getVisibility(){e()}setVisibility(t){e()}findLocation(){e()}zoomIn(){e()}zoomOut(){e()}zoomTo(t,i){e()}switchView(){e()}setCamera(t){e()}getCamera(){e()}fitBounds(){e()}getBounds(t){e()}getBoothRect(t){e()}convertToGeo(t,i){e()}getGeoConfig(){e()}unstable_destroy(){e()}highlightExhibitors(t){e()}highlightBooths(t){e()}onCurrentPositionChanged(t){e()}search(t){e()}getFloors(){e()}onFloorActivated(t){e()}activateFloor(t){e()}showPathway(t,i){e()}showPathwayOnly(t,i){e()}hidePathways(){e()}showSearch(){e()}changeLanguage(t){e()}isGpsTrackingEnabled(){e()}setGpsTrackingEnabled(t){e()}deselectCurrentPosition(){e()}deselectRoute(){e()}reset(){e()}selectAccessibleRoute(t){e()}constructor(t,i){this.icons=new Map,this.enableRotation=!0,this.alwaysShowSidebar=!1;const s=v();if(this.noOverlay=!!s.noOverlay,this.offHistory=!!s.offHistory,this.ignoreQuery=s.ignoreQuery,this.consent=s.consent,this.consent==="ask"&&(_?this.consent="granted":V&&!A&&(this.consent="denied")),this.onBoothClick=t.onBoothClick,this.onBookmarkClick=t.onBookmarkClick,this.onVisitedClick=t.onVisitedClick,this.onCategoryClick=t.onCategoryClick,this.onDetails=t.onDetails,this.onExhibitorCustomButtonClick=t.onExhibitorCustomButtonClick,this.onGetCoordsClick=t.onGetCoordsClick,this.onMarkerClick=t.onMarkerClick,this.onFpConfigured=t.onFpConfigured,this.onDirection=t.onDirection,this.onInit=t.onInit,this.onCurrentPositionChanged=t.onCurrentPositionChanged,this.onFloorActivated=t.onFloorActivated,this.onLeaveEvent=t.onLeaveEvent,this.viewerMode=!!s.viewerMode,this.disableRuntimeAlerts=s.disableRuntimeAlerts,this.maplibre=s.maplibre,window.__efpMaplibre=s.maplibre,this._ready=new Promise((d,a)=>{this.resolveReady=d}),this.element=i,i.__expofp)throw new Error("Element already in use");i.__expofp=this;const y=s.expo;j({eventId:y||"",isWebview:_}),this.eventId=y,window.__efpEvent=y,window.__efpElement=i;const h=document.createElement("div");h.style.height="100%",h.style.width="100%",i.appendChild(h);let n;if(E){n=h.attachShadow({mode:"open"});const d=n,a=document;d.createElement=(...r)=>a.createElement(...r),d.createElementNS=(...r)=>a.createElementNS(...r),d.createTextNode=(...r)=>a.createTextNode(...r)}else n=h;const f=document.createElement("div");f.style.height="100%",f.style.width="100%",n.appendChild(f),E&&Object.defineProperty(f,"ownerDocument",{value:n}),window.__efpShadowDOMStyleParent=E?n:void 0,this.renderTarget=f,R.log("Instantiating ExpoFP floorplan",i,y);let b=0;this.efpStyleLoadHandler=function(d){const a=window.__efpStyleElements;for(;b<a.length;){const r=a[b];n.appendChild(r),b++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler);const g=this;(async function(){const a=v();await F();const r=new URLSearchParams(window.location.search);let p,w;if(a?.trackerUrl)try{p=new URL(a.trackerUrl),w=p.searchParams.get("expoId")}catch(o){console.error(o)}const I=async o=>{if(!p||!w)return Promise.reject(new Error("trackerUrl or expoId is missing"));const l=new URL(o.dataUrl,p.origin),u=await fetch(l.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:w,token:decodeURIComponent(r.get("t"))})});let C=[];u.ok&&(C=(await u.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:C}},k=a?.heatmap??{},S=D(k)||r.get("heatmap")==="true",O=k.variant==="yah"||r.get("type")==="yah",L=k.kiosk===!0||r.get("subtype")==="kiosk";if(S)try{if(O)L?await I({dataUrl:"/api/kiosks/list/viewer",dataMapper:o=>({...o,id:o.key,name:`Kiosk ${o.key}`})}):await I({dataUrl:"/api/v1/you-are-here/qr-code/list/viewer",dataMapper:(o,l)=>({...o,name:`QR Code #${l+1}`})});else{const o=new URL("/api/fp-stats/get",p.origin);o.searchParams.set("expoId",w),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(r.get("t")));const l=new URL("api/fp-stats/get",p.origin);l.searchParams.set("expoId",w),l.searchParams.set("type","exview"),l.searchParams.set("t",decodeURIComponent(r.get("t")));const[u,C]=await Promise.all([fetch(o.toString()),fetch(l.toString())]),[P,M]=await Promise.all([u.json(),C.json()]);window.__heatmapData={booths:P,exhibitors:M}}}catch(o){console.error("Heatmap: Initialization error",o)}const U=[x(c+"vendor/sanitize-css/sanitize.css",n),x(c+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",n),m("Oswald",c+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),m("Oswald",c+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),m("Inter",c+"fonts/inter-400.woff2",{weight:400}),m("Inter",c+"fonts/inter-500.woff2",{weight:500}),m("Inter",c+"fonts/inter-600.woff2",{weight:600}),m("efp-symbols",c+"fonts/efp-symbols.woff",{weight:400}),z(a,n),G(g.icons)];await Promise.all(U),g.enableRotation=a?.enableRotation??!1,g.alwaysShowSidebar=a?.alwaysShowSidebar??!1,R.log("Data loaded"),window.__storeInitAllowed=!0;const{default:B}=await import("./floorplan.ready");for(document.querySelectorAll(".expofp-floorplan-loader").forEach(o=>o.remove());i.firstChild&&i.firstChild!==h;)i.removeChild(i.firstChild);Object.setPrototypeOf(g,B.prototype).init()})()}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as x,Fragment as A,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import q from"./data";import{fpGeo as b}from"./data/fpGeo";import N from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as U,POISelectorsSchema as w,ZoomToOptionsSchema as P}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as H,applyParameters as Y,applyPathway as _,initUrlRouting as D}from"./services/url-dispatch";import{destroyUrlSync as W}from"./services/url-sync";import r from"./store";import{destroyUiHandlers as X}from"./store/init/init-ui";import{findBooth as S,Route as v,separateExternalIds as B}from"./store/RouteStore";import{destroyGtag as K,GaEventActions as k,sendEventToGa as F,setConsentSettings as Q}from"./tools/gtag";import Z from"./tools/report-error";import{resetGlobalVariables as J}from"./tools/reset";import ee from"./tools/track-event";import{cameraToMapSettings as te,mapSettingsToCamera as re}from"./utils/camera-map-settings";import{getStorage as C}from"./utils/entity-storage";import{convertLocalToGps as oe,isValidPointCoords as y}from"./utils/gps";import{getLocales as ie,hasLocale as se,setLocale as ne}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ae extends N{root;init(){H(),this.ignoreQuery||D(this.offHistory),ee("load"),r.fp=this,Q(this.consent),F(k.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(k.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=O(q);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));r.selectBooth(t)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(i=>typeof e=="string"?i.name===e||i.externalId===e:e.includes(i.name)||e.includes(i.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(i=>i.booths.map(s=>s.layer)),{description:n}=o.reduce((i,s)=>(i.freq[s.description]=(i.freq[s.description]||0)+1,i.freq[s.description]>i.maxCount&&(i.maxCount=i.freq[s.description],i.mostFrequent=s),i),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(i=>i.externalId).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:o}=B(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const n=o.shift(),i=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!n||!i){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}r.routeStore.selectRoute(new v(m(n),m(i),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of t){const i=n.layer?.name??"",s=o.get(i);s?s.push(n):o.set(i,[n])}return Array.from(o.values()).map(n=>({waypoints:M(n.map(i=>[i.name,{x:i.rect.center.x,y:i.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const n=y(e.x)&&y(e.y),i=y(e.lng)&&y(e.lat);!n&&!i&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const o=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);o&&(o.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],o=e.find(s=>!s.type||!t.includes(s.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=C("bookmarked"),i={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceBookmarked(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceBookmarked(s)},speaker:{existingIds:new Set(n.speakers||[]),finder:s=>r.speakerStore.speakers.find(h=>h.name===s||h.externalId===s||h.slug===s),replacer:s=>r.speakerStore.replaceBookmarked(s)},booth:{existingIds:new Set(n.booths||[]),finder:s=>{const h=r.boothStore.findBooth(s);return h?.exhibitors.length===0?h:void 0},replacer:s=>r.boothStore.replaceBookmarked(s)}};e.forEach(s=>{const h=i[s.type],c=s.name||s.externalId||"",l=h.finder(c);l?s.bookmarked?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(i).forEach(s=>{s.replacer(Array.from(s.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],o=e.find(s=>!s.type||!t.includes(s.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=C("visited"),i={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceVisited(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceVisited(s)}};e.forEach(s=>{const h=i[s.type],c=s.name||s.externalId||"",l=h.finder(c);l?s.visited?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(i).forEach(s=>{s.replacer(Array.from(s.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),o=r.categoryStore.categories.find(({name:n,slug:i})=>n?.toLowerCase()===t||i?.toLowerCase()===t);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(o)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,o=t?.toLowerCase(),n=r.boothStore.booths.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o||l.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(n){setTimeout(()=>r.selectBooth(n),250);return}const i=r.eventStore.eventItems.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(i){r.selectEventItem(i,!0);return}const s=r.exhibitorStore.exhibitors.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(s){setTimeout(()=>r.clickExhibitor(s),250);return}const h=r.categoryStore.categories.find(l=>l.slug===t);if(h){r.selectCategory(h);return}const c=r.speakerStore.findBySlug(t);if(c){r.selectSpeaker(c,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},o=t[e];if(!o){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}o()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),Y(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(te(t.data))}getCamera(){return re(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=w.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=P.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const i=this.getBounds(e);i&&this.fitBounds(i,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=w.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(i=>{let s;i.externalId?s=r.boothStore.boothByExternalId.get(i.externalId):i.name&&(s=r.boothStore.boothByName.get(i.name.toLowerCase())),s?.rect&&o.push(s.rect)}),e.exhibitors?.forEach(i=>{let s;i.externalId?s=r.exhibitorStore.exhibitorByExternalId.get(i.externalId):i.name&&(s=r.exhibitorStore.exhibitorByName.get(i.name.toLowerCase())),s?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const n=E.fromUnion(...o);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=U.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=P.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const i=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?i.expand(t.padding):i}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?u.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return oe(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}unstable_destroy(){let e=window.__efpElement.firstChild;J(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",Z),r.maplibreStore.dispose(),W(),X(),K(),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const t=this.getFloors();if(e.name){const o=t.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=t.find(i=>i.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const{boothExternalIds:o,exhibitorExternalIds:n}=t?.length?B(t):{boothExternalIds:[],exhibitorExternalIds:[]};_({pathwayId:e,boothIds:o,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),i=o?.rect||o?.viewbox?o:n;if(i?.rect||i?.viewbox){const s=i.viewbox??i.rect;r.uiState.moveToRect=s.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!se(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${ie().map(o=>o.id).join(",")}`,"EFP001300");return}ne(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let L=0;function a(f,e,t){const o=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let i="https://js-sdk.expofp.com/api/packages";if(t&&(i+=`#error-${t}`),console.error(`${o} ${n} ${i}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:T(A,{children:[n," ",x("a",{href:i,target:"_blank",rel:"noreferrer",children:i})]})}),clearTimeout(L);const s=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(c=>setTimeout(c,s/2)),h())};h()},s)}class u{x1;y1;x2;y2;get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,o,n){if(e>o){const i=e;e=o,o=i}if(t>n){const i=t;t=n,n=i}this.x1=e,this.y1=t,this.x2=o,this.y2=n}static fromBox(e){return new u(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,n){return new u(e-o/2,t-n/2,e+o/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),i=Math.min(this.y2,e.y2);return o>=t&&i>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),i=Math.min(this.y2,e.y2);return o>=t&&i>=n?new u(t,n,o,i):new u(0,0,0,0)}getRotated90(){return u.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new u(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:u.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new u(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new u(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
|
|
1
|
+
import{Fragment as A,jsx as x,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import q from"./data";import{fpGeo as b}from"./data/fpGeo";import N from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as U,POISelectorsSchema as w,ZoomToOptionsSchema as P}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as H,applyParameters as Y,applyPathway as _,initUrlRouting as D}from"./services/url-dispatch";import{destroyUrlSync as W}from"./services/url-sync";import r from"./store";import{destroyUiHandlers as X}from"./store/init/init-ui";import{findBooth as S,Route as v,separateExternalIds as B}from"./store/RouteStore";import{destroyGtag as K,GaEventActions as k,sendEventToGa as F,setConsentSettings as Q}from"./tools/gtag";import Z from"./tools/report-error";import{resetGlobalVariables as J}from"./tools/reset";import ee from"./tools/track-event";import{cameraToMapSettings as te,mapSettingsToCamera as re}from"./utils/camera-map-settings";import{getStorage as C}from"./utils/entity-storage";import{convertLocalToGps as oe,isValidPointCoords as y}from"./utils/gps";import{getLocales as ie,hasLocale as se,setLocale as ne}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ae extends N{init(){H(),this.ignoreQuery||D(this.offHistory),ee("load"),r.fp=this,Q(this.consent),F(k.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(k.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=O(q);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));r.selectBooth(t)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(i=>typeof e=="string"?i.name===e||i.externalId===e:e.includes(i.name)||e.includes(i.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(i=>i.booths.map(s=>s.layer)),{description:n}=o.reduce((i,s)=>(i.freq[s.description]=(i.freq[s.description]||0)+1,i.freq[s.description]>i.maxCount&&(i.maxCount=i.freq[s.description],i.mostFrequent=s),i),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(i=>i.externalId).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:o}=B(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const n=o.shift(),i=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!n||!i){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}r.routeStore.selectRoute(new v(m(n),m(i),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of t){const i=n.layer?.name??"",s=o.get(i);s?s.push(n):o.set(i,[n])}return Array.from(o.values()).map(n=>({waypoints:M(n.map(i=>[i.name,{x:i.rect.center.x,y:i.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const n=y(e.x)&&y(e.y),i=y(e.lng)&&y(e.lat);!n&&!i&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const o=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);o&&(o.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],o=e.find(s=>!s.type||!t.includes(s.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=C("bookmarked"),i={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceBookmarked(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceBookmarked(s)},speaker:{existingIds:new Set(n.speakers||[]),finder:s=>r.speakerStore.speakers.find(h=>h.name===s||h.externalId===s||h.slug===s),replacer:s=>r.speakerStore.replaceBookmarked(s)},booth:{existingIds:new Set(n.booths||[]),finder:s=>{const h=r.boothStore.findBooth(s);return h?.exhibitors.length===0?h:void 0},replacer:s=>r.boothStore.replaceBookmarked(s)}};e.forEach(s=>{const h=i[s.type],c=s.name||s.externalId||"",l=h.finder(c);l?s.bookmarked?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(i).forEach(s=>{s.replacer(Array.from(s.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],o=e.find(s=>!s.type||!t.includes(s.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=C("visited"),i={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceVisited(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceVisited(s)}};e.forEach(s=>{const h=i[s.type],c=s.name||s.externalId||"",l=h.finder(c);l?s.visited?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(i).forEach(s=>{s.replacer(Array.from(s.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),o=r.categoryStore.categories.find(({name:n,slug:i})=>n?.toLowerCase()===t||i?.toLowerCase()===t);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(o)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,o=t?.toLowerCase(),n=r.boothStore.booths.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o||l.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(n){setTimeout(()=>r.selectBooth(n),250);return}const i=r.eventStore.eventItems.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(i){r.selectEventItem(i,!0);return}const s=r.exhibitorStore.exhibitors.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(s){setTimeout(()=>r.clickExhibitor(s),250);return}const h=r.categoryStore.categories.find(l=>l.slug===t);if(h){r.selectCategory(h);return}const c=r.speakerStore.findBySlug(t);if(c){r.selectSpeaker(c,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},o=t[e];if(!o){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}o()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),Y(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(te(t.data))}getCamera(){return re(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=w.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=P.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const i=this.getBounds(e);i&&this.fitBounds(i,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=w.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(i=>{let s;i.externalId?s=r.boothStore.boothByExternalId.get(i.externalId):i.name&&(s=r.boothStore.boothByName.get(i.name.toLowerCase())),s?.rect&&o.push(s.rect)}),e.exhibitors?.forEach(i=>{let s;i.externalId?s=r.exhibitorStore.exhibitorByExternalId.get(i.externalId):i.name&&(s=r.exhibitorStore.exhibitorByName.get(i.name.toLowerCase())),s?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const n=E.fromUnion(...o);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=U.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=P.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const i=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?i.expand(t.padding):i}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?u.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return oe(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}unstable_destroy(){let e=window.__efpElement.firstChild;J(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",Z),r.maplibreStore.dispose(),W(),X(),K(),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const t=this.getFloors();if(e.name){const o=t.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=t.find(i=>i.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const{boothExternalIds:o,exhibitorExternalIds:n}=t?.length?B(t):{boothExternalIds:[],exhibitorExternalIds:[]};_({pathwayId:e,boothIds:o,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),i=o?.rect||o?.viewbox?o:n;if(i?.rect||i?.viewbox){const s=i.viewbox??i.rect;r.uiState.moveToRect=s.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!se(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${ie().map(o=>o.id).join(",")}`,"EFP001300");return}ne(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let L=0;function a(f,e,t){const o=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let i="https://js-sdk.expofp.com/api/packages";if(t&&(i+=`#error-${t}`),console.error(`${o} ${n} ${i}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:T(A,{children:[n," ",x("a",{href:i,target:"_blank",rel:"noreferrer",children:i})]})}),clearTimeout(L);const s=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(c=>setTimeout(c,s/2)),h())};h()},s)}class u{get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,o,n){if(e>o){const i=e;e=o,o=i}if(t>n){const i=t;t=n,n=i}this.x1=e,this.y1=t,this.x2=o,this.y2=n}static fromBox(e){return new u(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,n){return new u(e-o/2,t-n/2,e+o/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),i=Math.min(this.y2,e.y2);return o>=t&&i>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),i=Math.min(this.y2,e.y2);return o>=t&&i>=n?new u(t,n,o,i):new u(0,0,0,0)}getRotated90(){return u.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new u(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:u.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new u(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new u(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class HandlerRegistry{handlers=new Map
|
|
1
|
+
export class HandlerRegistry{constructor(){this.handlers=new Map}register(e,s){return this.handlers.set(e,s),()=>this.handlers.delete(e)}unregisterByName(e){this.handlers.delete(e)}unregisterByPrefix(e){for(const s of this.handlers.keys())s.startsWith(e)&&this.handlers.delete(s)}invoke(...e){const s=[];for(const t of this.handlers.values()){const r=t(...e);r!=null&&s.push(r)}return s}clear(){this.handlers.clear()}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Renderer as c}from"@expofp/renderer";import{HandlerRegistry as a}from"./HandlerRegistry";import{loadCustomFontsUrls as
|
|
1
|
+
import{Renderer as c}from"@expofp/renderer";import{HandlerRegistry as a}from"./HandlerRegistry";import{loadCustomFontsUrls as u}from"./index";import d from"../tools/logger";import{isDefaultScene as p}from"./engine-core/defs";export class RendererService{constructor(){this._renderer=null,this._scene=null,this._fontUrls=[],this.requestRepaint=null,this.currentPtScale=null,this.ptScaleCorrection=1,this.rendererEventsCleanup=null,this.ptScaleRegistry=new a,this.rollRegistry=new a,this.layerImagesRegistry=new a}get renderer(){return this._renderer?.isInitialized?this._renderer:null}get scene(){return this._scene}get fontUrls(){return this._fontUrls}getCameraState(){if(!this._renderer?.isInitialized){d.warn("Renderer is not initialized. Cannot get camera state.");return}return this._renderer.controls.getCameraState()}get scale(){return this.currentPtScale!==null?this.currentPtScale:this._renderer?.isInitialized?this._renderer.controls.getCameraState()?.ptScale??1:1}get angle(){return this._renderer?.isInitialized?this._renderer.controls.getCameraState()?.roll??0:0}create(e){return this._renderer=new c(e),this._fontUrls=u(),this.setupEventListeners(),this._renderer}start(e){if(this._scene=e,this.requestRepaint=null,!this._renderer)throw new Error("RendererService: renderer is not created.");this._renderer.init(e),this._renderer.start()}attach(e,r,l,n=1){this._renderer=e,this._scene=r,this._fontUrls=u(),this.requestRepaint=l??null,this.ptScaleCorrection=n,this.setupEventListeners()}dispose(){this.rendererEventsCleanup?.(),this.rendererEventsCleanup=null,this.ptScaleRegistry.clear(),this.rollRegistry.clear(),this.layerImagesRegistry.clear(),this._renderer?.dispose(),this._renderer=null,this._scene=null,this._fontUrls=[],this.requestRepaint=null,this.currentPtScale=null,this.ptScaleCorrection=1}disposeIfCurrent(e){if(!e||this._renderer!==e){e?.dispose();return}this.dispose()}onPtScale(e,r){return this.ptScaleRegistry.register(e,r)}onRoll(e,r){return this.rollRegistry.register(e,r)}onLayerImages(e,r){return this.layerImagesRegistry.register(e,r)}update(...e){if(this._renderer){if(!this._renderer.isInitialized){d.warn("Renderer is not initialized. Cannot update.");return}this._renderer.update(...e),this.requestRepaint?.()}}setupEventListeners(){this.rendererEventsCleanup?.(),this.rendererEventsCleanup=null;const e=this._renderer;if(!e)return;const r=n=>{const{ptScale:t,sceneId:i}=f(n);if(!p(i)||!Number.isFinite(t))return;const o=t*this.ptScaleCorrection;this.currentPtScale=o;const h=[...this.ptScaleRegistry.invoke(o)];h.length&&this.update(...h)},l=n=>{if(!Number.isFinite(n))return;const t=[];for(const i of this.rollRegistry.invoke(n))Array.isArray(i)?t.push(...i):t.push(i);t.length&&this.update(...t)};e.events.addEventListener("viewport:ptscale",r),e.events.addEventListener("navigation:roll",l),this.rendererEventsCleanup=()=>{e.events.removeEventListener("viewport:ptscale",r),e.events.removeEventListener("navigation:roll",l)}}}function f(s){return typeof s=="number"?{ptScale:s}:s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__esDecorate as n,__runInitializers as u}from"tslib";import{getConfig as A}from"@expofp/config";import{action as h,observable as z,reaction as m}from"mobx";import{PREFIXES as M}from"../store/search-buttons/constants";import a from"../tools/logger";import{decodeString as N,decodeStringArray as v,encodeString as Y,encodeStringArray as B,toLowerCaseArray as g,toLowerCaseString as k}from"../utils/urlEncoding";import{replaceQuery as $}from"./url-sync";const d={CATEGORIES:"categories",POI_TYPE:"poiType",POI_TYPES:"poiTypes",EXHIBITORS:"exhibitors"};let X=(()=>{let c=[],F,f=[],T=[],S,P=[],L=[],I,C,_,b,R,O,w,x,U,E;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;F=[z],S=[z],I=[h],C=[h],_=[h],b=[h],R=[h],O=[h],w=[h],x=[h],U=[h],E=[h],n(this,null,I,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:e=>"initialize"in e,get:e=>e.initialize},metadata:t},null,c),n(this,null,C,{kind:"method",name:"parseURLFilters",static:!1,private:!1,access:{has:e=>"parseURLFilters"in e,get:e=>e.parseURLFilters},metadata:t},null,c),n(this,null,_,{kind:"method",name:"applyFiltersToStore",static:!1,private:!1,access:{has:e=>"applyFiltersToStore"in e,get:e=>e.applyFiltersToStore},metadata:t},null,c),n(this,null,b,{kind:"method",name:"updateURLFromFilters",static:!1,private:!1,access:{has:e=>"updateURLFromFilters"in e,get:e=>e.updateURLFromFilters},metadata:t},null,c),n(this,null,R,{kind:"method",name:"setCategories",static:!1,private:!1,access:{has:e=>"setCategories"in e,get:e=>e.setCategories},metadata:t},null,c),n(this,null,O,{kind:"method",name:"setPoiType",static:!1,private:!1,access:{has:e=>"setPoiType"in e,get:e=>e.setPoiType},metadata:t},null,c),n(this,null,w,{kind:"method",name:"setPoiTypes",static:!1,private:!1,access:{has:e=>"setPoiTypes"in e,get:e=>e.setPoiTypes},metadata:t},null,c),n(this,null,x,{kind:"method",name:"clearAllFilters",static:!1,private:!1,access:{has:e=>"clearAllFilters"in e,get:e=>e.clearAllFilters},metadata:t},null,c),n(this,null,U,{kind:"method",name:"focusOnFilteredBooths",static:!1,private:!1,access:{has:e=>"focusOnFilteredBooths"in e,get:e=>e.focusOnFilteredBooths},metadata:t},null,c),n(this,null,E,{kind:"method",name:"openExhibitorsList",static:!1,private:!1,access:{has:e=>"openExhibitorsList"in e,get:e=>e.openExhibitorsList},metadata:t},null,c),n(null,null,F,{kind:"field",name:"currentFilters",static:!1,private:!1,access:{has:e=>"currentFilters"in e,get:e=>e.currentFilters,set:(e,r)=>{e.currentFilters=r}},metadata:t},f,T),n(null,null,S,{kind:"field",name:"isInitialized",static:!1,private:!1,access:{has:e=>"isInitialized"in e,get:e=>e.isInitialized,set:(e,r)=>{e.isInitialized=r}},metadata:t},P,L),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=u(this,c);currentFilters=u(this,f,{categories:[],poiType:null,poiTypes:[],exhibitors:!1});isInitialized=(u(this,T),u(this,P,!1));constructor(t){u(this,L),this.rootStore=t,this.setupReactions()}initialize(){this.parseURLFilters(),this.applyFiltersToStore(),this.isInitialized=!0,a.log("URLFilterManager initialized with filters:",this.currentFilters)}parseURLFilters(){const{categories:t,poiType:e,poiTypes:r,exhibitors:i}=this.readRawFilters(),s=r.filter(o=>{if(!o)return!1;const l=this.rootStore.poiTypeStore.poiTypes.some(p=>p.name.toLowerCase()===o.toLowerCase());return l||a.warn(`POI type not found in data: ${o}`),l});t.length>0&&(e||s.length>0)?(a.warn("URL contains both categories and POI types. Clearing POI types."),this.currentFilters={categories:t,poiType:null,poiTypes:[],exhibitors:i}):this.currentFilters={categories:t,poiType:e,poiTypes:s,exhibitors:i},a.log("URLFilterManager parsed filters:",{categories:t,poiType:e,poiTypes:r,exhibitors:i}),this.validateFilters(this.currentFilters)}readRawFilters(){const t=A().filters;if(Object.keys(t).length>0)return{categories:[...t.categories??[]],poiType:t.poiType??null,poiTypes:[...t.poiTypes??[]],exhibitors:t.exhibitors??!1};const e=new URLSearchParams(window.location.search),r=e.get(d.CATEGORIES),i=r?v(r):[],s=e.get(d.POI_TYPE),o=s?N(s):null,l=e.get(d.POI_TYPES),p=l?v(l):[],y=e.get(d.EXHIBITORS);return{categories:i,poiType:o,poiTypes:p,exhibitors:y==="true"||y===""}}applyFiltersToStore(){const{uiState:t,categoryFilterStore:e,searchButtonsStore:r}=this.rootStore;if(this.currentFilters.categories.length>0){const i=this.currentFilters.categories.map(s=>this.rootStore.categoryStore.categories.find(o=>o.name.toLowerCase()===s.toLowerCase())).filter(s=>s!==void 0);i.length>0?(t.selectedCategoryFilters=i,e.state.selectedItems=i.map(s=>({id:s.id,name:s.name})),t.categoryFilterOpen=!0,a.log("URLFilterManager applied categories:",i.map(s=>s.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):a.warn("URLFilterManager: no categories found for names:",this.currentFilters.categories)}if(this.currentFilters.poiType){const i=this.rootStore.poiTypeStore.poiTypes.find(s=>s.name.toLowerCase()===this.currentFilters.poiType.toLowerCase());i?(t.selectedPoiTypeFilters=[i],r.setPoiFilterId(`${M.POI_TYPE}${i.id}`),a.log("URLFilterManager applied POI type:",i.name),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):a.warn("URLFilterManager: no POI type found for name:",this.currentFilters.poiType)}if(this.currentFilters.poiTypes.length>0){const i=this.currentFilters.poiTypes.map(s=>s?this.rootStore.poiTypeStore.poiTypes.find(o=>o.name.toLowerCase()===s.toLowerCase()):null).filter(s=>s!=null);i.length>0?(t.selectedPoiTypeFilters=i,a.log("URLFilterManager applied POI types:",i.map(s=>s.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):(a.warn("URLFilterManager: no POI types found for names:",this.currentFilters.poiTypes),this.currentFilters.poiTypes=[])}this.currentFilters.exhibitors&&this.openExhibitorsList()}filterSearch(){const{uiState:t}=this.rootStore,e=new URLSearchParams;if(t.selectedCategoryFilters.length>0){const r=t.selectedCategoryFilters.map(s=>s.name.toLowerCase()),i=B(r);i&&e.set(d.CATEGORIES,i)}if(t.selectedPoiTypeFilters.length>0&&t.selectedCategoryFilters.length===0)if(t.selectedPoiTypeFilters.length===1){const r=t.selectedPoiTypeFilters[0].name.toLowerCase();if(r){const i=Y(r);i&&e.set(d.POI_TYPE,i)}}else{const r=t.selectedPoiTypeFilters.map(s=>s.name.toLowerCase()),i=B(r);i&&e.set(d.POI_TYPES,i)}return this.currentFilters.exhibitors&&t.selectedCategoryFilters.length===0&&t.selectedPoiTypeFilters.length===0&&e.set(d.EXHIBITORS,"true"),e.toString()?`?${e.toString()}`:""}updateURLFromFilters(){const{uiState:t}=this.rootStore;$(this.filterSearch()),this.currentFilters={categories:t.selectedCategoryFilters.length>0?t.selectedCategoryFilters.map(e=>e.name):[],poiType:t.selectedPoiTypeFilters.length===1&&t.selectedCategoryFilters.length===0?t.selectedPoiTypeFilters[0].name:null,poiTypes:t.selectedPoiTypeFilters.length>1&&t.selectedCategoryFilters.length===0?t.selectedPoiTypeFilters.map(e=>e.name):[],exhibitors:this.currentFilters.exhibitors}}setCategories(t){this.currentFilters.categories=g(t),this.currentFilters.poiType=null,this.isInitialized&&this.updateURLFromFilters()}setPoiType(t){this.currentFilters.poiType=k(t),this.currentFilters.poiTypes=[],this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}setPoiTypes(t){this.currentFilters.poiTypes=g(t),this.currentFilters.poiType=null,this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}clearAllFilters(){this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1};const{uiState:t}=this.rootStore;t.categoryFilterOpen=!1,this.updateURLFromFilters()}getCurrentFilters(){return{...this.currentFilters}}setupReactions(){m(()=>this.rootStore.uiState.selectedCategoryFilters,t=>{if(this.isInitialized&&t.length>0){const e=g(t.map(r=>r.name));this.setCategories(e)}}),m(()=>this.rootStore.uiState.selectedPoiTypeFilters,t=>{if(this.isInitialized&&t.length>0)if(t.length===1){const e=k(t[0].name);e&&this.setPoiType(e)}else{const e=g(t.map(r=>r.name));this.setPoiTypes(e)}})}validateFilters(t){if(t.categories.length>0&&(t.poiType||t.poiTypes.length>0))return a.warn("Categories and POI types cannot be active simultaneously"),!1;if(t.poiType&&t.poiTypes.length>0)return a.warn("Both single POI type and multiple POI types cannot be active simultaneously"),!1;for(const e of t.categories)if(!this.getCategoryIdByName(e))return a.warn(`Category not found: ${e}`),!1;if(t.poiType&&!this.getPoiTypeIdByName(t.poiType))return a.warn(`POI type not found: ${t.poiType}`),!1;for(const e of t.poiTypes)if(!this.getPoiTypeIdByName(e))return a.warn(`POI type not found: ${e}`),!1;return!0}getCategoryIdByName(t){const e=this.rootStore.categoryStore.categories.find(r=>r.name.toLowerCase()===t.toLowerCase());return e?e.id:null}getPoiTypeIdByName(t){const e=this.rootStore.poiTypeStore.poiTypes.find(r=>r.name.toLowerCase()===t.toLowerCase());return e?e.id:null}focusOnFilteredBooths(){if(!this.rootStore.layerStore.layersLoaded){m(()=>this.rootStore.layerStore.layersLoaded,()=>{this.focusOnFilteredBooths()},{fireImmediately:!1});return}const{uiState:t,exhibitorStore:e,boothStore:r}=this.rootStore;let i=[];if(t.selectedCategoryFilters.length>0){const o=e.exhibitors.filter(l=>t.selectedCategoryFilters.some(p=>l.categories.some(y=>y.id===p.id)));i=r.booths.filter(l=>o.some(p=>p.id===l.exhibitors[0]?.id))}if(t.selectedPoiTypeFilters.length>0){const o=r.booths.filter(l=>t.selectedPoiTypeFilters.some(p=>l.poiTypeId===p.id));i.length>0?i=i.filter(l=>o.some(p=>p.id===l.id)):i=o}const s=i.filter(o=>o.visible);s.length>0?(t.moveToBooths=s,this.rootStore.moveToList(s)):i.length>0&&(this.rootStore.showMap(),this.rootStore.moveToList(i))}openExhibitorsList(){const{uiState:t}=this.rootStore;t.list={type:"exhibitors",text:"",focused:!1},setTimeout(()=>{this.rootStore.searchStore.setFocused(!0)},100),a.log("URLFilterManager opened exhibitors list")}}})();export{X as URLFilterManager};
|
|
1
|
+
import{__decorate as a}from"tslib";import{getConfig as m}from"@expofp/config";import{action as c,observable as g,reaction as u}from"mobx";import{PREFIXES as S}from"../store/search-buttons/constants";import l from"../tools/logger";import{decodeString as P,decodeStringArray as F,encodeString as L,encodeStringArray as T,toLowerCaseArray as d,toLowerCaseString as f}from"../utils/urlEncoding";import{replaceQuery as I}from"./url-sync";const h={CATEGORIES:"categories",POI_TYPE:"poiType",POI_TYPES:"poiTypes",EXHIBITORS:"exhibitors"};export class URLFilterManager{constructor(e){this.rootStore=e,this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1},this.isInitialized=!1,this.setupReactions()}initialize(){this.parseURLFilters(),this.applyFiltersToStore(),this.isInitialized=!0,l.log("URLFilterManager initialized with filters:",this.currentFilters)}parseURLFilters(){const{categories:e,poiType:t,poiTypes:r,exhibitors:i}=this.readRawFilters(),o=r.filter(s=>{if(!s)return!1;const n=this.rootStore.poiTypeStore.poiTypes.some(p=>p.name.toLowerCase()===s.toLowerCase());return n||l.warn(`POI type not found in data: ${s}`),n});e.length>0&&(t||o.length>0)?(l.warn("URL contains both categories and POI types. Clearing POI types."),this.currentFilters={categories:e,poiType:null,poiTypes:[],exhibitors:i}):this.currentFilters={categories:e,poiType:t,poiTypes:o,exhibitors:i},l.log("URLFilterManager parsed filters:",{categories:e,poiType:t,poiTypes:r,exhibitors:i}),this.validateFilters(this.currentFilters)}readRawFilters(){const e=m().filters;if(Object.keys(e).length>0)return{categories:[...e.categories??[]],poiType:e.poiType??null,poiTypes:[...e.poiTypes??[]],exhibitors:e.exhibitors??!1};const t=new URLSearchParams(window.location.search),r=t.get(h.CATEGORIES),i=r?F(r):[],o=t.get(h.POI_TYPE),s=o?P(o):null,n=t.get(h.POI_TYPES),p=n?F(n):[],y=t.get(h.EXHIBITORS);return{categories:i,poiType:s,poiTypes:p,exhibitors:y==="true"||y===""}}applyFiltersToStore(){const{uiState:e,categoryFilterStore:t,searchButtonsStore:r}=this.rootStore;if(this.currentFilters.categories.length>0){const i=this.currentFilters.categories.map(o=>this.rootStore.categoryStore.categories.find(s=>s.name.toLowerCase()===o.toLowerCase())).filter(o=>o!==void 0);i.length>0?(e.selectedCategoryFilters=i,t.state.selectedItems=i.map(o=>({id:o.id,name:o.name})),e.categoryFilterOpen=!0,l.log("URLFilterManager applied categories:",i.map(o=>o.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):l.warn("URLFilterManager: no categories found for names:",this.currentFilters.categories)}if(this.currentFilters.poiType){const i=this.rootStore.poiTypeStore.poiTypes.find(o=>o.name.toLowerCase()===this.currentFilters.poiType.toLowerCase());i?(e.selectedPoiTypeFilters=[i],r.setPoiFilterId(`${S.POI_TYPE}${i.id}`),l.log("URLFilterManager applied POI type:",i.name),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):l.warn("URLFilterManager: no POI type found for name:",this.currentFilters.poiType)}if(this.currentFilters.poiTypes.length>0){const i=this.currentFilters.poiTypes.map(o=>o?this.rootStore.poiTypeStore.poiTypes.find(s=>s.name.toLowerCase()===o.toLowerCase()):null).filter(o=>o!=null);i.length>0?(e.selectedPoiTypeFilters=i,l.log("URLFilterManager applied POI types:",i.map(o=>o.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):(l.warn("URLFilterManager: no POI types found for names:",this.currentFilters.poiTypes),this.currentFilters.poiTypes=[])}this.currentFilters.exhibitors&&this.openExhibitorsList()}filterSearch(){const{uiState:e}=this.rootStore,t=new URLSearchParams;if(e.selectedCategoryFilters.length>0){const r=e.selectedCategoryFilters.map(o=>o.name.toLowerCase()),i=T(r);i&&t.set(h.CATEGORIES,i)}if(e.selectedPoiTypeFilters.length>0&&e.selectedCategoryFilters.length===0)if(e.selectedPoiTypeFilters.length===1){const r=e.selectedPoiTypeFilters[0].name.toLowerCase();if(r){const i=L(r);i&&t.set(h.POI_TYPE,i)}}else{const r=e.selectedPoiTypeFilters.map(o=>o.name.toLowerCase()),i=T(r);i&&t.set(h.POI_TYPES,i)}return this.currentFilters.exhibitors&&e.selectedCategoryFilters.length===0&&e.selectedPoiTypeFilters.length===0&&t.set(h.EXHIBITORS,"true"),t.toString()?`?${t.toString()}`:""}updateURLFromFilters(){const{uiState:e}=this.rootStore;I(this.filterSearch()),this.currentFilters={categories:e.selectedCategoryFilters.length>0?e.selectedCategoryFilters.map(t=>t.name):[],poiType:e.selectedPoiTypeFilters.length===1&&e.selectedCategoryFilters.length===0?e.selectedPoiTypeFilters[0].name:null,poiTypes:e.selectedPoiTypeFilters.length>1&&e.selectedCategoryFilters.length===0?e.selectedPoiTypeFilters.map(t=>t.name):[],exhibitors:this.currentFilters.exhibitors}}setCategories(e){this.currentFilters.categories=d(e),this.currentFilters.poiType=null,this.isInitialized&&this.updateURLFromFilters()}setPoiType(e){this.currentFilters.poiType=f(e),this.currentFilters.poiTypes=[],this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}setPoiTypes(e){this.currentFilters.poiTypes=d(e),this.currentFilters.poiType=null,this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}clearAllFilters(){this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1};const{uiState:e}=this.rootStore;e.categoryFilterOpen=!1,this.updateURLFromFilters()}getCurrentFilters(){return{...this.currentFilters}}setupReactions(){u(()=>this.rootStore.uiState.selectedCategoryFilters,e=>{if(this.isInitialized&&e.length>0){const t=d(e.map(r=>r.name));this.setCategories(t)}}),u(()=>this.rootStore.uiState.selectedPoiTypeFilters,e=>{if(this.isInitialized&&e.length>0)if(e.length===1){const t=f(e[0].name);t&&this.setPoiType(t)}else{const t=d(e.map(r=>r.name));this.setPoiTypes(t)}})}validateFilters(e){if(e.categories.length>0&&(e.poiType||e.poiTypes.length>0))return l.warn("Categories and POI types cannot be active simultaneously"),!1;if(e.poiType&&e.poiTypes.length>0)return l.warn("Both single POI type and multiple POI types cannot be active simultaneously"),!1;for(const t of e.categories)if(!this.getCategoryIdByName(t))return l.warn(`Category not found: ${t}`),!1;if(e.poiType&&!this.getPoiTypeIdByName(e.poiType))return l.warn(`POI type not found: ${e.poiType}`),!1;for(const t of e.poiTypes)if(!this.getPoiTypeIdByName(t))return l.warn(`POI type not found: ${t}`),!1;return!0}getCategoryIdByName(e){const t=this.rootStore.categoryStore.categories.find(r=>r.name.toLowerCase()===e.toLowerCase());return t?t.id:null}getPoiTypeIdByName(e){const t=this.rootStore.poiTypeStore.poiTypes.find(r=>r.name.toLowerCase()===e.toLowerCase());return t?t.id:null}focusOnFilteredBooths(){if(!this.rootStore.layerStore.layersLoaded){u(()=>this.rootStore.layerStore.layersLoaded,()=>{this.focusOnFilteredBooths()},{fireImmediately:!1});return}const{uiState:e,exhibitorStore:t,boothStore:r}=this.rootStore;let i=[];if(e.selectedCategoryFilters.length>0){const s=t.exhibitors.filter(n=>e.selectedCategoryFilters.some(p=>n.categories.some(y=>y.id===p.id)));i=r.booths.filter(n=>s.some(p=>p.id===n.exhibitors[0]?.id))}if(e.selectedPoiTypeFilters.length>0){const s=r.booths.filter(n=>e.selectedPoiTypeFilters.some(p=>n.poiTypeId===p.id));i.length>0?i=i.filter(n=>s.some(p=>p.id===n.id)):i=s}const o=i.filter(s=>s.visible);o.length>0?(e.moveToBooths=o,this.rootStore.moveToList(o)):i.length>0&&(this.rootStore.showMap(),this.rootStore.moveToList(i))}openExhibitorsList(){const{uiState:e}=this.rootStore;e.list={type:"exhibitors",text:"",focused:!1},setTimeout(()=>{this.rootStore.searchStore.setFocused(!0)},100),l.log("URLFilterManager opened exhibitors list")}}a([g],URLFilterManager.prototype,"currentFilters",void 0),a([g],URLFilterManager.prototype,"isInitialized",void 0),a([c],URLFilterManager.prototype,"initialize",null),a([c],URLFilterManager.prototype,"parseURLFilters",null),a([c],URLFilterManager.prototype,"applyFiltersToStore",null),a([c],URLFilterManager.prototype,"updateURLFromFilters",null),a([c],URLFilterManager.prototype,"setCategories",null),a([c],URLFilterManager.prototype,"setPoiType",null),a([c],URLFilterManager.prototype,"setPoiTypes",null),a([c],URLFilterManager.prototype,"clearAllFilters",null),a([c],URLFilterManager.prototype,"focusOnFilteredBooths",null),a([c],URLFilterManager.prototype,"openExhibitorsList",null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__decorate as e}from"tslib";import{action as s,observable as r}from"mobx";export default class t{get publicRootStore(){return this.rootStore}constructor(i){this.state={isOpen:!1,selectedItems:[],pendingItems:[]},this.rootStore=i}openFilter(){this.state.isOpen=!0,this.state.pendingItems=[...this.state.selectedItems]}closeFilter(){this.state.isOpen=!1,this.state.pendingItems=[],this.rootStore.urlFilterManager&&this.rootStore.urlFilterManager.isInitialized&&this.rootStore.urlFilterManager.clearAllFilters()}applyFilter(){this.state.selectedItems=[...this.state.pendingItems],this.closeFilter(),this.updateUIState()}resetFilter(){this.state.pendingItems=[]}clearPendingItems(){this.state.pendingItems=[]}setPendingItems(i){this.state.pendingItems=i}}e([r],t.prototype,"state",void 0),e([s],t.prototype,"openFilter",null),e([s],t.prototype,"closeFilter",null),e([s],t.prototype,"applyFilter",null),e([s],t.prototype,"resetFilter",null),e([s],t.prototype,"clearPendingItems",null),e([s],t.prototype,"setPendingItems",null);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`+
|
|
1
|
+
import{__decorate as e}from"tslib";import l from"copy-to-clipboard";import{computed as a}from"mobx";import{t as s}from"../utils/i18n";export default class r{constructor(t){this.rootStore=t,this._share=this.share.bind(this)}get bookmarkedBooths(){return this.rootStore.boothStore.booths.filter(t=>t.exhibitors.length===0&&t.bookmarkedDirectly)}get total(){return this.rootStore.exhibitorStore.bookmarked.length+this.rootStore.eventStore.bookmarked.length+this.rootStore.speakerStore.bookmarked.length+this.bookmarkedBooths.length}get hasBookmarks(){return this.total>0}get hasRoutableBookmarks(){return this.rootStore.exhibitorStore.bookmarked.length>0||this.bookmarkedBooths.length>0}share(){const{exhibitorStore:t,eventStore:h,speakerStore:k}=this.rootStore,i=window.location,m=[...t.bookmarked.map(o=>o.id),...h.bookmarked.map(o=>o.id),...k.bookmarked.map(o=>o.id),...this.bookmarkedBooths.map(o=>o.id)];l(`${i.protocol}//${i.host}/?b=`+m.join("|")),alert(s("Link copied to clipboard")+`.
|
|
2
|
+
`+s("Open it on another device to import bookmarks")+".")}}e([a],r.prototype,"bookmarkedBooths",null),e([a],r.prototype,"total",null),e([a],r.prototype,"hasBookmarks",null),e([a],r.prototype,"hasRoutableBookmarks",null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__decorate as o}from"tslib";import{pointDistance as d}from"@expofp/geometry";import{action as m,computed as i,observable as l}from"mobx";import p from"../tools/settings";import{uiState as b}from"./index";export default class s{get boothById(){return new Map(this.booths.map(t=>[t.id,t]))}get boothByExternalId(){return new Map(this.booths.map(t=>[t.externalId,t]))}get boothByName(){return new Map(this.booths.map(t=>[t.name.toLowerCase(),t]))}get boothBySlug(){return new Map(this.booths.map(t=>[t.slug,t]))}get borderWidth(){if(p.boothBorderWidth)return p.boothBorderWidth;if(p.EXPO==="groomexpo")return .4;const t=this.booths.filter(e=>e.rect).map(e=>e.rect.size.width+e.rect.size.height);return t.reduce((e,h)=>e+h,0)/t.length/80}constructor(t){this.booths=[],this.highlightedByExternalIds=[],this.rootStore=t}get bookmarked(){return this.booths.filter(t=>t.bookmarkedDirectly)}getNearestBooth(t){var e=null;const a=this.booths.map(r=>({lineLength:d(t,r.rect.center),name:r.name})).sort((r,u)=>r.lineLength-u.lineLength)[0];return e=this.booths.find(r=>r.name===a.name),e}getBoothAtPoint(t){return this.booths.find(e=>e.rect.containsPoint(t))}findBooth(t){return this.boothByExternalId.get(t)||this.boothByName.get(t.toLowerCase())||this.boothBySlug.get(t)}replaceBookmarked(t){const e=(t||[]).map(r=>this.boothById.get(r)).filter(r=>r),h=new Set(e),a=this.bookmarked.filter(r=>!h.has(r));for(const r of a)r.bookmarkedDirectly=!1;for(const r of e)r.bookmarkedDirectly=!0}}o([l],s.prototype,"booths",void 0),o([l],s.prototype,"highlightedByExternalIds",void 0),o([i({keepAlive:!0})],s.prototype,"boothById",null),o([i({keepAlive:!0})],s.prototype,"boothByExternalId",null),o([i({keepAlive:!0})],s.prototype,"boothByName",null),o([i({keepAlive:!0})],s.prototype,"boothBySlug",null),o([i({keepAlive:!0})],s.prototype,"borderWidth",null),o([i],s.prototype,"bookmarked",null),o([m],s.prototype,"replaceBookmarked",null);export class BoothBase{constructor(){this.bookmarkedDirectly=!1}get bookmarked(){return b.disableBookmarked?!1:this.schedule?.some(t=>t.bookmarked)?!0:this.exhibitors.length>0?!!this.exhibitors.find(t=>t.bookmarked):this.bookmarkedDirectly}get uiState(){return this.store.rootStore.uiState}get fullName(){const t=this.meta?Object.entries(this.meta).filter(([e])=>!e.startsWith("_")).map(([e,h])=>`${e} ${h}`).join(" "):"";return`${this.name} ${t}`.replace(/\s+/g," ").trim()}get visible(){return this.layer?.visible??!0}get hover(){return this.uiState.hoveredBooths.has(this)}get selected(){return this.uiState.selectedBooths.has(this)}get skipDim(){return this.uiState.highlightedBooths.has(this.id.toString())}}o([l],BoothBase.prototype,"layer",void 0),o([l],BoothBase.prototype,"bookmarkedDirectly",void 0),o([i({keepAlive:!0})],BoothBase.prototype,"bookmarked",null),o([i({keepAlive:!0})],BoothBase.prototype,"uiState",null),o([i({keepAlive:!0})],BoothBase.prototype,"fullName",null),o([i({keepAlive:!0})],BoothBase.prototype,"visible",null),o([i({keepAlive:!0})],BoothBase.prototype,"hover",null),o([i({keepAlive:!0})],BoothBase.prototype,"selected",null),o([i({keepAlive:!0})],BoothBase.prototype,"skipDim",null);export class RegularBooth extends BoothBase{constructor(){super(...arguments),this.entity={type:"booth",variant:"regular"}}}export class SpecialBooth extends BoothBase{constructor(){super(...arguments),this.entity={type:"booth",variant:"special"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__decorate as i}from"tslib";import{action as a,computed as s}from"mobx";import l from"./BaseFilterStore";export default class r extends l{get filteredExhibitors(){return this.state.selectedItems.length===0?this.rootStore.exhibitorStore.exhibitors:this.rootStore.exhibitorStore.exhibitors.filter(t=>this.state.selectedItems.some(e=>t.categories.some(o=>o.id===e.id)))}get filteredBooths(){return this.rootStore.boothStore.booths.filter(t=>this.filteredExhibitors.some(e=>e.id===t.exhibitors[0]?.id))}get publicRootStore(){return this.rootStore}updateUIState(){this.rootStore.uiState.menu=!1;const t=this.state.selectedItems.map(o=>this.rootStore.categoryStore.categories.find(h=>h.id===o.id)).filter(Boolean);this.rootStore.uiState.selectedCategoryFilters=t,this.rootStore.uiState.categoryFilterOpen=!0,this.rootStore.searchStore.setFocused(!0),this.rootStore.moveToList(),this.rootStore.showMap();const e=t.map(o=>o.name);this.rootStore.urlFilterManager.setCategories(e)}getFilteredItems(){return this.rootStore.exhibitorStore.exhibitors.map(t=>({id:t.id,name:t.name}))}getMatchingExhibitorsCount(){return this.state.pendingItems.length===0?this.rootStore.exhibitorStore.exhibitors.length:this.rootStore.exhibitorStore.exhibitors.filter(t=>t.categories.some(e=>this.state.pendingItems.some(o=>o.id===e.id))).length}resetFilter(){this.state.pendingItems=[],this.state.selectedItems=[],this.rootStore.uiState.selectedCategoryFilters=[],this.rootStore.uiState.categoryFilterOpen=!1,this.rootStore.uiState.list={type:"search",text:"",focused:!1},this.rootStore.urlFilterManager.setCategories([])}}i([s],r.prototype,"filteredExhibitors",null),i([s],r.prototype,"filteredBooths",null),i([a],r.prototype,"resetFilter",null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__decorate as r}from"tslib";import{computed as o}from"mobx";export default class e{get categoryById(){return new Map(this.categories.map(t=>[t.id,t]))}get seminarsCategory(){return this.categories.find(t=>t.slug==="seminars")}constructor(t){this.categories=[],this.rootStore=t}}r([o({keepAlive:!0})],e.prototype,"categoryById",null),r([o],e.prototype,"seminarsCategory",null);export class Category{constructor(){this.entity={type:"category"}}}
|