@mapvx/web-components 0.0.41 → 0.0.42

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./lazy-load-adpISPJL.cjs");var e,i,o,n,s,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,d=t=>{throw TypeError(t)},l=(t,e,i,o)=>{for(var n,s=o>1?void 0:o?r(e,i):e,d=t.length-1;d>=0;d--)(n=t[d])&&(s=(o?n(e,i,s):n(s))||s);return o&&s&&a(e,i,s),s},h=(t,e,i)=>e.has(t)||d("Cannot "+i),c=(t,e,i)=>(h(t,e,"read from private field"),i?i.call(t):e.get(t)),p=(t,e,i)=>e.has(t)?d("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),u=(t,e,i,o)=>(h(t,e,"write to private field"),e.set(t,i),i);exports.RouteViewTotems=class extends t.i{constructor(){super(...arguments),this.styles=[t.i$1`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./lazy-load-adpISPJL.cjs");var e,i,n,o,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=t=>{throw TypeError(t)},d=(t,e,i,n)=>{for(var o,r=n>1?void 0:n?a(e,i):e,d=t.length-1;d>=0;d--)(o=t[d])&&(r=(n?o(e,i,r):o(r))||r);return n&&r&&s(e,i,r),r},l=(t,e,i)=>e.has(t)||r("Cannot "+i),h=(t,e,i)=>(l(t,e,"read from private field"),i?i.call(t):e.get(t)),c=(t,e,i)=>e.has(t)?r("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),p=(t,e,i,n)=>(l(t,e,"write to private field"),e.set(t,i),i);exports.RouteViewTotems=class extends t.i{constructor(){super(...arguments),this.styles=[t.i$1`
2
2
  :host {
3
3
  display: block;
4
4
  height: 100%;
@@ -19,7 +19,7 @@
19
19
  background: #fff;
20
20
  box-shadow: 0 0 24px #00000026;
21
21
  }
22
- `],p(this,e,""),p(this,i,""),p(this,o,"es"),p(this,n,""),p(this,s,""),this._swPath="/mvx-tiles-sw.js",this._swScope="/",this.sdkController=new t.SDKController(this),this.analyticsController=t.AnalyticsController.getInstance(),this._customMapRef=null}get apiKey(){return c(this,e)}set apiKey(t){u(this,e,t)}get parentPlaceId(){return c(this,i)}set parentPlaceId(t){u(this,i,t)}get locale(){return c(this,o)}set locale(t){u(this,o,t)}get originId(){return c(this,n)}set originId(t){u(this,n,t)}get destinationId(){return c(this,s)}set destinationId(t){u(this,s,t)}async _loadComponents(){await Promise.all([t.loadCustomMap(),t.loadFloorSelector(),t.loadQrModal(),t.loadRouteOptions()])}_preloadApiRequests(){const t=this.apiKey||this.getAttribute("apiKey")||"",e=this.parentPlaceId||this.getAttribute("parentPlaceId")||"",i=this.locale||this.getAttribute("locale")||"es";if(!t||!e)return;const o=t=>{const e=`mvx-preload:${t}`;if(document.head.querySelector(`link[data-mvx-preload="${e}"]`))return;const i=document.createElement("link");i.rel="preload",i.as="fetch",i.href=t,i.crossOrigin="anonymous",i.setAttribute("fetchpriority","high"),i.setAttribute("data-mvx-preload",e),document.head.appendChild(i)},n="https://api.mapvx.com/sdk/",s=encodeURIComponent;o(`${n}v3/place?token=${s(t)}&place_id=${s(e)}&lang=${s(i)}`),o(`https://api.mapvx.com/api/configuration?token=${s(t)}&lang=${s(i)}&place_id=${s(e)}`),this.originId&&o(`${n}v3/place?token=${s(t)}&place_id=${s(this.originId)}&lang=${s(i)}`),this.destinationId&&o(`${n}v3/place?token=${s(t)}&place_id=${s(this.destinationId)}&lang=${s(i)}`)}async firstUpdated(){"serviceWorker"in navigator&&navigator.serviceWorker.register(this._swPath,{scope:this._swScope}).catch(()=>{});const e=this._loadComponents(),i=t.preloadMaplibreCss();await Promise.all([e,i]),this.analyticsController.initialize("route-view-totems"),t.RollbarController.initialize("route-view-totems"),this.sendEvent("initial_render")}sendEvent(t,e={}){const i=this.sdkController.getDestination(),o={...e,apiKey:this.apiKey,locale:this.locale,parentPlaceId:this.parentPlaceId,originId:this.originId,host:window.location.host,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer,userAgent:navigator.userAgent,screenWidth:window.innerWidth,destinationName:i?.title,destinationId:i?.lazarilloId,destinationClientId:i?.clientId??this.destinationId,parentId:this.parentPlaceId??i?.parentId,institutionId:i?.parentInstitutionId};this.analyticsController.trackEvent(t,o)}_mapReadyHandler(){this.sendEvent("map_ready"),this.sdkController.setMapReady(!0)}_cameraInitializedHandler(){this.sdkController.setCameraInitialized(!0),this.sendEvent("view_loaded")}updated(t){if(this.apiKey&&this.locale&&this.parentPlaceId&&(t.has("apiKey")||t.has("locale")||t.has("parentPlaceId"))){const e=t.get("parentPlaceId");t.has("parentPlaceId")&&e!==this.parentPlaceId&&this.sdkController.clearParentPlace(),this._preloadApiRequests(),this.sdkController.prewarm(this.apiKey,this.locale,this.parentPlaceId,{originId:this.originId,destinationId:this.destinationId}),this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId)}this.originId&&t.has("destinationId")&&this.sdkController.setOriginAndDestination(this.originId,this.destinationId).finally(()=>{this.sendEvent("set_origin_and_destination",{origin_id:this.originId,destination_id:this.destinationId})})}render(){return t.b`
22
+ `],c(this,e,""),c(this,i,""),c(this,n,"es"),c(this,o,""),this._destinationId="",this._hasInitialized=!1,this._swPath="/mvx-tiles-sw.js",this._swScope="/",this.sdkController=new t.SDKController(this),this.analyticsController=t.AnalyticsController.getInstance(),this._customMapRef=null}get apiKey(){return h(this,e)}set apiKey(t){p(this,e,t)}get parentPlaceId(){return h(this,i)}set parentPlaceId(t){p(this,i,t)}get locale(){return h(this,n)}set locale(t){p(this,n,t)}get originId(){return h(this,o)}set originId(t){p(this,o,t)}get destinationId(){return this._destinationId}set destinationId(t){const e=this._destinationId;this._destinationId=t,e===t&&t&&this.originId&&this._hasInitialized&&queueMicrotask(()=>{this.sdkController.setOriginAndDestination(this.originId,t).then(()=>{this.sendEvent("destination_reloaded",{origin_id:this.originId,destination_id:t})})}),this.requestUpdate("destinationId",e)}async _loadComponents(){await Promise.all([t.loadCustomMap(),t.loadFloorSelector(),t.loadQrModal(),t.loadRouteOptions()])}_preloadApiRequests(){const t=this.apiKey||this.getAttribute("apiKey")||"",e=this.parentPlaceId||this.getAttribute("parentPlaceId")||"",i=this.locale||this.getAttribute("locale")||"es";if(!t||!e)return;const n=t=>{const e=`mvx-preload:${t}`;if(document.head.querySelector(`link[data-mvx-preload="${e}"]`))return;const i=document.createElement("link");i.rel="preload",i.as="fetch",i.href=t,i.crossOrigin="anonymous",i.setAttribute("fetchpriority","high"),i.setAttribute("data-mvx-preload",e),document.head.appendChild(i)},o="https://api.mapvx.com/sdk/",s=encodeURIComponent;n(`${o}v3/place?token=${s(t)}&place_id=${s(e)}&lang=${s(i)}`),n(`https://api.mapvx.com/api/configuration?token=${s(t)}&lang=${s(i)}&place_id=${s(e)}`),this.originId&&n(`${o}v3/place?token=${s(t)}&place_id=${s(this.originId)}&lang=${s(i)}`),this.destinationId&&n(`${o}v3/place?token=${s(t)}&place_id=${s(this.destinationId)}&lang=${s(i)}`)}async firstUpdated(){"serviceWorker"in navigator&&navigator.serviceWorker.register(this._swPath,{scope:this._swScope}).catch(()=>{});const e=this._loadComponents(),i=t.preloadMaplibreCss();await Promise.all([e,i]),this.analyticsController.initialize("route-view-totems"),t.RollbarController.initialize("route-view-totems"),this.sendEvent("initial_render"),this._hasInitialized=!0}sendEvent(t,e={}){const i=this.sdkController.getDestination(),n={...e,apiKey:this.apiKey,locale:this.locale,parentPlaceId:this.parentPlaceId,originId:this.originId,host:window.location.host,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer,userAgent:navigator.userAgent,screenWidth:window.innerWidth,destinationName:i?.title,destinationId:i?.lazarilloId,destinationClientId:i?.clientId??this.destinationId,parentId:this.parentPlaceId??i?.parentId,institutionId:i?.parentInstitutionId};this.analyticsController.trackEvent(t,n)}_mapReadyHandler(){this.sendEvent("map_ready"),this.sdkController.setMapReady(!0)}_cameraInitializedHandler(){this.sdkController.setCameraInitialized(!0),this.sendEvent("view_loaded")}updated(t){if(this.apiKey&&this.locale&&this.parentPlaceId&&(t.has("apiKey")||t.has("locale")||t.has("parentPlaceId"))){const e=t.get("parentPlaceId");t.has("parentPlaceId")&&e!==this.parentPlaceId&&this.sdkController.clearParentPlace(),this._preloadApiRequests(),this.sdkController.prewarm(this.apiKey,this.locale,this.parentPlaceId,{originId:this.originId,destinationId:this.destinationId}),this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId)}this.originId&&t.has("destinationId")&&this.sdkController.setOriginAndDestination(this.originId,this.destinationId).finally(()=>{this.sendEvent("set_origin_and_destination",{origin_id:this.originId,destination_id:this.destinationId})})}render(){return t.b`
23
23
  <div class="route-container" data-testid="route-container" style="height: 100%; width: 100%;">
24
24
  <custom-map
25
25
  class="map-container"
@@ -37,5 +37,5 @@
37
37
  <floor-selector data-testid="floor-selector" @floorChange=${this._updateFloorHandler}></floor-selector>
38
38
  <route-options data-testid="route-options"></route-options>
39
39
  </div>
40
- `}_accessibilityChangeHandler(t){this.sdkController.setAccessibleRoute(t.detail),this.sendEvent("accessibility_change",{accessible:t.detail})}_repeatRouteHandler(){this.sdkController.repeatRoute(),this.sendEvent("route_repeat")}_generateRouteHandler(t){this.sdkController.generateRoute(),this.sendEvent("route_generate",t.detail)}_backHandler(){const t=this.sdkController.getDestination();this.sendEvent("back_navigation_triggered",{had_route:!!this.sdkController.getDestination(),from_destination_id:t?.lazarilloId,from_destination_name:t?.title}),this.destinationId="",this.originId="",this.sdkController.resetData()}_updateFloorHandler(t){const e=t.detail;this.sdkController.setFloor(e),this.sendEvent("floor_change",{floor_id:e})}_startRouteAnimationHandler(){this.sdkController.startRouteAnimation(),this.sendEvent("route_animation_start")}_routeAnimationFinishedHandler(){this.sdkController.routeAnimationFinished(),this.sendEvent("route_animation_finish")}_dismissRouteErrorHandler(){this.sdkController.clearRouteError()}async updateComponent(t){const e=this.destinationId;console.info("[MAP] updateComponent start",{params:t,previousDestinationId:e});try{const i=this._customMapRef||this.shadowRoot?.querySelector("custom-map"),o=!t.originId&&!!t.destinationId;return i&&await i.clearMap(o,"Actualizando mapa..."),t.originId&&(this.originId=t.originId),void 0!==t.destinationId&&(this.destinationId=t.destinationId),t.floor&&this.sdkController.setFloor(t.floor),await this.updateComplete,this.originId&&this.destinationId&&await this.sdkController.setOriginAndDestination(this.originId,this.destinationId),console.info("[MAP] updateComponent complete",{previousDestinationId:e,newDestinationId:this.destinationId}),this.sendEvent("update_component",{previous_destination_id:e,new_destination_id:this.destinationId,new_origin_id:t.originId}),{success:!0,previousDestinationId:e,newDestinationId:this.destinationId}}catch(i){return console.error("[MAP] updateComponent error",i),{success:!1,error:i instanceof Error?i.message:"Unknown error",previousDestinationId:e,newDestinationId:this.destinationId}}}async clearMap(t=!0){const e=this._customMapRef||this.shadowRoot?.querySelector("custom-map");e&&await e.clearMap(t)}isLoading(){const t=this._customMapRef||this.shadowRoot?.querySelector("custom-map");return t?.isLoadingVisible()??!1}getMarkerVisibility(){const t=this._customMapRef||this.shadowRoot?.querySelector("custom-map");return t?.areMarkersVisible()??{originVisible:!1,destinationVisible:!1,bothVisible:!1}}connectedCallback(){super.connectedCallback(),this.addEventListener("accessibilityChange",this._accessibilityChangeHandler),this.addEventListener("repeatRoute",this._repeatRouteHandler),this.addEventListener("generateRoute",this._generateRouteHandler),this.addEventListener("back",this._backHandler),this.addEventListener("startRouteAnimation",this._startRouteAnimationHandler),this.addEventListener("routeAnimationFinished",this._routeAnimationFinishedHandler),this.addEventListener("dismissRouteError",this._dismissRouteErrorHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("accessibilityChange",this._accessibilityChangeHandler),this.removeEventListener("repeatRoute",this._repeatRouteHandler),this.removeEventListener("generateRoute",this._generateRouteHandler),this.removeEventListener("back",this._backHandler),this.removeEventListener("startRouteAnimation",this._startRouteAnimationHandler),this.removeEventListener("routeAnimationFinished",this._routeAnimationFinishedHandler),this.removeEventListener("dismissRouteError",this._dismissRouteErrorHandler)}},e=new WeakMap,i=new WeakMap,o=new WeakMap,n=new WeakMap,s=new WeakMap,l([t.n({type:String})],exports.RouteViewTotems.prototype,"apiKey",1),l([t.n({type:String})],exports.RouteViewTotems.prototype,"parentPlaceId",1),l([t.n({type:String})],exports.RouteViewTotems.prototype,"locale",1),l([t.n({type:String})],exports.RouteViewTotems.prototype,"originId",1),l([t.n({type:String,reflect:!0})],exports.RouteViewTotems.prototype,"destinationId",1),exports.RouteViewTotems=l([t.t("route-view-totems")],exports.RouteViewTotems);
40
+ `}_accessibilityChangeHandler(t){this.sdkController.setAccessibleRoute(t.detail),this.sendEvent("accessibility_change",{accessible:t.detail})}_repeatRouteHandler(){this.sdkController.repeatRoute(),this.sendEvent("route_repeat")}_generateRouteHandler(t){this.sdkController.generateRoute(),this.sendEvent("route_generate",t.detail)}_backHandler(){const t=this.sdkController.getDestination();this.sendEvent("back_navigation_triggered",{had_route:!!this.sdkController.getDestination(),from_destination_id:t?.lazarilloId,from_destination_name:t?.title}),this.destinationId="",this.originId="",this.sdkController.resetData()}_updateFloorHandler(t){const e=t.detail;this.sdkController.setFloor(e),this.sendEvent("floor_change",{floor_id:e})}_startRouteAnimationHandler(){this.sdkController.startRouteAnimation(),this.sendEvent("route_animation_start")}_routeAnimationFinishedHandler(){this.sdkController.routeAnimationFinished(),this.sendEvent("route_animation_finish")}_dismissRouteErrorHandler(){this.sdkController.clearRouteError()}async updateComponent(t){const e=this.destinationId;console.info("[MAP] updateComponent start",{params:t,previousDestinationId:e});try{const i=this._customMapRef||this.shadowRoot?.querySelector("custom-map"),n=!t.originId&&!!t.destinationId;return i&&await i.clearMap(n,"Actualizando mapa..."),t.originId&&(this.originId=t.originId),void 0!==t.destinationId&&(this.destinationId=t.destinationId),t.floor&&this.sdkController.setFloor(t.floor),await this.updateComplete,this.originId&&this.destinationId&&await this.sdkController.setOriginAndDestination(this.originId,this.destinationId),console.info("[MAP] updateComponent complete",{previousDestinationId:e,newDestinationId:this.destinationId}),this.sendEvent("update_component",{previous_destination_id:e,new_destination_id:this.destinationId,new_origin_id:t.originId}),{success:!0,previousDestinationId:e,newDestinationId:this.destinationId}}catch(i){return console.error("[MAP] updateComponent error",i),{success:!1,error:i instanceof Error?i.message:"Unknown error",previousDestinationId:e,newDestinationId:this.destinationId}}}async clearMap(t=!0){const e=this._customMapRef||this.shadowRoot?.querySelector("custom-map");e&&await e.clearMap(t)}isLoading(){const t=this._customMapRef||this.shadowRoot?.querySelector("custom-map");return t?.isLoadingVisible()??!1}getMarkerVisibility(){const t=this._customMapRef||this.shadowRoot?.querySelector("custom-map");return t?.areMarkersVisible()??{originVisible:!1,destinationVisible:!1,bothVisible:!1}}connectedCallback(){super.connectedCallback(),this.addEventListener("accessibilityChange",this._accessibilityChangeHandler),this.addEventListener("repeatRoute",this._repeatRouteHandler),this.addEventListener("generateRoute",this._generateRouteHandler),this.addEventListener("back",this._backHandler),this.addEventListener("startRouteAnimation",this._startRouteAnimationHandler),this.addEventListener("routeAnimationFinished",this._routeAnimationFinishedHandler),this.addEventListener("dismissRouteError",this._dismissRouteErrorHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("accessibilityChange",this._accessibilityChangeHandler),this.removeEventListener("repeatRoute",this._repeatRouteHandler),this.removeEventListener("generateRoute",this._generateRouteHandler),this.removeEventListener("back",this._backHandler),this.removeEventListener("startRouteAnimation",this._startRouteAnimationHandler),this.removeEventListener("routeAnimationFinished",this._routeAnimationFinishedHandler),this.removeEventListener("dismissRouteError",this._dismissRouteErrorHandler)}},e=new WeakMap,i=new WeakMap,n=new WeakMap,o=new WeakMap,d([t.n({type:String})],exports.RouteViewTotems.prototype,"apiKey",1),d([t.n({type:String})],exports.RouteViewTotems.prototype,"parentPlaceId",1),d([t.n({type:String})],exports.RouteViewTotems.prototype,"locale",1),d([t.n({type:String})],exports.RouteViewTotems.prototype,"originId",1),d([t.n({type:String,reflect:!0})],exports.RouteViewTotems.prototype,"destinationId",1),exports.RouteViewTotems=d([t.t("route-view-totems")],exports.RouteViewTotems);
41
41
  //# sourceMappingURL=route-view-totems.cjs.map
@@ -1,4 +1,4 @@
1
- import{c as o,i as r,n as e,t}from"./route-view-totems-BTZ3ElHf.js";import{B as s,e as l}from"./components-CGNn-QWI.js";var i,a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,d=o=>{throw TypeError(o)},c=(o,r,e,t)=>{for(var s,l=t>1?void 0:t?n(r,e):r,i=o.length-1;i>=0;i--)(s=o[i])&&(l=(t?s(r,e,l):s(l))||l);return t&&l&&a(r,e,l),l},f=(o,r,e)=>r.has(o)||d("Cannot "+e);let p=class extends s{constructor(){var o,r,e;super(...arguments),o=this,e=!1,(r=i).has(o)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),this.isOpen=!1,this._handleClickOutside=o=>{this.isOpen&&!this.shadowRoot?.contains(o.target)&&(this.isOpen=!1,this.requestUpdate())}}get disabled(){return f(o=this,r=i,"read from private field"),e?e.call(o):r.get(o);var o,r,e}set disabled(o){var r,e,t;t=o,f(r=this,e=i,"write to private field"),e.set(r,t)}_toggleDropdown(o){this.disabled||(o.stopPropagation(),this.isOpen=!this.isOpen,this.requestUpdate())}_selectFloor(o){this.disabled||(this.selectFloor(o),this.isOpen=!1,this.requestUpdate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutside)}render(){if(!this.sdkData)return o`<div>No data</div>`;const r=this.getFloors(),e=this.getCurrentFloor(),t=e?this.getFloorDisplayName(e):"Seleccionar piso";return o`
1
+ import{c as o,i as r,n as e,t}from"./route-view-totems-LDoUrJDW.js";import{B as s,e as l}from"./components-9th9lb7v.js";var i,a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,d=o=>{throw TypeError(o)},c=(o,r,e,t)=>{for(var s,l=t>1?void 0:t?n(r,e):r,i=o.length-1;i>=0;i--)(s=o[i])&&(l=(t?s(r,e,l):s(l))||l);return t&&l&&a(r,e,l),l},f=(o,r,e)=>r.has(o)||d("Cannot "+e);let p=class extends s{constructor(){var o,r,e;super(...arguments),o=this,e=!1,(r=i).has(o)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),this.isOpen=!1,this._handleClickOutside=o=>{this.isOpen&&!this.shadowRoot?.contains(o.target)&&(this.isOpen=!1,this.requestUpdate())}}get disabled(){return f(o=this,r=i,"read from private field"),e?e.call(o):r.get(o);var o,r,e}set disabled(o){var r,e,t;t=o,f(r=this,e=i,"write to private field"),e.set(r,t)}_toggleDropdown(o){this.disabled||(o.stopPropagation(),this.isOpen=!this.isOpen,this.requestUpdate())}_selectFloor(o){this.disabled||(this.selectFloor(o),this.isOpen=!1,this.requestUpdate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutside)}render(){if(!this.sdkData)return o`<div>No data</div>`;const r=this.getFloors(),e=this.getCurrentFloor(),t=e?this.getFloorDisplayName(e):"Seleccionar piso";return o`
2
2
  <div class="floor-dropdown">
3
3
  <button
4
4
  class=${l({"floor-button":!0,active:!!e,open:this.isOpen})}
@@ -173,4 +173,4 @@ import{c as o,i as r,n as e,t}from"./route-view-totems-BTZ3ElHf.js";import{B as
173
173
  }
174
174
  }
175
175
  `],c([e({type:Boolean})],p.prototype,"disabled",1),p=c([t("compact-floor-selector")],p);export{p as CompactFloorSelector};
176
- //# sourceMappingURL=compact-floor-selector-DPSZGpmP.js.map
176
+ //# sourceMappingURL=compact-floor-selector-BVF9pPKo.js.map
@@ -1,4 +1,4 @@
1
- import{a as t,c as e,r as o,i as n,n as i,d as r,t as s,E as a,A as l}from"./route-view-totems-BTZ3ElHf.js";import{R as c,M as d}from"./utils-BfLnla0S.js";
1
+ import{a as t,c as e,r as o,i as n,n as i,d as r,t as s,E as a,A as l}from"./route-view-totems-LDoUrJDW.js";import{R as c,M as d}from"./utils-DPoAOsZP.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2021 Google LLC
@@ -320,4 +320,4 @@ function m({context:t,subscribe:e}){return(o,n)=>{"object"==typeof n?n.addInitia
320
320
  </div>
321
321
  `:""}
322
322
  `}};ue.styles=[o(":host{position:absolute;top:0;left:0;padding:1rem;z-index:10;font-family:Poppins!important;user-select:none}svg{vertical-align:middle}.back-panel{background-color:#11032b;color:#fff;margin-bottom:5px;padding-left:1.2rem;align-items:center;height:55px;position:relative}.back-content{margin:0;position:relative;top:50%;transform:translateY(-50%);font-size:22px;color:#fff;display:flex;align-items:center;gap:8px;cursor:pointer}.route-panel{width:29.79vw;min-width:415px;max-height:75vh;overflow-y:auto;overflow-x:hidden;border-radius:24px;background:#fff;box-shadow:0 0 24px #00000026}.back-text{font-size:24px;font-weight:600}.back-content img{vertical-align:middle}.route-modal{padding:19px 13px 22px 32px}.icon_switcher_user_type{position:relative;color:#000}.d-flex{display:flex!important}.flex-fill{flex:1 1 auto!important}.place-name{font-weight:700;font-size:32px;line-height:1;letter-spacing:-1.6px;color:#333;margin-left:2px}.repeat-route-btn{display:flex;gap:10px;justify-content:center;align-items:center;text-align:center;background-color:#fff;border:2px solid #000000;border-radius:999px;margin-left:auto;margin-right:0;padding:12px 20px;font-size:20px;font-weight:700;line-height:20px;letter-spacing:-1px;color:#000;transition:background-color .3s ease,color .3s ease;cursor:pointer}.repeat-route-btn[disabled]{color:gray;border-color:gray;cursor:not-allowed;pointer-events:none}.floor-name{font-size:1rem;color:#427553}.floor-specs{font-family:Poppins;font-weight:600;line-height:14px;size:18px}.route-distance{color:#666}.container-controls{margin-top:16px;align-items:end;gap:11px}.c-route-input{color:#000;display:flex;padding:15px;font-size:16px;font-style:normal;font-weight:600;line-height:16px;letter-spacing:-.8px;align-items:center;gap:9px;border-radius:30px;background:#fff;box-shadow:0 0 10px #0000001a;position:relative;margin-top:12px}.c-route-input .c-route-input-icon svg{width:22px;height:22px}.c-route-input-from{margin-top:0}.c-route-input-from:after{content:\"\";position:absolute;bottom:-50%;left:24px;width:3.998px;height:34.5px;z-index:1;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='38' viewBox='0 0 4 38' fill='none'%3E%3Cpath d='M-0.00028944 18.9386C-0.00028944 17.8347 0.894666 16.9397 1.99864 16.9397C3.10259 16.9397 3.99756 17.8347 3.99756 18.9386C3.99756 20.0426 3.10259 20.9375 1.99864 20.9375C0.894666 20.9375 -0.00028944 20.0426 -0.00028944 18.9386ZM-0.00028944 27.2198C-0.00028944 26.1159 0.894666 25.2209 1.99864 25.2209C3.10259 25.2209 3.99756 26.1159 3.99756 27.2198C3.99756 28.3238 3.10259 29.2188 1.99864 29.2188C0.894666 29.2188 -0.00028944 28.3238 -0.00028944 27.2198ZM-0.00028944 35.5011C-0.00028944 34.3971 0.894666 33.5021 1.99864 33.5021C3.10259 33.5021 3.99756 34.3971 3.99756 35.5011C3.99756 36.605 3.10259 37.5 1.99864 37.5C0.894666 37.5 -0.00028944 36.605 -0.00028944 35.5011Z' fill='%23D0D0D0'/%3E%3Cpath d='M1.99864 8.49999C0.894666 8.49999 -0.00028944 9.39496 -0.00028944 10.4989C-0.00028944 11.6029 0.894666 12.4978 1.99864 12.4978C3.10259 12.4978 3.99756 11.6029 3.99756 10.4989C3.99756 9.39496 3.10259 8.49999 1.99864 8.49999Z' fill='%23D0D0D0'/%3E%3Cpath d='M1.99864 0C0.894666 0 -0.00028944 0.894973 -0.00028944 1.99892C-0.00028944 3.10289 0.894666 3.99784 1.99864 3.99784C3.10259 3.99784 3.99756 3.10289 3.99756 1.99892C3.99756 0.894973 3.10259 0 1.99864 0Z' fill='%23D0D0D0'/%3E%3C/svg%3E\")}.c-route-input span{padding:0 6px;border-radius:15px;color:#454545;background:#f2f2f2;font-size:10px;font-style:normal;font-weight:600;line-height:14px;letter-spacing:-.5px}.accessibility-switch{display:flex;align-items:center;justify-content:center;min-width:100px;height:50px;border-radius:48px;background-color:#fff;box-shadow:0 0 15px #0003;position:relative}.accessibility-switch:before,.accessibility-switch:after{content:\"\";border-radius:50%;width:50%;height:100%;background:#000;position:absolute;bottom:0;left:0;background:linear-gradient(45.8deg,#f5a 10.03%,#b850c9 25.23%,#6572d6 48.67%,#4eaeb8 72.74%);z-index:0;transition:transform .5s ease}.accessibility-switch:after{background:#000;clip-path:circle(22px);z-index:1}.accessibility-switch.accessible:before,.accessibility-switch.accessible:after{transform:translate(100%)}.accessibility-switch-icon{width:50px;height:100%;display:grid;place-items:center;cursor:pointer;z-index:2;transition:color .5s ease;color:#000}.accessibility-switch-icon.active{color:#fff}.generate-route-btn{border-style:solid;width:100%;border-radius:30px;height:58px;background-color:#11032b;cursor:pointer}.generate-route-btn span{font-family:Poppins;font-size:1rem;line-height:16px;font-weight:600;text-align:center;color:#fff}.generate-route-container{width:100%}.mt-3{margin-top:1rem!important}.align-items-center{align-items:center!important}.justify-content-center{justify-content:center!important}.error-modal-overlay{position:fixed;inset:0;background:#00000080;backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000}.error-modal{background:#fff;color:#11032b;border-radius:24px;padding:32px;text-align:center;max-width:350px;box-shadow:0 0 24px #0000004d;animation:fadeInScale .2s ease-out}@keyframes fadeInScale{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.error-icon{margin-bottom:16px;color:#11032b}.error-message{font-size:18px;margin:0 0 24px;line-height:1.4;font-weight:500}.error-btn{background:#11032b;color:#fff;border:none;border-radius:30px;padding:12px 40px;font-size:16px;font-weight:600;cursor:pointer;transition:background-color .2s ease}.error-btn:hover{background:#1a0540}.loading-overlay{position:fixed;inset:0;background:#ffffffd9;backdrop-filter:blur(4px);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:9999}.loading-spinner{width:60px;height:60px;border:4px solid #f3f3f3;border-top:4px solid #11032b;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-text{margin-top:16px;font-size:18px;font-weight:600;color:#11032b}.error-icon.network-error{color:#e74c3c}")],de([m({context:b,subscribe:!0})],ue.prototype,"sdkData",2),ue=de([s("route-options")],ue);const he=/*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({__proto__:null,get RouteOptions(){return ue}},Symbol.toStringTag,{value:"Module"}));export{_ as B,P as c,T as e,S as f,f as i,ae as q,he as r,b as s};
323
- //# sourceMappingURL=components-CGNn-QWI.js.map
323
+ //# sourceMappingURL=components-9th9lb7v.js.map
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,a as o,A as r,l as a,b as i,p as s,R as l,c as n,t as c}from"./route-view-totems-BTZ3ElHf.js";import{S as p}from"./utils-BfLnla0S.js";var d,h,m,v,f,w,y,x,u,g=Object.defineProperty,b=Object.getOwnPropertyDescriptor,z=e=>{throw TypeError(e)},S=(e,t,o,r)=>{for(var a,i=r>1?void 0:r?b(t,o):t,s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r?a(t,o,i):a(i))||i);return r&&i&&g(t,o,i),i},I=(e,t,o)=>t.has(e)||z("Cannot "+o),k=(e,t,o)=>(I(e,t,"read from private field"),o?o.call(e):t.get(e)),P=(e,t,o)=>t.has(e)?z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),C=(e,t,o,r)=>(I(e,t,"write to private field"),t.set(e,o),o);let _=class extends o{constructor(){super(...arguments),P(this,d,""),P(this,h,""),P(this,m,"es"),P(this,v,""),P(this,f,!1),P(this,w,"normal"),P(this,y,!0),P(this,x,"top-left"),P(this,u,!1),this._swPath="/mvx-tiles-sw.js",this._swScope="/",this.sdkController=new p(this),this.analyticsController=r.getInstance(),this.currentFloorId=""}get apiKey(){return k(this,d)}set apiKey(e){C(this,d,e)}get parentPlaceId(){return k(this,h)}set parentPlaceId(e){C(this,h,e)}get locale(){return k(this,m)}set locale(e){C(this,m,e)}get placeId(){return k(this,v)}set placeId(e){C(this,v,e)}get compactMode(){return k(this,f)}set compactMode(e){C(this,f,e)}get zoomButtonSize(){return k(this,w)}set zoomButtonSize(e){C(this,w,e)}get showFloorSelector(){return k(this,y)}set showFloorSelector(e){C(this,y,e)}get floorSelectorPosition(){return k(this,x)}set floorSelectorPosition(e){C(this,x,e)}get floorSelectorDisabled(){return k(this,u)}set floorSelectorDisabled(e){C(this,u,e)}async _loadComponents(){await Promise.all([a(),i()])}_preloadApiRequests(){const e=this.apiKey||this.getAttribute("apiKey")||"",t=this.parentPlaceId||this.getAttribute("parentPlaceId")||"",o=this.locale||this.getAttribute("locale")||"es";if(!e||!t)return;const r=e=>{const t=`mvx-preload:${e}`;if(document.head.querySelector(`link[data-mvx-preload="${t}"]`))return;const o=document.createElement("link");o.rel="preload",o.as="fetch",o.href=e,o.crossOrigin="anonymous",o.setAttribute("fetchpriority","high"),o.setAttribute("data-mvx-preload",t),document.head.appendChild(o)},a="https://api.mapvx.com/sdk/",i=encodeURIComponent;r(`${a}v3/place?token=${i(e)}&place_id=${i(t)}&lang=${i(o)}`),r(`https://api.mapvx.com/api/configuration?token=${i(e)}&lang=${i(o)}&place_id=${i(t)}`),this.placeId&&r(`${a}v3/place?token=${i(e)}&place_id=${i(this.placeId)}&lang=${i(o)}`)}async _registerTileCacheSW(){if("serviceWorker"in navigator)try{await navigator.serviceWorker.register(this._swPath,{scope:this._swScope})}catch{}}async firstUpdated(){this._registerTileCacheSW();const e=this._loadComponents(),t=s();await Promise.all([e,t]),this.analyticsController.initialize("map-view-with-modal"),l.initialize("map-view-with-modal")}_mapReadyHandler(){this.sdkController.setMapReady(!0),this.analyticsController.trackEvent("map_ready",this.baseParams())}_cameraInitializedHandler(){this.sdkController.setCameraInitialized(!0),this.analyticsController.trackEvent("camera_initialized",this.baseParams())}_updateFloorHandler(e){const t=e.detail;if(this.currentFloorId===t)return;this.currentFloorId=t,this.sdkController.setFloor(t);const o=this.baseParams();o.floor_id=t,this.analyticsController.trackEvent("floor_change",o)}baseParams(){return{apiKey:this.apiKey,locale:this.locale,parentPlaceId:this.parentPlaceId,placeId:this.placeId,host:window.location.host,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer,userAgent:navigator.userAgent,screenWidth:window.innerWidth}}getFloorSelectorPositionStyles(){const e={"top-left":"top: 20px; left: 20px;","top-center":"top: 20px; left: 50%; transform: translateX(-50%);","top-right":"top: 20px; right: 20px;","center-left":"top: 50%; left: 20px; transform: translateY(-50%);","center-right":"top: 50%; right: 20px; transform: translateY(-50%);","bottom-left":"bottom: 20px; left: 20px;","bottom-center":"bottom: 20px; left: 50%; transform: translateX(-50%);","bottom-right":"bottom: 20px; right: 20px;"};return e[this.floorSelectorPosition]||e["top-left"]}updated(e){this.apiKey&&this.locale&&this.parentPlaceId&&(e.has("apiKey")||e.has("locale")||e.has("parentPlaceId"))&&(this._preloadApiRequests(),this.sdkController.prewarm(this.apiKey,this.locale,this.parentPlaceId,{destinationId:this.placeId}),this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId)),this.placeId&&e.has("placeId")&&this.sdkController.setOriginAndDestination("",this.placeId)}render(){return n`
1
+ import{i as e,n as t,a as o,A as r,l as a,b as i,p as s,R as l,c as n,t as c}from"./route-view-totems-LDoUrJDW.js";import{S as p}from"./utils-DPoAOsZP.js";var d,h,m,v,f,w,y,x,u,g=Object.defineProperty,b=Object.getOwnPropertyDescriptor,z=e=>{throw TypeError(e)},S=(e,t,o,r)=>{for(var a,i=r>1?void 0:r?b(t,o):t,s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r?a(t,o,i):a(i))||i);return r&&i&&g(t,o,i),i},I=(e,t,o)=>t.has(e)||z("Cannot "+o),k=(e,t,o)=>(I(e,t,"read from private field"),o?o.call(e):t.get(e)),P=(e,t,o)=>t.has(e)?z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),C=(e,t,o,r)=>(I(e,t,"write to private field"),t.set(e,o),o);let _=class extends o{constructor(){super(...arguments),P(this,d,""),P(this,h,""),P(this,m,"es"),P(this,v,""),P(this,f,!1),P(this,w,"normal"),P(this,y,!0),P(this,x,"top-left"),P(this,u,!1),this._swPath="/mvx-tiles-sw.js",this._swScope="/",this.sdkController=new p(this),this.analyticsController=r.getInstance(),this.currentFloorId=""}get apiKey(){return k(this,d)}set apiKey(e){C(this,d,e)}get parentPlaceId(){return k(this,h)}set parentPlaceId(e){C(this,h,e)}get locale(){return k(this,m)}set locale(e){C(this,m,e)}get placeId(){return k(this,v)}set placeId(e){C(this,v,e)}get compactMode(){return k(this,f)}set compactMode(e){C(this,f,e)}get zoomButtonSize(){return k(this,w)}set zoomButtonSize(e){C(this,w,e)}get showFloorSelector(){return k(this,y)}set showFloorSelector(e){C(this,y,e)}get floorSelectorPosition(){return k(this,x)}set floorSelectorPosition(e){C(this,x,e)}get floorSelectorDisabled(){return k(this,u)}set floorSelectorDisabled(e){C(this,u,e)}async _loadComponents(){await Promise.all([a(),i()])}_preloadApiRequests(){const e=this.apiKey||this.getAttribute("apiKey")||"",t=this.parentPlaceId||this.getAttribute("parentPlaceId")||"",o=this.locale||this.getAttribute("locale")||"es";if(!e||!t)return;const r=e=>{const t=`mvx-preload:${e}`;if(document.head.querySelector(`link[data-mvx-preload="${t}"]`))return;const o=document.createElement("link");o.rel="preload",o.as="fetch",o.href=e,o.crossOrigin="anonymous",o.setAttribute("fetchpriority","high"),o.setAttribute("data-mvx-preload",t),document.head.appendChild(o)},a="https://api.mapvx.com/sdk/",i=encodeURIComponent;r(`${a}v3/place?token=${i(e)}&place_id=${i(t)}&lang=${i(o)}`),r(`https://api.mapvx.com/api/configuration?token=${i(e)}&lang=${i(o)}&place_id=${i(t)}`),this.placeId&&r(`${a}v3/place?token=${i(e)}&place_id=${i(this.placeId)}&lang=${i(o)}`)}async _registerTileCacheSW(){if("serviceWorker"in navigator)try{await navigator.serviceWorker.register(this._swPath,{scope:this._swScope})}catch{}}async firstUpdated(){this._registerTileCacheSW();const e=this._loadComponents(),t=s();await Promise.all([e,t]),this.analyticsController.initialize("map-view-with-modal"),l.initialize("map-view-with-modal")}_mapReadyHandler(){this.sdkController.setMapReady(!0),this.analyticsController.trackEvent("map_ready",this.baseParams())}_cameraInitializedHandler(){this.sdkController.setCameraInitialized(!0),this.analyticsController.trackEvent("camera_initialized",this.baseParams())}_updateFloorHandler(e){const t=e.detail;if(this.currentFloorId===t)return;this.currentFloorId=t,this.sdkController.setFloor(t);const o=this.baseParams();o.floor_id=t,this.analyticsController.trackEvent("floor_change",o)}baseParams(){return{apiKey:this.apiKey,locale:this.locale,parentPlaceId:this.parentPlaceId,placeId:this.placeId,host:window.location.host,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer,userAgent:navigator.userAgent,screenWidth:window.innerWidth}}getFloorSelectorPositionStyles(){const e={"top-left":"top: 20px; left: 20px;","top-center":"top: 20px; left: 50%; transform: translateX(-50%);","top-right":"top: 20px; right: 20px;","center-left":"top: 50%; left: 20px; transform: translateY(-50%);","center-right":"top: 50%; right: 20px; transform: translateY(-50%);","bottom-left":"bottom: 20px; left: 20px;","bottom-center":"bottom: 20px; left: 50%; transform: translateX(-50%);","bottom-right":"bottom: 20px; right: 20px;"};return e[this.floorSelectorPosition]||e["top-left"]}updated(e){this.apiKey&&this.locale&&this.parentPlaceId&&(e.has("apiKey")||e.has("locale")||e.has("parentPlaceId"))&&(this._preloadApiRequests(),this.sdkController.prewarm(this.apiKey,this.locale,this.parentPlaceId,{destinationId:this.placeId}),this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId)),this.placeId&&e.has("placeId")&&this.sdkController.setOriginAndDestination("",this.placeId)}render(){return n`
2
2
  <div class="route-container" style="height: 100%; width: 100%; position: relative;">
3
3
  <custom-map
4
4
  class="map-container"
@@ -74,4 +74,4 @@ import{i as e,n as t,a as o,A as r,l as a,b as i,p as s,R as l,c as n,t as c}fro
74
74
  overflow: hidden;
75
75
  }
76
76
  `],S([t({type:String})],_.prototype,"apiKey",1),S([t({type:String})],_.prototype,"parentPlaceId",1),S([t({type:String})],_.prototype,"locale",1),S([t({type:String})],_.prototype,"placeId",1),S([t({type:Boolean,attribute:"compact-mode",reflect:!0})],_.prototype,"compactMode",1),S([t({type:String,attribute:"zoom-size",reflect:!0})],_.prototype,"zoomButtonSize",1),S([t({type:Boolean})],_.prototype,"showFloorSelector",1),S([t({type:String})],_.prototype,"floorSelectorPosition",1),S([t({type:Boolean})],_.prototype,"floorSelectorDisabled",1),_=S([c("map-view-with-modal")],_);export{_ as M};
77
- //# sourceMappingURL=map-view-with-modal-CQ7XDDrk.js.map
77
+ //# sourceMappingURL=map-view-with-modal-DmQa3IAV.js.map