@expofp/floorplan 3.44.4 → 3.44.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/browser/{Button-F_XLD8Fy.js → Button-RBFYQ_Hi.js} +5 -5
  2. package/dist/browser/{CookieConsent-DZfbYufk.js → CookieConsent-DYvHugt5.js} +7 -7
  3. package/dist/browser/{Debug-Bfe4H5gN.js → Debug-Dwdforl1.js} +7 -7
  4. package/dist/browser/{DebugTools-D8ye4Kez.js → DebugTools-zmeDHNGo.js} +6 -6
  5. package/dist/browser/{Demo-CuFsb-_M.js → Demo-BS9Anmla.js} +9 -9
  6. package/dist/browser/{Free-C0Nk9qPr.js → Free-Js3r8S0A.js} +10 -10
  7. package/dist/browser/{GalleryContainer-CyAGAg4x.js → GalleryContainer-BAlmaG0f.js} +11 -11
  8. package/dist/browser/{GpsLoader-CoB3sRdS.js → GpsLoader-CPVQbvzp.js} +13 -13
  9. package/dist/browser/{KioskStore-CFuPEGt0.js → KioskStore-Bq5T3Ffz.js} +30 -30
  10. package/dist/browser/{LayerStore-CoevODUO.js → LayerStore-DCQ96IE-.js} +16 -16
  11. package/dist/browser/{MaplibreAdapter-Cu_LsCXF.js → MaplibreAdapter-DhVJu6nu.js} +2614 -2474
  12. package/dist/browser/{ModalContainer-My0C_xoz.js → ModalContainer-D6K2b0AJ.js} +10 -10
  13. package/dist/browser/{PermissionNotice-BOGBP1GX.js → PermissionNotice-DfjCPzFB.js} +6 -6
  14. package/dist/browser/{RouteStore-Dm2o_5F2.js → RouteStore-BZ4yT6y-.js} +9 -9
  15. package/dist/browser/{SetKioskMode-DPCRqozK.js → SetKioskMode-CrOh6y0s.js} +11 -11
  16. package/dist/browser/{ShowKiosk-DrNye8Aa.js → ShowKiosk-D1ClaHDA.js} +29 -30
  17. package/dist/browser/{UIState-BQFpVx6u.js → UIState-ByyaMrdX.js} +249 -238
  18. package/dist/browser/{ViewerMenuPanel-CR4YhVRV.js → ViewerMenuPanel-DakCumIN.js} +10 -10
  19. package/dist/browser/{add-debug-secret-listener-ujLceXxU.js → add-debug-secret-listener-CTKH_oRH.js} +1 -1
  20. package/dist/browser/{adopt-global-settings-CN0GZTt5.js → adopt-global-settings-D9sTS_JW.js} +9 -9
  21. package/dist/browser/{boolean-editor-Ceq6Etwz.js → boolean-editor-BwIw17rF.js} +9 -9
  22. package/dist/browser/{bootIntercom-B1uR7uMB.js → bootIntercom-CdKoKFoh.js} +2 -2
  23. package/dist/browser/bundle.json +85 -85
  24. package/dist/browser/{camera-events-CvNcBo4O.js → camera-events-sB__cd6I.js} +1 -1
  25. package/dist/browser/{classnames-CrsP-Ebw.js → classnames-CYKN3c87.js} +2 -2
  26. package/dist/browser/{client-BHrMhFVE.js → client-DrQUHXfL.js} +5 -5
  27. package/dist/browser/{components-BqCyp8zM.js → components-B5r0X7hw.js} +48 -48
  28. package/dist/browser/{create-live-plan-CvZGo-XN.js → create-live-plan-B5ooow2K.js} +13 -13
  29. package/dist/browser/{debug-context-i7l7Gx3K.js → debug-context-J8d6t8eB.js} +5 -5
  30. package/dist/browser/{debug-overlay-CRW_rbNG.js → debug-overlay-C2Jgoq6G.js} +10 -10
  31. package/dist/browser/{debug-ui-3YKCQhko.js → debug-ui-DPXawVu_.js} +6 -6
  32. package/dist/browser/{dimming-Dvu1pvil.js → dimming-BxZDtzpk.js} +282 -234
  33. package/dist/browser/{dist-DkwknQXP.js → dist-97S2bhkn.js} +5 -5
  34. package/dist/browser/{dist-uDlhOKs3.js → dist-Bbn7DzPA.js} +6 -6
  35. package/dist/browser/{dist-Cle-ua_T.js → dist-DMogs9qh.js} +3 -3
  36. package/dist/browser/{efp-debug-init-BYeJPe2d.js → efp-debug-init-D_04kt78.js} +3 -3
  37. package/dist/browser/{enum-editor-B_FawgZE.js → enum-editor-BAL-m2C_.js} +4 -4
  38. package/dist/browser/{es5-Dbukoinx.js → es5-CrpYYfSz.js} +2 -2
  39. package/dist/browser/{event-head-D6VrYuEF.js → event-head-qa_rZoTR.js} +1 -1
  40. package/dist/browser/{event-not-found-BDz3WPij.js → event-not-found-9sjy2LtU.js} +3 -3
  41. package/dist/browser/{event-scoped-cache-e6nGR3aQ.js → event-scoped-cache-BHo01Y40.js} +2 -2
  42. package/dist/browser/{expofpUrl-B0MZmxoe.js → expofpUrl-zbpM1nSq.js} +1 -1
  43. package/dist/browser/{exports-DEZevwDn.js → exports-DlkhL3Gn.js} +1 -1
  44. package/dist/browser/{favicon-u31TeYa4.js → favicon-MiQiTRAG.js} +1 -1
  45. package/dist/browser/{fetch-retry.umd-Cn-1aORd.js → fetch-retry.umd-BqYOzYBV.js} +2 -2
  46. package/dist/browser/{flex-cYeXiUeX.js → flex-u4ly_-5z.js} +5 -5
  47. package/dist/browser/{floorplan.loader-DQ33Y83e.js → floorplan.loader-CC9R8Z2W.js} +12 -12
  48. package/dist/browser/{floorplan.ready-DzJBQvVZ.js → floorplan.ready-WeInPpd9.js} +24 -24
  49. package/dist/browser/{freeBanner-DIcnNW6x.js → freeBanner-C4Bvu0Zb.js} +2 -2
  50. package/dist/browser/{fuse-ZGglAVb9.js → fuse-G-0speZ8.js} +2 -2
  51. package/dist/browser/{i18n-DkibBSFF.js → i18n-BnNMXZMY.js} +6 -6
  52. package/dist/browser/index.js +17 -17
  53. package/dist/browser/{index.module-BP-TB38-.js → index.module-BSaN-b6b.js} +4 -4
  54. package/dist/browser/{init-ui-DwX0YEOm.js → init-ui-DzAjXF5g.js} +11 -11
  55. package/dist/browser/{integrateKiosk-Di2HTJ8S.js → integrateKiosk-BVDvw6FM.js} +11 -11
  56. package/dist/browser/{is-debug-DH7N8jQh.js → is-debug-D9QhFSGQ.js} +4 -4
  57. package/dist/browser/{is-own-domain-CE5Nyu9G.js → is-own-domain-yTnvm9Le.js} +1 -1
  58. package/dist/browser/{is-webview-BCZ5IIAQ.js → is-webview-BqECy8-R.js} +1 -1
  59. package/dist/browser/{jsx-runtime-DRF-BLHf.js → jsx-runtime-BSXeXEHO.js} +2 -2
  60. package/dist/browser/kiosk-mode-DWfwx4t2.js +28 -0
  61. package/dist/browser/{kiosk-record-DjdRCsw4.js → kiosk-record-BOMPoHaT.js} +1 -1
  62. package/dist/browser/{kioskApi-CvKNO-wZ.js → kioskApi-BDv0w-PS.js} +7 -7
  63. package/dist/browser/{lib-D51yHChz.js → lib-B1qP6Z0C.js} +3 -3
  64. package/dist/browser/{loadImage-mqrRnYPB.js → loadImage-DPQiw0WY.js} +1 -1
  65. package/dist/browser/{logDeviceInfo-BbgtT2xS.js → logDeviceInfo-1M7WZnu3.js} +9 -9
  66. package/dist/browser/{mobx-DzcgHXfh.js → mobx-ClZZNnUh.js} +4 -4
  67. package/dist/browser/{mobx.module-DXfPwJbY.js → mobx.module-6oYVXmmv.js} +1 -1
  68. package/dist/browser/{optional-boolean-editor-i9cNIguy.js → optional-boolean-editor-Cc0C_hZa.js} +3 -3
  69. package/dist/browser/{optional-enum-editor-OmCRikPm.js → optional-enum-editor-V4cHa53F.js} +4 -4
  70. package/dist/browser/{optional-string-editor-C5sw9XjO.js → optional-string-editor-DRRoeLbD.js} +4 -4
  71. package/dist/browser/{particles.min-Cj5RSf6H.js → particles.min-COe9Gmit.js} +2 -2
  72. package/dist/browser/{react-BU3jD5B2.js → react-Ca00Xeqo.js} +2 -2
  73. package/dist/browser/{react-dom-DJDMclnf.js → react-dom-DDAmTd7-.js} +3 -3
  74. package/dist/browser/{rolldown-runtime-CEvxUPK8.js → rolldown-runtime-DgjedSI7.js} +1 -1
  75. package/dist/browser/{scene-B7RN58fT.js → scene-DaAXLmIU.js} +2 -2
  76. package/dist/browser/{scheduler-BZKT_e0-.js → scheduler-BGLqZKHW.js} +2 -2
  77. package/dist/browser/{select-COMyfaY9.js → select-DXkYXR4z.js} +10 -10
  78. package/dist/browser/{settings-Cg-yMbvI.js → settings-CwB0Bji2.js} +2 -2
  79. package/dist/browser/{settings-item-D1VQ8quC.js → settings-item-CT5g44Cs.js} +6 -6
  80. package/dist/browser/{store-XoxiSr-z.js → store-WuygYZ-g.js} +2 -2
  81. package/dist/browser/{string-editor-CWO5nIcD.js → string-editor-BATS-p4e.js} +4 -4
  82. package/dist/browser/{text-field-BqEB9Lpy.js → text-field-BDxhPAkK.js} +5 -5
  83. package/dist/browser/{theme-Drd2jIAq.js → theme-ln4LxgRi.js} +8 -8
  84. package/dist/browser/{ui-Bg4NEUSa.js → ui-BDzovVzL.js} +8 -8
  85. package/dist/browser/{useRenderTarget-Bqxwvxh1.js → useRenderTarget-BBar7DgD.js} +4 -4
  86. package/dist/browser/{viewport-BkMq7yU7.js → viewport-D2M15h-f.js} +3 -3
  87. package/dist/browser/{wayfinding-BvV-kzMQ.js → wayfinding-zYAP3tr2.js} +5 -5
  88. package/dist/esm/components/Kiosk/KioskStore.js +1 -1
  89. package/dist/esm/components/Kiosk/ShowKiosk.js +1 -1
  90. package/dist/esm/components/Kiosk/integrateKiosk.js +1 -1
  91. package/dist/esm/components/Kiosk/kiosk-mode.d.ts +4 -28
  92. package/dist/esm/components/Kiosk/kiosk-mode.js +1 -1
  93. package/dist/esm/components/Map/drawing/config/booth-badge-anchor.d.ts +121 -0
  94. package/dist/esm/components/Map/drawing/config/booth-badge-anchor.js +1 -0
  95. package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
  96. package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +5 -0
  97. package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
  98. package/dist/esm/components/Maplibre/utils/basemap-palette.d.ts +19 -0
  99. package/dist/esm/components/Maplibre/utils/basemap-palette.js +1 -0
  100. package/dist/esm/components/Maplibre/utils/map-helpers.js +1 -1
  101. package/dist/esm/components/Maplibre/utils/resolve-map-style.d.ts +5 -1
  102. package/dist/esm/components/Maplibre/utils/resolve-map-style.js +1 -1
  103. package/dist/esm/store/UIState.d.ts +21 -10
  104. package/dist/esm/store/UIState.js +1 -1
  105. package/dist/esm/store/init/init-ui.js +1 -1
  106. package/dist/esm/utils/is-phone.d.ts +9 -0
  107. package/dist/esm/utils/is-phone.js +1 -0
  108. package/package.json +10 -10
  109. package/dist/browser/kiosk-mode-AIiDx_CP.js +0 -33
@@ -1,15 +1,15 @@
1
1
  (function() {
2
2
  try {
3
3
  var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
- e.SENTRY_RELEASE = { id: "3.44.4" };
4
+ e.SENTRY_RELEASE = { id: "3.44.6" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "26f7cfc6-3edc-4a9d-8ddb-25fdd365a6fd", e._sentryDebugIdIdentifier = "sentry-dbid-26f7cfc6-3edc-4a9d-8ddb-25fdd365a6fd");
7
7
  } catch {}
8
8
  })();
9
- import { r as e, t } from "./rolldown-runtime-CEvxUPK8.js";
10
- import { o as n } from "./is-debug-DH7N8jQh.js";
11
- import { i as r, l as i } from "./mobx.module-DXfPwJbY.js";
12
- import { Ct as a, Gt as o, Jt as s, Mt as c, Rt as l, St as u, Ut as d, Vt as f, Wt as p, Xt as m, Yt as h, _t as g, bt as _, dt as v, gt as y, jt as b, qt as x, tt as S, xt as C, yt as w } from "./LayerStore-CoevODUO.js";
9
+ import { r as e, t } from "./rolldown-runtime-DgjedSI7.js";
10
+ import { o as n } from "./is-debug-D9QhFSGQ.js";
11
+ import { i as r, l as i } from "./mobx.module-6oYVXmmv.js";
12
+ import { Ct as a, Gt as o, Jt as s, Mt as c, Rt as l, St as u, Ut as d, Vt as f, Wt as p, Xt as m, Yt as h, _t as g, bt as _, dt as v, gt as y, jt as b, qt as x, tt as S, xt as C, yt as w } from "./LayerStore-DCQ96IE-.js";
13
13
  //#region ../geometry/src/lib/geo.ts
14
14
  var T = 6371e3;
15
15
  function E(e, t) {
@@ -1 +1 @@
1
- import{__decorate as i}from"tslib";import{getConfig as C}from"@expofp/config";import{action as n,computed as g,observable as S,toJS as m,when as y}from"mobx";import{KIOSK_ENABLE_KEY as p}from"../../constants";import a from"../../store";import{areLayersEnabled as K}from"../../utils/areLayersEnabled";import{t as h}from"../../utils/i18n";import{isLocalStorageAvailable as d}from"../../utils/localStorage";import{mapCamera as f}from"../Map/camera";import{mapViewport as M}from"../Map/viewport";import{screenFitsKiosk as v,storedKioskMode as P}from"./kiosk-mode";import{getPtScaleZoomRatio as b,toFiniteNumber as u}from"./kiosk-record";import{updateKiosk as w}from"./kioskApi";import{getSavedKiosk as F,removeKiosk as R,saveKiosk as D}from"./SetKiosk";import{KIOSK_STORAGE_KEY as I}from"./SetKiosk/constants";const z=2e4;class s{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1,this.isRestoringFraming=!1}get kiosk(){return a.uiState.kioskData}setKiosk(e){a.uiState.setKioskData(e)}getCameraState(){if(a.maplibreStore.showMaplibre){const t=a.maplibreStore.cameraPort?.getCameraState();return t?{mapCenterLng:t.lng,mapCenterLat:t.lat,mapZoom:t.zoom,mapBearingDegrees:t.bearing,mapPitchDegrees:t.pitch}:{}}const e=f()?.state();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.pixelSize,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=m(this.kiosk);if(!t||!e)return!!t!=!!e;const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!0;for(const l of o)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){if(!this.isResettingCamera){this.isResettingCamera=!0;try{if(a.maplibreStore.showMaplibre&&await this.resetMaplibreCamera()){this.isRestoringFraming=!0;return}this.isRestoringFraming=await this.resetPlanCamera()}finally{this.isResettingCamera=!1}}}async resetMaplibreCamera(){const e=await this.waitForMaplibreCameraPort();if(!e)return!1;const t=this.kiosk;t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=u(t?.mapCenterLng),r=u(t?.mapCenterLat),l=u(t?.mapZoom);return o===void 0||r===void 0||l===void 0?(e.resetPitch(),a.uiState.fitBounds(),!0):(e.applyCameraState({lng:o,lat:r,zoom:l,bearing:u(t?.mapBearingDegrees),pitch:u(t?.mapPitchDegrees)}),!0)}async waitForMaplibreCameraPort(){const{maplibreStore:e}=a;if(e.cameraPort)return e.cameraPort;try{await y(()=>!!e.cameraPort||!e.showMaplibre,{timeout:z})}catch{return null}return e.cameraPort}async resetPlanCamera(){const e=f();if(!e)return!1;const t=this.kiosk;await e.api.reset({pan:!0,zoom:!0,roll:!0,pitch:!0},{immediate:!0}),t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=b(t);o!==void 0&&await e.api.zoomBy(o,{immediate:!0});const r=u(t?.mapCenterX),l=u(t?.mapCenterY);r!==void 0&&l!==void 0&&await e.api.panTo({x:r,y:l},{immediate:!0});const c=u(t?.mapRollDegrees);c!==void 0&&await e.api.rollTo(c,{immediate:!0});const k=u(t?.mapPitch);return k!==void 0&&await e.api.pitchTo(k,{immediate:!0}),!0}restoreData(){const e=F();this.savedKiosk=e??null,e&&(this.setKiosk(e),a.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),a.uiState.kiosk=!0,a.uiState.hideFreeOrDemo=!0,a.uiState.setForceDim(!0),a.searchStore.setSearchText(""),a.searchStore.setFocused(!1),this.resetCamera()}handleClose(){v(a.uiState)&&P(C())||(a.uiState.kiosk=!1),a.uiState.restoreUIScale(),this.setKiosk(null),a.uiState.setForceDim(!1),a.uiState.enableSetKioskMode(!1),a.searchStore.closeSearch()}handleDelete(){d&&localStorage.getItem(I)!==null&&localStorage.getItem(p)==="1"&&localStorage.removeItem(p),R(),this.savedKiosk=null,this.setKiosk(null),a.uiState.resetMapSettings(),a.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:h("Deleted")})}handleSave(){const e=M();if(!e)return;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState(),r={...t,...o};if(!e.isVisible({x:r.x,y:r.y})){this.addStatusMessage({variant:"error",title:h("Kiosk not visible")});return}this.setKiosk(r),D(r),d&&localStorage.setItem(p,"1"),w(r,"https://app.expofp.com/"),a.uiState.setUIScale(r.uiScale,!0),this.addStatusMessage({variant:"success",title:h("Saved")}),this.savedKiosk=r}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=m(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>a.uiState.setUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=m(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=m(this.kiosk),o=a.fp.getFloors(),r=K()?o.find(c=>c.active)?.name??null:null,l=a.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:r,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=this.isRestoringFraming;this.isRestoringFraming=!1;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState();this.setKiosk({...t,...o}),e&&this.savedKiosk&&(this.savedKiosk={...this.savedKiosk,...o})}}i([g({keepAlive:!0})],s.prototype,"kiosk",null),i([n],s.prototype,"setKiosk",null),i([S],s.prototype,"savedKiosk",void 0),i([g({keepAlive:!0})],s.prototype,"hasUnsavedChanges",null),i([S],s.prototype,"statusMessages",void 0),i([n],s.prototype,"addStatusMessage",null),i([n],s.prototype,"clearStatusMessages",null),i([n],s.prototype,"startCleanupMessages",null),i([n],s.prototype,"resetCamera",null),i([n],s.prototype,"restoreData",null),i([n],s.prototype,"handleSetupReady",null),i([n],s.prototype,"handleClose",null),i([n],s.prototype,"handleDelete",null),i([n],s.prototype,"handleSave",null),i([n],s.prototype,"handleChange",null),i([n],s.prototype,"setInitialPtScale",null),i([n],s.prototype,"handleClick",null),i([n],s.prototype,"handleNavigationChange",null);export default new s;
1
+ import{__decorate as i}from"tslib";import{getConfig as C}from"@expofp/config";import{action as n,computed as k,observable as d,toJS as m,when as y}from"mobx";import{KIOSK_ENABLE_KEY as p}from"../../constants";import a from"../../store";import{areLayersEnabled as K}from"../../utils/areLayersEnabled";import{t as h}from"../../utils/i18n";import{isLocalStorageAvailable as S}from"../../utils/localStorage";import{mapCamera as f}from"../Map/camera";import{mapViewport as M}from"../Map/viewport";import{storedKioskMode as v}from"./kiosk-mode";import{getPtScaleZoomRatio as P,toFiniteNumber as u}from"./kiosk-record";import{updateKiosk as b}from"./kioskApi";import{getSavedKiosk as w,removeKiosk as F,saveKiosk as R}from"./SetKiosk";import{KIOSK_STORAGE_KEY as D}from"./SetKiosk/constants";const I=2e4;class s{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1,this.isRestoringFraming=!1}get kiosk(){return a.uiState.kioskData}setKiosk(e){a.uiState.setKioskData(e)}getCameraState(){if(a.maplibreStore.showMaplibre){const t=a.maplibreStore.cameraPort?.getCameraState();return t?{mapCenterLng:t.lng,mapCenterLat:t.lat,mapZoom:t.zoom,mapBearingDegrees:t.bearing,mapPitchDegrees:t.pitch}:{}}const e=f()?.state();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.pixelSize,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=m(this.kiosk);if(!t||!e)return!!t!=!!e;const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!0;for(const l of o)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){if(!this.isResettingCamera){this.isResettingCamera=!0;try{if(a.maplibreStore.showMaplibre&&await this.resetMaplibreCamera()){this.isRestoringFraming=!0;return}this.isRestoringFraming=await this.resetPlanCamera()}finally{this.isResettingCamera=!1}}}async resetMaplibreCamera(){const e=await this.waitForMaplibreCameraPort();if(!e)return!1;const t=this.kiosk;t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=u(t?.mapCenterLng),r=u(t?.mapCenterLat),l=u(t?.mapZoom);return o===void 0||r===void 0||l===void 0?(e.resetPitch(),a.uiState.fitBounds(),!0):(e.applyCameraState({lng:o,lat:r,zoom:l,bearing:u(t?.mapBearingDegrees),pitch:u(t?.mapPitchDegrees)}),!0)}async waitForMaplibreCameraPort(){const{maplibreStore:e}=a;if(e.cameraPort)return e.cameraPort;try{await y(()=>!!e.cameraPort||!e.showMaplibre,{timeout:I})}catch{return null}return e.cameraPort}async resetPlanCamera(){const e=f();if(!e)return!1;const t=this.kiosk;await e.api.reset({pan:!0,zoom:!0,roll:!0,pitch:!0},{immediate:!0}),t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=P(t);o!==void 0&&await e.api.zoomBy(o,{immediate:!0});const r=u(t?.mapCenterX),l=u(t?.mapCenterY);r!==void 0&&l!==void 0&&await e.api.panTo({x:r,y:l},{immediate:!0});const c=u(t?.mapRollDegrees);c!==void 0&&await e.api.rollTo(c,{immediate:!0});const g=u(t?.mapPitch);return g!==void 0&&await e.api.pitchTo(g,{immediate:!0}),!0}restoreData(){const e=w();this.savedKiosk=e??null,e&&(this.setKiosk(e),a.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),a.uiState.kiosk=!0,a.uiState.hideFreeOrDemo=!0,a.uiState.setForceDim(!0),a.searchStore.setSearchText(""),a.searchStore.setFocused(!1),this.resetCamera()}handleClose(){v(C())||(a.uiState.kiosk=!1),a.uiState.restoreUIScale(),this.setKiosk(null),a.uiState.setForceDim(!1),a.uiState.enableSetKioskMode(!1),a.searchStore.closeSearch()}handleDelete(){S&&localStorage.getItem(D)!==null&&localStorage.getItem(p)==="1"&&localStorage.removeItem(p),F(),this.savedKiosk=null,this.setKiosk(null),a.uiState.resetMapSettings(),a.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:h("Deleted")})}handleSave(){const e=M();if(!e)return;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState(),r={...t,...o};if(!e.isVisible({x:r.x,y:r.y})){this.addStatusMessage({variant:"error",title:h("Kiosk not visible")});return}this.setKiosk(r),R(r),S&&localStorage.setItem(p,"1"),b(r,"https://app.expofp.com/"),a.uiState.setKioskUIScale(r.uiScale,!0),this.addStatusMessage({variant:"success",title:h("Saved")}),this.savedKiosk=r}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=m(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>a.uiState.setKioskUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=m(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=m(this.kiosk),o=a.fp.getFloors(),r=K()?o.find(c=>c.active)?.name??null:null,l=a.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:r,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=this.isRestoringFraming;this.isRestoringFraming=!1;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState();this.setKiosk({...t,...o}),e&&this.savedKiosk&&(this.savedKiosk={...this.savedKiosk,...o})}}i([k({keepAlive:!0})],s.prototype,"kiosk",null),i([n],s.prototype,"setKiosk",null),i([d],s.prototype,"savedKiosk",void 0),i([k({keepAlive:!0})],s.prototype,"hasUnsavedChanges",null),i([d],s.prototype,"statusMessages",void 0),i([n],s.prototype,"addStatusMessage",null),i([n],s.prototype,"clearStatusMessages",null),i([n],s.prototype,"startCleanupMessages",null),i([n],s.prototype,"resetCamera",null),i([n],s.prototype,"restoreData",null),i([n],s.prototype,"handleSetupReady",null),i([n],s.prototype,"handleClose",null),i([n],s.prototype,"handleDelete",null),i([n],s.prototype,"handleSave",null),i([n],s.prototype,"handleChange",null),i([n],s.prototype,"setInitialPtScale",null),i([n],s.prototype,"handleClick",null),i([n],s.prototype,"handleNavigationChange",null);export default new s;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{getConfig as s}from"@expofp/config";import{TouchHand as a}from"@expofp/ui";import{observer as m}from"mobx-react-lite";import{KIOSK_ENABLE_KEY as n}from"../../constants";import t from"../../store";import{useInit as f}from"../../utils/mobx";import{integrateKioskIntoMap as u,integrateKioskIntoWf as k}from"./integrateKiosk";import{screenFitsKiosk as l}from"./kiosk-mode";import i from"./KioskStore";const S=m(()=>(f(()=>{if(localStorage.getItem(n)==="0"||!l(t.uiState))return;i.restoreData();let e=i.kiosk;if(!e){const r=s().kiosk;Object.keys(r).length&&(e=r,Number.isFinite(r.uiScale)&&t.uiState.setUIScale(r.uiScale,!1))}if(e)return u(e,!0),k(e),i.resetCamera(),t.setResetCameraFn(()=>i.resetCamera()),()=>{t.uiState.setKioskData(null),t.uiState.resetMapSettings()}}),t.uiState.kiosk&&t.uiState.inIdle?o(a,{}):null));export default S;
1
+ import{jsx as r}from"react/jsx-runtime";import{getConfig as s}from"@expofp/config";import{TouchHand as a}from"@expofp/ui";import{observer as m}from"mobx-react-lite";import{KIOSK_ENABLE_KEY as n}from"../../constants";import t from"../../store";import{useInit as f}from"../../utils/mobx";import{integrateKioskIntoMap as k,integrateKioskIntoWf as u}from"./integrateKiosk";import i from"./KioskStore";const l=m(()=>(f(()=>{if(localStorage.getItem(n)==="0")return;i.restoreData();let e=i.savedKiosk;if(!e){const o=s().kiosk;Object.keys(o).length&&(e=o,Number.isFinite(o.uiScale)&&t.uiState.setKioskUIScale(o.uiScale,!1))}if(e&&(k(e,!0),u(e),t.uiState.kiosk&&(i.resetCamera(),t.setResetCameraFn(()=>i.resetCamera()))),!!i.kiosk)return()=>{t.uiState.setKioskData(null),t.uiState.resetMapSettings()}}),t.uiState.kiosk&&t.uiState.inIdle?r(a,{}):null));export default l;
@@ -1 +1 @@
1
- import{runInAction as a}from"mobx";import e from"../../store";import{planWhen as i}from"../../utils/plan-reactions.js";import{getPtScaleZoomRatio as u}from"./kiosk-record";export function integrateKioskIntoMap(t,r){t&&a(()=>{if(e.uiState.setKioskData(t),e.uiState.kiosk=r,e.maplibreStore.showMaplibre)return;const o=t.mapCenterX!=null&&t.mapCenterY!=null;e.uiState.setMapSettings({centerxy:o?`${t.mapCenterX},${t.mapCenterY}`:"",z:t.z??void 0,bearing:t.mapRollDegrees});const n=u(t);n!==void 0&&e.uiState.changeZoom(n)})}export function integrateKioskIntoWf(t){t&&(t.z!=null&&e.fp.activateFloor({name:t.z.toString()}),i(()=>!!e.uiState.selectedRoute,()=>{const r=e.uiState.selectedRoute;r?.to&&!r.from&&e.routeStore.selectRoute(r,!1,!0)}))}
1
+ import{runInAction as a}from"mobx";import t from"../../store";import{planWhen as u}from"../../utils/plan-reactions.js";import{getPtScaleZoomRatio as m}from"./kiosk-record";export function integrateKioskIntoMap(e,n){e&&a(()=>{if(t.uiState.setKioskData(e),t.uiState.kiosk=n,t.maplibreStore.showMaplibre)return;const o=t.uiState.kiosk?e:{},i=o.mapCenterX!=null&&o.mapCenterY!=null;t.uiState.setMapSettings({centerxy:i?`${o.mapCenterX},${o.mapCenterY}`:"",z:e.z??void 0,bearing:o.mapRollDegrees});const r=m(o);r!==void 0&&t.uiState.changeZoom(r)})}export function integrateKioskIntoWf(e){e&&(e.z!=null&&t.fp.activateFloor({name:e.z.toString()}),u(()=>!!t.uiState.selectedRoute,()=>{const n=t.uiState.selectedRoute;n?.to&&!n.from&&t.routeStore.selectRoute(n,!1,!0)}))}
@@ -1,42 +1,16 @@
1
1
  import { type Config } from '@expofp/config';
2
2
  import type UIState from '../../store/UIState';
3
- /**
4
- * Whether this plan has room for the kiosk layout.
5
- *
6
- * Kiosk mode forces the left overlay, which is 450px wide — so it may only run
7
- * where that layout would have been chosen anyway. `UIState.overlayPosition`
8
- * asks this same question and calls this, which is what keeps the two answers
9
- * from drifting apart.
10
- *
11
- * The guard exists because kiosk mode reaches devices that never asked for it.
12
- * A route QR hands its `kiosk_x/y/z` anchor to every scanning phone, and
13
- * `uiState.kioskData` doubles as "this device IS a kiosk" (see `kioskUrlParam`),
14
- * so the phone adopts the whole kiosk boot: a left overlay wider than its screen,
15
- * which collapses the map's framing region to a sliver and leaves any route it
16
- * was opened for zoomed out to nothing.
17
- *
18
- * Measured off the width of the container the plan was handed, not the window —
19
- * that is what `screenSize` holds (`bindRootElement`), and the overlay lives in
20
- * the container. Width alone, as `overlayPosition` reads it: a phone held in
21
- * landscape passes, being as wide as a small desktop window and getting the same
22
- * layout, and every real kiosk panel passes in either orientation.
23
- */
24
- export declare function screenFitsKiosk(uiState: UIState): boolean;
25
3
  /**
26
4
  * Toggle kiosk mode — the single meaning of `kiosk=1` / `kiosk=0` from either
27
5
  * channel (the `?kiosk=` URL param, the typed search-box command) — and store
28
6
  * that choice. Exit also resets the per-device UI scale.
29
- *
30
- * Turning it ON is refused where the kiosk layout does not fit
31
- * ({@link screenFitsKiosk}); turning it OFF always works, so the `kiosk=0`
32
- * opt-out can never be locked out by the size of the screen it is typed on.
33
7
  */
34
8
  export declare function applyKioskMode(uiState: UIState, enabled: boolean): void;
35
9
  /**
36
10
  * Store-free kiosk check — the mode a load starts in: the `?kiosk=` param wins, then whatever the
37
11
  * device itself says. Used by the Intercom boot, which runs before the MobX stores exist, so the
38
- * screen rule above is the caller's to add. The direct `?kiosk` read is kiosk-semantic and migrates
39
- * with the kiosk config node (retirement plan §4.7).
12
+ * phone rule (`UIState.kiosk`) is not applied here. The direct `?kiosk` read is kiosk-semantic and
13
+ * migrates with the kiosk config node (retirement plan §4.7).
40
14
  */
41
15
  export declare function isKioskMode(data: Config): boolean;
42
16
  /**
@@ -47,4 +21,6 @@ export declare function isKioskMode(data: Config): boolean;
47
21
  * param.
48
22
  */
49
23
  export declare function storedKioskMode(data: Config): boolean;
24
+ /** Whether this device holds a kiosk saved by the setkiosk panel. */
25
+ export declare function hasSavedKiosk(): boolean;
50
26
  //# sourceMappingURL=kiosk-mode.d.ts.map
@@ -1 +1 @@
1
- import{untracked as n}from"mobx";import{KIOSK_ENABLE_KEY as r,MOBILE_BREAKPOINT as i}from"../../constants";import s from"../../tools/logger";import{isLocalStorageAvailable as t}from"../../utils/localStorage";import{getSavedKiosk as a}from"./SetKiosk/storage";export function screenFitsKiosk(o){return o.screenSize.width>i}export function applyKioskMode(o,e){e&&n(()=>f(o))||(o.kiosk=e,e||o.resetUIScale(),t&&window.localStorage.setItem(r,e?"1":"0"))}export function isKioskMode(o){const e=new URLSearchParams(window.location.search).get(r);return e==="1"||e==="0"?e==="1":storedKioskMode(o)}export function storedKioskMode(o){const e=t?window.localStorage.getItem(r):null;return e==="1"||e==="0"?e==="1":t&&a()!=null||Object.keys(o.kiosk??{}).length>0}function f(o){return screenFitsKiosk(o)?!1:(s.warn(`Kiosk mode refused: the plan is ${o.screenSize.width}px wide, and the kiosk layout needs more than ${i}px.`),!0)}
1
+ import{KIOSK_ENABLE_KEY as e}from"../../constants";import{isLocalStorageAvailable as r}from"../../utils/localStorage";import{getSavedKiosk as i}from"./SetKiosk/storage";export function applyKioskMode(t,o){t.kiosk=o,o||t.resetUIScale(),r&&window.localStorage.setItem(e,o?"1":"0")}export function isKioskMode(t){const o=new URLSearchParams(window.location.search).get(e);return o==="1"||o==="0"?o==="1":storedKioskMode(t)}export function storedKioskMode(t){const o=r?window.localStorage.getItem(e):null;return o==="1"||o==="0"?o==="1":hasSavedKiosk()||Object.keys(t.kiosk??{}).length>0}export function hasSavedKiosk(){return r&&i()!=null}
@@ -0,0 +1,121 @@
1
+ import { Box } from '@expofp/geometry';
2
+ import { type RegularBooth } from '../../../../store/BoothStore';
3
+ /** What a badge's anchor search reads off its booth. */
4
+ export type BadgeBooth = Pick<RegularBooth, 'rect' | 'rotate'>;
5
+ /** Where a badge sits in one booth corner, and how large it may grow there. */
6
+ export interface BadgeFit {
7
+ /** The badge's top-left corner on the plan, before rotation. */
8
+ readonly x: number;
9
+ readonly y: number;
10
+ /** The largest scale that keeps the badge inside the booth's footprint. */
11
+ readonly maxScale: number;
12
+ }
13
+ /**
14
+ * The places a booth's badge can sit, one per booth corner, each computed on the first visit to
15
+ * that corner and kept.
16
+ *
17
+ * The plan's roll moves the badge to another booth corner every quarter turn, and every badge on
18
+ * the plan moves in the same frame. Finding a corner's anchor tests the booth's vertices against
19
+ * its own triangles, so it is too slow to repeat for hundreds of badges at once. The result
20
+ * depends only on the corner: the rotation the scale search uses is the booth's own plus the
21
+ * quarter turns to that corner, the same at every visit to it up to whole turns of 2π.
22
+ *
23
+ * The first visit to a corner still searches, for every badge at once, so {@link prefetch} works
24
+ * the other corners out ahead, while the page is idle.
25
+ */
26
+ export declare class BoothBadgeAnchors {
27
+ private readonly booth;
28
+ private readonly triangles;
29
+ private readonly border;
30
+ private readonly source;
31
+ /** The badges with corners still to work out while the page is idle, in the order queued. */
32
+ private static readonly idle;
33
+ private static idleScheduled;
34
+ private readonly fits;
35
+ /** The rotation at corner 0 the idle work counts quarter turns from. */
36
+ private prefetchRotation;
37
+ private readonly polygon;
38
+ private readonly bbox;
39
+ /** The booth's distinct vertices in first-seen order, built on the first search. */
40
+ private vertices;
41
+ /**
42
+ * @param booth - The booth the badge belongs to.
43
+ * @param triangles - The booth's footprint as triangles; empty when it has no paths.
44
+ * @param border - How far the badge stays in from the booth's edge.
45
+ * @param source - The badge's width and height at scale 1.
46
+ */
47
+ constructor(booth: BadgeBooth, triangles: number[][][], border: number, source: {
48
+ readonly x: number;
49
+ readonly y: number;
50
+ });
51
+ /**
52
+ * The badge's place in a booth corner.
53
+ * @param corner - The booth corner, clockwise from top-left (0) to bottom-left (3).
54
+ * @param rotation - The badge's rotation in radians: the booth's own plus the quarter turns that
55
+ * brought the badge to this corner. Read on the first visit only.
56
+ * @returns The anchor and the largest scale, the same object at every visit.
57
+ */
58
+ fit(corner: number, rotation: number): BadgeFit;
59
+ /**
60
+ * Works out the three corners not yet visited while the page is idle, so the first quarter turn
61
+ * into each finds it ready. Queuing again while queued changes nothing.
62
+ * @param rotation - The badge's rotation at corner 0: the booth's own.
63
+ */
64
+ prefetch(rotation: number): void;
65
+ /** Drops the idle work {@link prefetch} queued and has not done yet. */
66
+ cancelPrefetch(): void;
67
+ private static scheduleIdle;
68
+ /**
69
+ * Works out one corner after another while the idle period lasts, for at most a slice, then asks
70
+ * for another.
71
+ * @param deadline - How much of the idle period is left.
72
+ */
73
+ private static runIdle;
74
+ /**
75
+ * Works out the next corner not yet known, at the rotation the quarter turns to it give.
76
+ * @returns Whether a corner is still unknown after this one.
77
+ */
78
+ private prefetchNext;
79
+ private compute;
80
+ /**
81
+ * The largest scale the booth's rect allows. At odd corners the badge's width and height lie
82
+ * along the booth's height and width.
83
+ * @param swapped - Whether the badge's axes are swapped against the booth's.
84
+ * @returns The scale.
85
+ */
86
+ private rectMaxScale;
87
+ /**
88
+ * The booth vertex, moved in by the border, nearest the target corner of the booth's bounding
89
+ * box and still inside the booth. Uses booth.rotate (the booth's true tilt) for the fallback,
90
+ * never the badge's stepped rotation: the booth does not move when the badge steps.
91
+ *
92
+ * The candidates are tested nearest first, so the search stops at the first one inside instead
93
+ * of testing every vertex. Ties keep the vertex seen first, as a full scan would.
94
+ * @param signX - 1 to aim at the left edge, -1 at the right.
95
+ * @param signY - 1 to aim at the top edge, -1 at the bottom.
96
+ * @returns The anchor.
97
+ */
98
+ private findAnchor;
99
+ /**
100
+ * Binary-searches the largest scale, up to the rect's cap, that keeps all badge corners inside
101
+ * the booth's footprint.
102
+ * @param anchorX - The badge's anchor.
103
+ * @param anchorY - The badge's anchor.
104
+ * @param rectMaxScale - The cap the booth's rect allows.
105
+ * @param rotation - The badge's rotation, in radians.
106
+ * @returns The scale; the cap itself when the booth has no footprint or the anchor lies outside.
107
+ */
108
+ private clampScale;
109
+ /**
110
+ * The booth's distinct vertices, in the order the triangles first name them.
111
+ * @returns The vertices, built once.
112
+ */
113
+ private distinctVertices;
114
+ }
115
+ /**
116
+ * The bounding box of a booth's triangles.
117
+ * @param triangles - The triangles, as `[x, y]` vertex triples.
118
+ * @returns The box, or `null` when there are no triangles.
119
+ */
120
+ export declare function trianglesBoundingBox(triangles: number[][][]): Box | null;
121
+ //# sourceMappingURL=booth-badge-anchor.d.ts.map
@@ -0,0 +1 @@
1
+ import{Box as b,pointRotate as x,Polygon as S}from"@expofp/geometry";const R=.5,E=.3,M=10,I=8,P=50;export class BoothBadgeAnchors{static{this.idle=new Set}static{this.idleScheduled=!1}constructor(t,i,e,n){this.booth=t,this.triangles=i,this.border=e,this.source=n,this.fits=[],this.prefetchRotation=0,this.vertices=null,this.polygon=T(i),this.bbox=trianglesBoundingBox(i)}fit(t,i){let e=this.fits[t];return e||(this.fits[t]=e=this.compute(t,i)),e}prefetch(t){BoothBadgeAnchors.idle.has(this)||(this.prefetchRotation=t,BoothBadgeAnchors.idle.add(this),BoothBadgeAnchors.scheduleIdle())}cancelPrefetch(){BoothBadgeAnchors.idle.delete(this)}static scheduleIdle(){BoothBadgeAnchors.idleScheduled||!BoothBadgeAnchors.idle.size||(BoothBadgeAnchors.idleScheduled=!0,typeof requestIdleCallback=="function"?requestIdleCallback(BoothBadgeAnchors.runIdle):setTimeout(()=>BoothBadgeAnchors.runIdle({timeRemaining:()=>I}),P))}static runIdle(t){BoothBadgeAnchors.idleScheduled=!1;const i=performance.now()+I;for(const e of BoothBadgeAnchors.idle){if(t.timeRemaining()<=0||performance.now()>=i)break;e.prefetchNext()||BoothBadgeAnchors.idle.delete(e)}BoothBadgeAnchors.scheduleIdle()}prefetchNext(){for(let t=1;t<4;t++)if(!this.fits[t])return this.fit(t,this.prefetchRotation+t*Math.PI/2),t<3;return!1}compute(t,i){const e=t===0||t===3?1:-1,n=t===0||t===1?1:-1,s=this.findAnchor(e,n),o=this.clampScale(s.x,s.y,this.rectMaxScale(t%2===1),i);return{x:s.x,y:s.y,maxScale:o}}rectMaxScale(t){const i=this.booth.rect.size.width,e=this.booth.rect.size.height,n=t?e:i,s=t?i:e;return Math.min(n>0?n*R/this.source.x:1/0,s>0?s*E/this.source.y:1/0)}findAnchor(t,i){const{booth:e,border:n,bbox:s}=this;if(s){const a=t>0?s.min.x:s.max.x,d=i>0?s.min.y:s.max.y,f=[];for(const[r,l]of this.distinctVertices()){const y=r+n*t,p=l+n*i,m=Math.abs(y-a)+Math.abs(p-d);m<1/0&&f.push({x:y,y:p,score:m,order:f.length})}f.sort((r,l)=>r.score-l.score||r.order-l.order);for(const r of f){const l={x:r.x,y:r.y};if(this.polygon.containsPoint(l))return l}}const o=t>0?e.rect.min.x+n:e.rect.max.x-n,c=i>0?e.rect.min.y+n:e.rect.max.y-n,h=e.rotate??0;return h?x({x:o,y:c},h,e.rect.center):{x:o,y:c}}clampScale(t,i,e,n){const{polygon:s,source:o}=this;if(!this.triangles.length)return e;const c={x:t,y:i};if(!s.containsPoint(c))return e;let h=0,a=e;for(let d=0;d<M;d++){const f=(h+a)/2,r=o.x*f,l=o.y*f;s.containsPoint(x({x:t+r,y:i},n,c))&&s.containsPoint(x({x:t,y:i+l},n,c))&&s.containsPoint(x({x:t+r,y:i+l},n,c))?h=f:a=f}return h}distinctVertices(){if(this.vertices)return this.vertices;const t=new Set,i=[];for(const e of this.triangles)for(const n of e){const s=`${n[0]},${n[1]}`;t.has(s)||(t.add(s),i.push([n[0],n[1]]))}return this.vertices=i}}export function trianglesBoundingBox(u){if(!u.length)return null;let t=1/0,i=1/0,e=-1/0,n=-1/0;for(const s of u)for(const[o,c]of s)o<t&&(t=o),c<i&&(i=c),o>e&&(e=o),c>n&&(n=c);return b.fromMinMax({x:t,y:i},{x:e,y:n})}function T(u){const t=[],i=[];for(const e of u){const n=t.length;t.push({x:e[0][0],y:e[0][1]}),t.push({x:e[1][0],y:e[1][1]}),t.push({x:e[2][0],y:e[2][1]}),i.push([n,n+1,n+2])}return new S(t,i)}
@@ -1 +1 @@
1
- import{Box as q,pointRotate as R,Polygon as J,Rect as v}from"@expofp/geometry";import{update as L}from"@expofp/renderer";import K from"color";import{reaction as P}from"mobx";import{SEPARATOR as G}from"../../../../constants";import U from"../../../../data";import{getTrianglesFromFpPaths as Y}from"../../../../data/svg";import{createShapeDef as tt,createTextDef as et,createTextDefLines as nt}from"../../../../engine/defs";import{loadCustomFontsUrls as ot}from"../../../../engine/fonts";import{getQuarterTurns as rt,getRollValue as st}from"../../../../engine/update-def";import{boothStore as it,uiState as N}from"../../../../store";import{RegularBooth as ct}from"../../../../store/BoothStore";import k from"../../../../tools/settings";import{getContrastTextColor as at}from"../../../../utils/getContrastTextColor";import{getFont as lt}from"./canvases";import{isBoothBadgeEligible as ht}from"./config-booth-badge-eligibility";import{getBadgeFontWeight as dt,getFontUrlByWeight as ut}from"./config-booth-labels";const ft=.5,gt=.3,z=15,mt=24,X=30,xt=12,pt=12,Z=.8,Q=document.createElement("canvas").getContext("2d");function yt(t){return t.length<=z?t:t.slice(0,z-1)+"\u2026"}function V(t){if(!t.paths?.length)return[];const n=t.layer?.name||"",e=[];for(const o of t.paths)for(const r of Y(o.index,n))e.push(r);return e}function Bt(t){const n=V(t);return n.length?q.fromPoints(n.flat().map(([e,o])=>({x:e,y:o}))):null}function St(t){const n=[],e=[];for(const o of t){const r=n.length;n.push({x:o[0][0],y:o[0][1]}),n.push({x:o[1][0],y:o[1][1]}),n.push({x:o[2][0],y:o[2][1]}),e.push([r,r+1,r+2])}return new J(n,e)}function H(t,n,e){return e.containsPoint({x:t,y:n})}function At(t,n,e,o,r,h,i,c){if(!t.length||!H(e,o,n))return i;const d={x:e,y:o};let a=0,f=i;const A=10;for(let y=0;y<A;y++){const m=(a+f)/2,I=r*m,g=h*m;[R({x:e+I,y:o},c,d),R({x:e,y:o+g},c,d),R({x:e+I,y:o+g},c,d)].every(l=>H(l.x,l.y,n))?a=m:f=m}return a}function Et(t){return Bt(t)??t.rect}function Tt(t,n,e,o,r,h){if(n.length){const a=Et(t),f={x:r>0?a.min.x:a.max.x,y:h>0?a.min.y:a.max.y},A=new Set;let y=null,m=1/0;for(const I of n)for(const g of I){const _=`${g[0]},${g[1]}`;if(A.has(_))continue;A.add(_);const u=g[0]+o*r,l=g[1]+o*h;if(H(u,l,e)){const B=Math.abs(u-f.x)+Math.abs(l-f.y);B<m&&(m=B,y={x:u,y:l})}}if(y)return y}const i=r>0?t.rect.min.x+o:t.rect.max.x-o,c=h>0?t.rect.min.y+o:t.rect.max.y-o,d=t.rotate??0;return d?R({x:i,y:c},d,t.rect.center):{x:i,y:c}}function W(t){return t&&t!=="none"?t:void 0}function It(t){const n=W(t.borderColor)||W(k.boothBorderColor)||k.colors.booths.default;return t.paths?.length>1&&W(t.paths[t.paths.length-1].color)||n}export function createBoothBadge(t){const n=yt(t.title||t.name),e=It(t),o=at(K(e).hex()),r=dt(),h=lt(X,r);Q.font=h;const i=Q.measureText(n).width,c=Math.ceil(i+xt*2),d=X+pt*2,a=(t.borderWidth||it.borderWidth)/2,f=c*Z,A=d*Z,y=t.rect.size.width,m=t.rect.size.height,I=s=>{const E=s?m:y,p=s?y:m;return Math.min(E>0?E*ft/f:1/0,p>0?p*gt/A:1/0)},g=V(t),_=St(g);let u=t.rotate??0,l=0,B=0,D=0,O=0;const w=()=>{const p=Tt(t,g,_,a,l===0||l===3?1:-1,l===0||l===1?1:-1);B=p.x,D=p.y;const T=I(l===1||l===3);O=At(g,_,B,D,f,A,T,u)};w();const F=(s,E)=>{const p=s/2,T=E/2,j=R({x:B+p,y:D+T},u,{x:B,y:D});return new v(j,{x:s,y:E},u,t.elevation)},$=ut(r,ot()),x=tt(F(1,1),e);x.hidden=!0,x.dim=t.skipDim?0:void 0;const S=et(nt([[n],[]],o,0,[$,$]),F(1,1),[0,0],{horizontal:"center",vertical:"center"});S.hidden=!0,S.dim=t.skipDim?0:void 0;const C={booth:t,anchor:{x:B,y:D},source:{x:f,y:A},rotation:u,maxScale:O,bg:x,text:S},b=new BoothBadgeDrawer(C);x.onScale=({pixelSize:s})=>b.layOutBg(s),S.onScale=({pixelSize:s})=>b.layOutText(s);const M=[];return M.push(P(()=>t.skipDim,s=>{x.dim=s?0:void 0,S.dim=s?0:void 0,L(x,S)})),M.push(P(()=>t.layer?.visible??!0,s=>{x.hidden=!s,S.hidden=!s,L(x,S)})),M.push(P(()=>N.mapSettings,({roll:s})=>{st(s??0)&&(x.onRoll=({roll:E,pixelSize:p})=>{const T=rt(E,u);if(T!==0)return u+=T*Math.PI/2,l=((l+T)%4+4)%4,w(),C.anchor.x=B,C.anchor.y=D,C.rotation=u,C.maxScale=O,[...b.layOutBg(p),...b.layOutText(p)]})},{fireImmediately:!0})),{bg:x,text:S,dispose:()=>{M.forEach(s=>s()),M.length=0}}}export class BoothBadgeDrawer{constructor(n){this.placement=n}layOutBg(n){const{bg:e}=this.placement;return e.shape=this.rectScaled(n),e.hidden=this.isHidden(),e.hidden?[]:[e]}layOutText(n){const{text:e,maxScale:o}=this.placement;return e.lines[0].fontSize=mt*Math.min(n,o),e.bounds=this.rectScaled(n),e.hidden=this.isHidden(),e.hidden?[]:[e]}rectScaled(n){const{anchor:e,booth:o,source:r,rotation:h,maxScale:i}=this.placement,c=Math.min(n,i),d=r.x*c,a=r.y*c,f=R({x:e.x+d/2,y:e.y+a/2},h,e);return new v(f,{x:d,y:a},h,o.elevation)}isHidden(){const{booth:n}=this.placement;return!!(n.layer&&!n.layer.visible)}}export function configBoothsBadges(t,n){const e=[],o=[],r=[];for(const i of n)if(i instanceof ct&&ht({hideExhibitorBoothNumber:U.hideExhibitorBoothNumber,hideBoothBadges:U.hideBoothBadges,hideLogoInBooth:N.hideLogoInBooth,noLabels:i.noLabels,hasExhibitors:i.exhibitors.length>0,hasLogoInBooth:i.exhibitors.some(c=>c.logoInBooth&&c.logo)})){const{bg:c,text:d,dispose:a}=createBoothBadge(i);e.push(c),o.push(d),r.push(a)}const h=()=>{r.forEach(i=>i()),r.length=0};return e.length?{layer:{name:`${t}${G}badges`,children:[{name:`${t}${G}badgeBgs`,children:e},{name:`${t}${G}badgeTexts`,children:o}]},cleanup:h}:{layer:null,cleanup:h}}
1
+ import{pointRotate as G,Rect as W}from"@expofp/geometry";import{update as w}from"@expofp/renderer";import k from"color";import{reaction as _}from"mobx";import{SEPARATOR as C}from"../../../../constants";import L from"../../../../data";import{getTrianglesFromFpPaths as Y}from"../../../../data/svg";import{createShapeDef as Z,createTextDef as z,createTextDefLines as Q}from"../../../../engine/defs";import{loadCustomFontsUrls as V}from"../../../../engine/fonts";import{getQuarterTurns as j,getRollValue as q}from"../../../../engine/update-def";import{boothStore as J,uiState as P}from"../../../../store";import{RegularBooth as K}from"../../../../store/BoothStore";import H from"../../../../tools/settings";import{getContrastTextColor as tt}from"../../../../utils/getContrastTextColor";import{BoothBadgeAnchors as et}from"./booth-badge-anchor";import{getFont as ot}from"./canvases";import{isBoothBadgeEligible as nt}from"./config-booth-badge-eligibility";import{getBadgeFontWeight as rt,getFontUrlByWeight as st}from"./config-booth-labels";const U=15,it=24,$=30,at=12,ct=12,v=.8,N=document.createElement("canvas").getContext("2d");function dt(t){return t.length<=U?t:t.slice(0,U-1)+"\u2026"}function lt(t){if(!t.paths?.length)return[];const o=t.layer?.name||"",e=[];for(const i of t.paths)for(const r of Y(i.index,o))e.push(r);return e}function I(t){return t&&t!=="none"?t:void 0}function ht(t){const o=I(t.borderColor)||I(H.boothBorderColor)||H.colors.booths.default;return t.paths?.length>1&&I(t.paths[t.paths.length-1].color)||o}export function createBoothBadge(t){const o=dt(t.title||t.name),e=ht(t),i=tt(k(e).hex()),r=rt(),l=ot($,r);N.font=l;const s=N.measureText(o).width,c=Math.ceil(s+at*2),m=$+ct*2,u=(t.borderWidth||J.borderWidth)/2,y=c*v,R=m*v,T=new et(t,lt(t),u,{x:y,y:R});let h=t.rotate??0,b=0,g=0,f=0,D=0;const O=()=>{const n=T.fit(b,h);g=n.x,f=n.y,D=n.maxScale};O();const M=(n,E)=>{const A=n/2,B=E/2,X=G({x:g+A,y:f+B},h,{x:g,y:f});return new W(X,{x:n,y:E},h,t.elevation)},F=st(r,V()),a=Z(M(1,1),e);a.hidden=!0,a.dim=t.skipDim?0:void 0;const d=z(Q([[o],[]],i,0,[F,F]),M(1,1),[0,0],{horizontal:"center",vertical:"center"});d.hidden=!0,d.dim=t.skipDim?0:void 0;const p={booth:t,anchor:{x:g,y:f},source:{x:y,y:R},rotation:h,maxScale:D,bg:a,text:d},S=new BoothBadgeDrawer(p);a.onScale=({pixelSize:n})=>S.layOutBg(n),d.onScale=({pixelSize:n})=>S.layOutText(n);const x=[];return x.push(_(()=>t.skipDim,n=>{a.dim=n?0:void 0,d.dim=n?0:void 0,w(a,d)})),x.push(_(()=>t.layer?.visible??!0,n=>{a.hidden=!n,d.hidden=!n,w(a,d)})),x.push(_(()=>P.mapSettings,({roll:n})=>{q(n??0)&&(T.prefetch(t.rotate??0),a.onRoll=({roll:E,pixelSize:A})=>{const B=j(E,h);if(B!==0)return h+=B*Math.PI/2,b=((b+B)%4+4)%4,O(),p.anchor.x=g,p.anchor.y=f,p.rotation=h,p.maxScale=D,[...S.layOutBg(A),...S.layOutText(A)]})},{fireImmediately:!0}),()=>T.cancelPrefetch()),{bg:a,text:d,dispose:()=>{x.forEach(n=>n()),x.length=0}}}export class BoothBadgeDrawer{constructor(o){this.placement=o}layOutBg(o){const{bg:e}=this.placement;return e.shape=this.rectScaled(o),e.hidden=this.isHidden(),e.hidden?[]:[e]}layOutText(o){const{text:e,maxScale:i}=this.placement;return e.lines[0].fontSize=it*Math.min(o,i),e.bounds=this.rectScaled(o),e.hidden=this.isHidden(),e.hidden?[]:[e]}rectScaled(o){const{anchor:e,booth:i,source:r,rotation:l,maxScale:s}=this.placement,c=Math.min(o,s),m=r.x*c,u=r.y*c,y=G({x:e.x+m/2,y:e.y+u/2},l,e);return new W(y,{x:m,y:u},l,i.elevation)}isHidden(){const{booth:o}=this.placement;return!!(o.layer&&!o.layer.visible)}}export function configBoothsBadges(t,o){const e=[],i=[],r=[];for(const s of o)if(s instanceof K&&nt({hideExhibitorBoothNumber:L.hideExhibitorBoothNumber,hideBoothBadges:L.hideBoothBadges,hideLogoInBooth:P.hideLogoInBooth,noLabels:s.noLabels,hasExhibitors:s.exhibitors.length>0,hasLogoInBooth:s.exhibitors.some(c=>c.logoInBooth&&c.logo)})){const{bg:c,text:m,dispose:u}=createBoothBadge(s);e.push(c),i.push(m),r.push(u)}const l=()=>{r.forEach(s=>s()),r.length=0};return e.length?{layer:{name:`${t}${C}badges`,children:[{name:`${t}${C}badgeBgs`,children:e},{name:`${t}${C}badgeTexts`,children:i}]},cleanup:l}:{layer:null,cleanup:l}}
@@ -17,6 +17,11 @@ export interface TileSourceConfig {
17
17
  * tolerates a host without Range support.
18
18
  */
19
19
  offline?: boolean;
20
+ /**
21
+ * Edits the loaded style before MapLibre applies it — a palette over a
22
+ * hosted style, for instance.
23
+ */
24
+ restyle?: (style: StyleSpecification) => StyleSpecification;
20
25
  }
21
26
  export interface CameraPaddingOptions {
22
27
  top: number;
@@ -1 +1 @@
1
- import{jsx as F}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{prepareDebug as q,Renderer as H}from"@expofp/renderer";import{addProtocol as J,Map as V}from"maplibre-gl";import{Protocol as X}from"pmtiles";import{useEffect as T,useRef as l,useState as K}from"react";import{uiState as B}from"../../store";import{CollapsedAttributionControl as Q}from"./CollapsedAttributionControl.js";import{ExpofpLogoControl as $}from"./ExpofpLogoControl.js";import{registerPmtilesArchive as v}from"./utils/pmtiles-range-fallback";import{createStyleTransform as ee}from"./utils/resolve-map-style";const te='<a href="https://maplibre.org/" target="_blank">MapLibre</a>';export const MAP_DIM_LAYER_ID="expofp-map-dim";const p="expofp-map-dim-source",oe="3d-expofp";let y=null;const re=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],ne={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function z(e){if(!e||typeof e!="object")return!1;const o=e.length;if(typeof o!="number"||o<16)return!1;const r=e[0];return typeof r=="number"&&Number.isFinite(r)}function ie(e){if(z(e))return Array.from(e);const r=e?.defaultProjectionData?.mainMatrix;return z(r)?Array.from(r):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function g(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(o=>g(o)):!e||typeof e!="object"?!1:Object.values(e).some(o=>g(o))}function ae(e){return e.type!=="symbol"||!e.id||!e.layout?!1:g(e.layout["text-field"])}function se(e){const o=e.getStyle();for(const r of o.layers??[])ae(r)&&e.setLayoutProperty(r.id,"text-field",re)}function le(){if(y)return y;const e=new X;y=e;try{J("pmtiles",e.tile)}catch(o){console.warn("Maplibre PMTiles protocol registration failed.",o)}return e}export default function ce({sceneDef:e,geoConfig:o,tileSource:r,mapOptions:N,debug:b,onMapReady:h,onMapDimLayerReady:x,onMapLoadError:M,onPointerMissed:Z,children:U}){const P=l(null),[A,L]=K(),_=l(h),S=l(x),E=l(M),G=l({geoConfig:o,tileSource:r,mapOptions:N,debug:b});return T(()=>{_.current=h,S.current=x,E.current=M}),T(()=>{const j=P.current;if(!j)return;const{geoConfig:n,tileSource:m,mapOptions:c,debug:I}=G.current;let u=!1,R;const C=()=>{const W=le(),Y=n.bounds?{bounds:n.bounds,fitBoundsOptions:{padding:n.fitPadding,bearing:n.bearing}}:{center:n.center,zoom:n.zoom},w=ee(m.style,m.offline?i=>v(W,i):void 0),t=new V({container:j,...Y,bearing:n.bearing,maxPitch:c?.maxPitch,minZoom:c?.minZoom,maxZoom:c?.maxZoom,maxBounds:c?.maxBounds,attributionControl:!1,bearingSnap:0,aroundCenter:!1,pitchWithRotate:B.pitchEnabled,touchPitch:B.pitchEnabled,canvasContextAttributes:{antialias:!0}});t.addControl(new $),t.addControl(new Q(te)),n.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+n.zoomAdjustment}),t.once("error",i=>{t.isStyleLoaded()||E.current?.(i?.error??i)});const O=i=>{const a=i?.id;!a||t.hasImage(a)||t.addImage(a,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",O);let f;const d=()=>t.triggerRepaint(),k={id:oe,type:"custom",renderingMode:"3d",onAdd(i,a){u||(L({gl:a,requestFrame:d,onFrame:s=>(f=s,d(),()=>{f===s&&(f=void 0)})}),_.current?.(t,d))},render(i,a){const s=ie(a??i);s&&f?.(s),I&&d()}},D=()=>{se(t),t.getSource(p)||t.addSource(p,{type:"geojson",data:ne}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:p,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),S.current?.(t),t.addLayer(k)};t.on("style.load",D),t.setStyle(m.style,w?{transformStyle:w}:void 0),R=()=>{t.off("style.load",D),t.off("styleimagemissing",O),t.remove()}};return I?q().then(()=>{u||C()}):C(),()=>{u=!0,R?.(),L(void 0)}},[]),F("div",{ref:P,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:A&&F(H,{...A,scene:e,debug:b,onPointerMissed:Z,children:U})})}
1
+ import{jsx as F}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{prepareDebug as q,Renderer as H}from"@expofp/renderer";import{addProtocol as J,Map as V}from"maplibre-gl";import{Protocol as X}from"pmtiles";import{useEffect as T,useRef as l,useState as K}from"react";import{uiState as B}from"../../store";import{CollapsedAttributionControl as Q}from"./CollapsedAttributionControl.js";import{ExpofpLogoControl as $}from"./ExpofpLogoControl.js";import{registerPmtilesArchive as v}from"./utils/pmtiles-range-fallback";import{createStyleTransform as ee}from"./utils/resolve-map-style";const te='<a href="https://maplibre.org/" target="_blank">MapLibre</a>';export const MAP_DIM_LAYER_ID="expofp-map-dim";const p="expofp-map-dim-source",oe="3d-expofp";let y=null;const re=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],ne={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function z(e){if(!e||typeof e!="object")return!1;const o=e.length;if(typeof o!="number"||o<16)return!1;const r=e[0];return typeof r=="number"&&Number.isFinite(r)}function ie(e){if(z(e))return Array.from(e);const r=e?.defaultProjectionData?.mainMatrix;return z(r)?Array.from(r):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function g(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(o=>g(o)):!e||typeof e!="object"?!1:Object.values(e).some(o=>g(o))}function ae(e){return e.type!=="symbol"||!e.id||!e.layout?!1:g(e.layout["text-field"])}function se(e){const o=e.getStyle();for(const r of o.layers??[])ae(r)&&e.setLayoutProperty(r.id,"text-field",re)}function le(){if(y)return y;const e=new X;y=e;try{J("pmtiles",e.tile)}catch(o){console.warn("Maplibre PMTiles protocol registration failed.",o)}return e}export default function ce({sceneDef:e,geoConfig:o,tileSource:r,mapOptions:N,debug:b,onMapReady:h,onMapDimLayerReady:x,onMapLoadError:M,onPointerMissed:Z,children:U}){const P=l(null),[A,L]=K(),_=l(h),S=l(x),E=l(M),G=l({geoConfig:o,tileSource:r,mapOptions:N,debug:b});return T(()=>{_.current=h,S.current=x,E.current=M}),T(()=>{const j=P.current;if(!j)return;const{geoConfig:n,tileSource:c,mapOptions:f,debug:I}=G.current;let u=!1,R;const C=()=>{const W=le(),Y=n.bounds?{bounds:n.bounds,fitBoundsOptions:{padding:n.fitPadding,bearing:n.bearing}}:{center:n.center,zoom:n.zoom},w=ee(c.style,c.offline?i=>v(W,i):void 0,c.restyle),t=new V({container:j,...Y,bearing:n.bearing,maxPitch:f?.maxPitch,minZoom:f?.minZoom,maxZoom:f?.maxZoom,maxBounds:f?.maxBounds,attributionControl:!1,bearingSnap:0,aroundCenter:!1,pitchWithRotate:B.pitchEnabled,touchPitch:B.pitchEnabled,canvasContextAttributes:{antialias:!0}});t.addControl(new $),t.addControl(new Q(te)),n.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+n.zoomAdjustment}),t.once("error",i=>{t.isStyleLoaded()||E.current?.(i?.error??i)});const O=i=>{const a=i?.id;!a||t.hasImage(a)||t.addImage(a,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",O);let d;const m=()=>t.triggerRepaint(),k={id:oe,type:"custom",renderingMode:"3d",onAdd(i,a){u||(L({gl:a,requestFrame:m,onFrame:s=>(d=s,m(),()=>{d===s&&(d=void 0)})}),_.current?.(t,m))},render(i,a){const s=ie(a??i);s&&d?.(s),I&&m()}},D=()=>{se(t),t.getSource(p)||t.addSource(p,{type:"geojson",data:ne}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:p,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),S.current?.(t),t.addLayer(k)};t.on("style.load",D),t.setStyle(c.style,w?{transformStyle:w}:void 0),R=()=>{t.off("style.load",D),t.off("styleimagemissing",O),t.remove()}};return I?q().then(()=>{u||C()}):C(),()=>{u=!0,R?.(),L(void 0)}},[]),F("div",{ref:P,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:A&&F(H,{...A,scene:e,debug:b,onPointerMissed:Z,children:U})})}
@@ -0,0 +1,19 @@
1
+ import { type StyleSpecification } from 'maplibre-gl';
2
+ /**
3
+ * Paint properties to set, keyed by the id of the style layer they apply to.
4
+ * A property named here replaces the layer's own value; the rest of its paint
5
+ * stays as the style wrote it.
6
+ */
7
+ export type PaintOverrides = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
8
+ /**
9
+ * Return a copy of `style` whose named layers carry the override paint.
10
+ *
11
+ * Overrides for layers the style does not have are skipped, so an upstream
12
+ * rename falls back to the upstream color rather than breaking the map.
13
+ */
14
+ export declare function recolorStyle(style: StyleSpecification, overrides: PaintOverrides): StyleSpecification;
15
+ /** CARTO Positron colors for the OpenFreeMap `positron` style. */
16
+ export declare const POSITRON_PAINT: PaintOverrides;
17
+ /** CARTO Dark Matter colors for the OpenFreeMap `dark` style. */
18
+ export declare const DARK_MATTER_PAINT: PaintOverrides;
19
+ //# sourceMappingURL=basemap-palette.d.ts.map
@@ -0,0 +1 @@
1
+ export function recolorStyle(_,s){return{..._,layers:_.layers.map(l=>{const n=s[l.id];return n?{...l,paint:{...l.paint,...n}}:l})}}const o={"text-color":"#697b89","text-halo-color":"rgba(255,255,255,0.5)"},e={"text-color":"#8a99a4","text-halo-color":"#fafaf8"},r={"text-color":"#838383","text-halo-color":"#fff"},t={"text-color":"#7a96a0","text-halo-color":"#f5f5f3"},i={"fill-color":"rgba(234, 241, 233, 0.5)"},a={"line-color":"#dddddd"};export const POSITRON_PAINT={background:{"background-color":"#fafaf8"},park:i,landcover_wood:i,landuse_residential:{"fill-color":"rgba(237, 237, 237, 0.5)"},water:{"fill-color":"#d4dadc"},waterway:{"line-color":"#d1dbdf"},building:{"fill-color":"#ededed","fill-outline-color":"#dfdfdf"},highway_minor:{"line-color":["match",["get","class"],"service","#efefef","#e6e6e6"]},tunnel_motorway_casing:a,highway_major_casing:a,highway_motorway_casing:a,highway_motorway_bridge_casing:a,highway_path:{"line-color":"#d5d5d5"},boundary_2:{"line-color":"#ebd6d8"},boundary_3:{"line-color":"#e1c5c7"},boundary_disputed:{"line-color":"#ebd6d8"},"highway-name-path":r,"highway-name-minor":r,"highway-name-major":r,waterway_line_label:t,water_name_point_label:t,water_name_line_label:t,label_other:o,label_village:o,label_town:o,label_city:o,label_city_capital:o,label_state:{"text-color":"#97a4ae","text-halo-color":"#fafaf8"},label_country_1:e,label_country_2:e,label_country_3:e};const h={"line-color":"#232323"},g={"line-color":"rgb(96, 96, 96)"},d={"text-color":"#666","text-halo-color":"#222"},b={"text-color":"rgb(211, 228, 236)","text-halo-color":"#222"},c={"text-color":"rgb(158, 182, 189)","text-halo-color":"#111"},y={"fill-opacity":0};export const DARK_MATTER_PAINT={background:{"background-color":"#0e0e0e"},landcover_wood:y,landuse_park:y,water:{"fill-color":"#2c353c"},waterway:{"line-color":"rgb(63, 90, 109)"},building:{"fill-color":"#393939","fill-outline-color":"#0e0e0e"},highway_path:{"line-color":"#262626"},highway_minor:{"line-color":["match",["get","class"],"minor","rgb(65, 71, 88)","service","#1c1c1c","#262626"]},highway_major_casing:h,highway_major_inner:{"line-color":"rgb(83, 86, 102)"},highway_motorway_casing:h,highway_motorway_inner:{"line-color":"rgb(73, 73, 73)"},highway_name_other:{"text-color":"rgb(181, 180, 180)","text-halo-color":"#111"},water_name:{"text-color":"rgb(155, 155, 155)","text-halo-color":"#181818"},boundary_state:{"line-color":"rgb(103, 103, 114)"},"boundary_country_z0-4":g,"boundary_country_z5-":g,place_other:d,place_suburb:d,place_village:{"text-color":"rgb(154, 153, 153)","text-halo-color":"#222"},place_town:{"text-color":"rgb(204, 208, 228)","text-halo-color":"#222"},place_city:b,place_city_large:b,place_state:{"text-color":"rgb(203, 230, 230)","text-halo-color":"#111"},place_country_other:c,place_country_minor:c,place_country_major:c};
@@ -1 +1 @@
1
- import{getFpGeo as a}from"../../../data/fpGeo.js";import f,{uiState as s}from"../../../store/index.js";import u from"../../../tools/settings.js";import{MAP_DIM_LAYER_ID as c}from"../MaplibreWrapper.js";import{resolveMapTheme as p}from"./map-theme.js";export const LIGHT_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"},DARK_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},MAP_MIN_ZOOM=12;export function applyMapDimValue(t,e){t?.getLayer(c)&&(t.setPaintProperty(c,"fill-opacity",m(e)),t.triggerRepaint())}function m(t){return Math.min(Math.max(t,0),1)}export function applyMapOptions(t,e){if(!t)return;t.setMinZoom(e.minZoom??null),t.setMaxZoom(e.maxZoom??null),t.setMaxBounds(e.maxBounds??null);const{pitch:o,maxPitch:n}=e,r=s.animatePitch,i=t.getPitch(),l=!!(r&&o!=null&&n!=null&&n<i);l||t.setMaxPitch(n??null),!(o==null||i===o)&&(r?(t.easeTo({pitch:o,duration:s.mapSettings.pitchtime}),l&&t.once("moveend",()=>t.setMaxPitch(n))):t.jumpTo({pitch:o}))}export function getTileSource(){const t=f.fp?.maplibre??window.__efpMaplibre;return t?.style?{style:t.style,offline:t.offline}:t?.styleUrl?{style:t.styleUrl,offline:t.offline}:p(a()?.properties?.config?.style,u.backgroundColor)==="dark"?DARK_TILE_SOURCE:LIGHT_TILE_SOURCE}
1
+ import{getFpGeo as p}from"../../../data/fpGeo.js";import u,{uiState as s}from"../../../store/index.js";import a from"../../../tools/settings.js";import{MAP_DIM_LAYER_ID as f}from"../MaplibreWrapper.js";import{DARK_MATTER_PAINT as m,POSITRON_PAINT as y,recolorStyle as c}from"./basemap-palette.js";import{resolveMapTheme as h}from"./map-theme.js";export const LIGHT_TILE_SOURCE={style:"https://tiles.openfreemap.org/styles/positron",restyle:t=>c(t,y)},DARK_TILE_SOURCE={style:"https://tiles.openfreemap.org/styles/dark",restyle:t=>c(t,m)},MAP_MIN_ZOOM=12;export function applyMapDimValue(t,e){t?.getLayer(f)&&(t.setPaintProperty(f,"fill-opacity",M(e)),t.triggerRepaint())}function M(t){return Math.min(Math.max(t,0),1)}export function applyMapOptions(t,e){if(!t)return;t.setMinZoom(e.minZoom??null),t.setMaxZoom(e.maxZoom??null),t.setMaxBounds(e.maxBounds??null);const{pitch:o,maxPitch:r}=e,i=s.animatePitch,n=t.getPitch(),l=!!(i&&o!=null&&r!=null&&r<n);l||t.setMaxPitch(r??null),!(o==null||n===o)&&(i?(t.easeTo({pitch:o,duration:s.mapSettings.pitchtime}),l&&t.once("moveend",()=>t.setMaxPitch(r))):t.jumpTo({pitch:o}))}export function getTileSource(){const t=u.fp?.maplibre??window.__efpMaplibre;return t?.style?{style:t.style,offline:t.offline}:t?.styleUrl?{style:t.styleUrl,offline:t.offline}:h(p()?.properties?.config?.style,a.backgroundColor)==="dark"?DARK_TILE_SOURCE:LIGHT_TILE_SOURCE}
@@ -10,6 +10,10 @@ import { type StyleSpecification, type TransformStyleFunction } from 'maplibre-g
10
10
  *
11
11
  * Inline style objects have no style URL to resolve against; callers must pass
12
12
  * already-absolute internals for those.
13
+ *
14
+ * `restyle`, when given, edits the style last — after URL resolution — for
15
+ * changes the style document cannot carry itself, such as a palette applied to
16
+ * a hosted style.
13
17
  */
14
- export declare function createStyleTransform(style: string | StyleSpecification, onPmtilesArchive?: (url: string) => void): TransformStyleFunction | undefined;
18
+ export declare function createStyleTransform(style: string | StyleSpecification, onPmtilesArchive?: (url: string) => void, restyle?: (style: StyleSpecification) => StyleSpecification): TransformStyleFunction | undefined;
15
19
  //# sourceMappingURL=resolve-map-style.d.ts.map
@@ -1 +1 @@
1
- export function createStyleTransform(l,p){if(typeof l!="string")return;const y=new URL(l,window.location.href).href,o=i=>new URL(i,y).href.replace(/%7B/g,"{").replace(/%7D/g,"}"),u=i=>{if(!i.startsWith("pmtiles://"))return o(i);const n=o(i.slice(10));return p?.(n),`pmtiles://${n}`};return(i,n)=>{const e={...n};typeof e.sprite=="string"?e.sprite=o(e.sprite):Array.isArray(e.sprite)&&(e.sprite=e.sprite.map(r=>{if(!r||typeof r!="object")return r;const t=r;return typeof t.url!="string"?r:{...t,url:o(t.url)}})),typeof e.glyphs=="string"&&(e.glyphs=o(e.glyphs));const c=e.sources;if(c){e.sources={...c};for(const[r,t]of Object.entries(c)){if(!t||typeof t!="object")continue;const s={...t};typeof s.url=="string"&&(s.url=u(s.url)),Array.isArray(s.tiles)&&(s.tiles=s.tiles.map(f=>typeof f=="string"?u(f):f)),e.sources[r]=s}}return e}}
1
+ export function createStyleTransform(p,a,c){if(typeof p!="string")return c?(e,o)=>c(o):void 0;const y=new URL(p,window.location.href).href,n=e=>new URL(e,y).href.replace(/%7B/g,"{").replace(/%7D/g,"}"),l=e=>{if(!e.startsWith("pmtiles://"))return n(e);const o=n(e.slice(10));return a?.(o),`pmtiles://${o}`};return(e,o)=>{const r={...o};typeof r.sprite=="string"?r.sprite=n(r.sprite):Array.isArray(r.sprite)&&(r.sprite=r.sprite.map(t=>{if(!t||typeof t!="object")return t;const s=t;return typeof s.url!="string"?t:{...s,url:n(s.url)}})),typeof r.glyphs=="string"&&(r.glyphs=n(r.glyphs));const f=r.sources;if(f){r.sources={...f};for(const[t,s]of Object.entries(f)){if(!s||typeof s!="object")continue;const i={...s};typeof i.url=="string"&&(i.url=l(i.url)),Array.isArray(i.tiles)&&(i.tiles=i.tiles.map(u=>typeof u=="string"?l(u):u)),r.sources[t]=i}}return c?c(r):r}}
@@ -64,7 +64,6 @@ export default class UIState {
64
64
  previewExhibitor: Exhibitor | null;
65
65
  wsStarted: boolean;
66
66
  canvasStarted: boolean;
67
- kiosk: boolean;
68
67
  inIdle: boolean;
69
68
  modalActive: {
70
69
  share: boolean;
@@ -138,15 +137,15 @@ export default class UIState {
138
137
  get noOverlay(): boolean;
139
138
  get overlayOnDemand(): boolean;
140
139
  get overlayHiddenNow(): boolean;
141
- get onBoothClick(): (e: import("..").FloorPlanBoothClickEvent) => void;
142
- get onMarkerClick(): (e: import("..").FloorPlanMarkerEvent) => void;
143
- get onBookmarkClick(): (e: import("..").FloorPlanBookmarkClickEvent) => void;
144
- get onVisitedClick(): (e: import("..").FloorPlanVisitedClickEvent) => void;
145
- get onCategoryClick(): (e: import("..").FloorPlanCategory) => void;
146
- get onDirection(): (e: import("..").FloorPlanDirectionEvent | null) => void;
147
- get onDetails(): (e: import("..").FloorPlanDetailsEvent) => void;
148
- get onExhibitorCustomButtonClick(): (e: import("..").FloorPlanCustomButtonEvent) => void;
149
- get onGetCoordsClick(): (e: import("..").FloorPlanGetCoordsEvent) => void;
140
+ get onBoothClick(): (e: import("../types.js").FloorPlanBoothClickEvent) => void;
141
+ get onMarkerClick(): (e: import("../types.js").FloorPlanMarkerEvent) => void;
142
+ get onBookmarkClick(): (e: import("../types.js").FloorPlanBookmarkClickEvent) => void;
143
+ get onVisitedClick(): (e: import("../types.js").FloorPlanVisitedClickEvent) => void;
144
+ get onCategoryClick(): (e: import("../types.js").FloorPlanCategory) => void;
145
+ get onDirection(): (e: import("../types.js").FloorPlanDirectionEvent | null) => void;
146
+ get onDetails(): (e: import("../types.js").FloorPlanDetailsEvent) => void;
147
+ get onExhibitorCustomButtonClick(): (e: import("../types.js").FloorPlanCustomButtonEvent) => void;
148
+ get onGetCoordsClick(): (e: import("../types.js").FloorPlanGetCoordsEvent) => void;
150
149
  get selectedExhibitor(): Exhibitor | null;
151
150
  get selectedBooth(): Booth | null;
152
151
  get selectedCategory(): Category | null;
@@ -306,9 +305,21 @@ export default class UIState {
306
305
  minUIScale: number;
307
306
  maxUIScale: number;
308
307
  setUIScale(scale: number | undefined, saveToStorage?: boolean): void;
308
+ /**
309
+ * Applies the UI scale a kiosk carries. Not on a phone: kiosk mode stays off there (see `kiosk`),
310
+ * and its scale with it.
311
+ */
312
+ setKioskUIScale(scale: number | undefined, saveToStorage: boolean): void;
309
313
  resetUIScale(): void;
310
314
  /** Drops a scale applied without saving, back to the stored one (or the default). */
311
315
  restoreUIScale(): void;
316
+ private kioskEnabled;
317
+ /**
318
+ * Kiosk mode. Never on for a phone ({@link isPhone}), whichever writer asks for it. A phone still
319
+ * shows the kiosk's marker, which follows `kioskData`.
320
+ */
321
+ get kiosk(): boolean;
322
+ set kiosk(enabled: boolean);
312
323
  setKioskModeEnabled: boolean;
313
324
  enableSetKioskMode(enable: boolean): void;
314
325
  kioskData: Kiosk | null;