@panoramax/web-viewer 4.0.3-develop-001b0de1 → 4.0.3-develop-885abb56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/docs/reference/components/ui/Map.md +2 -2
- package/docs/reference/components/ui/MapMore.md +2 -2
- package/package.json +1 -1
- package/src/components/core/Editor.js +1 -0
- package/src/components/ui/Map.js +5 -2
- package/src/utils/map.js +1 -1
package/build/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
!function(at,st){"object"===typeof exports&&"object"===typeof module?module.exports=st():"function"===typeof define&&define.amd?define("Panoramax",[],st):"object"===typeof exports?exports.Panoramax=st():at.Panoramax=st()}(this,(()=>(()=>{var at={9039:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Basic});var ut=ot(4542),Hl=ot(5254),rc=ot(4964),sc=ot(8340),oc=ot(5995),_c=ot(7343),wc=ot(2614),Sc=ot.n(wc),iu=ot(8330);ot(1865),ot(3638);class Basic extends ut.WF{constructor(){let at=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this.mapstyle=this.getAttribute("mapstyle")||sc.DEFAULT_TILES,this.lang=this.getAttribute("lang")||null,this.endpoint=this.getAttribute("endpoint")||null,this.picture=this.getAttribute("picture")||null,this.sequence=this.getAttribute("sequence")||null,console.info(`\ud83d\udcf7 Panoramax ${this.getClassName()} - Version ${iu.rE} (001b0de)\n\n\ud83c\udd98 Issues can be reported at ${iu.Jk.O}`),at||(this._isInternetFast=null,(0,_c.isInternetFast)().then((at=>this._isInternetFast=at)))}connectedCallback(){super.connectedCallback(),this._t=(0,rc.getTranslations)(this.lang),this.loader=(0,oc.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,_c.isInIframe)()}),this._loadsAPI&&this.endpoint&&this._loadsAPI===this.endpoint||this.api&&this.api._endpoint===this.endpoint||!this.endpoint||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())}_setupAPI(){if(this.loader=this.loader||(0,oc.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let at=this.endpoint;try{this.mapstyle=JSON.parse(this.mapstyle)}catch(ot){}try{this.api=new Hl.A(this.endpoint,{users:this.users,fetch:this.fetchOptions,style:this.mapstyle}),this.api.onceReady().then((()=>{if(at!=this._loadsAPI||!this.api)return;let st=this.api.getUnavailableFeatures(),ot=this.api.getAvailableFeatures();ot=0===st.length?"\u2705 All features available":"\u2705 Available features: "+ot.join(", "),st=0===st.length?"":"\ud83d\udeab Unavailable features: "+st.join(", "),console.info(`\ud83c\udf10 Connected to API "${this.api._metadata.name}" (${this.api._endpoint})\n\u2139\ufe0f API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version?"& GeoVisio "+this.api._metadata.geovisio_version:""}\n ${ot}\n ${st}\n`.trim())})).catch((at=>this.loader.dismiss(at,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(ot){var st;delete this._loadsAPI,null!==(st=this.loader)&&void 0!==st&&st.dismiss?this.loader.dismiss(ot,this._t.pnx.error_api):console.error(ot)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((at=>setTimeout(at,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(at,st,ot){if(super.attributeChangedCallback(at,st,ot),"endpoint"===at&&(this._loadsAPI&&ot&&this._loadsAPI===ot||this.api&&this.api._endpoint===ot||!ot||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(at)){let ut,Hl,rc,sc;"picture"===at?(ut=this.sequence,rc=this.sequence,Hl=ot,sc=st):(ut=ot,rc=st,Hl=this.picture,sc=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:ut,picId:Hl,prevSeqId:rc,prevPicId:sc}}))}}getClassName(){return"Basic"}select(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(this.picture=null,this.sequence=null),this.picture=st,this.sequence=at}isWidthSmall(){return(null===this||void 0===this?void 0:this.offsetWidth)<576}isHeightSmall(){return(null===this||void 0===this?void 0:this.offsetHeight)<400}render(){return ut.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(at,st,ot){let ut=at.split(":").shift();if(ut&&this.getSubComponentsNames().includes(ut)){var Hl;const rc=at.substring(ut.length+1);null!==(Hl=this[ut])&&void 0!==Hl&&Hl.addEventListener?this[ut].addEventListener(rc,st,ot):setTimeout((()=>this.addEventListener(at,st,ot)),50)}else super.addEventListener(at,st,ot)}static GetJSONConverter(){return{fromAttribute:at=>"object"===typeof at?at:Sc().parse(at),toAttribute:at=>JSON.stringify(at)}}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},fetchOptions:{converter:Basic.GetJSONConverter()},users:{type:Array,reflect:!0},mapstyle:{type:String},lang:{type:String},endpoint:{type:String}}},153:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>CoverageMap});var ut=ot(9039),Hl=ot(5642),rc=ot(8340),sc=ot(927),oc=(ot(7776),ot(2118));class CoverageMap extends ut.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new oc.Ay(oc.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}disconnectedCallback(){var at;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy()}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((at=>setTimeout(at,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const at=super.getSubComponentsNames();return at.push("map"),at}_initMap(){class MyMap extends Hl.A{_getLayerStyleProperties(at){return"pictures_symbols"===at?{layout:{visibility:"none"}}:super._getLayerStyleProperties(at)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new sc.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(at=>this.select(at.seqId,at.picId))),this.map.on("sequence-click",(at=>this.select(at.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,oc.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(at){if(at.detail.picId||at.detail.seqId){const st=at.detail.picId?"pictures":"sequences",ot=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((at=>(0,rc.getUserLayerId)(at,st))),filter:["==",["get","id"],at.detail.picId||at.detail.seqId]});ot.length>=0&&null!=ot[0]&&this.map._attachPreviewToPictures({features:ot},st)}}}CoverageMap.properties={map:{converter:ut.A.GetJSONConverter()},...ut.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Editor});ot(7365);var ut=ot(9039),Hl=ot(5642),rc=ot(9048),sc=(ot(7534),ot(6810),ot(508)),oc=ot(8340),_c=ot(1545),wc=(ot(4542),ot(5995));const Sc="sequence-headings";class Editor extends ut.A{constructor(){super(),this.raster=null,this.background="streets",this.users=[],this._psvContainer=document.createElement("div"),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this.sequence||this.loader.dismiss({},"No sequence is selected"),this.addEventListener("select",this._onSelect.bind(this)),this._initPSV(),this._initMap()}))}disconnectedCallback(){var at,st;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy(),null===(st=this.psv)||void 0===st||st.destroy()}getClassName(){return"Editor"}onceReady(){var at,st;return this.map&&this.psv&&null!==(at=(st=this.map).loaded)&&void 0!==at&&at.call(st)?Promise.resolve():new Promise((at=>setTimeout(at,100))).then(this.onceReady.bind(this))}connectedCallback(){Array.isArray(this.users)&&this.users.length>0&&(console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"),this.users=[]),super.connectedCallback()}attributeChangedCallback(at,st,ot){"users"===at&&Array.isArray(ot)&&ot.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(at,st,ot)}render(){return[this.loader,this._psvContainer,this._mapContainer]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv"])}_initPSV(){try{this.psv=new rc.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(at){let st=_c.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(at,st)}}_initMap(){try{this.map=new Hl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15}),(0,oc.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const at=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=st=>(st=void 0===this._lastRelHeading?st:st+this._lastRelHeading-this.psv.getPictureRelativeHeading(),at(st))}catch(at){this.loader.dismiss(at,this._t.pnx.error_psv)}}_createMapStyle(){return{sources:{geovisio_editor_sequences:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"geovisio_editor_sequences",type:"line",source:"geovisio_editor_sequences",layout:{...oc.VECTOR_STYLES.SEQUENCES.layout},paint:{...oc.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...oc.VECTOR_STYLES.PICTURES.layout},paint:{...oc.VECTOR_STYLES.PICTURES.paint}}]}}_bindPicturesEvents(){this.map.on("mousemove","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor=""})),this.map.on("click","geovisio_editor_pictures",this.map._onPictureClick.bind(this.map))}_loadSequence(){return this.loader.setAttribute("value",60),this.api.getSequenceItems(this.sequence).then((at=>{if(this.loader.setAttribute("value",80),this.map.once("sourcedata",(()=>{this.map.setPaintProperty("geovisio_editor_sequences","line-color",this.map._getLayerColorStyle("sequences")),this.map.setPaintProperty("geovisio_editor_pictures","circle-color",this.map._getLayerColorStyle("pictures")),this.map.setLayoutProperty("geovisio_editor_sequences","visibility","visible"),this.map.setLayoutProperty("geovisio_editor_pictures","visibility","visible"),this.map.once("styledata",(()=>this.loader.dismiss()))})),this._sequenceData=at.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:at.features.map((at=>at.geometry.coordinates))}},...at.features.map((at=>(at.properties.id=at.id,at.properties.sequences=[this.sequence],at)))]}),this.picture){const st=at.features.find((at=>at.id===this.picture));st?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:st.geometry.coordinates,zoom:18})):console.log("Picture with ID",st,"was not found")}else{const st=[...at.features[0].geometry.coordinates,...at.features[0].geometry.coordinates];for(let ot=1;ot<at.features.length;ot++){const ut=at.features[ot].geometry.coordinates;ut[0]<st[0]&&(st[0]=ut[0]),ut[1]<st[1]&&(st[1]=ut[1]),ut[0]>st[2]&&(st[2]=ut[0]),ut[1]>st[3]&&(st[3]=ut[1])}this.map.fitBounds(st,{animate:!1})}})).catch((at=>this.loader.dismiss(at,this._t.pnx.error_api)))}_getNode(at){const st=this._sequenceData.find((st=>st.properties.id===at)),ot=st?(0,sc.apiFeatureToPSVNode)(st,this._t,this._isInternetFast):null;return ot&&delete ot.links,ot}_addMapBackgroundWidget(){const at=(0,wc.createWebComp)("pnx-map-background",{_parent:this,size:"sm"});this._mapContainer.appendChild(at)}previewSequenceHeadingChange(at){const st=void 0!==this.map.getLayer(Sc);if(this.map._picMarkerPreview.remove(),void 0===at)return delete this._lastRelHeading,st&&this.map.setLayoutProperty(Sc,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=at,st||this.map.addLayer({id:Sc,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const ot=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Sc,"visibility","visible"),this.map.setLayoutProperty(Sc,"icon-rotate",["+",["get","view:azimuth"],ot,at]);const ut=[["==",["geometry-type"],"Point"]];this.picture&&ut.push(["!=",["get","id"],this.picture]),this.map.setFilter(Sc,["all",...ut]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{converter:ut.A.GetJSONConverter()},background:{type:String},...ut.A.properties},customElements.define("pnx-editor",Editor)},3407:(at,st,ot)=>{"use strict";ot.d(st,{Ay:()=>PhotoViewer,RD:()=>su});ot(970);var ut=ot(1545),Hl=ot(4451),rc=ot(9039),sc=ot(9048),oc=ot(5995),_c=ot(7343),wc=ot(2118),Sc=ot(4207);const iu=Math.PI/6,su=["pnx-mini","pnx-widget-player","pnx-widget-zoom"];class PhotoViewer extends rc.A{constructor(){super(),this.psv={},this["url-parameters"]=this.getAttribute("url-parameters")||!0,this["keyboard-shortcuts"]=this.getAttribute("keyboard-shortcuts")||!0,this.widgets=this.getAttribute("widgets")||"true",this.grid=(0,oc.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,oc.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)})}_createInitParamsHandler(){var at,st;this._initParams=new wc.Ay(wc.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(at=this.urlHandler)||void 0===at?void 0:at.currentURLParams(),null===(st=this.urlHandler)||void 0===st?void 0:st.currentURLParams(!0)),{})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,oc.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.isWidthSmall()?(this.legend=(0,oc.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,oc.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().picture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(at=>{(0,_c.isNullId)(at.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,oc.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?void 0:"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend),this.grid.appendChild((0,oc.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))))}connectedCallback(){super.connectedCallback(),this.presetsManager=new Sc.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new Hl.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()}))),this.onceAPIReady().then(this._postAPIInit.bind(this))}disconnectedCallback(){var at,st;super.disconnectedCallback(),null===(at=this.urlHandler)||void 0===at||at.destroy(),null===(st=this.psv)||void 0===st||st.destroy()}firstUpdated(){super.firstUpdated(),this._moveChildToGrid()}getClassName(){return"PhotoViewer"}onceReady(){return this.oncePSVReady().then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}render(){return[this.loader,this.grid,this.popup]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["psv","grid","popup","urlHandler"])}oncePSVReady(){let at;return new Promise((st=>{at=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(at),st()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(at),st()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((at=>{this.psv.addEventListener("picture-loaded",at,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const at=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,wc.ai)(this,at),at.keyboardShortcuts&&this._handleKeyboardManagement(),at.picture?this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new sc.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...ut.zY.keyboardActions,8:"ROTATE_UP",2:"ROTATE_DOWN",4:"ROTATE_LEFT",6:"ROTATE_RIGHT",PageUp:()=>this.psv.goToNextPicture(),9:()=>this.psv.goToNextPicture(),PageDown:()=>this.psv.goToPrevPicture(),3:()=>this.psv.goToPrevPicture(),5:()=>this.moveCenter(),"*":()=>this.moveCenter(),Home:()=>this._toggleFocus(),7:()=>this._toggleFocus(),End:()=>this.mini.toggleAttribute("collapsed"),1:()=>this.mini.toggleAttribute("collapsed")," ":()=>this.psv.toggleSequencePlaying(),0:()=>this.psv.toggleSequencePlaying()},...this._initParams.getPSVInit()}),this.oncePSVReady().then((()=>{this.loader.setAttribute("value",50),(0,wc.Vy)(this.psv,this._initParams.getPSVPostInit())}))}catch(at){let st=ut.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(at,st)}}_handleKeyboardManagement(){const keytonone=()=>this.psv.stopKeyboardControl(),keytopsv=()=>this.psv.startKeyboardControl();this.popup.addEventListener("open",keytonone),this.popup.addEventListener("close",keytopsv),this.psv.addEventListener("click",keytopsv);for(let at of this.grid.childNodes)"bg"===at.getAttribute("slot")||su.includes(at.tagName.toLowerCase())||(at.addEventListener("focusin",keytonone),at.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytopsv()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((at=>{var st;null!==(st=at.tagName)&&void 0!==st&&st.toLowerCase().startsWith("pnx-")&&(at._parent=this,at._t=this._t),"editors"===at.getAttribute("slot")?this.onceReady().then((()=>{var st;return null===(st=this.legend)||void 0===st?void 0:st.appendChild(at)})):this.grid.appendChild(at)}))}setPopup(at){let st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;at?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof st?this.popup.innerHTML=st:Array.isArray(st)&&st.forEach((at=>this.popup.appendChild(at)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,oc.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,oc.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,oc.createWebComp)("pnx-share-menu",{_parent:this})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:sc.LM,yaw:0,pitch:0,zoom:sc.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(at){let st=this.psv.getPosition();switch(at){case"up":st.pitch+=iu;break;case"left":st.yaw-=iu;break;case"down":st.pitch-=iu;break;case"right":st.yaw+=iu}this._psvAnimate({speed:sc.LM,...st})}_psvAnimate(at){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(at)}addEventListener(at,st,ot){super.addEventListener(at,st,ot)}}PhotoViewer.properties={psv:{converter:rc.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},...rc.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(at,st,ot)=>{"use strict";ot.d(st,{$:()=>su,A:()=>Viewer});ot(9616);var ut=ot(8340),Hl=ot(3407),rc=(ot(9039),ot(2771)),sc=ot(7343),oc=ot(5995),_c=ot(9683),wc=ot(2e3),Sc=ot(9438),iu=ot(2118);const su=20,lu=(Math.PI,100);class Viewer extends Hl.Ay{constructor(){super(),this.map=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,oc.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,sc.isNullId)(this.picture)||void 0}),this.mini.addEventListener("expand",this._toggleFocus.bind(this)),this.grid.appendChild(this.mini),this.mapContainer=document.createElement("div")}_createInitParamsHandler(){var at,st;this._initParams=new iu.Ay(iu.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(at=this.urlHandler)||void 0===at?void 0:at.currentURLParams(),null===(st=this.urlHandler)||void 0===st?void 0:st.currentURLParams(!0)),{map:(0,ut.getMapParamsFromLocalStorage)()})}_initWidgets(){var at,st;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,oc.createWebComp)("pnx-widget-zoom",{slot:this.isWidthSmall()?"top-left":"bottom-right",class:this.isWidthSmall()?"pnx-only-map pnx-print-hidden":"pnx-print-hidden",_parent:this})),this.isWidthSmall()?(this.legend=(0,oc.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,oc.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().picture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(at=>{(0,sc.isNullId)(at.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,oc.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?"top":"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend),this.grid.appendChild((0,oc.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-geosearch",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,class:"pnx-only-map pnx-print-hidden",geocoder:this._initParams.getParentPostInit().geocoder})),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-mapfilters",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,"user-search":null!==this.api._endpoints.user_search&&null!==this.api._endpoints.user_tiles,"quality-score":(null===(at=this.map)||void 0===at||null===(st=at._hasQualityScore)||void 0===st?void 0:st.call(at))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"})))}disconnectedCallback(){var at;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy()}getClassName(){return"Viewer"}getSubComponentsNames(){return super.getSubComponentsNames().concat(["mini","map"])}onceReady(){return Promise.all([this.oncePSVReady(),this.onceMapReady()]).then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}attributeChangedCallback(at,st,ot){var ut,Hl,rc,oc;(super.attributeChangedCallback(at,st,ot),"picture"===at)&&(null===(ut=this.legend)||void 0===ut||null===(Hl=ut.setAttribute)||void 0===Hl||Hl.call(ut,"picture",ot),(0,sc.isNullId)(st)&&!(0,sc.isNullId)(ot)&&this.mini.removeAttribute("collapsed"),(0,sc.isNullId)(ot)?this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map"):(this.mini.classList.remove("pnx-hidden"),(0,sc.isNullId)(st)&&(this._setFocus("pic"),"closed"===(null===(rc=this.bottomDrawer)||void 0===rc||null===(oc=rc.getAttribute)||void 0===oc?void 0:oc.call(rc,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened"))));"focus"===at&&this._setFocus(ot)}onceMapReady(){if(!this.map)return Promise.resolve();let at;return new Promise((st=>{at=setInterval((()=>{var ot,ut,Hl;"object"===typeof this.map&&(null!==(ot=this.map)&&void 0!==ot&&null!==(ut=ot.loaded)&&void 0!==ut&&ut.call(ot)?(clearInterval(at),st()):null!==(Hl=this.map)&&void 0!==Hl&&Hl.once&&this.map.once("render",(()=>{clearInterval(at),st()})))}),250)}))}async _initMap(){await new Promise((at=>{this.map=new rc.A(this,this.mapContainer,this._initParams.getMapInit()),(0,ut.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),at()}))})),await(0,iu.mK)(this.map,this._initParams.getMapPostInit()),(0,ut.initMapKeyboardHandler)(this),(0,ut.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const at=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,iu.iz)(this,at),at.keyboardShortcuts&&this._handleKeyboardManagement(),at.picture?this.psv.addEventListener("picture-loaded",(()=>{(0,iu.iz)(this,at),this.loader.dismiss()}),{once:!0}):this.loader.dismiss()}_handleKeyboardManagement(){const keytomap=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.enable()},keytopsv=()=>{this.psv.startKeyboardControl(),this.map.keyboard.disable()},keytonone=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.disable()},keytofocused=()=>{this.map&&this.isMapWide()?keytomap():keytopsv()};this.addEventListener("focus-changed",(at=>{"map"===at.detail.focus&&keytomap(),this.popup.getAttribute("visible")?keytonone():keytopsv()})),this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytofocused()));for(let at of this.grid.childNodes)"bg"===at.getAttribute("slot")||Hl.RD.includes(at.tagName.toLowerCase())||(at.addEventListener("focusin",(()=>keytonone())),at.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytofocused()})))}moveCenter(){const at=this.psv.getPictureMetadata();at&&(this.map&&this.isMapWide()?this.map.flyTo({center:at.gps,zoom:20}):super.moveCenter())}_moveToDirection(at){if(this.map&&this.isMapWide()){let st;switch(at){case"up":st=[0,-100];break;case"left":st=[-100,0];break;case"down":st=[0,lu];break;case"right":st=[lu,0]}this.map.panBy(st)}else super._moveToDirection(at)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(at){var st,ot,ut,Hl;let rc=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Sc=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===at&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(at))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=at,(Sc||("map"!==at||!this.map||!this.isMapWide())&&("pic"!==at||this.map&&this.isMapWide()))&&("map"===at?(this.psvContainer.parentNode==this.grid&&(this.grid.removeChild(this.psvContainer),this.psvContainer.removeAttribute("slot")),this.mapContainer.parentNode==this.mini&&this.mini.removeChild(this.mapContainer),this.mapContainer.setAttribute("slot","bg"),this.grid.appendChild(this.mapContainer),this.mini.appendChild(this.psvContainer),this.mini.icon=(0,oc.fa)(_c.pt),(0,sc.isNullId)(this.picture)?this.mini.classList.add("pnx-hidden"):this.mini.classList.remove("pnx-hidden"),this.map.getCanvas().focus()):(this.mapContainer.parentNode==this.grid&&(this.grid.removeChild(this.mapContainer),this.mapContainer.removeAttribute("slot")),this.psvContainer.parentNode==this.mini&&this.mini.removeChild(this.psvContainer),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.mini.classList.remove("pnx-hidden"),this.mini.appendChild(this.mapContainer),this.mini.icon=(0,oc.fa)(wc.e5),this.psvContainer.focus()),null===this||void 0===this||null===(st=this.map)||void 0===st||null===(ot=st.resize)||void 0===ot||ot.call(st),this.psv.autoSize(),this.psv.forceRefresh(),null===(ut=this.legend)||void 0===ut||null===(Hl=ut.setAttribute)||void 0===Hl||Hl.call(ut,"focus",this.focus),!rc)){const st=new CustomEvent("focus-changed",{detail:{focus:at}});this.dispatchEvent(st)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var at;const st=(0,Sc.qi)("#pnx-map-filters-menu"),ot=null===st||void 0===st?void 0:st.shadowRoot.getElementById("pnx-filter-date-from"),ut=null===st||void 0===st?void 0:st.shadowRoot.getElementById("pnx-filter-date-end"),Hl=null===st||void 0===st?void 0:st.shadowRoot.querySelectorAll("input[name='pnx-filter-type']"),rc=(0,Sc.qi)("#pnx-map-theme");let sc="";for(let wc=0;wc<Hl.length;wc++){const at=Hl[wc];if(at.checked){sc=at.value;break}}let oc=[];if(null!==(at=this.map)&&void 0!==at&&at._hasQualityScore()){const at=null===st||void 0===st?void 0:st.shadowRoot.getElementById("pnx-filter-qualityscore");oc=((null===at||void 0===at?void 0:at.grade)||"").split(",").map((at=>parseInt(at))).filter((at=>!isNaN(at))),5==oc.length&&(oc=[])}const _c={minDate:null===ot||void 0===ot?void 0:ot.value,maxDate:null===ut||void 0===ut?void 0:ut.value,pic_type:sc,theme:null===rc||void 0===rc?void 0:rc.value,qualityscore:oc};this.map.setFilters(_c)}}Viewer.properties={map:{converter:Hl.Ay.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},...Hl.Ay.properties},customElements.define("pnx-viewer",Viewer)},3921:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{Basic:()=>ut.A,CoverageMap:()=>Hl.A,Editor:()=>rc.A,PhotoViewer:()=>oc.Ay,Viewer:()=>sc.A});var ut=ot(9039),Hl=ot(153),rc=ot(1752),sc=ot(8743),oc=ot(3407)},9341:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{core:()=>ut,layout:()=>Hl,menus:()=>rc,ui:()=>sc});var ut=ot(3921),Hl=ot(456),rc=ot(8794),sc=ot(9472)},6784:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>BottomDrawer});var ut=ot(4542),Hl=ot(1198);const rc={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends ut.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){var at;super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const st=this._getDrawer();st&&(st.style.height=`${this._drawerHeight}px`,st.style.maxHeight=`${this._drawerHeight}px`,null===(at=this._parent)||void 0===at||at.onceReady().then((()=>{var at,st;null===(at=this._parent.map)||void 0===at||at.addEventListener("click",(()=>this.openness="closed")),null===(st=this._parent.psv)||void 0===st||st.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(at,st,ot){if(super.attributeChangedCallback(at,st,ot),"openness"===at){if("opened"!==ot){const at=this.shadowRoot.querySelector(".content");at&&(at.scrollTop=0)}const at=this._getDrawer();at&&(at.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var at;return null===(at=this.shadowRoot)||void 0===at?void 0:at.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(at){this._isDragging=!0,this._startFingerY=at.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*rc[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(at){if(!this._isDragging)return;const st=this.shadowRoot.querySelector(".content");st.scrollHeight>st.offsetHeight&&st.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=at.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(at){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||at.target.closest(".handle"))&&(at.preventDefault(),this._isDragging=!1,0===this._deltaFingerY&&"closed"===this.openness?this.openness="half-opened":this._updateDrawerTransform(this._drawerY+this._deltaFingerY,!0),this._cleanupTouchListeners(),this._startFingerY=null,this._deltaFingerY=null)}_cleanupTouchListeners(){window.removeEventListener("touchmove",this._boundTouchMove),window.removeEventListener("touchend",this._boundTouchEnd),window.removeEventListener("touchcancel",this._boundTouchCancel)}_updateDrawerTransform(at){let st=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const ot=this._getDrawer();ot&&(at=Math.max(0,Math.min(at,this._drawerHeight-30)),st&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-rc["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,at=Math.max(0,Math.min(rc[this.openness]*this._drawerHeight,this._drawerHeight-30))),ot.style.transform=`translateY(${at}px)`)}render(){const at={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return ut.qy`
|
|
12
|
+
!function(at,st){"object"===typeof exports&&"object"===typeof module?module.exports=st():"function"===typeof define&&define.amd?define("Panoramax",[],st):"object"===typeof exports?exports.Panoramax=st():at.Panoramax=st()}(this,(()=>(()=>{var at={9039:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Basic});var ut=ot(4542),Hl=ot(5254),rc=ot(4964),sc=ot(8340),oc=ot(5995),_c=ot(7343),wc=ot(2614),Sc=ot.n(wc),iu=ot(8330);ot(1865),ot(3638);class Basic extends ut.WF{constructor(){let at=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this.mapstyle=this.getAttribute("mapstyle")||sc.DEFAULT_TILES,this.lang=this.getAttribute("lang")||null,this.endpoint=this.getAttribute("endpoint")||null,this.picture=this.getAttribute("picture")||null,this.sequence=this.getAttribute("sequence")||null,console.info(`\ud83d\udcf7 Panoramax ${this.getClassName()} - Version ${iu.rE} (885abb5)\n\n\ud83c\udd98 Issues can be reported at ${iu.Jk.O}`),at||(this._isInternetFast=null,(0,_c.isInternetFast)().then((at=>this._isInternetFast=at)))}connectedCallback(){super.connectedCallback(),this._t=(0,rc.getTranslations)(this.lang),this.loader=(0,oc.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,_c.isInIframe)()}),this._loadsAPI&&this.endpoint&&this._loadsAPI===this.endpoint||this.api&&this.api._endpoint===this.endpoint||!this.endpoint||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())}_setupAPI(){if(this.loader=this.loader||(0,oc.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let at=this.endpoint;try{this.mapstyle=JSON.parse(this.mapstyle)}catch(ot){}try{this.api=new Hl.A(this.endpoint,{users:this.users,fetch:this.fetchOptions,style:this.mapstyle}),this.api.onceReady().then((()=>{if(at!=this._loadsAPI||!this.api)return;let st=this.api.getUnavailableFeatures(),ot=this.api.getAvailableFeatures();ot=0===st.length?"\u2705 All features available":"\u2705 Available features: "+ot.join(", "),st=0===st.length?"":"\ud83d\udeab Unavailable features: "+st.join(", "),console.info(`\ud83c\udf10 Connected to API "${this.api._metadata.name}" (${this.api._endpoint})\n\u2139\ufe0f API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version?"& GeoVisio "+this.api._metadata.geovisio_version:""}\n ${ot}\n ${st}\n`.trim())})).catch((at=>this.loader.dismiss(at,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(ot){var st;delete this._loadsAPI,null!==(st=this.loader)&&void 0!==st&&st.dismiss?this.loader.dismiss(ot,this._t.pnx.error_api):console.error(ot)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((at=>setTimeout(at,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(at,st,ot){if(super.attributeChangedCallback(at,st,ot),"endpoint"===at&&(this._loadsAPI&&ot&&this._loadsAPI===ot||this.api&&this.api._endpoint===ot||!ot||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(at)){let ut,Hl,rc,sc;"picture"===at?(ut=this.sequence,rc=this.sequence,Hl=ot,sc=st):(ut=ot,rc=st,Hl=this.picture,sc=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:ut,picId:Hl,prevSeqId:rc,prevPicId:sc}}))}}getClassName(){return"Basic"}select(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(this.picture=null,this.sequence=null),this.picture=st,this.sequence=at}isWidthSmall(){return(null===this||void 0===this?void 0:this.offsetWidth)<576}isHeightSmall(){return(null===this||void 0===this?void 0:this.offsetHeight)<400}render(){return ut.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(at,st,ot){let ut=at.split(":").shift();if(ut&&this.getSubComponentsNames().includes(ut)){var Hl;const rc=at.substring(ut.length+1);null!==(Hl=this[ut])&&void 0!==Hl&&Hl.addEventListener?this[ut].addEventListener(rc,st,ot):setTimeout((()=>this.addEventListener(at,st,ot)),50)}else super.addEventListener(at,st,ot)}static GetJSONConverter(){return{fromAttribute:at=>"object"===typeof at?at:Sc().parse(at),toAttribute:at=>JSON.stringify(at)}}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},fetchOptions:{converter:Basic.GetJSONConverter()},users:{type:Array,reflect:!0},mapstyle:{type:String},lang:{type:String},endpoint:{type:String}}},153:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>CoverageMap});var ut=ot(9039),Hl=ot(5642),rc=ot(8340),sc=ot(927),oc=(ot(7776),ot(2118));class CoverageMap extends ut.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new oc.Ay(oc.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}disconnectedCallback(){var at;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy()}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((at=>setTimeout(at,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const at=super.getSubComponentsNames();return at.push("map"),at}_initMap(){class MyMap extends Hl.A{_getLayerStyleProperties(at){return"pictures_symbols"===at?{layout:{visibility:"none"}}:super._getLayerStyleProperties(at)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new sc.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(at=>this.select(at.seqId,at.picId))),this.map.on("sequence-click",(at=>this.select(at.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,oc.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(at){if(at.detail.picId||at.detail.seqId){const st=at.detail.picId?"pictures":"sequences",ot=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((at=>(0,rc.getUserLayerId)(at,st))),filter:["==",["get","id"],at.detail.picId||at.detail.seqId]});ot.length>=0&&null!=ot[0]&&this.map._attachPreviewToPictures({features:ot},st)}}}CoverageMap.properties={map:{converter:ut.A.GetJSONConverter()},...ut.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Editor});ot(7365);var ut=ot(9039),Hl=ot(5642),rc=ot(9048),sc=(ot(7534),ot(6810),ot(508)),oc=ot(8340),_c=ot(1545),wc=(ot(4542),ot(5995));const Sc="sequence-headings";class Editor extends ut.A{constructor(){super(),this.raster=null,this.background="streets",this.users=[],this._psvContainer=document.createElement("div"),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this.sequence||this.loader.dismiss({},"No sequence is selected"),this.addEventListener("select",this._onSelect.bind(this)),this._initPSV(),this._initMap()}))}disconnectedCallback(){var at,st;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy(),null===(st=this.psv)||void 0===st||st.destroy()}getClassName(){return"Editor"}onceReady(){var at,st;return this.map&&this.psv&&null!==(at=(st=this.map).loaded)&&void 0!==at&&at.call(st)?Promise.resolve():new Promise((at=>setTimeout(at,100))).then(this.onceReady.bind(this))}connectedCallback(){Array.isArray(this.users)&&this.users.length>0&&(console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"),this.users=[]),super.connectedCallback()}attributeChangedCallback(at,st,ot){"users"===at&&Array.isArray(ot)&&ot.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(at,st,ot)}render(){return[this.loader,this._psvContainer,this._mapContainer]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv"])}_initPSV(){try{this.psv=new rc.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(at){let st=_c.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(at,st)}}_initMap(){try{this.map=new Hl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15}),(0,oc.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const at=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=st=>(st=void 0===this._lastRelHeading?st:st+this._lastRelHeading-this.psv.getPictureRelativeHeading(),at(st))}catch(at){this.loader.dismiss(at,this._t.pnx.error_psv)}}_createMapStyle(){return{sources:{geovisio_editor_sequences:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"geovisio_editor_sequences",type:"line",source:"geovisio_editor_sequences",layout:{...oc.VECTOR_STYLES.SEQUENCES.layout},paint:{...oc.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...oc.VECTOR_STYLES.PICTURES.layout},paint:{...oc.VECTOR_STYLES.PICTURES.paint}}]}}_bindPicturesEvents(){this.map.on("mousemove","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor=""})),this.map.on("click","geovisio_editor_pictures",this.map._onPictureClick.bind(this.map))}_loadSequence(){return this.loader.setAttribute("value",60),this.api.getSequenceItems(this.sequence).then((at=>{if(this.loader.setAttribute("value",80),this.map.once("sourcedata",(()=>{this.map.setPaintProperty("geovisio_editor_sequences","line-color",this.map._getLayerColorStyle("sequences")),this.map.setPaintProperty("geovisio_editor_pictures","circle-color",this.map._getLayerColorStyle("pictures")),this.map.setLayoutProperty("geovisio_editor_sequences","visibility","visible"),this.map.setLayoutProperty("geovisio_editor_pictures","visibility","visible"),this.map.once("styledata",(()=>this.loader.dismiss()))})),this._sequenceData=at.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{id:this.sequence,type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:at.features.map((at=>at.geometry.coordinates))}},...at.features.map((at=>(at.properties.id=at.id,at.properties.sequences=[this.sequence],at)))]}),this.picture){const st=at.features.find((at=>at.id===this.picture));st?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:st.geometry.coordinates,zoom:18})):console.log("Picture with ID",st,"was not found")}else{const st=[...at.features[0].geometry.coordinates,...at.features[0].geometry.coordinates];for(let ot=1;ot<at.features.length;ot++){const ut=at.features[ot].geometry.coordinates;ut[0]<st[0]&&(st[0]=ut[0]),ut[1]<st[1]&&(st[1]=ut[1]),ut[0]>st[2]&&(st[2]=ut[0]),ut[1]>st[3]&&(st[3]=ut[1])}this.map.fitBounds(st,{animate:!1})}})).catch((at=>this.loader.dismiss(at,this._t.pnx.error_api)))}_getNode(at){const st=this._sequenceData.find((st=>st.properties.id===at)),ot=st?(0,sc.apiFeatureToPSVNode)(st,this._t,this._isInternetFast):null;return ot&&delete ot.links,ot}_addMapBackgroundWidget(){const at=(0,wc.createWebComp)("pnx-map-background",{_parent:this,size:"sm"});this._mapContainer.appendChild(at)}previewSequenceHeadingChange(at){const st=void 0!==this.map.getLayer(Sc);if(this.map._picMarkerPreview.remove(),void 0===at)return delete this._lastRelHeading,st&&this.map.setLayoutProperty(Sc,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=at,st||this.map.addLayer({id:Sc,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const ot=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Sc,"visibility","visible"),this.map.setLayoutProperty(Sc,"icon-rotate",["+",["get","view:azimuth"],ot,at]);const ut=[["==",["geometry-type"],"Point"]];this.picture&&ut.push(["!=",["get","id"],this.picture]),this.map.setFilter(Sc,["all",...ut]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{converter:ut.A.GetJSONConverter()},background:{type:String},...ut.A.properties},customElements.define("pnx-editor",Editor)},3407:(at,st,ot)=>{"use strict";ot.d(st,{Ay:()=>PhotoViewer,RD:()=>su});ot(970);var ut=ot(1545),Hl=ot(4451),rc=ot(9039),sc=ot(9048),oc=ot(5995),_c=ot(7343),wc=ot(2118),Sc=ot(4207);const iu=Math.PI/6,su=["pnx-mini","pnx-widget-player","pnx-widget-zoom"];class PhotoViewer extends rc.A{constructor(){super(),this.psv={},this["url-parameters"]=this.getAttribute("url-parameters")||!0,this["keyboard-shortcuts"]=this.getAttribute("keyboard-shortcuts")||!0,this.widgets=this.getAttribute("widgets")||"true",this.grid=(0,oc.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,oc.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)})}_createInitParamsHandler(){var at,st;this._initParams=new wc.Ay(wc.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(at=this.urlHandler)||void 0===at?void 0:at.currentURLParams(),null===(st=this.urlHandler)||void 0===st?void 0:st.currentURLParams(!0)),{})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,oc.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.isWidthSmall()?(this.legend=(0,oc.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,oc.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().picture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(at=>{(0,_c.isNullId)(at.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,oc.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?void 0:"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend),this.grid.appendChild((0,oc.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))))}connectedCallback(){super.connectedCallback(),this.presetsManager=new Sc.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new Hl.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()}))),this.onceAPIReady().then(this._postAPIInit.bind(this))}disconnectedCallback(){var at,st;super.disconnectedCallback(),null===(at=this.urlHandler)||void 0===at||at.destroy(),null===(st=this.psv)||void 0===st||st.destroy()}firstUpdated(){super.firstUpdated(),this._moveChildToGrid()}getClassName(){return"PhotoViewer"}onceReady(){return this.oncePSVReady().then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}render(){return[this.loader,this.grid,this.popup]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["psv","grid","popup","urlHandler"])}oncePSVReady(){let at;return new Promise((st=>{at=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(at),st()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(at),st()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((at=>{this.psv.addEventListener("picture-loaded",at,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const at=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,wc.ai)(this,at),at.keyboardShortcuts&&this._handleKeyboardManagement(),at.picture?this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new sc.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...ut.zY.keyboardActions,8:"ROTATE_UP",2:"ROTATE_DOWN",4:"ROTATE_LEFT",6:"ROTATE_RIGHT",PageUp:()=>this.psv.goToNextPicture(),9:()=>this.psv.goToNextPicture(),PageDown:()=>this.psv.goToPrevPicture(),3:()=>this.psv.goToPrevPicture(),5:()=>this.moveCenter(),"*":()=>this.moveCenter(),Home:()=>this._toggleFocus(),7:()=>this._toggleFocus(),End:()=>this.mini.toggleAttribute("collapsed"),1:()=>this.mini.toggleAttribute("collapsed")," ":()=>this.psv.toggleSequencePlaying(),0:()=>this.psv.toggleSequencePlaying()},...this._initParams.getPSVInit()}),this.oncePSVReady().then((()=>{this.loader.setAttribute("value",50),(0,wc.Vy)(this.psv,this._initParams.getPSVPostInit())}))}catch(at){let st=ut.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(at,st)}}_handleKeyboardManagement(){const keytonone=()=>this.psv.stopKeyboardControl(),keytopsv=()=>this.psv.startKeyboardControl();this.popup.addEventListener("open",keytonone),this.popup.addEventListener("close",keytopsv),this.psv.addEventListener("click",keytopsv);for(let at of this.grid.childNodes)"bg"===at.getAttribute("slot")||su.includes(at.tagName.toLowerCase())||(at.addEventListener("focusin",keytonone),at.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytopsv()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((at=>{var st;null!==(st=at.tagName)&&void 0!==st&&st.toLowerCase().startsWith("pnx-")&&(at._parent=this,at._t=this._t),"editors"===at.getAttribute("slot")?this.onceReady().then((()=>{var st;return null===(st=this.legend)||void 0===st?void 0:st.appendChild(at)})):this.grid.appendChild(at)}))}setPopup(at){let st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;at?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof st?this.popup.innerHTML=st:Array.isArray(st)&&st.forEach((at=>this.popup.appendChild(at)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,oc.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,oc.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,oc.createWebComp)("pnx-share-menu",{_parent:this})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:sc.LM,yaw:0,pitch:0,zoom:sc.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(at){let st=this.psv.getPosition();switch(at){case"up":st.pitch+=iu;break;case"left":st.yaw-=iu;break;case"down":st.pitch-=iu;break;case"right":st.yaw+=iu}this._psvAnimate({speed:sc.LM,...st})}_psvAnimate(at){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(at)}addEventListener(at,st,ot){super.addEventListener(at,st,ot)}}PhotoViewer.properties={psv:{converter:rc.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},...rc.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(at,st,ot)=>{"use strict";ot.d(st,{$:()=>su,A:()=>Viewer});ot(9616);var ut=ot(8340),Hl=ot(3407),rc=(ot(9039),ot(2771)),sc=ot(7343),oc=ot(5995),_c=ot(9683),wc=ot(2e3),Sc=ot(9438),iu=ot(2118);const su=20,lu=(Math.PI,100);class Viewer extends Hl.Ay{constructor(){super(),this.map=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,oc.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,sc.isNullId)(this.picture)||void 0}),this.mini.addEventListener("expand",this._toggleFocus.bind(this)),this.grid.appendChild(this.mini),this.mapContainer=document.createElement("div")}_createInitParamsHandler(){var at,st;this._initParams=new iu.Ay(iu.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(at=this.urlHandler)||void 0===at?void 0:at.currentURLParams(),null===(st=this.urlHandler)||void 0===st?void 0:st.currentURLParams(!0)),{map:(0,ut.getMapParamsFromLocalStorage)()})}_initWidgets(){var at,st;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,oc.createWebComp)("pnx-widget-zoom",{slot:this.isWidthSmall()?"top-left":"bottom-right",class:this.isWidthSmall()?"pnx-only-map pnx-print-hidden":"pnx-print-hidden",_parent:this})),this.isWidthSmall()?(this.legend=(0,oc.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,oc.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().picture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(at=>{(0,sc.isNullId)(at.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,oc.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?"top":"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend),this.grid.appendChild((0,oc.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-geosearch",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,class:"pnx-only-map pnx-print-hidden",geocoder:this._initParams.getParentPostInit().geocoder})),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-mapfilters",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,"user-search":null!==this.api._endpoints.user_search&&null!==this.api._endpoints.user_tiles,"quality-score":(null===(at=this.map)||void 0===at||null===(st=at._hasQualityScore)||void 0===st?void 0:st.call(at))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"})))}disconnectedCallback(){var at;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy()}getClassName(){return"Viewer"}getSubComponentsNames(){return super.getSubComponentsNames().concat(["mini","map"])}onceReady(){return Promise.all([this.oncePSVReady(),this.onceMapReady()]).then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}attributeChangedCallback(at,st,ot){var ut,Hl,rc,oc;(super.attributeChangedCallback(at,st,ot),"picture"===at)&&(null===(ut=this.legend)||void 0===ut||null===(Hl=ut.setAttribute)||void 0===Hl||Hl.call(ut,"picture",ot),(0,sc.isNullId)(st)&&!(0,sc.isNullId)(ot)&&this.mini.removeAttribute("collapsed"),(0,sc.isNullId)(ot)?this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map"):(this.mini.classList.remove("pnx-hidden"),(0,sc.isNullId)(st)&&(this._setFocus("pic"),"closed"===(null===(rc=this.bottomDrawer)||void 0===rc||null===(oc=rc.getAttribute)||void 0===oc?void 0:oc.call(rc,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened"))));"focus"===at&&this._setFocus(ot)}onceMapReady(){if(!this.map)return Promise.resolve();let at;return new Promise((st=>{at=setInterval((()=>{var ot,ut,Hl;"object"===typeof this.map&&(null!==(ot=this.map)&&void 0!==ot&&null!==(ut=ot.loaded)&&void 0!==ut&&ut.call(ot)?(clearInterval(at),st()):null!==(Hl=this.map)&&void 0!==Hl&&Hl.once&&this.map.once("render",(()=>{clearInterval(at),st()})))}),250)}))}async _initMap(){await new Promise((at=>{this.map=new rc.A(this,this.mapContainer,this._initParams.getMapInit()),(0,ut.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),at()}))})),await(0,iu.mK)(this.map,this._initParams.getMapPostInit()),(0,ut.initMapKeyboardHandler)(this),(0,ut.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const at=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,iu.iz)(this,at),at.keyboardShortcuts&&this._handleKeyboardManagement(),at.picture?this.psv.addEventListener("picture-loaded",(()=>{(0,iu.iz)(this,at),this.loader.dismiss()}),{once:!0}):this.loader.dismiss()}_handleKeyboardManagement(){const keytomap=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.enable()},keytopsv=()=>{this.psv.startKeyboardControl(),this.map.keyboard.disable()},keytonone=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.disable()},keytofocused=()=>{this.map&&this.isMapWide()?keytomap():keytopsv()};this.addEventListener("focus-changed",(at=>{"map"===at.detail.focus&&keytomap(),this.popup.getAttribute("visible")?keytonone():keytopsv()})),this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytofocused()));for(let at of this.grid.childNodes)"bg"===at.getAttribute("slot")||Hl.RD.includes(at.tagName.toLowerCase())||(at.addEventListener("focusin",(()=>keytonone())),at.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytofocused()})))}moveCenter(){const at=this.psv.getPictureMetadata();at&&(this.map&&this.isMapWide()?this.map.flyTo({center:at.gps,zoom:20}):super.moveCenter())}_moveToDirection(at){if(this.map&&this.isMapWide()){let st;switch(at){case"up":st=[0,-100];break;case"left":st=[-100,0];break;case"down":st=[0,lu];break;case"right":st=[lu,0]}this.map.panBy(st)}else super._moveToDirection(at)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(at){var st,ot,ut,Hl;let rc=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Sc=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===at&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(at))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=at,(Sc||("map"!==at||!this.map||!this.isMapWide())&&("pic"!==at||this.map&&this.isMapWide()))&&("map"===at?(this.psvContainer.parentNode==this.grid&&(this.grid.removeChild(this.psvContainer),this.psvContainer.removeAttribute("slot")),this.mapContainer.parentNode==this.mini&&this.mini.removeChild(this.mapContainer),this.mapContainer.setAttribute("slot","bg"),this.grid.appendChild(this.mapContainer),this.mini.appendChild(this.psvContainer),this.mini.icon=(0,oc.fa)(_c.pt),(0,sc.isNullId)(this.picture)?this.mini.classList.add("pnx-hidden"):this.mini.classList.remove("pnx-hidden"),this.map.getCanvas().focus()):(this.mapContainer.parentNode==this.grid&&(this.grid.removeChild(this.mapContainer),this.mapContainer.removeAttribute("slot")),this.psvContainer.parentNode==this.mini&&this.mini.removeChild(this.psvContainer),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.mini.classList.remove("pnx-hidden"),this.mini.appendChild(this.mapContainer),this.mini.icon=(0,oc.fa)(wc.e5),this.psvContainer.focus()),null===this||void 0===this||null===(st=this.map)||void 0===st||null===(ot=st.resize)||void 0===ot||ot.call(st),this.psv.autoSize(),this.psv.forceRefresh(),null===(ut=this.legend)||void 0===ut||null===(Hl=ut.setAttribute)||void 0===Hl||Hl.call(ut,"focus",this.focus),!rc)){const st=new CustomEvent("focus-changed",{detail:{focus:at}});this.dispatchEvent(st)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var at;const st=(0,Sc.qi)("#pnx-map-filters-menu"),ot=null===st||void 0===st?void 0:st.shadowRoot.getElementById("pnx-filter-date-from"),ut=null===st||void 0===st?void 0:st.shadowRoot.getElementById("pnx-filter-date-end"),Hl=null===st||void 0===st?void 0:st.shadowRoot.querySelectorAll("input[name='pnx-filter-type']"),rc=(0,Sc.qi)("#pnx-map-theme");let sc="";for(let wc=0;wc<Hl.length;wc++){const at=Hl[wc];if(at.checked){sc=at.value;break}}let oc=[];if(null!==(at=this.map)&&void 0!==at&&at._hasQualityScore()){const at=null===st||void 0===st?void 0:st.shadowRoot.getElementById("pnx-filter-qualityscore");oc=((null===at||void 0===at?void 0:at.grade)||"").split(",").map((at=>parseInt(at))).filter((at=>!isNaN(at))),5==oc.length&&(oc=[])}const _c={minDate:null===ot||void 0===ot?void 0:ot.value,maxDate:null===ut||void 0===ut?void 0:ut.value,pic_type:sc,theme:null===rc||void 0===rc?void 0:rc.value,qualityscore:oc};this.map.setFilters(_c)}}Viewer.properties={map:{converter:Hl.Ay.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},...Hl.Ay.properties},customElements.define("pnx-viewer",Viewer)},3921:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{Basic:()=>ut.A,CoverageMap:()=>Hl.A,Editor:()=>rc.A,PhotoViewer:()=>oc.Ay,Viewer:()=>sc.A});var ut=ot(9039),Hl=ot(153),rc=ot(1752),sc=ot(8743),oc=ot(3407)},9341:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{core:()=>ut,layout:()=>Hl,menus:()=>rc,ui:()=>sc});var ut=ot(3921),Hl=ot(456),rc=ot(8794),sc=ot(9472)},6784:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>BottomDrawer});var ut=ot(4542),Hl=ot(1198);const rc={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends ut.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){var at;super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const st=this._getDrawer();st&&(st.style.height=`${this._drawerHeight}px`,st.style.maxHeight=`${this._drawerHeight}px`,null===(at=this._parent)||void 0===at||at.onceReady().then((()=>{var at,st;null===(at=this._parent.map)||void 0===at||at.addEventListener("click",(()=>this.openness="closed")),null===(st=this._parent.psv)||void 0===st||st.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(at,st,ot){if(super.attributeChangedCallback(at,st,ot),"openness"===at){if("opened"!==ot){const at=this.shadowRoot.querySelector(".content");at&&(at.scrollTop=0)}const at=this._getDrawer();at&&(at.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var at;return null===(at=this.shadowRoot)||void 0===at?void 0:at.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(at){this._isDragging=!0,this._startFingerY=at.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*rc[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(at){if(!this._isDragging)return;const st=this.shadowRoot.querySelector(".content");st.scrollHeight>st.offsetHeight&&st.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=at.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(at){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||at.target.closest(".handle"))&&(at.preventDefault(),this._isDragging=!1,0===this._deltaFingerY&&"closed"===this.openness?this.openness="half-opened":this._updateDrawerTransform(this._drawerY+this._deltaFingerY,!0),this._cleanupTouchListeners(),this._startFingerY=null,this._deltaFingerY=null)}_cleanupTouchListeners(){window.removeEventListener("touchmove",this._boundTouchMove),window.removeEventListener("touchend",this._boundTouchEnd),window.removeEventListener("touchcancel",this._boundTouchCancel)}_updateDrawerTransform(at){let st=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const ot=this._getDrawer();ot&&(at=Math.max(0,Math.min(at,this._drawerHeight-30)),st&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-rc["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,at=Math.max(0,Math.min(rc[this.openness]*this._drawerHeight,this._drawerHeight-30))),ot.style.transform=`translateY(${at}px)`)}render(){const at={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return ut.qy`
|
|
13
13
|
<div
|
|
14
14
|
class=${(0,Hl.H)(at)}
|
|
15
15
|
@touchstart="${this._onTouchStart}"
|
|
@@ -1708,7 +1708,7 @@
|
|
|
1708
1708
|
}
|
|
1709
1709
|
/* Logo */
|
|
1710
1710
|
img.logo-dead { width: 100px; }
|
|
1711
|
-
`,Loader.properties={_mode:{state:!0},_label:{state:!0},_isLabelFun:{state:!0},visible:{type:Boolean,reflect:!0},"no-label":{type:Boolean},value:{type:Number}},customElements.define("pnx-loader",Loader)},5642:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Map});ot(3041);var ut=ot(8340),Hl=ot(7343),rc=ot(6883),sc=ot(270),oc=ot(6462),_c=ot(9740),wc=(ot(6795),ot(927)),Sc=ot.n(wc),iu=ot(2968),su=ot.n(iu),lu=ot(748);Sc().workerClass=su(),Sc().addProtocol("pmtiles",(new lu.Zs).tile);class Map extends Sc().Map{constructor(at,st){let ot=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var Hl;(super({container:st,style:(0,ut.combineStyles)(at,ot),center:[0,0],zoom:0,maxZoom:24,attributionControl:!1,dragRotate:!1,pitchWithRotate:!1,touchZoomRotate:!0,touchPitch:!1,doubleClickZoom:!1,canvasContextAttributes:{preserveDrawingBuffer:!at.isWidthSmall()},transformRequest:at.api._getMapRequestTransform(),locale:at._t.maplibre,hash:!1,...ot}),this._loadMarkerImages(),this._parent=at,this._options=ot,this.getContainer().classList.add("pnx-map"),void 0===ot.touchZoomRotate)&&(null===this||void 0===this||null===(Hl=this.touchZoomRotate)||void 0===Hl||Hl.disableRotation());this._options.raster&&(this._options.background=this._options.background||"streets"),this._attribution=new(Sc().AttributionControl)({compact:!1,...ot.attributionControl}),this.addControl(this._attribution),this._initMapPosition(),this._picMarker=this._getPictureMarker(),this._picMarkerPreview=this._getPictureMarker(!1),this._picThumbUrl={},this._seqPictures={},this._userLayers=new Set,this._parent.addEventListener("select",this.reloadLayersStyles.bind(this)),setTimeout((()=>{var at;!this.loaded()&&null!==(at=this._parent)&&void 0!==at&&at.loader.isVisible()&&this._parent.loader.dismiss({},this._parent._t.map.slow_loading,(async()=>{await this._postLoad(),this._parent.loader.dismiss()}))}),15e3),this.waitForEnoughMapLoaded().then((async()=>await this._postLoad()))}async _postLoad(){this.resize(),await this.setVisibleUsers(this._parent.users),this.reloadLayersStyles(),this.fire("ready")}destroy(){this.remove(),delete this._parent,delete this._options,delete this._attribution,delete this._picMarker,delete this._picMarkerPreview,delete this._picThumbUrl,delete this._seqPictures,delete this._userLayers}waitForEnoughMapLoaded(){return new Promise((at=>{let st=0,ot=0,ut=0,Hl=0;const onSourceDataLoading=at=>{"source"===at.dataType&&at.tile&&(at.sourceId.startsWith("geovisio")?ot++:st++)},onSourceData=at=>{"source"===at.dataType&&at.tile&&(at.sourceId.startsWith("geovisio")?(Hl++,at.isSourceLoaded&&(Hl=ot)):(ut++,at.isSourceLoaded&&(ut=st))),checkEnoughLoaded()},checkEnoughLoaded=()=>{ut/st>=.75&&(0===ot||Hl/ot>=.75)&&(this.off("sourcedata",onSourceData),this.off("sourcedataloading",onSourceDataLoading),at())};this.on("sourcedataloading",onSourceDataLoading),this.on("sourcedata",onSourceData)}))}_initMapPosition(){this._options.center&&this._options.center!=[0,0]||this._options.zoom&&0!==this._options.zoom||this._options.hash||this._parent.onceAPIReady().then((()=>{var at,st;let ot=null===(at=this._parent)||void 0===at||null===(st=at.api)||void 0===st?void 0:st.getDataBbox();if(ot)try{ot=new(Sc().LngLatBounds)(ot),this.loaded()?this.fitBounds(ot,{animate:!1}):this.waitForEnoughMapLoaded().then((()=>this.fitBounds(ot,{animate:!1})))}catch(ut){console.warn("Received invalid bbox: "+ot)}}))}_loadMarkerImages(){[{id:"pnx-marker",img:rc},{id:"pnx-arrow-flat",img:oc},{id:"pnx-arrow-360",img:_c}].forEach((at=>{const st=new Image(64,64);st.onload=()=>this.addImage(at.id,st),st.src=at.img}))}_hasQualityScore(){var at,st,ot,ut;const Hl=(null===(at=this.getStyle())||void 0===at||null===(st=at.metadata)||void 0===st?void 0:st["panoramax:fields"])||{};return(null===Hl||void 0===Hl||null===(ot=Hl.pictures)||void 0===ot?void 0:ot.includes("gps_accuracy"))&&(null===Hl||void 0===Hl||null===(ut=Hl.pictures)||void 0===ut?void 0:ut.includes("h_pixel_density"))}_hasGridStats(){var at,st,ot,ut,Hl,rc;const sc=(null===(at=this.getStyle())||void 0===at||null===(st=at.metadata)||void 0===st?void 0:st["panoramax:fields"])||{};return(null===sc||void 0===sc||null===(ot=sc.grid)||void 0===ot?void 0:ot.includes("nb_360_pictures"))&&(null===sc||void 0===sc||null===(ut=sc.grid)||void 0===ut?void 0:ut.includes("nb_flat_pictures"))&&(null===sc||void 0===sc||null===(Hl=sc.grid)||void 0===Hl?void 0:Hl.includes("coef_360_pictures"))&&(null===sc||void 0===sc||null===(rc=sc.grid)||void 0===rc?void 0:rc.includes("coef_flat_pictures"))}reloadVectorTiles(){[...this._userLayers].forEach((at=>{const st=this.getSource((0,ut.getUserSourceId)(at));st.setTiles(st.tiles)}))}hasTwoBackgrounds(){return void 0!==this.getLayer(ut.RASTER_LAYER_ID)}getBackground(){if(!this.getLayer(ut.RASTER_LAYER_ID))return"streets";return"visible"==this.getLayoutProperty(ut.RASTER_LAYER_ID,"visibility")?"aerial":"streets"}setBackground(at){if(!this.getLayer(ut.RASTER_LAYER_ID)&&"aerial"===at)throw new Error("No aerial imagery available");this.getLayer(ut.RASTER_LAYER_ID)&&(this.setLayoutProperty(ut.RASTER_LAYER_ID,"visibility","aerial"===at?"visible":"none"),this.fire("background-changed",{background:at||"streets"}))}getVisibleUsers(){return[...this._userLayers].filter((at=>this.getLayer((0,ut.getUserLayerId)(at,"pictures"))&&"visible"===this.getLayoutProperty((0,ut.getUserLayerId)(at,"pictures"),"visibility")))}onceLayerReady(at){return this.getLayer(at)?Promise.resolve():new Promise((at=>{setTimeout(at,250)})).then((()=>this.onceLayerReady(at)))}async setVisibleUsers(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"===typeof at?at=[at]:null===at&&(at=[]),await Promise.all(at.filter((at=>""!=at&&!this._userLayers.has(at))).map((at=>(this._createPicturesTilesLayer(at),this.onceLayerReady((0,ut.getUserLayerId)(at,"pictures"))))));const st=["pictures","sequences","sequences_plus","grid","pictures_symbols"];[...this._userLayers].forEach((ot=>{st.forEach((st=>{const Hl=(0,ut.getUserLayerId)(ot,st);this.getLayer(Hl)&&this.setLayoutProperty(Hl,"visibility",at.includes(ot)?"visible":"none")}))})),this.reloadLayersStyles(),this.fire("users-changed",{usersIds:at})}filterUserLayersContent(at,st){[...this._userLayers].forEach((ot=>{this.getLayer((0,ut.getUserLayerId)(ot,at))?(this.setFilter((0,ut.getUserLayerId)(ot,at),st),"sequences"===at&&this.getLayer((0,ut.getUserLayerId)(ot,"sequences_plus"))&&this.setFilter((0,ut.getUserLayerId)(ot,"sequences_plus"),st),"pictures"===at&&this.getLayer((0,ut.getUserLayerId)(ot,"pictures_symbols"))&&this.setFilter((0,ut.getUserLayerId)(ot,"pictures_symbols"),st)):console.warn("Layer",(0,ut.getUserLayerId)(ot,at),"not ready")}))}displayPictureMarker(at,st,ot){let Hl=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._picMarkerPreview.remove(),void 0!==at&&void 0!==st?this._picMarker.setLngLat([at,st]).setRotation(ot).addTo(this):this._picMarker.remove(),this.reloadLayersStyles(),Hl||void 0===at||void 0===st||this.flyTo({center:[at,st],zoom:this.getZoom()<ut.TILES_PICTURES_ZOOM+2?ut.TILES_PICTURES_ZOOM+2:this.getZoom(),maxDuration:2e3})}reloadLayersStyles(){const updateStyle=(at,st)=>{[...this._userLayers].forEach((ot=>{const Hl=(0,ut.getUserLayerId)(ot,at);if(this.getLayer(Hl)){for(let at in st.layout)this.setLayoutProperty(Hl,at,st.layout[at]);for(let at in st.paint)this.setPaintProperty(Hl,at,st.paint[at])}else console.warn("Layer",Hl,"not ready")}))};["pictures","pictures_symbols","sequences"].forEach((at=>{updateStyle(at,this._getLayerStyleProperties(at))}))}async _createPicturesTilesLayer(at){this._userLayers.add(at);const st=this.getStyle().layers.find(ut.isLabelLayer);if("geovisio"!==at&&!this.getSource(`geovisio_${at}`)){const ot=await this._parent.api.getUserMapStyle(at);Object.entries(ot.sources).forEach((at=>{let[st,ot]=at;return this.addSource(st,ot)})),ot.layers=ot.layers||[];ot.layers.concat((0,ut.getMissingLayerStyles)(ot.sources,ot.layers)).filter((at=>Object.keys(at).length>0)).forEach((at=>this.addLayer(at,null===st||void 0===st?void 0:st.id)))}this._picPreviewTimer=null,this._picPopup=new(Sc().Popup)({closeButton:!1,closeOnClick:!this._parent.isWidthSmall(),offset:3}),this._picPopup.on("close",(()=>{delete this._picPopup._picId}));const ot=(0,ut.getUserLayerId)(at,"pictures");this.on("mousemove",ot,(at=>{this.getCanvas().style.cursor="pointer";const st=Object.assign({},at);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(st,ot)),100)})),this.on("mouseleave",ot,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",ot,this._onPictureClick.bind(this));const Hl=(0,ut.getUserLayerId)(at,"sequences_plus");this.on("mousemove",Hl,(at=>{if(this._onSequenceHover(at),this.getZoom()<=ut.TILES_PICTURES_ZOOM+1&&(this.getCanvas().style.cursor="pointer",at.features[0].properties.id)){const st=Object.assign({},at);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(st,Hl)),100)}})),this.on("mouseleave",Hl,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",Hl,(at=>{at.preventDefault(),this.getZoom()<=ut.TILES_PICTURES_ZOOM+1&&this._onSequenceClick(at)})),"geovisio"===at&&this.getLayer("geovisio_grid")&&(this.on("mousemove","geovisio_grid",(at=>{if(this.getZoom()<=ut.TILES_PICTURES_ZOOM+1){this.getCanvas().style.cursor="pointer";const st=Object.assign({},at);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(st,"geovisio_grid")),100)}})),this.on("mouseleave","geovisio_grid",(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click","geovisio_grid",(at=>{at.preventDefault(),this.flyTo({center:at.lngLat,zoom:ut.TILES_PICTURES_ZOOM-6})}))),this.on("click",(at=>{!1===at.defaultPrevented&&(clearTimeout(this._picPreviewTimer),this._picPopup.remove())}))}_getLayerStyleProperties(at){if("pictures_symbols"===at)return{paint:{},layout:{"icon-image":["case",["==",["get","id"],this._parent.picture],"",["==",["get","type"],"equirectangular"],"pnx-arrow-360","pnx-arrow-flat"],"symbol-sort-key":this._getLayerSortStyle(at)}};{const st={pictures:"circle",sequences:"line"};return{paint:Object.assign({[`${st[at]}-color`]:this._getLayerColorStyle(at)},ut.VECTOR_STYLES[at.toUpperCase()].paint),layout:Object.assign({[`${st[at]}-sort-key`]:this._getLayerSortStyle(at)},ut.VECTOR_STYLES[at.toUpperCase()].layout)}}}_getLayerColorStyle(at){const st=["case",["==",["get","hidden"],!0],Hl.COLORS.HIDDEN,["==",["get","geovisio:status"],"hidden"],Hl.COLORS.HIDDEN],ot=this._parent.sequence;return"sequences"==at&&ot?st.push(["==",["get","id"],ot],Hl.COLORS.SELECTED):at.startsWith("pictures")&&ot&&st.push(["in",ot,["get","sequences"]],Hl.COLORS.SELECTED),st.push(Hl.COLORS.BASE),st}_getLayerSortStyle(at){const st=["case",["==",["get","hidden"],!0],90],ot=this._parent.sequence;return"sequences"==at&&ot?st.push(["==",["get","id"],ot],100):at.startsWith("pictures")&&ot&&st.push(["in",ot,["get","sequences"]],100),st.push(10),st}_attachPreviewToPictures(at,st){let ot=at.features.pop();if(!ot||ot.properties.id==this._picPopup._picId)return;let Hl=null;if(st.endsWith("pictures")?Hl=ot.geometry.coordinates.slice():at.lngLat&&(Hl=[at.lngLat.lng,at.lngLat.lat]),!Hl){const at="LineString"===ot.geometry.type?[ot.geometry.coordinates]:ot.geometry.coordinates;let st=null;const ut=this.getBounds(),rc=ut.getCenter();for(let ot=0;ot<at.length;ot++)for(let sc=0;sc<at[ot].length;sc++)if(ut.contains(at[ot][sc])){let ut=rc.distanceTo(new(Sc().LngLat)(...at[ot][sc]));(null===st||ut<st)&&(Hl=at[ot][sc],st=ut)}if(!Hl)return}this._picPopup.setLngLat(Hl).addTo(this),this._picThumbUrl[ot.properties.id]||this._picPopup.setDOMContent((0,ut.getThumbGif)(this._parent._t)),this._picPopup._loading=ot.properties.id,this._picPopup._picId=ot.properties.id;const displayThumb=at=>{if(this._picPopup._loading===ot.properties.id)if(delete this._picPopup._loading,at){let st=document.createElement("img");st.classList.add("pnx-map-thumb"),st.alt=this._parent._t.map.thumbnail;let ut=new Image;if(ut.src=at,ut.addEventListener("load",(()=>{ot.properties.hidden?st.children[0].src=ut.src:st.src=ut.src,this._picPopup.setDOMContent(st)})),ot.properties.hidden){const at=document.createElement("div");at.classList.add("pnx-map-thumb-legend"),at.appendChild(document.createTextNode(this._parent._t.map.not_public));const ot=document.createElement("div");ot.appendChild(st),ot.appendChild(at),st=ot}}else this._picPopup.remove()};st.endsWith("pictures")?this._getPictureThumbURL(ot.properties.id).then(displayThumb):st.endsWith("grid")?this._getThumbURL(Hl).then(displayThumb):this._getSequenceThumbURL(ot.properties.id,new(Sc().LngLat)(...Hl)).then(displayThumb)}_getThumbURL(at){return this._parent.api.getPicturesAroundCoordinates(at[1],at[0],.1,1).then((at=>{var st;const ot=null===at||void 0===at||null===(st=at.features)||void 0===st?void 0:st.pop();return ot?this._parent.api.findThumbnailInPictureFeature(ot):null}))}_getSequenceThumbURL(at,st){return st?this._parent.api.getPicturesAroundCoordinates(st.lat,st.lng,1,1,at).then((st=>{var ot;return(null===st||void 0===st||null===(ot=st.features)||void 0===ot?void 0:ot.length)>0?this._parent.api.findThumbnailInPictureFeature(st.features[0]):this._parent.api.getPictureThumbnailURLForSequence(at)})):this._parent.api.getPictureThumbnailURLForSequence(at)}_getPictureThumbURL(at,st){let ot=null;return at&&(void 0!==this._picThumbUrl[at]?ot="string"===typeof this._picThumbUrl[at]?Promise.resolve(this._picThumbUrl[at]):this._picThumbUrl[at]:(this._picThumbUrl[at]=this._parent.api.getPictureThumbnailURL(at,st).then((st=>st?(this._picThumbUrl[at]=st,st):(this._picThumbUrl[at]=null,null))).catch((()=>{this._picThumbUrl[at]=null})),ot=this._picThumbUrl[at])),ot}_getPictureMarker(){let at=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const st=document.createElement("img");return st.src=at?sc:rc,st.alt="",new(Sc().Marker)({element:st})}_onSequenceHover(at){var st;at.preventDefault(),at.features.length>0&&null!==(st=at.features[0].properties)&&void 0!==st&&st.id&&this.fire("sequence-hover",{seqId:at.features[0].properties.id})}_onSequenceClick(at){var st;at.preventDefault(),at.features.length>0&&null!==(st=at.features[0].properties)&&void 0!==st&&st.id&&this.fire("sequence-click",{seqId:at.features[0].properties.id,coordinates:at.lngLat})}_onPictureClick(at){var st,ot;at.preventDefault();const ut=(null===at||void 0===at||null===(st=at.features)||void 0===st?void 0:st.length)>0?at.features[0]:null;if(null!==ut&&void 0!==ut&&null!==(ot=ut.properties)&&void 0!==ot&&ot.id){let st=null;try{ut.properties.sequences&&(Array.isArray(ut.properties.sequences)||(ut.properties.sequences=JSON.parse(ut.properties.sequences)),st=ut.properties.sequences.pop())}catch(at){console.log("Sequence ID is not available in vector tiles for picture "+ut.properties.id)}this.fire("picture-click",{picId:ut.properties.id,seqId:st,feature:ut})}}addEventListener(at,st){let ot=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!==ot&&void 0!==ot&&ot.once?this.once(at,st):this.on(at,st)}}},2771:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>MapMore,T:()=>oc});var ut=ot(5642),Hl=ot(7343),rc=ot(8340);const sc={DEFAULT:"default",AGE:"age",TYPE:"type",SCORE:"score"},oc=["minDate","maxDate","pic_type","camera","theme","qualityscore"];class MapMore extends ut.A{constructor(at,st){super(at,st,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this._mapFilters={},this._options.theme&&(this._mapFilters={theme:this._options.theme})}reloadLayersStyles(){if(super.reloadLayersStyles(),this._hasGridStats()){let at="coef";this._mapFilters.pic_type&&(at="flat"==this._mapFilters.pic_type?"coef_flat_pictures":"coef_360_pictures"),this.getStyle().layers.filter((at=>at.id.endsWith("_grid"))).forEach((st=>{const ot=(0,rc.switchCoefValue)(st,at);for(let at in ot.layout)this.setLayoutProperty(st.id,at,ot.layout[at]);for(let at in ot.paint)this.setPaintProperty(st.id,at,ot.paint[at])}))}}_getDatesForLayerColors(){const at=864e5,st=Date.now();return[st-30*at,st-365*at,st-730*at].map((at=>new Date(at).toISOString().split("T")[0]))}_getLayerColorStyle(at){var st,ot,ut,oc,_c,wc,Sc,iu;const su=["case",["==",["get","hidden"],!0],Hl.COLORS.HIDDEN],lu=(null===(st=this._parent.psv)||void 0===st||null===(ot=st._myVTour)||void 0===ot||null===(ut=ot.state)||void 0===ut?void 0:ut.loadingNode)||(null===(oc=this._parent.psv)||void 0===oc||null===(_c=oc._myVTour)||void 0===_c||null===(wc=_c.state)||void 0===wc||null===(Sc=wc.currentNode)||void 0===Sc?void 0:Sc.id),cu=lu?null===(iu=this._parent.psv)||void 0===iu?void 0:iu._picturesSequences[lu]:null;if("sequences"==at&&cu?su.push(["==",["get","id"],cu],Hl.COLORS.SELECTED):"pictures"==at&&cu&&su.push(["in",cu,["get","sequences"]],Hl.COLORS.SELECTED),this._mapFilters.theme==sc.AGE){const st="sequences"==at?"date":"ts",ot=this._getDatesForLayerColors();su.push(["!",["has",st]],Hl.COLORS.BASE,[">=",["get",st],ot[0]],Hl.COLORS.PALETTE_4,[">=",["get",st],ot[1]],Hl.COLORS.PALETTE_3,[">=",["get",st],ot[2]],Hl.COLORS.PALETTE_2,Hl.COLORS.PALETTE_1)}else this._mapFilters.theme==sc.TYPE?su.push(["!",["has","type"]],Hl.COLORS.BASE,["==",["get","type"],"equirectangular"],Hl.COLORS.QUALI_1,Hl.COLORS.QUALI_2):this._mapFilters.theme==sc.SCORE?su.push(["==",rc.MAP_EXPR_QUALITYSCORE,5],Hl.QUALITYSCORE_VALUES[0].color,["==",rc.MAP_EXPR_QUALITYSCORE,4],Hl.QUALITYSCORE_VALUES[1].color,["==",rc.MAP_EXPR_QUALITYSCORE,3],Hl.QUALITYSCORE_VALUES[2].color,["==",rc.MAP_EXPR_QUALITYSCORE,2],Hl.QUALITYSCORE_VALUES[3].color,Hl.QUALITYSCORE_VALUES[4].color):su.push(Hl.COLORS.BASE);return su}_getLayerSortStyle(at){var st,ot,ut,Hl,oc,_c,wc,Sc;const iu=["case",["==",["get","hidden"],!0],90],su=(null===(st=this._parent.psv)||void 0===st||null===(ot=st._myVTour)||void 0===ot||null===(ut=ot.state)||void 0===ut?void 0:ut.loadingNode)||(null===(Hl=this._parent.psv)||void 0===Hl||null===(oc=Hl._myVTour)||void 0===oc||null===(_c=oc.state)||void 0===_c||null===(wc=_c.currentNode)||void 0===wc?void 0:wc.id),lu=su?null===(Sc=this._parent.psv)||void 0===Sc?void 0:Sc._picturesSequences[su]:null;if("sequences"==at&&lu?iu.push(["==",["get","id"],lu],100):"pictures"==at&&lu&&iu.push(["in",lu,["get","sequences"]],100),this._mapFilters.theme==sc.AGE){const st="sequences"==at?"date":"ts",ot=this._getDatesForLayerColors();iu.push(["!",["has",st]],0,[">=",["get",st],ot[0]],50,[">=",["get",st],ot[1]],49,[">=",["get",st],ot[2]],48)}else this._mapFilters.theme==sc.TYPE?iu.push(["!",["has","type"]],0,["==",["get","type"],"equirectangular"],50):this._mapFilters.theme==sc.SCORE&&iu.push(["==",rc.MAP_EXPR_QUALITYSCORE,5],80,["==",rc.MAP_EXPR_QUALITYSCORE,4],65,["==",rc.MAP_EXPR_QUALITYSCORE,3],50,["==",rc.MAP_EXPR_QUALITYSCORE,2],35,["==",rc.MAP_EXPR_QUALITYSCORE,1],20);return iu.push(10),iu}_mapFiltersToLayersFilters(at){let st={},ot=[],ut=[],Hl=!1;if(at.minDate&&""!==at.minDate&&(st.minDate=at.minDate,ot.push([">=",["get","date"],at.minDate]),ut.push([">=",["get","ts"],at.minDate])),at.maxDate&&""!==at.maxDate){st.maxDate=at.maxDate,ot.push(["<=",["get","date"],at.maxDate]);let Hl=new Date(at.maxDate);Hl.setDate(Hl.getDate()+1),Hl=Hl.toISOString().split("T")[0],ut.push(["<=",["get","ts"],Hl])}if(at.pic_type&&""!==at.pic_type&&(st.pic_type="flat"===at.pic_type?"flat":"equirectangular",ot.push(["==",["get","type"],st.pic_type]),ut.push(["==",["get","type"],st.pic_type])),this._hasGridStats()&&(Hl=!0),at.camera&&""!==at.camera){st.camera=at.camera;const Hl=at.camera.toLowerCase().trim()+" ",rc=at.camera.toLowerCase().trim()+"zzzzzzzzzzzzzzzzzzzz",sc=["collator",{"case-sensitive":!1,"diacritic-sensitive":!1}];ot.push([">=",["get","model"],Hl,sc]),ot.push(["<=",["get","model"],rc,sc]),ut.push([">=",["get","model"],Hl,sc]),ut.push(["<=",["get","model"],rc,sc])}return at.qualityscore&&at.qualityscore.length>0&&(st.qualityscore=at.qualityscore,ot.push(["in",rc.MAP_EXPR_QUALITYSCORE,["literal",st.qualityscore]]),ut.push(["in",rc.MAP_EXPR_QUALITYSCORE,["literal",st.qualityscore]])),at.theme&&Object.values(sc).includes(at.theme)&&(st.theme=at.theme,Hl=!0),0==ot.length?ot=null:ot.unshift("all"),0==ut.length?ut=null:(ut.unshift("all"),ut=["step",["zoom"],!0,rc.TILES_PICTURES_ZOOM,ut]),{mapFilters:st,mapSeqFilters:ot,mapPicFilters:ut,reloadMapStyle:Hl}}setFilters(at){let st=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{mapFilters:ot,mapSeqFilters:ut,mapPicFilters:Hl,reloadMapStyle:rc}=this._mapFiltersToLayersFilters(at);this._mapFilters=ot,rc&&this.reloadLayersStyles();const oc=this.getVisibleUsers().includes("geovisio");ut&&oc&&(ut=["step",["zoom"],!0,7,ut]),this.filterUserLayersContent("sequences",ut),this.filterUserLayersContent("pictures",Hl),!st&&(null!==ut||null!==Hl||null!==this._mapFilters.theme&&this._mapFilters.theme!==sc.DEFAULT)&&oc&&this.getZoom()<7&&!this._hasGridStats()&&this.easeTo({zoom:7}),this.fire("filters-changed",Object.assign({},this._mapFilters))}async setVisibleUsers(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];await super.setVisibleUsers(at);let{mapSeqFilters:st,mapPicFilters:ot,reloadMapStyle:ut}=this._mapFiltersToLayersFilters(this._mapFilters);ut&&this.reloadLayersStyles();const Hl=at.includes("geovisio");st&&Hl&&(st=["step",["zoom"],!0,7,st]),this.filterUserLayersContent("sequences",st),this.filterUserLayersContent("pictures",ot)}}},9048:(at,st,ot)=>{"use strict";ot.d(st,{Ay:()=>Photo,LM:()=>cu,Vf:()=>uu,cS:()=>lu});ot(5003);var ut=ot(5975),Hl=ot(2305),rc=ot(7343),sc=ot(508),oc=(ot(3961),ot(1080),ot(2710),ot(1575),ot(1545)),_c=ot(3348),wc=ot(4991),Sc=ot(3727);const iu={baseUrl:ut,width:1280,cols:2,rows:1,tileUrl:()=>null},su={id:rc.BASE_PANORAMA_ID,caption:"",panorama:iu,links:[],gps:[0,0],sequence:{},sphereCorrection:{},horizontalFov:360,properties:{}},lu=30,cu=250,uu=3e3;oc.jM.useNewAnglesOrder=!0;class Photo extends oc.jM{constructor(at,st){var ot;let ut=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super({container:st,adapter:[Sc.A,{showErrorTile:!1,baseBlur:!1,resolution:at.isWidthSmall()?32:64,shouldGoFast:ut.shouldGoFast}],withCredentials:at.api._getPSVWithCredentials(),requestHeaders:null===at||void 0===at||null===(ot=at.fetchOptions)||void 0===ot?void 0:ot.headers,panorama:iu,lang:at._t.psv,minFov:5,loadingTxt:" ",navbar:null,rendererParameters:{preserveDrawingBuffer:!at.isWidthSmall()},plugins:[[_c.$,{dataMode:"server",positionMode:"gps",renderMode:"3d",preload:!0,getNode:()=>{},transitionOptions:()=>{},arrowsPosition:{linkOverlapAngle:Math.PI/6}}],[wc.b,{}]],...ut}),this._parent=at,this._options=ut,st.classList.add("pnx-psv"),this._shouldGoFast=(null===ut||void 0===ut?void 0:ut.shouldGoFast)||(()=>!1),this._transitionDuration=(null===ut||void 0===ut?void 0:ut.transitionDuration)||cu,this._myVTour=this.getPlugin(_c.$),this._myVTour.datasource.nodeResolver=this._getNodeFromAPI.bind(this),this._myVTour.config.transitionOptions=this._psvNodeTransition.bind(this),this._clearArrows=this._myVTour.arrowsRenderer.clear.bind(this._myVTour.arrowsRenderer),this._myVTour.arrowsRenderer.clear=()=>{},this._myMarkers=this.getPlugin(wc.b),this._annotationsVisible=!1,this._sequencePlaying=!1,this._picturesNavigation=this._options.picturesNavigation||"any",this._picturesSequences={},this._myVTour.addEventListener("enter-arrow",this._onEnterArrow.bind(this)),this._myVTour.addEventListener("leave-arrow",this._onLeaveArrow.bind(this)),this._myVTour.addEventListener("node-changed",this._onNodeChanged.bind(this)),this._myMarkers.addEventListener("select-marker",this._onSelectMarker.bind(this)),this.addEventListener("position-updated",this._onPositionUpdated.bind(this)),this.addEventListener("zoom-updated",this._onZoomUpdated.bind(this)),this.addEventListener("dblclick",this._onDoubleClick.bind(this)),this._parent.addEventListener("select",this._onSelect.bind(this)),this.loader.size=150,this.loader.color="rgba(61, 61, 61, 0.5)",this.loader.textColor="rgba(255, 255, 255, 0.7)",this.loader.border=5,this.loader.thickness=10,this.loader.canvas.setAttribute("viewBox","0 0 150 150"),this.loader.__updateContent(),this._options.position&&!this._parent.picture&&this.goToPosition(...this._options.position)}async _getNodeFromAPI(at){var st,ot;if((0,rc.isNullId)(at))return su;const ut=await fetch(this._parent.api.getPictureMetadataUrl(at,this._picturesSequences[at]),this._parent.api._getFetchOptions());let Hl=await ut.json();if(Hl.features&&(Hl=Hl.features.pop()),!Hl||0===Object.keys(Hl).length||!ut.ok)throw this._parent.loader&&this._parent.loader.dismiss(!0,this._parent._t.pnx.error_pic),new Error("Picture with ID "+at+" was not found");this._picturesSequences[at]=Hl.collection;const oc=(0,sc.apiFeatureToPSVNode)(Hl,this._parent._t,this._parent._isInternetFast,this._picturesNavFilter.bind(this));var _c,wc;null!==oc&&void 0!==oc&&null!==(st=oc.sequence)&&void 0!==st&&st.prevPic&&(this._picturesSequences[null===oc||void 0===oc||null===(_c=oc.sequence)||void 0===_c?void 0:_c.prevPic]=Hl.collection);null!==oc&&void 0!==oc&&null!==(ot=oc.sequence)&&void 0!==ot&&ot.nextPic&&(this._picturesSequences[null===oc||void 0===oc||null===(wc=oc.sequence)||void 0===wc?void 0:wc.nextPic]=Hl.collection);return oc}_psvNodeTransition(at,st,ot){var ut,Hl,sc;let oc={};const _c=this._shouldGoFast()?0:Math.min(cu,this._transitionDuration),wc=_c>100,Sc=null!=(ot||(null===st||void 0===st?void 0:st.links.find((st=>st.nodeId==at.id)))),iu=st&&at.sequence.id===st.sequence.id,su=((null===st||void 0===st||null===(ut=st.properties)||void 0===ut?void 0:ut["view:azimuth"])||0)*(Math.PI/180),uu=((null===at||void 0===at||null===(Hl=at.properties)||void 0===Hl?void 0:Hl["view:azimuth"])||0)*(Math.PI/180),pu=(0,rc.getRelativeHeading)(at)*(Math.PI/180);this.setOption("maxFov",Math.min(3*at.horizontalFov/4,90));const mu={showLoader:!1,effect:"none",speed:0,rotation:!1,rotateTo:{pitch:0,yaw:-pu},zoomTo:lu};if(360==at.horizontalFov)oc=st?(0,rc.getDistance)(st.gps,at.gps)>=.001?mu:{speed:_c,effect:Sc&&wc?"fade":"none",rotation:Sc&&iu&&wc,rotateTo:this.getPosition()}:mu;else if(iu){const at=this.getPosition().yaw,ot=st.horizontalFov*(Math.PI/180)/2,ut=at<=ot||at>=2*Math.PI-ot,Hl=Math.abs(su-uu)<=Math.PI/4;oc={speed:_c,effect:Sc&&Hl&&wc?"fade":"none",rotation:Sc&&Hl&&wc,rotateTo:ut?this.getPosition():{pitch:0,yaw:0},zoomTo:ut?this.getZoomLevel():lu}}else oc=Object.assign(mu,{rotateTo:{pitch:0,yaw:0}});"fade"===oc.effect&&oc.speed>=150?setTimeout(this._clearArrows,oc.speed-100):this._clearArrows();const gu=new CustomEvent("picture-loading",{detail:{...Object.assign({},this.getXYZ(),oc.rotateTo?{x:180*(uu+oc.rotateTo.yaw)/Math.PI}:null,oc.zoomTo?{z:oc.zoomTo}:null),picId:at.id,lon:at.gps[0],lat:at.gps[1],first:(null===(sc=this._parent._initParams)||void 0===sc?void 0:sc.getParentPostInit().picture)==at.id}});return this.dispatchEvent(gu),oc}_onEnterArrow(at){const st=at.link,ot=at.node;let ut;ot&&(ut=360===ot.horizontalFov?(this.getPictureOriginalHeading()+180*this.getPosition().yaw/Math.PI)%360:this.getPictureOriginalHeading());const Hl=new CustomEvent("picture-preview-started",{detail:{picId:st.nodeId,coordinates:st.gps,direction:ut}});this.dispatchEvent(Hl)}_onLeaveArrow(at){const st=at.link,ot=new CustomEvent("picture-preview-stopped",{detail:{picId:st.nodeId}});this.dispatchEvent(ot)}_onPositionUpdated(at){let{position:st}=at;const ot=(0,rc.positionToXYZ)(st,this.getZoomLevel());ot.x+=this.getPictureOriginalHeading(),ot.x=ot.x%360;const ut=new CustomEvent("view-rotated",{detail:ot});this.dispatchEvent(ut),this._onTilesStartLoading()}_onZoomUpdated(at){let{zoomLevel:st}=at;const ot=new CustomEvent("view-rotated",{detail:{...this.getXY(),z:st}});this.dispatchEvent(ot),this._onTilesStartLoading()}_onDoubleClick(){this.unfocusAnnotation()}_onNodeChanged(at){for(let Hl of document.getElementsByClassName("pnx-psv-tour-arrows"))Hl.classList.remove("pnx-clicked");if(at.node.id){var st,ot,ut;const Hl=(null===(st=this._parent._initParams)||void 0===st?void 0:st.getParentPostInit().picture)==at.node.id;this._parent.select(null===(ot=at.node)||void 0===ot||null===(ut=ot.sequence)||void 0===ut?void 0:ut.id,at.node.id);const rc=this.getPictureMetadata();if(!rc)return void this.dispatchEvent(new CustomEvent("picture-loaded",{detail:{}}));this._prevSequence=rc.sequence.id;const sc=new CustomEvent("picture-loaded",{detail:{...this.getXYZ(),picId:at.node.id,lon:rc.gps[0],lat:rc.gps[1],first:Hl}});this.dispatchEvent(sc),rc.panorama.hdUrl?(this.setOption("downloadUrl",rc.panorama.hdUrl),this.setOption("downloadName",at.node.id+".jpg")):this.setOption("downloadUrl",null),this._annotationsVisible&&this.toggleAllAnnotations(!0)}this._onTilesStartLoading()}_onSelectMarker(at){var st;if(at.marker&&null!==(st=at.marker.id)&&void 0!==st&&st.startsWith("annotation-")){const st=new CustomEvent("annotation-click",{detail:{annotationId:at.marker.data.id}});this.dispatchEvent(st)}}_onTilesStartLoading(){this._tilesQueueTimer&&(clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer),this._tilesQueueTimer=setInterval((()=>{if(0===Object.keys(this.adapter.queue.tasks).length){if(this._myVTour.state.currentNode){const at=new CustomEvent("picture-tiles-loaded",{detail:{picId:this._myVTour.state.currentNode.id}});this.dispatchEvent(at)}clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer}}),100)}getPictureMetadata(){var at,st,ot;return(0,rc.isNullId)(null===(at=this._myVTour)||void 0===at||null===(st=at.state)||void 0===st||null===(ot=st.currentNode)||void 0===ot?void 0:ot.id)?null:this._myVTour.state.currentNode?Object.assign({},this._myVTour.state.currentNode):null}getPictureId(){var at,st,ot,ut,Hl;const sc=(null===(at=this._myVTour)||void 0===at||null===(st=at.state)||void 0===st?void 0:st.loadingNode)||(null===(ot=this._myVTour)||void 0===ot||null===(ut=ot.state)||void 0===ut||null===(Hl=ut.currentNode)||void 0===Hl?void 0:Hl.id);return(0,rc.isNullId)(sc)?null:sc}_onSelect(at){var st;at.detail.seqId&&(this._picturesSequences[at.detail.picId]=at.detail.seqId),(null===(st=this._myVTour.getCurrentNode())||void 0===st?void 0:st.id)!==at.detail.picId&&(this.loader.show(),this._myVTour.setCurrentNode(at.detail.picId).catch((at=>{this.showErrorOverlay(at,this._parent._t.pnx.error_pic,!0)})))}goToNextPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const at=this.getPictureMetadata().sequence.nextPic;if(!at)throw new Error("No next picture available");this._parent.select(this.getPictureMetadata().sequence.id,at)}goToPrevPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const at=this.getPictureMetadata().sequence.prevPic;if(!at)throw new Error("No previous picture available");this._parent.select(this.getPictureMetadata().sequence.id,at)}async goToPosition(at,st){return this._parent.api.getPicturesAroundCoordinates(at,st).then((at=>{if(at.features.length>0){const st=at.features.pop();return this._parent.select(null===st||void 0===st?void 0:st.collection,st.id),st.id}return Promise.reject(new Error("No picture found nearby given coordinates"))}))}getXY(){const at=(0,rc.positionToXYZ)(this.getPosition());return at.x=(at.x+this.getPictureOriginalHeading())%360,at}getXYZ(){const at=this.getXY();return at.z=this.getZoomLevel(),at}getPictureOriginalHeading(){var at,st;return(null===(at=this.getPictureMetadata())||void 0===at||null===(st=at.properties)||void 0===st?void 0:st["view:azimuth"])||0}getPictureRelativeHeading(){return(0,rc.getRelativeHeading)(this.getPictureMetadata())}clearPictureMetadataCache(){var at,st,ot,ut;const Hl=null===(at=this.getPictureMetadata())||void 0===at?void 0:at.id,rc=null===(st=this.getPictureMetadata())||void 0===st||null===(ot=st.sequence)||void 0===ot?void 0:ot.id;null===(ut=this._myVTour.state.currentTooltip)||void 0===ut||ut.hide(),this._myVTour.state.currentTooltip=null,this._myVTour.state.currentNode=null,this._myVTour.state.preload={},this._myVTour.datasource.nodes={},Hl&&this._parent.select(rc,Hl)}setXYZ(at,st,ot){const ut=(0,rc.xyzToPosition)(at-this.getPictureOriginalHeading(),st,ot);this.rotate({yaw:ut.yaw,pitch:ut.pitch}),this.zoom(ut.zoom)}setHigherContrast(at){this.renderer.renderer.toneMapping=at?3:0,this.renderer.renderer.toneMappingExposure=at?2:1,this.needsUpdate()}getTransitionDuration(){return this._transitionDuration}setTransitionDuration(at){if((at=parseFloat(at))<100||at>uu)throw new Error("Invalid transition duration (should be between 100 and "+uu+")");this._transitionDuration=at;const st=new CustomEvent("transition-duration-changed",{detail:{value:at}});this.dispatchEvent(st)}setPanorama(at,st){const onFailure=at=>{var st;return this.showErrorOverlay(at,null===(st=this._parent)||void 0===st?void 0:st._t.pnx.error_pic,!0)};try{return super.setPanorama(at,st).catch(onFailure)}catch(ot){onFailure(ot)}}showErrorOverlay(at,st,ot){var ut,rc,sc,oc;null!==(ut=this._parent)&&void 0!==ut&&ut.loader.isVisible()||!this.overlay.isVisible()?null===(rc=this._parent)||void 0===rc||rc.loader.dismiss(at,st,ot?()=>{var at;null===(at=this._parent)||void 0===at||at.loader.dismiss(),this.overlay.hide()}:void 0):(console.error(at),this.overlay.show({image:`<img style="width: 200px" src="${Hl}" alt="" />`,title:null===(sc=this._parent)||void 0===sc?void 0:sc._t.pnx.error,text:st+"<br />"+(null===(oc=this._parent)||void 0===oc?void 0:oc._t.pnx.error_click),dissmisable:ot}))}playSequence(){this._sequencePlaying=!0;const at=new Event("sequence-playing",{bubbles:!0,composed:!0});this.dispatchEvent(at);const nextPicturePlay=()=>{if(this._sequencePlaying){this.addEventListener("picture-loaded",(()=>{this._playTimer=setTimeout((()=>{nextPicturePlay()}),this.getTransitionDuration())}),{once:!0});try{this.goToNextPicture()}catch(at){this.stopSequence()}}};this.addEventListener("click",(()=>this.stopSequence())),nextPicturePlay()}stopSequence(){this._sequencePlaying=!1,this._playTimer&&(clearTimeout(this._playTimer),delete this._playTimer),this.forceRefresh();const at=new Event("sequence-stopped",{bubbles:!0,composed:!0});this.dispatchEvent(at)}isSequencePlaying(){return this._sequencePlaying}toggleSequencePlaying(){this.isSequencePlaying()?this.stopSequence():this.playSequence()}getPicturesNavigation(){return this._picturesNavigation}setPicturesNavigation(at){"none"===at&&(at="pic"),this._picturesNavigation=at;const st=new CustomEvent("pictures-navigation-changed",{detail:{value:at}});this.dispatchEvent(st)}_picturesNavFilter(at){switch(this._picturesNavigation){case"seq":return["next","prev"].includes(at.rel);case"pic":case"none":return!1;default:return!0}}areAnnotationsVisible(){return this._annotationsVisible}toggleAllAnnotations(at){const st=this.getPictureMetadata();if(!st)throw this._myMarkers.clearMarkers(),new Error("No picture currently selected");if(at){var ot,ut;let at=st.properties.annotations;0===(null===(ot=at)||void 0===ot?void 0:ot.length)&&console.warn("No annotation available on picture",st.id);const Hl=null===(ut=this.state.textureData.panoData)||void 0===ut?void 0:ut.baseData;at=at.map((at=>{const st=this.getPictureMetadata().properties["pers:interior_orientation"].sensor_array_dimensions;if(!st)return console.warn("Picture lacks pers:interior_orientation.sensor_array_dimensions property, can't compute marker"),null;const ot=at.shape.coordinates.map((at=>at.map((at=>{const ot=[at[0]*Hl.croppedWidth/st[0],at[1]*Hl.croppedHeight/st[1]],ut=[(Hl.croppedX+ot[0])/Hl.fullWidth,(Hl.croppedY+ot[1])/Hl.fullHeight];return[2*(ut[0]-.5)*Math.PI,(.5-ut[1])*Math.PI]}))));return{id:`annotation-${at.id}`,polygon:ot,data:{id:at.id},svgStyle:{stroke:"var(--orange)",strokeWidth:"3px",fill:"var(--orange-transparent)",cursor:"pointer"},tooltip:this._parent._t.pnx.semantics_annotation_tooltip}})),this._myMarkers.setMarkers(at)}else this._myMarkers.clearMarkers();const Hl=this._annotationsVisible!=at;this._annotationsVisible=at,Hl&&this.dispatchEvent(new CustomEvent("annotations-toggled",{detail:{visible:at}}))}focusOnAnnotation(at){this.areAnnotationsVisible()||this.toggleAllAnnotations(!0),this.unfocusAnnotation(!0);const st=`annotation-${at}`;this._myMarkers.updateMarker({id:st,svgStyle:{stroke:"var(--red)",strokeWidth:"3px",fill:"var(--red-transparent)"},data:{selected:!0}}),this._myMarkers.gotoMarker(st,0),this.zoom(65)}unfocusAnnotation(){let at=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const st=Object.keys(this._myMarkers.markers).filter((at=>{var st,ot,ut;return at.startsWith("annotation-")&&(null===(st=this._myMarkers.markers[at])||void 0===st||null===(ot=st.config)||void 0===ot||null===(ut=ot.data)||void 0===ut?void 0:ut.selected)}));st.length>0&&(st.forEach((at=>{this._myMarkers.updateMarker({id:at,svgStyle:{stroke:"var(--orange)",strokeWidth:"3px",fill:"var(--orange-transparent)"},data:{selected:!1}})})),at||this.dispatchEvent(new Event("annotations-unfocused")))}forceRefresh(){var at;const st=this._myVTour.getCurrentNode();if(st&&st.panorama.baseUrl!==(null===st||void 0===st||null===(at=st.panorama)||void 0===at?void 0:at.origBaseUrl)){const at=this.getZoomLevel(),ot=this.getPosition();this._myVTour.state.currentNode=null,this._myVTour.setCurrentNode(st.id,{zoomTo:at,rotateTo:ot,fadeIn:!1,speed:0,rotation:!1})}st&&st.panorama.rows>1&&this.adapter.__refresh()}}},4374:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Popup});var ut=ot(4542),Hl=ot(5995),rc=ot(8591),sc=ot(6627);class Popup extends ut.WF{constructor(){super(),this.visible=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",(at=>{at.target===this&&this.close()})),document.addEventListener("keyup",(at=>{"Escape"===at.key&&this.visible&&this.close()}))}attributeChangedCallback(at,st,ot){super.attributeChangedCallback(at,st,ot),"visible"==at&&(""!==ot&&!0!==ot||this.dispatchEvent(new Event("open")))}close(){this.visible=!1,this.dispatchEvent(new Event("close"))}render(){return ut.qy`
|
|
1711
|
+
`,Loader.properties={_mode:{state:!0},_label:{state:!0},_isLabelFun:{state:!0},visible:{type:Boolean,reflect:!0},"no-label":{type:Boolean},value:{type:Number}},customElements.define("pnx-loader",Loader)},5642:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Map});ot(3041);var ut=ot(8340),Hl=ot(7343),rc=ot(6883),sc=ot(270),oc=ot(6462),_c=ot(9740),wc=(ot(6795),ot(927)),Sc=ot.n(wc),iu=ot(2968),su=ot.n(iu),lu=ot(748);Sc().workerClass=su(),Sc().addProtocol("pmtiles",(new lu.Zs).tile);class Map extends Sc().Map{constructor(at,st){let ot=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var Hl;(super({container:st,style:(0,ut.combineStyles)(at,ot),center:[0,0],zoom:0,maxZoom:24,attributionControl:!1,dragRotate:!1,pitchWithRotate:!1,touchZoomRotate:!0,touchPitch:!1,doubleClickZoom:!1,canvasContextAttributes:{preserveDrawingBuffer:!at.isWidthSmall()},transformRequest:at.api._getMapRequestTransform(),locale:at._t.maplibre,hash:!1,...ot}),this._loadMarkerImages(),this._parent=at,this._options=ot,this.getContainer().classList.add("pnx-map"),void 0===ot.touchZoomRotate)&&(null===this||void 0===this||null===(Hl=this.touchZoomRotate)||void 0===Hl||Hl.disableRotation());this._options.raster&&(this._options.background=this._options.background||"streets"),this._attribution=new(Sc().AttributionControl)({compact:!1,...ot.attributionControl}),this.addControl(this._attribution),this._initMapPosition(),this._picMarker=this._getPictureMarker(),this._picMarkerPreview=this._getPictureMarker(!1),this._picThumbUrl={},this._seqPictures={},this._userLayers=new Set,this._parent.addEventListener("select",this.reloadLayersStyles.bind(this)),setTimeout((()=>{var at;!this.loaded()&&null!==(at=this._parent)&&void 0!==at&&at.loader.isVisible()&&this._parent.loader.dismiss({},this._parent._t.map.slow_loading,(async()=>{await this._postLoad(),this._parent.loader.dismiss()}))}),15e3),this.waitForEnoughMapLoaded().then((async()=>await this._postLoad()))}async _postLoad(){this.resize(),await this.setVisibleUsers(this._parent.users),this.reloadLayersStyles(),this.fire("ready")}destroy(){this.remove(),delete this._parent,delete this._options,delete this._attribution,delete this._picMarker,delete this._picMarkerPreview,delete this._picThumbUrl,delete this._seqPictures,delete this._userLayers}waitForEnoughMapLoaded(){return new Promise((at=>{let st=0,ot=0,ut=0,Hl=0;const onSourceDataLoading=at=>{"source"===at.dataType&&at.tile&&(at.sourceId.startsWith("geovisio")?ot++:st++)},onSourceData=at=>{"source"===at.dataType&&at.tile&&(at.sourceId.startsWith("geovisio")?(Hl++,at.isSourceLoaded&&(Hl=ot)):(ut++,at.isSourceLoaded&&(ut=st))),checkEnoughLoaded()},checkEnoughLoaded=()=>{ut/st>=.75&&(0===ot||Hl/ot>=.75)&&(this.off("sourcedata",onSourceData),this.off("sourcedataloading",onSourceDataLoading),at())};this.on("sourcedataloading",onSourceDataLoading),this.on("sourcedata",onSourceData)}))}_initMapPosition(){this._options.center&&this._options.center!=[0,0]||this._options.zoom&&0!==this._options.zoom||this._options.hash||this._parent.onceAPIReady().then((()=>{var at,st;let ot=null===(at=this._parent)||void 0===at||null===(st=at.api)||void 0===st?void 0:st.getDataBbox();if(ot)try{ot=new(Sc().LngLatBounds)(ot),this.loaded()?this.fitBounds(ot,{animate:!1}):this.waitForEnoughMapLoaded().then((()=>this.fitBounds(ot,{animate:!1})))}catch(ut){console.warn("Received invalid bbox: "+ot)}}))}_loadMarkerImages(){[{id:"pnx-marker",img:rc},{id:"pnx-arrow-flat",img:oc},{id:"pnx-arrow-360",img:_c}].forEach((at=>{const st=new Image(64,64);st.onload=()=>this.addImage(at.id,st),st.src=at.img}))}_hasQualityScore(){var at,st,ot,ut;const Hl=(null===(at=this.getStyle())||void 0===at||null===(st=at.metadata)||void 0===st?void 0:st["panoramax:fields"])||{};return(null===Hl||void 0===Hl||null===(ot=Hl.pictures)||void 0===ot?void 0:ot.includes("gps_accuracy"))&&(null===Hl||void 0===Hl||null===(ut=Hl.pictures)||void 0===ut?void 0:ut.includes("h_pixel_density"))}_hasGridStats(){var at,st,ot,ut,Hl,rc;const sc=(null===(at=this.getStyle())||void 0===at||null===(st=at.metadata)||void 0===st?void 0:st["panoramax:fields"])||{};return(null===sc||void 0===sc||null===(ot=sc.grid)||void 0===ot?void 0:ot.includes("nb_360_pictures"))&&(null===sc||void 0===sc||null===(ut=sc.grid)||void 0===ut?void 0:ut.includes("nb_flat_pictures"))&&(null===sc||void 0===sc||null===(Hl=sc.grid)||void 0===Hl?void 0:Hl.includes("coef_360_pictures"))&&(null===sc||void 0===sc||null===(rc=sc.grid)||void 0===rc?void 0:rc.includes("coef_flat_pictures"))}reloadVectorTiles(){[...this._userLayers].forEach((at=>{const st=this.getSource((0,ut.getUserSourceId)(at));st.setTiles(st.tiles)}))}hasTwoBackgrounds(){return void 0!==this.getLayer(ut.RASTER_LAYER_ID)}getBackground(){if(!this.getLayer(ut.RASTER_LAYER_ID))return"streets";return"visible"==this.getLayoutProperty(ut.RASTER_LAYER_ID,"visibility")?"aerial":"streets"}setBackground(at){if(!this.getLayer(ut.RASTER_LAYER_ID)&&"aerial"===at)throw new Error("No aerial imagery available");this.getLayer(ut.RASTER_LAYER_ID)&&(this.setLayoutProperty(ut.RASTER_LAYER_ID,"visibility","aerial"===at?"visible":"none"),this.fire("background-changed",{background:at||"streets"}))}getVisibleUsers(){return[...this._userLayers].filter((at=>this.getLayer((0,ut.getUserLayerId)(at,"pictures"))&&"visible"===this.getLayoutProperty((0,ut.getUserLayerId)(at,"pictures"),"visibility")))}onceLayerReady(at){return this.getLayer(at)?Promise.resolve():new Promise((at=>{setTimeout(at,250)})).then((()=>this.onceLayerReady(at)))}async setVisibleUsers(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"===typeof at?at=[at]:null===at&&(at=[]),await Promise.all(at.filter((at=>""!=at&&!this._userLayers.has(at))).map((at=>(this._createPicturesTilesLayer(at),this.onceLayerReady((0,ut.getUserLayerId)(at,"pictures"))))));const st=["pictures","sequences","sequences_plus","grid","pictures_symbols"];[...this._userLayers].forEach((ot=>{st.forEach((st=>{const Hl=(0,ut.getUserLayerId)(ot,st);this.getLayer(Hl)&&this.setLayoutProperty(Hl,"visibility",at.includes(ot)?"visible":"none")}))})),this.reloadLayersStyles(),this.fire("users-changed",{usersIds:at})}filterUserLayersContent(at,st){[...this._userLayers].forEach((ot=>{this.getLayer((0,ut.getUserLayerId)(ot,at))?(this.setFilter((0,ut.getUserLayerId)(ot,at),st),"sequences"===at&&this.getLayer((0,ut.getUserLayerId)(ot,"sequences_plus"))&&this.setFilter((0,ut.getUserLayerId)(ot,"sequences_plus"),st),"pictures"===at&&this.getLayer((0,ut.getUserLayerId)(ot,"pictures_symbols"))&&this.setFilter((0,ut.getUserLayerId)(ot,"pictures_symbols"),st)):console.warn("Layer",(0,ut.getUserLayerId)(ot,at),"not ready")}))}displayPictureMarker(at,st,ot){let Hl=arguments.length>3&&void 0!==arguments[3]&&arguments[3],rc=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;this._picMarkerPreview.remove(),void 0!==at&&void 0!==st?(this._picMarker.setLngLat([at,st]).setRotation(ot).addTo(this),this._picMarker.picId=rc):this._picMarker.remove(),this.reloadLayersStyles(),Hl||void 0===at||void 0===st||this.flyTo({center:[at,st],zoom:this.getZoom()<ut.TILES_PICTURES_ZOOM+2?ut.TILES_PICTURES_ZOOM+2:this.getZoom(),maxDuration:2e3})}reloadLayersStyles(){const updateStyle=(at,st)=>{[...this._userLayers].forEach((ot=>{const Hl=(0,ut.getUserLayerId)(ot,at);if(this.getLayer(Hl)){for(let at in st.layout)this.setLayoutProperty(Hl,at,st.layout[at]);for(let at in st.paint)this.setPaintProperty(Hl,at,st.paint[at])}else console.warn("Layer",Hl,"not ready")}))};["pictures","pictures_symbols","sequences"].forEach((at=>{updateStyle(at,this._getLayerStyleProperties(at))}))}async _createPicturesTilesLayer(at){this._userLayers.add(at);const st=this.getStyle().layers.find(ut.isLabelLayer);if("geovisio"!==at&&!this.getSource(`geovisio_${at}`)){const ot=await this._parent.api.getUserMapStyle(at);Object.entries(ot.sources).forEach((at=>{let[st,ot]=at;return this.addSource(st,ot)})),ot.layers=ot.layers||[];ot.layers.concat((0,ut.getMissingLayerStyles)(ot.sources,ot.layers)).filter((at=>Object.keys(at).length>0)).forEach((at=>this.addLayer(at,null===st||void 0===st?void 0:st.id)))}this._picPreviewTimer=null,this._picPopup=new(Sc().Popup)({closeButton:!1,closeOnClick:!this._parent.isWidthSmall(),offset:3}),this._picPopup.on("close",(()=>{delete this._picPopup._picId}));const ot=(0,ut.getUserLayerId)(at,"pictures");this.on("mousemove",ot,(at=>{this.getCanvas().style.cursor="pointer";const st=Object.assign({},at);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(st,ot)),100)})),this.on("mouseleave",ot,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",ot,this._onPictureClick.bind(this));const Hl=(0,ut.getUserLayerId)(at,"sequences_plus");this.on("mousemove",Hl,(at=>{if(this._onSequenceHover(at),this.getZoom()<=ut.TILES_PICTURES_ZOOM+1&&(this.getCanvas().style.cursor="pointer",at.features[0].properties.id)){const st=Object.assign({},at);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(st,Hl)),100)}})),this.on("mouseleave",Hl,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",Hl,(at=>{at.preventDefault(),this.getZoom()<=ut.TILES_PICTURES_ZOOM+1&&this._onSequenceClick(at)})),"geovisio"===at&&this.getLayer("geovisio_grid")&&(this.on("mousemove","geovisio_grid",(at=>{if(this.getZoom()<=ut.TILES_PICTURES_ZOOM+1){this.getCanvas().style.cursor="pointer";const st=Object.assign({},at);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(st,"geovisio_grid")),100)}})),this.on("mouseleave","geovisio_grid",(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click","geovisio_grid",(at=>{at.preventDefault(),this.flyTo({center:at.lngLat,zoom:ut.TILES_PICTURES_ZOOM-6})}))),this.on("click",(at=>{!1===at.defaultPrevented&&(clearTimeout(this._picPreviewTimer),this._picPopup.remove())}))}_getLayerStyleProperties(at){if("pictures_symbols"===at)return{paint:{},layout:{"icon-image":["case",["==",["get","id"],this._parent.picture],"",["==",["get","type"],"equirectangular"],"pnx-arrow-360","pnx-arrow-flat"],"symbol-sort-key":this._getLayerSortStyle(at)}};{const st={pictures:"circle",sequences:"line"};return{paint:Object.assign({[`${st[at]}-color`]:this._getLayerColorStyle(at)},ut.VECTOR_STYLES[at.toUpperCase()].paint),layout:Object.assign({[`${st[at]}-sort-key`]:this._getLayerSortStyle(at)},ut.VECTOR_STYLES[at.toUpperCase()].layout)}}}_getLayerColorStyle(at){const st=["case",["==",["get","hidden"],!0],Hl.COLORS.HIDDEN,["==",["get","geovisio:status"],"hidden"],Hl.COLORS.HIDDEN],ot=this._parent.sequence;return"sequences"==at&&ot?st.push(["==",["get","id"],ot],Hl.COLORS.SELECTED):at.startsWith("pictures")&&ot&&st.push(["in",ot,["get","sequences"]],Hl.COLORS.SELECTED),st.push(Hl.COLORS.BASE),st}_getLayerSortStyle(at){const st=["case",["==",["get","hidden"],!0],90],ot=this._parent.sequence;return"sequences"==at&&ot?st.push(["==",["get","id"],ot],100):at.startsWith("pictures")&&ot&&st.push(["in",ot,["get","sequences"]],100),st.push(10),st}_attachPreviewToPictures(at,st){let ot=at.features.pop();if(!ot||ot.properties.id==this._picPopup._picId)return;let Hl=null;if(st.endsWith("pictures")?Hl=ot.geometry.coordinates.slice():at.lngLat&&(Hl=[at.lngLat.lng,at.lngLat.lat]),!Hl){const at="LineString"===ot.geometry.type?[ot.geometry.coordinates]:ot.geometry.coordinates;let st=null;const ut=this.getBounds(),rc=ut.getCenter();for(let ot=0;ot<at.length;ot++)for(let sc=0;sc<at[ot].length;sc++)if(ut.contains(at[ot][sc])){let ut=rc.distanceTo(new(Sc().LngLat)(...at[ot][sc]));(null===st||ut<st)&&(Hl=at[ot][sc],st=ut)}if(!Hl)return}this._picPopup.setLngLat(Hl).addTo(this),this._picThumbUrl[ot.properties.id]||this._picPopup.setDOMContent((0,ut.getThumbGif)(this._parent._t)),this._picPopup._loading=ot.properties.id,this._picPopup._picId=ot.properties.id;const displayThumb=at=>{if(this._picPopup._loading===ot.properties.id)if(delete this._picPopup._loading,at){let st=document.createElement("img");st.classList.add("pnx-map-thumb"),st.alt=this._parent._t.map.thumbnail;let ut=new Image;if(ut.src=at,ut.addEventListener("load",(()=>{ot.properties.hidden?st.children[0].src=ut.src:st.src=ut.src,this._picPopup.setDOMContent(st)})),ot.properties.hidden){const at=document.createElement("div");at.classList.add("pnx-map-thumb-legend"),at.appendChild(document.createTextNode(this._parent._t.map.not_public));const ot=document.createElement("div");ot.appendChild(st),ot.appendChild(at),st=ot}}else this._picPopup.remove()};st.endsWith("pictures")?this._getPictureThumbURL(ot.properties.id).then(displayThumb):st.endsWith("grid")?this._getThumbURL(Hl).then(displayThumb):this._getSequenceThumbURL(ot.properties.id,new(Sc().LngLat)(...Hl)).then(displayThumb)}_getThumbURL(at){return this._parent.api.getPicturesAroundCoordinates(at[1],at[0],.1,1).then((at=>{var st;const ot=null===at||void 0===at||null===(st=at.features)||void 0===st?void 0:st.pop();return ot?this._parent.api.findThumbnailInPictureFeature(ot):null}))}_getSequenceThumbURL(at,st){return st?this._parent.api.getPicturesAroundCoordinates(st.lat,st.lng,1,1,at).then((st=>{var ot;return(null===st||void 0===st||null===(ot=st.features)||void 0===ot?void 0:ot.length)>0?this._parent.api.findThumbnailInPictureFeature(st.features[0]):this._parent.api.getPictureThumbnailURLForSequence(at)})):this._parent.api.getPictureThumbnailURLForSequence(at)}_getPictureThumbURL(at,st){let ot=null;return at&&(void 0!==this._picThumbUrl[at]?ot="string"===typeof this._picThumbUrl[at]?Promise.resolve(this._picThumbUrl[at]):this._picThumbUrl[at]:(this._picThumbUrl[at]=this._parent.api.getPictureThumbnailURL(at,st).then((st=>st?(this._picThumbUrl[at]=st,st):(this._picThumbUrl[at]=null,null))).catch((()=>{this._picThumbUrl[at]=null})),ot=this._picThumbUrl[at])),ot}_getPictureMarker(){let at=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const st=document.createElement("img");return st.src=at?sc:rc,st.alt="",new(Sc().Marker)({element:st,picId:null})}_onSequenceHover(at){var st;at.preventDefault(),at.features.length>0&&null!==(st=at.features[0].properties)&&void 0!==st&&st.id&&this.fire("sequence-hover",{seqId:at.features[0].properties.id})}_onSequenceClick(at){var st;at.preventDefault(),at.features.length>0&&null!==(st=at.features[0].properties)&&void 0!==st&&st.id&&this.fire("sequence-click",{seqId:at.features[0].properties.id,coordinates:at.lngLat})}_onPictureClick(at){var st,ot;at.preventDefault();const ut=(null===at||void 0===at||null===(st=at.features)||void 0===st?void 0:st.length)>0?at.features[0]:null;if(null!==ut&&void 0!==ut&&null!==(ot=ut.properties)&&void 0!==ot&&ot.id){let st=null;try{ut.properties.sequences&&(Array.isArray(ut.properties.sequences)||(ut.properties.sequences=JSON.parse(ut.properties.sequences)),st=ut.properties.sequences.pop())}catch(at){console.log("Sequence ID is not available in vector tiles for picture "+ut.properties.id)}this.fire("picture-click",{picId:ut.properties.id,seqId:st,feature:ut})}}addEventListener(at,st){let ot=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!==ot&&void 0!==ot&&ot.once?this.once(at,st):this.on(at,st)}}},2771:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>MapMore,T:()=>oc});var ut=ot(5642),Hl=ot(7343),rc=ot(8340);const sc={DEFAULT:"default",AGE:"age",TYPE:"type",SCORE:"score"},oc=["minDate","maxDate","pic_type","camera","theme","qualityscore"];class MapMore extends ut.A{constructor(at,st){super(at,st,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this._mapFilters={},this._options.theme&&(this._mapFilters={theme:this._options.theme})}reloadLayersStyles(){if(super.reloadLayersStyles(),this._hasGridStats()){let at="coef";this._mapFilters.pic_type&&(at="flat"==this._mapFilters.pic_type?"coef_flat_pictures":"coef_360_pictures"),this.getStyle().layers.filter((at=>at.id.endsWith("_grid"))).forEach((st=>{const ot=(0,rc.switchCoefValue)(st,at);for(let at in ot.layout)this.setLayoutProperty(st.id,at,ot.layout[at]);for(let at in ot.paint)this.setPaintProperty(st.id,at,ot.paint[at])}))}}_getDatesForLayerColors(){const at=864e5,st=Date.now();return[st-30*at,st-365*at,st-730*at].map((at=>new Date(at).toISOString().split("T")[0]))}_getLayerColorStyle(at){var st,ot,ut,oc,_c,wc,Sc,iu;const su=["case",["==",["get","hidden"],!0],Hl.COLORS.HIDDEN],lu=(null===(st=this._parent.psv)||void 0===st||null===(ot=st._myVTour)||void 0===ot||null===(ut=ot.state)||void 0===ut?void 0:ut.loadingNode)||(null===(oc=this._parent.psv)||void 0===oc||null===(_c=oc._myVTour)||void 0===_c||null===(wc=_c.state)||void 0===wc||null===(Sc=wc.currentNode)||void 0===Sc?void 0:Sc.id),cu=lu?null===(iu=this._parent.psv)||void 0===iu?void 0:iu._picturesSequences[lu]:null;if("sequences"==at&&cu?su.push(["==",["get","id"],cu],Hl.COLORS.SELECTED):"pictures"==at&&cu&&su.push(["in",cu,["get","sequences"]],Hl.COLORS.SELECTED),this._mapFilters.theme==sc.AGE){const st="sequences"==at?"date":"ts",ot=this._getDatesForLayerColors();su.push(["!",["has",st]],Hl.COLORS.BASE,[">=",["get",st],ot[0]],Hl.COLORS.PALETTE_4,[">=",["get",st],ot[1]],Hl.COLORS.PALETTE_3,[">=",["get",st],ot[2]],Hl.COLORS.PALETTE_2,Hl.COLORS.PALETTE_1)}else this._mapFilters.theme==sc.TYPE?su.push(["!",["has","type"]],Hl.COLORS.BASE,["==",["get","type"],"equirectangular"],Hl.COLORS.QUALI_1,Hl.COLORS.QUALI_2):this._mapFilters.theme==sc.SCORE?su.push(["==",rc.MAP_EXPR_QUALITYSCORE,5],Hl.QUALITYSCORE_VALUES[0].color,["==",rc.MAP_EXPR_QUALITYSCORE,4],Hl.QUALITYSCORE_VALUES[1].color,["==",rc.MAP_EXPR_QUALITYSCORE,3],Hl.QUALITYSCORE_VALUES[2].color,["==",rc.MAP_EXPR_QUALITYSCORE,2],Hl.QUALITYSCORE_VALUES[3].color,Hl.QUALITYSCORE_VALUES[4].color):su.push(Hl.COLORS.BASE);return su}_getLayerSortStyle(at){var st,ot,ut,Hl,oc,_c,wc,Sc;const iu=["case",["==",["get","hidden"],!0],90],su=(null===(st=this._parent.psv)||void 0===st||null===(ot=st._myVTour)||void 0===ot||null===(ut=ot.state)||void 0===ut?void 0:ut.loadingNode)||(null===(Hl=this._parent.psv)||void 0===Hl||null===(oc=Hl._myVTour)||void 0===oc||null===(_c=oc.state)||void 0===_c||null===(wc=_c.currentNode)||void 0===wc?void 0:wc.id),lu=su?null===(Sc=this._parent.psv)||void 0===Sc?void 0:Sc._picturesSequences[su]:null;if("sequences"==at&&lu?iu.push(["==",["get","id"],lu],100):"pictures"==at&&lu&&iu.push(["in",lu,["get","sequences"]],100),this._mapFilters.theme==sc.AGE){const st="sequences"==at?"date":"ts",ot=this._getDatesForLayerColors();iu.push(["!",["has",st]],0,[">=",["get",st],ot[0]],50,[">=",["get",st],ot[1]],49,[">=",["get",st],ot[2]],48)}else this._mapFilters.theme==sc.TYPE?iu.push(["!",["has","type"]],0,["==",["get","type"],"equirectangular"],50):this._mapFilters.theme==sc.SCORE&&iu.push(["==",rc.MAP_EXPR_QUALITYSCORE,5],80,["==",rc.MAP_EXPR_QUALITYSCORE,4],65,["==",rc.MAP_EXPR_QUALITYSCORE,3],50,["==",rc.MAP_EXPR_QUALITYSCORE,2],35,["==",rc.MAP_EXPR_QUALITYSCORE,1],20);return iu.push(10),iu}_mapFiltersToLayersFilters(at){let st={},ot=[],ut=[],Hl=!1;if(at.minDate&&""!==at.minDate&&(st.minDate=at.minDate,ot.push([">=",["get","date"],at.minDate]),ut.push([">=",["get","ts"],at.minDate])),at.maxDate&&""!==at.maxDate){st.maxDate=at.maxDate,ot.push(["<=",["get","date"],at.maxDate]);let Hl=new Date(at.maxDate);Hl.setDate(Hl.getDate()+1),Hl=Hl.toISOString().split("T")[0],ut.push(["<=",["get","ts"],Hl])}if(at.pic_type&&""!==at.pic_type&&(st.pic_type="flat"===at.pic_type?"flat":"equirectangular",ot.push(["==",["get","type"],st.pic_type]),ut.push(["==",["get","type"],st.pic_type])),this._hasGridStats()&&(Hl=!0),at.camera&&""!==at.camera){st.camera=at.camera;const Hl=at.camera.toLowerCase().trim()+" ",rc=at.camera.toLowerCase().trim()+"zzzzzzzzzzzzzzzzzzzz",sc=["collator",{"case-sensitive":!1,"diacritic-sensitive":!1}];ot.push([">=",["get","model"],Hl,sc]),ot.push(["<=",["get","model"],rc,sc]),ut.push([">=",["get","model"],Hl,sc]),ut.push(["<=",["get","model"],rc,sc])}return at.qualityscore&&at.qualityscore.length>0&&(st.qualityscore=at.qualityscore,ot.push(["in",rc.MAP_EXPR_QUALITYSCORE,["literal",st.qualityscore]]),ut.push(["in",rc.MAP_EXPR_QUALITYSCORE,["literal",st.qualityscore]])),at.theme&&Object.values(sc).includes(at.theme)&&(st.theme=at.theme,Hl=!0),0==ot.length?ot=null:ot.unshift("all"),0==ut.length?ut=null:(ut.unshift("all"),ut=["step",["zoom"],!0,rc.TILES_PICTURES_ZOOM,ut]),{mapFilters:st,mapSeqFilters:ot,mapPicFilters:ut,reloadMapStyle:Hl}}setFilters(at){let st=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{mapFilters:ot,mapSeqFilters:ut,mapPicFilters:Hl,reloadMapStyle:rc}=this._mapFiltersToLayersFilters(at);this._mapFilters=ot,rc&&this.reloadLayersStyles();const oc=this.getVisibleUsers().includes("geovisio");ut&&oc&&(ut=["step",["zoom"],!0,7,ut]),this.filterUserLayersContent("sequences",ut),this.filterUserLayersContent("pictures",Hl),!st&&(null!==ut||null!==Hl||null!==this._mapFilters.theme&&this._mapFilters.theme!==sc.DEFAULT)&&oc&&this.getZoom()<7&&!this._hasGridStats()&&this.easeTo({zoom:7}),this.fire("filters-changed",Object.assign({},this._mapFilters))}async setVisibleUsers(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];await super.setVisibleUsers(at);let{mapSeqFilters:st,mapPicFilters:ot,reloadMapStyle:ut}=this._mapFiltersToLayersFilters(this._mapFilters);ut&&this.reloadLayersStyles();const Hl=at.includes("geovisio");st&&Hl&&(st=["step",["zoom"],!0,7,st]),this.filterUserLayersContent("sequences",st),this.filterUserLayersContent("pictures",ot)}}},9048:(at,st,ot)=>{"use strict";ot.d(st,{Ay:()=>Photo,LM:()=>cu,Vf:()=>uu,cS:()=>lu});ot(5003);var ut=ot(5975),Hl=ot(2305),rc=ot(7343),sc=ot(508),oc=(ot(3961),ot(1080),ot(2710),ot(1575),ot(1545)),_c=ot(3348),wc=ot(4991),Sc=ot(3727);const iu={baseUrl:ut,width:1280,cols:2,rows:1,tileUrl:()=>null},su={id:rc.BASE_PANORAMA_ID,caption:"",panorama:iu,links:[],gps:[0,0],sequence:{},sphereCorrection:{},horizontalFov:360,properties:{}},lu=30,cu=250,uu=3e3;oc.jM.useNewAnglesOrder=!0;class Photo extends oc.jM{constructor(at,st){var ot;let ut=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super({container:st,adapter:[Sc.A,{showErrorTile:!1,baseBlur:!1,resolution:at.isWidthSmall()?32:64,shouldGoFast:ut.shouldGoFast}],withCredentials:at.api._getPSVWithCredentials(),requestHeaders:null===at||void 0===at||null===(ot=at.fetchOptions)||void 0===ot?void 0:ot.headers,panorama:iu,lang:at._t.psv,minFov:5,loadingTxt:" ",navbar:null,rendererParameters:{preserveDrawingBuffer:!at.isWidthSmall()},plugins:[[_c.$,{dataMode:"server",positionMode:"gps",renderMode:"3d",preload:!0,getNode:()=>{},transitionOptions:()=>{},arrowsPosition:{linkOverlapAngle:Math.PI/6}}],[wc.b,{}]],...ut}),this._parent=at,this._options=ut,st.classList.add("pnx-psv"),this._shouldGoFast=(null===ut||void 0===ut?void 0:ut.shouldGoFast)||(()=>!1),this._transitionDuration=(null===ut||void 0===ut?void 0:ut.transitionDuration)||cu,this._myVTour=this.getPlugin(_c.$),this._myVTour.datasource.nodeResolver=this._getNodeFromAPI.bind(this),this._myVTour.config.transitionOptions=this._psvNodeTransition.bind(this),this._clearArrows=this._myVTour.arrowsRenderer.clear.bind(this._myVTour.arrowsRenderer),this._myVTour.arrowsRenderer.clear=()=>{},this._myMarkers=this.getPlugin(wc.b),this._annotationsVisible=!1,this._sequencePlaying=!1,this._picturesNavigation=this._options.picturesNavigation||"any",this._picturesSequences={},this._myVTour.addEventListener("enter-arrow",this._onEnterArrow.bind(this)),this._myVTour.addEventListener("leave-arrow",this._onLeaveArrow.bind(this)),this._myVTour.addEventListener("node-changed",this._onNodeChanged.bind(this)),this._myMarkers.addEventListener("select-marker",this._onSelectMarker.bind(this)),this.addEventListener("position-updated",this._onPositionUpdated.bind(this)),this.addEventListener("zoom-updated",this._onZoomUpdated.bind(this)),this.addEventListener("dblclick",this._onDoubleClick.bind(this)),this._parent.addEventListener("select",this._onSelect.bind(this)),this.loader.size=150,this.loader.color="rgba(61, 61, 61, 0.5)",this.loader.textColor="rgba(255, 255, 255, 0.7)",this.loader.border=5,this.loader.thickness=10,this.loader.canvas.setAttribute("viewBox","0 0 150 150"),this.loader.__updateContent(),this._options.position&&!this._parent.picture&&this.goToPosition(...this._options.position)}async _getNodeFromAPI(at){var st,ot;if((0,rc.isNullId)(at))return su;const ut=await fetch(this._parent.api.getPictureMetadataUrl(at,this._picturesSequences[at]),this._parent.api._getFetchOptions());let Hl=await ut.json();if(Hl.features&&(Hl=Hl.features.pop()),!Hl||0===Object.keys(Hl).length||!ut.ok)throw this._parent.loader&&this._parent.loader.dismiss(!0,this._parent._t.pnx.error_pic),new Error("Picture with ID "+at+" was not found");this._picturesSequences[at]=Hl.collection;const oc=(0,sc.apiFeatureToPSVNode)(Hl,this._parent._t,this._parent._isInternetFast,this._picturesNavFilter.bind(this));var _c,wc;null!==oc&&void 0!==oc&&null!==(st=oc.sequence)&&void 0!==st&&st.prevPic&&(this._picturesSequences[null===oc||void 0===oc||null===(_c=oc.sequence)||void 0===_c?void 0:_c.prevPic]=Hl.collection);null!==oc&&void 0!==oc&&null!==(ot=oc.sequence)&&void 0!==ot&&ot.nextPic&&(this._picturesSequences[null===oc||void 0===oc||null===(wc=oc.sequence)||void 0===wc?void 0:wc.nextPic]=Hl.collection);return oc}_psvNodeTransition(at,st,ot){var ut,Hl,sc;let oc={};const _c=this._shouldGoFast()?0:Math.min(cu,this._transitionDuration),wc=_c>100,Sc=null!=(ot||(null===st||void 0===st?void 0:st.links.find((st=>st.nodeId==at.id)))),iu=st&&at.sequence.id===st.sequence.id,su=((null===st||void 0===st||null===(ut=st.properties)||void 0===ut?void 0:ut["view:azimuth"])||0)*(Math.PI/180),uu=((null===at||void 0===at||null===(Hl=at.properties)||void 0===Hl?void 0:Hl["view:azimuth"])||0)*(Math.PI/180),pu=(0,rc.getRelativeHeading)(at)*(Math.PI/180);this.setOption("maxFov",Math.min(3*at.horizontalFov/4,90));const mu={showLoader:!1,effect:"none",speed:0,rotation:!1,rotateTo:{pitch:0,yaw:-pu},zoomTo:lu};if(360==at.horizontalFov)oc=st?(0,rc.getDistance)(st.gps,at.gps)>=.001?mu:{speed:_c,effect:Sc&&wc?"fade":"none",rotation:Sc&&iu&&wc,rotateTo:this.getPosition()}:mu;else if(iu){const at=this.getPosition().yaw,ot=st.horizontalFov*(Math.PI/180)/2,ut=at<=ot||at>=2*Math.PI-ot,Hl=Math.abs(su-uu)<=Math.PI/4;oc={speed:_c,effect:Sc&&Hl&&wc?"fade":"none",rotation:Sc&&Hl&&wc,rotateTo:ut?this.getPosition():{pitch:0,yaw:0},zoomTo:ut?this.getZoomLevel():lu}}else oc=Object.assign(mu,{rotateTo:{pitch:0,yaw:0}});"fade"===oc.effect&&oc.speed>=150?setTimeout(this._clearArrows,oc.speed-100):this._clearArrows();const gu=new CustomEvent("picture-loading",{detail:{...Object.assign({},this.getXYZ(),oc.rotateTo?{x:180*(uu+oc.rotateTo.yaw)/Math.PI}:null,oc.zoomTo?{z:oc.zoomTo}:null),picId:at.id,lon:at.gps[0],lat:at.gps[1],first:(null===(sc=this._parent._initParams)||void 0===sc?void 0:sc.getParentPostInit().picture)==at.id}});return this.dispatchEvent(gu),oc}_onEnterArrow(at){const st=at.link,ot=at.node;let ut;ot&&(ut=360===ot.horizontalFov?(this.getPictureOriginalHeading()+180*this.getPosition().yaw/Math.PI)%360:this.getPictureOriginalHeading());const Hl=new CustomEvent("picture-preview-started",{detail:{picId:st.nodeId,coordinates:st.gps,direction:ut}});this.dispatchEvent(Hl)}_onLeaveArrow(at){const st=at.link,ot=new CustomEvent("picture-preview-stopped",{detail:{picId:st.nodeId}});this.dispatchEvent(ot)}_onPositionUpdated(at){let{position:st}=at;const ot=(0,rc.positionToXYZ)(st,this.getZoomLevel());ot.x+=this.getPictureOriginalHeading(),ot.x=ot.x%360;const ut=new CustomEvent("view-rotated",{detail:ot});this.dispatchEvent(ut),this._onTilesStartLoading()}_onZoomUpdated(at){let{zoomLevel:st}=at;const ot=new CustomEvent("view-rotated",{detail:{...this.getXY(),z:st}});this.dispatchEvent(ot),this._onTilesStartLoading()}_onDoubleClick(){this.unfocusAnnotation()}_onNodeChanged(at){for(let Hl of document.getElementsByClassName("pnx-psv-tour-arrows"))Hl.classList.remove("pnx-clicked");if(at.node.id){var st,ot,ut;const Hl=(null===(st=this._parent._initParams)||void 0===st?void 0:st.getParentPostInit().picture)==at.node.id;this._parent.select(null===(ot=at.node)||void 0===ot||null===(ut=ot.sequence)||void 0===ut?void 0:ut.id,at.node.id);const rc=this.getPictureMetadata();if(!rc)return void this.dispatchEvent(new CustomEvent("picture-loaded",{detail:{}}));this._prevSequence=rc.sequence.id;const sc=new CustomEvent("picture-loaded",{detail:{...this.getXYZ(),picId:at.node.id,lon:rc.gps[0],lat:rc.gps[1],first:Hl}});this.dispatchEvent(sc),rc.panorama.hdUrl?(this.setOption("downloadUrl",rc.panorama.hdUrl),this.setOption("downloadName",at.node.id+".jpg")):this.setOption("downloadUrl",null),this._annotationsVisible&&this.toggleAllAnnotations(!0)}this._onTilesStartLoading()}_onSelectMarker(at){var st;if(at.marker&&null!==(st=at.marker.id)&&void 0!==st&&st.startsWith("annotation-")){const st=new CustomEvent("annotation-click",{detail:{annotationId:at.marker.data.id}});this.dispatchEvent(st)}}_onTilesStartLoading(){this._tilesQueueTimer&&(clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer),this._tilesQueueTimer=setInterval((()=>{if(0===Object.keys(this.adapter.queue.tasks).length){if(this._myVTour.state.currentNode){const at=new CustomEvent("picture-tiles-loaded",{detail:{picId:this._myVTour.state.currentNode.id}});this.dispatchEvent(at)}clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer}}),100)}getPictureMetadata(){var at,st,ot;return(0,rc.isNullId)(null===(at=this._myVTour)||void 0===at||null===(st=at.state)||void 0===st||null===(ot=st.currentNode)||void 0===ot?void 0:ot.id)?null:this._myVTour.state.currentNode?Object.assign({},this._myVTour.state.currentNode):null}getPictureId(){var at,st,ot,ut,Hl;const sc=(null===(at=this._myVTour)||void 0===at||null===(st=at.state)||void 0===st?void 0:st.loadingNode)||(null===(ot=this._myVTour)||void 0===ot||null===(ut=ot.state)||void 0===ut||null===(Hl=ut.currentNode)||void 0===Hl?void 0:Hl.id);return(0,rc.isNullId)(sc)?null:sc}_onSelect(at){var st;at.detail.seqId&&(this._picturesSequences[at.detail.picId]=at.detail.seqId),(null===(st=this._myVTour.getCurrentNode())||void 0===st?void 0:st.id)!==at.detail.picId&&(this.loader.show(),this._myVTour.setCurrentNode(at.detail.picId).catch((at=>{this.showErrorOverlay(at,this._parent._t.pnx.error_pic,!0)})))}goToNextPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const at=this.getPictureMetadata().sequence.nextPic;if(!at)throw new Error("No next picture available");this._parent.select(this.getPictureMetadata().sequence.id,at)}goToPrevPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const at=this.getPictureMetadata().sequence.prevPic;if(!at)throw new Error("No previous picture available");this._parent.select(this.getPictureMetadata().sequence.id,at)}async goToPosition(at,st){return this._parent.api.getPicturesAroundCoordinates(at,st).then((at=>{if(at.features.length>0){const st=at.features.pop();return this._parent.select(null===st||void 0===st?void 0:st.collection,st.id),st.id}return Promise.reject(new Error("No picture found nearby given coordinates"))}))}getXY(){const at=(0,rc.positionToXYZ)(this.getPosition());return at.x=(at.x+this.getPictureOriginalHeading())%360,at}getXYZ(){const at=this.getXY();return at.z=this.getZoomLevel(),at}getPictureOriginalHeading(){var at,st;return(null===(at=this.getPictureMetadata())||void 0===at||null===(st=at.properties)||void 0===st?void 0:st["view:azimuth"])||0}getPictureRelativeHeading(){return(0,rc.getRelativeHeading)(this.getPictureMetadata())}clearPictureMetadataCache(){var at,st,ot,ut;const Hl=null===(at=this.getPictureMetadata())||void 0===at?void 0:at.id,rc=null===(st=this.getPictureMetadata())||void 0===st||null===(ot=st.sequence)||void 0===ot?void 0:ot.id;null===(ut=this._myVTour.state.currentTooltip)||void 0===ut||ut.hide(),this._myVTour.state.currentTooltip=null,this._myVTour.state.currentNode=null,this._myVTour.state.preload={},this._myVTour.datasource.nodes={},Hl&&this._parent.select(rc,Hl)}setXYZ(at,st,ot){const ut=(0,rc.xyzToPosition)(at-this.getPictureOriginalHeading(),st,ot);this.rotate({yaw:ut.yaw,pitch:ut.pitch}),this.zoom(ut.zoom)}setHigherContrast(at){this.renderer.renderer.toneMapping=at?3:0,this.renderer.renderer.toneMappingExposure=at?2:1,this.needsUpdate()}getTransitionDuration(){return this._transitionDuration}setTransitionDuration(at){if((at=parseFloat(at))<100||at>uu)throw new Error("Invalid transition duration (should be between 100 and "+uu+")");this._transitionDuration=at;const st=new CustomEvent("transition-duration-changed",{detail:{value:at}});this.dispatchEvent(st)}setPanorama(at,st){const onFailure=at=>{var st;return this.showErrorOverlay(at,null===(st=this._parent)||void 0===st?void 0:st._t.pnx.error_pic,!0)};try{return super.setPanorama(at,st).catch(onFailure)}catch(ot){onFailure(ot)}}showErrorOverlay(at,st,ot){var ut,rc,sc,oc;null!==(ut=this._parent)&&void 0!==ut&&ut.loader.isVisible()||!this.overlay.isVisible()?null===(rc=this._parent)||void 0===rc||rc.loader.dismiss(at,st,ot?()=>{var at;null===(at=this._parent)||void 0===at||at.loader.dismiss(),this.overlay.hide()}:void 0):(console.error(at),this.overlay.show({image:`<img style="width: 200px" src="${Hl}" alt="" />`,title:null===(sc=this._parent)||void 0===sc?void 0:sc._t.pnx.error,text:st+"<br />"+(null===(oc=this._parent)||void 0===oc?void 0:oc._t.pnx.error_click),dissmisable:ot}))}playSequence(){this._sequencePlaying=!0;const at=new Event("sequence-playing",{bubbles:!0,composed:!0});this.dispatchEvent(at);const nextPicturePlay=()=>{if(this._sequencePlaying){this.addEventListener("picture-loaded",(()=>{this._playTimer=setTimeout((()=>{nextPicturePlay()}),this.getTransitionDuration())}),{once:!0});try{this.goToNextPicture()}catch(at){this.stopSequence()}}};this.addEventListener("click",(()=>this.stopSequence())),nextPicturePlay()}stopSequence(){this._sequencePlaying=!1,this._playTimer&&(clearTimeout(this._playTimer),delete this._playTimer),this.forceRefresh();const at=new Event("sequence-stopped",{bubbles:!0,composed:!0});this.dispatchEvent(at)}isSequencePlaying(){return this._sequencePlaying}toggleSequencePlaying(){this.isSequencePlaying()?this.stopSequence():this.playSequence()}getPicturesNavigation(){return this._picturesNavigation}setPicturesNavigation(at){"none"===at&&(at="pic"),this._picturesNavigation=at;const st=new CustomEvent("pictures-navigation-changed",{detail:{value:at}});this.dispatchEvent(st)}_picturesNavFilter(at){switch(this._picturesNavigation){case"seq":return["next","prev"].includes(at.rel);case"pic":case"none":return!1;default:return!0}}areAnnotationsVisible(){return this._annotationsVisible}toggleAllAnnotations(at){const st=this.getPictureMetadata();if(!st)throw this._myMarkers.clearMarkers(),new Error("No picture currently selected");if(at){var ot,ut;let at=st.properties.annotations;0===(null===(ot=at)||void 0===ot?void 0:ot.length)&&console.warn("No annotation available on picture",st.id);const Hl=null===(ut=this.state.textureData.panoData)||void 0===ut?void 0:ut.baseData;at=at.map((at=>{const st=this.getPictureMetadata().properties["pers:interior_orientation"].sensor_array_dimensions;if(!st)return console.warn("Picture lacks pers:interior_orientation.sensor_array_dimensions property, can't compute marker"),null;const ot=at.shape.coordinates.map((at=>at.map((at=>{const ot=[at[0]*Hl.croppedWidth/st[0],at[1]*Hl.croppedHeight/st[1]],ut=[(Hl.croppedX+ot[0])/Hl.fullWidth,(Hl.croppedY+ot[1])/Hl.fullHeight];return[2*(ut[0]-.5)*Math.PI,(.5-ut[1])*Math.PI]}))));return{id:`annotation-${at.id}`,polygon:ot,data:{id:at.id},svgStyle:{stroke:"var(--orange)",strokeWidth:"3px",fill:"var(--orange-transparent)",cursor:"pointer"},tooltip:this._parent._t.pnx.semantics_annotation_tooltip}})),this._myMarkers.setMarkers(at)}else this._myMarkers.clearMarkers();const Hl=this._annotationsVisible!=at;this._annotationsVisible=at,Hl&&this.dispatchEvent(new CustomEvent("annotations-toggled",{detail:{visible:at}}))}focusOnAnnotation(at){this.areAnnotationsVisible()||this.toggleAllAnnotations(!0),this.unfocusAnnotation(!0);const st=`annotation-${at}`;this._myMarkers.updateMarker({id:st,svgStyle:{stroke:"var(--red)",strokeWidth:"3px",fill:"var(--red-transparent)"},data:{selected:!0}}),this._myMarkers.gotoMarker(st,0),this.zoom(65)}unfocusAnnotation(){let at=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const st=Object.keys(this._myMarkers.markers).filter((at=>{var st,ot,ut;return at.startsWith("annotation-")&&(null===(st=this._myMarkers.markers[at])||void 0===st||null===(ot=st.config)||void 0===ot||null===(ut=ot.data)||void 0===ut?void 0:ut.selected)}));st.length>0&&(st.forEach((at=>{this._myMarkers.updateMarker({id:at,svgStyle:{stroke:"var(--orange)",strokeWidth:"3px",fill:"var(--orange-transparent)"},data:{selected:!1}})})),at||this.dispatchEvent(new Event("annotations-unfocused")))}forceRefresh(){var at;const st=this._myVTour.getCurrentNode();if(st&&st.panorama.baseUrl!==(null===st||void 0===st||null===(at=st.panorama)||void 0===at?void 0:at.origBaseUrl)){const at=this.getZoomLevel(),ot=this.getPosition();this._myVTour.state.currentNode=null,this._myVTour.setCurrentNode(st.id,{zoomTo:at,rotateTo:ot,fadeIn:!1,speed:0,rotation:!1})}st&&st.panorama.rows>1&&this.adapter.__refresh()}}},4374:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Popup});var ut=ot(4542),Hl=ot(5995),rc=ot(8591),sc=ot(6627);class Popup extends ut.WF{constructor(){super(),this.visible=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",(at=>{at.target===this&&this.close()})),document.addEventListener("keyup",(at=>{"Escape"===at.key&&this.visible&&this.close()}))}attributeChangedCallback(at,st,ot){super.attributeChangedCallback(at,st,ot),"visible"==at&&(""!==ot&&!0!==ot||this.dispatchEvent(new Event("open")))}close(){this.visible=!1,this.dispatchEvent(new Event("close"))}render(){return ut.qy`
|
|
1712
1712
|
<div class="pnx-panel pnx-padded">
|
|
1713
1713
|
<pnx-button
|
|
1714
1714
|
class="btn-close"
|
|
@@ -2381,7 +2381,7 @@
|
|
|
2381
2381
|
@click=${at=>this._onClick(at,!1)}
|
|
2382
2382
|
>${(0,sc.fa)(_c.EZ)}</pnx-button>
|
|
2383
2383
|
</pnx-button-group>
|
|
2384
|
-
`}}Zoom.properties={_lastWantedZoom:{state:!0}},customElements.define("pnx-widget-zoom",Zoom)},222:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{CopyCoordinates:()=>ut.A,GeoSearch:()=>Hl.A,Legend:()=>rc.A,MapFiltersButton:()=>sc.A,MapLayersButton:()=>oc.A,OSMEditors:()=>_c.A,PictureLegendActions:()=>wc.A,Player:()=>Sc.A,Zoom:()=>iu.A});var ut=ot(5114),Hl=ot(2603),rc=ot(4385),sc=ot(4529),oc=ot(1614),_c=ot(5789),wc=ot(8806),Sc=ot(8305),iu=ot(3023)},5254:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>API});var ut=ot(8340),Hl=ot(7343);class API extends EventTarget{constructor(at){let st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),null===at||void 0===at||"string"!==typeof at){const at=new Error("endpoint parameter is empty or not a valid string");throw this.dispatchEvent(new CustomEvent("broken",{detail:{error:at}})),at}if(at.startsWith("/")&&(at=window.location.href.split("/").slice(0,3).join("/")+at),!API.isValidHttpUrl(at)){const st=new Error(`endpoint parameter is not a valid URL: ${at}`);throw this.dispatchEvent(new CustomEvent("broken",{detail:{error:st}})),st}this._endpoint=at,this._isReady=0,this._dataBbox=null,this._fetchOpts=(null===st||void 0===st?void 0:st.fetch)||{},this._metadata={},st.skipReadLanding||(this._readLanding=fetch(at,this._getFetchOptions()).then((at=>at.json())).then((at=>this._parseLanding(at,st))).catch((at=>(this._isReady=-1,console.error(at),this.dispatchEvent(new CustomEvent("broken",{detail:{error:at}})),Promise.reject("Viewer failed to communicate with API")))).then((()=>this._loadMapStyles(st.style,st.users))).then((()=>(this._isReady=1,this.dispatchEvent(new Event("ready")),"API is ready"))))}onceReady(){return-1==this._isReady?Promise.reject("Viewer failed to communicate with API"):1==this._isReady?Promise.resolve("API is ready"):this._readLanding}isReady(){return 1==this._isReady}getAvailableFeatures(){return Object.entries(this._endpoints).filter((at=>null!==at[1])).map((at=>at[0]))}getUnavailableFeatures(){return Object.entries(this._endpoints).filter((at=>null===at[1])).map((at=>at[0]))}_parseLanding(at,st){var ot,ut;if(this._endpoints={collections:null,search:null,style:null,user_style:null,tiles:(null===st||void 0===st?void 0:st.tiles)||null,user_tiles:null,user_search:null,collection_preview:null,item_preview:null,rss:null,report:null},!at||!at.links||!Array.isArray(at.links))throw new Error("API Landing page doesn't contain 'links' list");if(!at.stac_version.startsWith("1."))throw new Error(`API is not in a supported STAC version (Panoramax viewer supports only 1.x, API is ${at.stac_version})`);this._metadata.name=at.title||"Unnamed",this._metadata.stac_version=at.stac_version,this._metadata.geovisio_version=at.geovisio_version;const Hl=[],rc=[];if([{rel:"search",type:"application/geo+json",endpointId:"search",mandatory:!0,missingIssue:"No direct access to pictures metadata."},{rel:"data",type:"application/json",endpointId:"collections",mandatory:!0,missingIssue:"No way for viewer to access sequences."},{rel:"data",type:"application/rss+xml",endpointId:"rss"},{rel:"xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"tiles"},{rel:"xyz-style",type:"application/json",endpointId:"style"},{rel:"user-xyz-style",type:"application/json",endpointId:"user_style"},{rel:"user-xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"user_tiles"},{rel:"user-search",type:"application/json",endpointId:"user_search",missingIssue:"Filter map data by user name will not be available."},{rel:"collection-preview",type:"image/jpeg",endpointId:"collection_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"item-preview",type:"image/jpeg",endpointId:"item_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"report",type:"application/json",endpointId:"report"}].forEach((st=>{const ot=at.links.find((at=>at.rel==st.rel&&at.type==st.type));if(ot){if(!API.isValidHttpUrl(ot.href))throw new Error(`API endpoint '${ot.rel}' (${ot.type}) is not a valid URL: ${ot.href}`);this._endpoints[st.endpointId]||(this._endpoints[st.endpointId]=ot.href)}else if(!this._endpoints[st.endpointId]){let at=`API doesn't offer a '${st.rel}' (${st.type}) endpoint in its links`;st.missingIssue&&(at+=`\n${st.missingIssue}`),st.mandatory?Hl.push(at):st.missingIssue&&rc.push(at)}})),this._endpoints.style||this._endpoints.tiles||rc.push("API doesn't offer 'xyz' or 'xyz-style' endpoints in its links.\nMap widget will not be available."),this._endpoints.user_style||this._endpoints.user_tiles||rc.push("API doesn't offer 'user-xyz' or 'user-xyz-style' endpoints in its links.\nFilter map data by user ID will not be available."),rc.forEach((at=>console.warn(at))),Hl.length>0)throw new Error(Hl.join("\n"));const sc=null===at||void 0===at||null===(ot=at.extent)||void 0===ot||null===(ut=ot.spatial)||void 0===ut?void 0:ut.bbox;this._dataBbox=sc&&Array.isArray(sc)&&sc.length>0&&Array.isArray(sc[0])&&4===sc[0].length?[[sc[0][0],sc[0][1]],[sc[0][2],sc[0][3]]]:null}_loadMapStyles(at,st){const ot=new Set(st||[]);this.mapStyle={version:8,sources:{},layers:[],metadata:{}};const ut=[this.getMapStyle()];if("string"===typeof at){const st=at.startsWith(this._endpoint)?this._getFetchOptions():void 0;ut.push(fetch(at,st).then((at=>at.json())))}else"object"===typeof at&&ut.push(Promise.resolve(at));return[...ot].filter((at=>"geovisio"!==at)).forEach((at=>{ut.push(this.getUserMapStyle(at,!0))})),Promise.all(ut).then((at=>{const st=["bearing","center","glyphs","light","name","pitch","sky","sprite","terrain","transition","zoom"];at.forEach((at=>{st.forEach((st=>{at[st]&&(this.mapStyle[st]=at[st]||this.mapStyle[st])})),Object.assign(this.mapStyle.sources,(null===at||void 0===at?void 0:at.sources)||{}),Object.assign(this.mapStyle.metadata,(null===at||void 0===at?void 0:at.metadata)||{}),this.mapStyle.layers=this.mapStyle.layers.concat((null===at||void 0===at?void 0:at.layers)||[])}))})).catch((at=>console.error(at)))}_getFetchOptions(){let at=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.assign({signal:at?void 0:AbortSignal.timeout(15e3)},this._fetchOpts)}_getMapRequestTransform(){const at=this._getFetchOptions();if(delete at.signal,Object.keys(at).length>0)return st=>{if(st.startsWith(this._endpoint))return{url:st,...at}}}_getPSVWithCredentials(){return"include"===this._getFetchOptions().credentials?at=>at.startsWith(this._endpoint):void 0}async getSequenceItems(at){let st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,ot=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!this.isReady())throw new Error("API is not ready to use");try{return API.isIdValid(at),fetch(st||`${this._endpoints.collections}/${at}/items`,this._getFetchOptions(!0)).then((at=>at.json())).then((st=>{let ut=st;ot&&(ut.features=ot.features.concat(ut.features));const Hl=st.links.find((at=>"next"===at.rel));return Hl?this.getSequenceItems(at,Hl.href,ut):ut}))}catch(ut){return Promise.reject(ut)}}getPicturesAroundCoordinatesUrl(at,st){let ot=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e-4,ut=arguments.length>3?arguments[3]:void 0,Hl=arguments.length>4?arguments[4]:void 0;if(!this.isReady())throw new Error("API is not ready to use");if(isNaN(parseFloat(at))||isNaN(parseFloat(st)))throw new Error("lat and lon parameters should be valid numbers");const rc=[st-ot,at-ot,st+ot,at+ot].map((at=>at.toFixed(4))).join(","),sc=ut?`&limit=${ut}`:"",oc=Hl?`&collections=${Hl}`:"";return`${this._endpoints.search}?bbox=${rc}${sc}${oc}`}getPicturesAroundCoordinates(at,st,ot,ut,Hl){return fetch(this.getPicturesAroundCoordinatesUrl(at,st,ot,ut,Hl),this._getFetchOptions()).then((at=>at.json()))}getPictureMetadataUrl(at,st){if(!this.isReady())throw new Error("API is not ready to use");if(API.isIdValid(at))return st?`${this._endpoints.collections}/${st}/items/${at}`:`${this._endpoints.search}?ids=${at}`}getMapStyle(){if(this.isReady())return this.mapStyle;let at;return at=this._endpoints.style?this._endpoints.style:this._endpoints.tiles?{version:8,sources:{geovisio:{type:"vector",tiles:[this._endpoints.tiles],minzoom:0,maxzoom:ut.TILES_PICTURES_ZOOM}}}:fetch(`${this._endpoint}/map/14/0/0.mvt`,this._getFetchOptions()).then((()=>(this._endpoints.tiles=`${this._endpoint}/map/{z}/{x}/{y}.mvt`,console.log("Using fallback endpoint for vector tiles"),this.getMapStyle()))).catch((at=>(console.error(at),Promise.reject(new Error("API doesn't offer a vector tiles endpoint"))))),"string"===typeof at?fetch(at,this._getFetchOptions()).then((at=>at.json())):Promise.resolve(at)}getUserMapStyle(at){let st;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.isReady()?at?(this._endpoints.user_style?st=this._endpoints.user_style.replace(/\{userId\}/g,at):this._endpoints.user_tiles&&(st={version:8,sources:{[`geovisio_${at}`]:{type:"vector",tiles:[this._endpoints.user_tiles.replace(/\{userId\}/g,at)],minzoom:0,maxzoom:ut.TILES_PICTURES_ZOOM}}}),st?"string"===typeof st?fetch(st,this._getFetchOptions()).then((at=>at.json())):Promise.resolve(st):Promise.reject(new Error("API doesn't offer map style for specific user"))):Promise.reject(new Error("Parameter userId is empty")):Promise.reject(new Error("API is not ready to use"))}findThumbnailInPictureFeature(at){if(!this.isReady())throw new Error("API is not ready to use");if(!at||!at.assets)return null;let st=null;for(let ot of Object.values(at.assets)){if(ot.roles.includes("thumbnail")&&"image/jpeg"==ot.type&&API.isValidHttpUrl(ot.href))return ot.href;ot.roles.includes("visual")&&"image/jpeg"==ot.type&&API.isValidHttpUrl(ot.href)&&(st=ot.href)}return st}getPictureThumbnailURLForSequence(at,st){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.collection_preview)return Promise.resolve(this._endpoints.collection_preview.replace("{id}",at));if(st&&Array.isArray(st.links)&&st.links.length>0){let at=st.links.find((at=>"preview"===at.rel&&"image/jpeg"===at.type));if(at&&API.isValidHttpUrl(at.href))return Promise.resolve(at.href)}const ot=`${this._endpoints.search}?limit=1&collections=${at}`;return fetch(ot,this._getFetchOptions()).then((at=>at.json())).then((at=>Array.isArray(at.features)&&0!=at.features.length?this.findThumbnailInPictureFeature(at.features.pop()):null))}getPictureThumbnailURL(at,st){if(!this.isReady())throw new Error("API is not ready to use");return at?this._endpoints.item_preview?Promise.resolve(this._endpoints.item_preview.replace("{id}",at)):at&&st?fetch(`${this._endpoints.collections}/${st}/items/${at}`,this._getFetchOptions()).then((at=>at.json())).then((at=>at?this.findThumbnailInPictureFeature(at):null)):fetch(`${this._endpoints.search}?ids=${at}`,this._getFetchOptions()).then((at=>at.json())).then((at=>at&&Array.isArray(at.features)&&0!=at.features.length?this.findThumbnailInPictureFeature(at.features.pop()):null)):Promise.resolve(null)}getRSSURL(at){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.rss){let st=this._endpoints.rss;return at&&(st+=st.includes("?")?"&":"?",st+="bbox="+[at.getWest(),at.getSouth(),at.getEast(),at.getNorth()].join(",")),st}return null}getSequenceMetadataUrl(at){if(!this.isReady())throw new Error("API is not ready to use");return`${this._endpoints.collections}/${at}`}getDataBbox(){if(!this.isReady())throw new Error("API is not ready to use");return this._dataBbox}searchUsers(at){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(`${this._endpoints.user_search}?q=${at}`,this._getFetchOptions()).then((at=>at.json())).then((at=>(null===at||void 0===at?void 0:at.features)||null))}getUserName(at){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(this._endpoints.user_search.replace(/\/search$/,`/${at}`),this._getFetchOptions()).then((at=>at.json())).then((at=>(null===at||void 0===at?void 0:at.name)||null))}sendReport(at){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.report)throw new Error("Report sending is not available");const st={...this._getFetchOptions(),method:"POST",body:JSON.stringify(at),headers:{"Content-Type":"application/json"}};return fetch(this._endpoints.report,st).then((async at=>{if(at.status>=400){let ot=await at.text();try{ot=JSON.parse(ot).message}catch(st){}return Promise.reject(ot)}return at.json()}))}static isValidHttpUrl(at){let st;try{st=new URL(at)}catch(ot){return!1}return"http:"===st.protocol||"https:"===st.protocol}static isIdValid(at){if((0,Hl.isNullId)(at))throw new Error("id should be a valid picture unique identifier");return!0}}},2118:(at,st,ot)=>{"use strict";ot.d(st,{Ay:()=>InitParameters,Qm:()=>ut,Vy:()=>alterPSVState,ai:()=>alterPhotoViewerState,iz:()=>alterViewerState,mK:()=>alterMapState});const ut={minDate:"date_from",maxDate:"date_to",pic_type:"pic_type",camera:"camera",theme:"theme",qualityscore:"pic_score"},Hl=Object.fromEntries(Object.entries(ut).map((at=>[at[1],at[0]]))),rc=["none","null","false",!1],sc=["antialias","bearing","bearingSnap","bounds","boxZoom","clickTolerance","collectResourceTiming","cooperativeGestures","crossSourceCollisions","doubleClickZoom","dragPan","dragRotate","fadeDuration","failIfMajorPerformanceCaveat","fitBoundsOptions","hash","interactive","localIdeographFontFamily","locale","logoPosition","maplibreLogo","maxBounds","maxCanvasSize","maxPitch","maxTileCacheSize","maxTileCacheZoomLevels","maxZoom","minPitch","minZoom","pitch","pitchWithRotate","pixelRatio","preserveDrawingBuffer","refreshExpiredTiles","renderWorldCopies","scrollZoom","touchPitch","touchZoomRotate","trackResize","transformCameraUpdate","transformRequest","validateStyle"];class InitParameters{constructor(){var at,st,ot,ut,Hl,oc;let _c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},wc=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},Sc=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"false"===_c["url-parameters"]&&(wc={});let iu={};"object"===typeof(null===_c||void 0===_c?void 0:_c.psv)&&(iu=_c.psv);let su={};"object"===typeof(null===_c||void 0===_c?void 0:_c.map)&&(su=_c.map);let lu={};"object"===typeof(null===Sc||void 0===Sc?void 0:Sc.map)&&(lu=Sc.map);let cu=wc.map&&"none"!==wc.map?getMapPositionFromString(wc.map):null,uu=!rc.includes(wc.map)&&!rc.includes(_c.map),pu=wc.focus||_c.focus,mu=wc.pic||_c.picture,gu=wc.users||_c.users,Au=wc.speed||(null===(at=iu)||void 0===at?void 0:at.transitionDuration),yu=wc.nav||(null===(st=iu)||void 0===st?void 0:st.picturesNavigation),_u=wc.theme||(null===(ot=lu)||void 0===ot?void 0:ot.theme)||su.theme,xu=wc.background||(null===(ut=lu)||void 0===ut?void 0:ut.background)||su.background,Su=(null===cu||void 0===cu?void 0:cu.center)||(null===(Hl=lu)||void 0===Hl?void 0:Hl.center)||su.center,Du=(null===cu||void 0===cu?void 0:cu.zoom)||(null===(oc=lu)||void 0===oc?void 0:oc.zoom)||su.zoom,Lu=(null===cu||void 0===cu?void 0:cu.pitch)||su.pitch,$u=(null===cu||void 0===cu?void 0:cu.bearing)||su.bearing,hh=_c.geocoder,ed=_c.widgets,td=_c.sequence,id=_c.fetchOptions,nd=_c.style,rd=_c.lang,ad=_c.endpoint,sd=su.raster,od=su.attributionControl,ld=(cd=su,Object.fromEntries(Object.entries(cd).filter((at=>{let[st]=at;return sc.includes(st)}))));var cd;let ud=_c["keyboard-shortcuts"],hd=wc.xyz,dd=wc.date_from,pd=wc.date_to,md=wc.pic_type,fd=wc.camera,gd=wc.pic_score;["map","pic"].includes(pu)?"map"!==pu||uu||(console.warn("Parameter focus can't be 'map' as map is disabled"),pu="pic"):(console.warn("Invalid value for parameter focus:",pu),pu=uu&&!mu?"map":"pic"),"aerial"!=xu||sd||(console.warn("Parameter background can't be 'aerial' as no aerial imagery is available"),xu="streets"),uu&&!mu&&(pu="map"),this._parentInit={map:uu,users:gu,fetchOptions:id,style:nd,lang:rd,endpoint:ad},this._parentPostInit={focus:pu,picture:mu,sequence:td,geocoder:hh,widgets:ed,forceFocus:!0,keyboardShortcuts:!0},this._psvInit=Object.fromEntries(Object.entries(iu).filter((at=>{let[st]=at;return!["transitionDuration","picturesNavigation"].includes(st)}))),this._psvAny={transitionDuration:Au,picturesNavigation:yu},this._psvPostInit={xyz:hd},this._mapInit={raster:sd,attributionControl:od,...ld},this._mapAny={theme:_u,background:xu,center:Su,zoom:Du,pitch:Lu,bearing:$u,users:gu},this._mapPostInit={date_from:dd,date_to:pd,pic_type:md,camera:fd,pic_score:gd},"false"===ud&&(this._psvInit.keyboard=!1,this._psvInit.keyboardActions={},this._mapInit.keyboard=!1,this._parentPostInit.keyboardShortcuts=!1)}_sanitize(at){return Object.fromEntries(Object.entries(at).filter((at=>{let[,st]=at;return void 0!==st})))}getParentInit(){return this._sanitize(this._parentInit)}getParentPostInit(){return this._sanitize(this._parentPostInit)}getPSVInit(){return this._sanitize(Object.assign({},this._psvInit,this._psvAny))}getPSVPostInit(){return this._sanitize(Object.assign({},this._psvPostInit,this._psvAny))}getMapInit(){return this._sanitize(Object.assign({},this._mapInit,this._mapAny))}getMapPostInit(){return this._sanitize(Object.assign({},this._mapPostInit,this._mapAny))}static GetComponentProperties(at,st){const ot={};for(let ut in at.properties){at.properties[ut].state||null==st[ut]||(ot[ut]=st[ut])}return ot}}function getMapPositionFromString(at,st){const ot=(at||"").split("/");if(ot.length>=3&&!ot.some((at=>isNaN(at)))){const at={center:[+ot[2],+ot[1]],zoom:+ot[0],pitch:+(ot[4]||0)};return st&&(at.bearing=st.dragRotate.isEnabled()&&st.touchZoomRotate.isEnabled()?+(ot[3]||0):st.getBearing()),at}return null}function alterPSVState(at,st){st.xyz&&at.addEventListener("picture-loaded",(()=>{const ot=function(at){const st=(at||"").split("/");return 3!==st.length||st.some((at=>isNaN(at)))?null:{x:+st[0],y:+st[1],z:+st[2]}}(st.xyz);at.setXYZ(ot.x,ot.y,ot.z)}),{once:!0});let ot=st.transitionDuration||st.speed;void 0!==ot&&at.setTransitionDuration(ot);let ut=st.picturesNavigation||st.nav;["none","pic","any","seq"].includes(ut)&&at.setPicturesNavigation(ut)}async function alterMapState(at,st){var ot;const ut=getMapPositionFromString(st.map,at);ut&&at.jumpTo(ut);let rc=Array.isArray(st.users)?st.users:(st.users||"").split(",");(0===rc.length||1===rc.length&&""===rc[0].trim())&&(rc=["geovisio"]),await at.setVisibleUsers(rc),null===(ot=at.setFilters)||void 0===ot||ot.call(at,function(at){const st={};for(let ot in Hl)at[ot]&&(st[Hl[ot]]=at[ot]);if(st.qualityscore){let at=st.qualityscore.split("");const ot={A:5,B:4,C:3,D:2,E:1};st.qualityscore=at.map((at=>ot[at]))}return st}(st)),["aerial","streets"].includes(st.background)&&at.setBackground(st.background)}function alterPhotoViewerState(at,st){let ot=st.picture||st.pic;if(ot){const st=ot.split(";");st.length>1&&console.warn("Multiple picture IDs passed in URL, only first one kept"),at.select(null,st[0],!0)}else at.select()}function alterViewerState(at,st){alterPhotoViewerState(at,st),"map"===st.focus&&null!==at&&void 0!==at&&at.map?(at.setPopup(!1),at._setFocus("map",null,st.forceFocus)):"pic"===st.focus&&null!==at&&void 0!==at&&at.mini?(at.setPopup(!1),at._setFocus("pic",null,st.forceFocus)):st.focus&&"meta"===st.focus&&null!==at&&void 0!==at&&at.mini&&at._setFocus("pic",null,st.forceFocus)}},3727:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>PhotoAdapter});var ut=ot(3890);class PhotoAdapter extends ut.D{constructor(at,st){super(at,st),this._shouldGoFast=st.shouldGoFast||(()=>!0)}loadTexture(at,st){return at.origBaseUrl?at.baseUrl=at.origBaseUrl:at.origBaseUrl=at.baseUrl,this._shouldGoFast()&&at.thumbUrl&&!at.hdLoaded&&1==at.rows&&(at.baseUrl=at.thumbUrl),super.loadTexture(at,st).then((st=>(at.baseUrl===at.origBaseUrl&&(at.hdLoaded=!0),st)))}__loadTiles(at){this._shouldGoFast()||super.__loadTiles(at)}}},4207:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>PresetManager});var ut=ot(7208);const Hl={fas:"fa6-solid"},rc={"fa6-solid:directions":"fa6-solid:diamond-turn-right"};class PresetManager{constructor(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,st=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._ready=!1,this._presets=null,this._translations={},st||this._load(at)}async _load(at){var st;at=at||(null===(st=window.navigator.languages[0])||void 0===st?void 0:st.substring(0,2));try{var ot,sc;const[st,wc,Sc]=await Promise.all([fetch(`${(0,ut.PanoramaxPresetsURL)()}/translations/en.min.json`),at?fetch(`${(0,ut.PanoramaxPresetsURL)()}/translations/${at}.min.json`):Promise.resolve({ok:!0}),fetch(`${(0,ut.PanoramaxPresetsURL)()}/presets.min.json`)]);if(!st||!wc||!Sc||!st.ok||!wc.ok||!Sc.ok)throw this._ready=-1,new Error("Presets service is not available");var oc,_c;if(this._presets=await Sc.json(),this._translations.en=null===(ot=await st.json())||void 0===ot||null===(sc=ot.en)||void 0===sc?void 0:sc.presets,at)this._translations[at]=null===(oc=await wc.json())||void 0===oc||null===(_c=oc[at])||void 0===_c?void 0:_c.presets;Object.entries(this._presets).forEach((st=>{var ot,ut,sc,oc,_c,wc;let[Sc,iu]=st;if(null!==(ot=this._translations[at])&&void 0!==ot&&null!==(ut=ot.presets)&&void 0!==ut&&null!==(sc=ut[Sc])&&void 0!==sc&&sc.name?iu.name=this._translations[at].presets[Sc].name:null!==(oc=this._translations.en)&&void 0!==oc&&null!==(_c=oc.presets)&&void 0!==_c&&null!==(wc=_c[Sc])&&void 0!==wc&&wc.name&&(iu.name=this._translations.en.presets[Sc].name),iu.icon){const at=iu.icon.split("-")[0],st=Hl[at];iu.iconify=st?iu.icon.replace(at+"-",st+":"):iu.icon.split("-")[0]+":"+iu.icon.split("-").slice(1).join("-"),rc[iu.iconify]&&(iu.iconify=rc[iu.iconify])}})),this._ready=!0}catch(wc){console.error("Presets service throws an error:",wc),this._ready=-1}}async onceReady(){return this._ready?-1===this._ready?Promise.reject():Promise.resolve():(await new Promise((at=>setTimeout(at,250))),this.onceReady())}async getPreset(at){return this.onceReady().then((()=>{const st=Object.values(this._presets).filter((st=>{if(0===Object.keys(st.tags).length)return!1;for(let ot in st.tags){const ut=st.tags[ot];if(!at.semantics.find((at=>at.key===ot&&("*"===ut||ut===at.value))))return!1}return!0}));return st.sort(((at,st)=>{const ot=Object.keys(at.tags).length,ut=Object.keys(st.tags).length;if(ot>ut)return-1;if(ot===ut){const ot=Object.values(at.tags).filter((at=>"*"===at)).length,ut=Object.values(st.tags).filter((at=>"*"===at)).length;return ot<ut?-1:ot>ut?1:0}return 1})),st.shift()}))}}},4451:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>URLHandler});var ut=ot(2118);const Hl=["speed","nav","focus","pic","xyz","map","background","users","pic_score","s"].concat(Object.values(ut.Qm)),rc=["focus-changed","pictures-navigation-changed"],sc=["position-updated","zoom-updated","view-rotated","picture-loaded","transition-duration-changed"],oc=["moveend","zoomend","boxzoomend","background-changed","users-changed","filters-changed"];class URLHandler extends EventTarget{constructor(at){super(),this._parent=at,this._delay=null}listenToChanges(){window.addEventListener("popstate",this._onURLChange.bind(this),!1),rc.forEach((at=>this._parent.addEventListener(at,this._onParentChange.bind(this)))),sc.forEach((at=>this._parent.psv.addEventListener(at,this._onParentChange.bind(this)))),this._parent.map&&oc.forEach((at=>this._parent.map.on(at,this._onParentChange.bind(this))))}destroy(){window.removeEventListener("popstate",this._onURLChange)}nextURLParams(){let at={};"number"==typeof this._parent.psv.getTransitionDuration()&&(at.speed=this._parent.psv.getTransitionDuration()),[null,"any"].includes(this._parent.psv.getPicturesNavigation())||(at.nav=this._parent.psv.getPicturesNavigation()),this._parent.psv.getPictureId()&&(at.pic=this._parent.psv.getPictureId());if(this._parent.psv.getPictureMetadata()&&(at.xyz=this.currentPSVString()),this._parent.map){at.map=this.currentMapString(),at.focus="pic",this._parent.isMapWide()&&(at.focus="map"),this._parent.map.hasTwoBackgrounds()&&this._parent.map.getBackground()&&(at.background=this._parent.map.getBackground());const st=this._parent.map.getVisibleUsers();if((st.length>1||!st.includes("geovisio"))&&(at.users=st.join(",")),this._parent.map._mapFilters){for(let st in ut.Qm)this._parent.map._mapFilters[st]&&(at[ut.Qm[st]]=this._parent.map._mapFilters[st]);if(at.pic_score){const st=[null,"E","D","C","B","A"];at.pic_score=at.pic_score.map((at=>st[at])).join("")}}}return at}nextURLString(){let at="";return Object.entries(this.nextURLParams()).sort(((at,st)=>at[0].localeCompare(st[0]))).forEach((st=>{let[ot,ut]=st,Hl=!1;const rc=at.split("&").map((at=>{const st=at.split("=")[0];return st===ot?(Hl=!0,`${st}=${ut}`):at})).filter((at=>at));Hl||rc.push(`${ot}=${ut}`),at=`${rc.join("&")}`})),`?${at}`.replace(/^\?+/,"?")}currentURLParams(){const at=(arguments.length>0&&void 0!==arguments[0]&&arguments[0]?window.location.hash:window.location.search).replace(/^[?#]/,"");let st={};if(at.split("&").map((at=>at.split("="))).filter((at=>void 0!==at[0]&&at[0].length>0&&Hl.includes(at[0]))).forEach((at=>{st[at[0]]=at[1]})),st.s){const at=Object.fromEntries(decodeURIComponent(st.s).split(";").map((at=>[at[0],at.substring(1)])));st={},"m"===at.f?st.focus="map":"p"===at.f?st.focus="pic":"t"===at.f&&(st.focus="meta"),""!==at.s&&(st.speed=100*parseFloat(at.s)),"a"===at.n?st.nav="any":"s"===at.n&&(st.nav="seq"),"n"===at.n&&(st.nav="none"),""!==at.p&&(st.pic=at.p),""!==at.c&&(st.xyz=at.c),""!==at.m&&(st.map=at.m),""!==at.d&&(st.date_from=at.d),""!==at.e&&(st.date_to=at.e),"f"===at.t?st.pic_type="flat":"e"===at.t&&(st.pic_type="equirectangular"),""!==at.k&&(st.camera=at.k),"d"===at.v?st.theme="default":"a"===at.v?st.theme="age":"t"===at.v?st.theme="type":"s"===at.v&&(st.theme="score"),"s"===at.b?st.background="streets":"a"===at.b&&(st.background="aerial"),""!==at.u&&(st.users=at.u),""!==at.q&&(st.pic_score=at.q)}return st}currentMapString(){const at=this._parent.map.getCenter(),st=Math.round(100*this._parent.map.getZoom())/100,ot=Math.ceil((st*Math.LN2+Math.log(512/360/.5))/Math.LN10),ut=Math.pow(10,ot),Hl=Math.round(at.lng*ut)/ut,rc=Math.round(at.lat*ut)/ut,sc=this._parent.map.getBearing(),oc=this._parent.map.getPitch();let _c=`${st}/${rc}/${Hl}`;return(sc||oc)&&(_c+="/"+Math.round(10*sc)/10),oc&&(_c+=`/${Math.round(oc)}`),_c}currentPSVString(){const at=this._parent.psv.getXYZ();return`${at.x.toFixed(2)}/${at.y.toFixed(2)}/${Math.round(at.z||0)}`}_onURLChange(){let at=this.currentURLParams();"Viewer"===this._parent.getClassName()?(0,ut.iz)(this._parent,at):(0,ut.ai)(this._parent,at),(0,ut.Vy)(this._parent.psv,at),this._parent.map&&(0,ut.mK)(this._parent.map,at)}nextShortLink(at){const st=new URL(at),ot=this.nextURLParams(),ut={f:(ot.focus||"").substring(0,1),s:isNaN(parseInt(ot.speed))?void 0:Math.floor(parseInt(ot.speed)/100),n:(ot.nav||"").substring(0,1),p:ot.pic,c:ot.xyz,m:ot.map,d:ot.date_from,e:ot.date_to,t:(ot.pic_type||"").substring(0,1),k:ot.camera,v:(ot.theme||"").substring(0,1),b:(ot.background||"").substring(0,1),u:ot.users,q:ot.pic_score},Hl=Object.entries(ut).filter((at=>{let[,st]=at;return void 0!=st&&""!=st})).map((at=>{let[st,ot]=at;return`${st}${ot}`})).join(";");return st.search=`s=${Hl}`,st}getUnmanagedParameters(at){return new URLSearchParams(Array.from(at.searchParams).filter((at=>{let[st]=at;return!Hl.includes(st)}))).toString()}_onParentChange(){this._delay&&(clearTimeout(this._delay),this._delay=null),this._delay=setTimeout((()=>{var at,st,ot;const ut=new URL(window.location.href),Hl=new URL(window.location.href),rc=this.getUnmanagedParameters(ut);if(Hl.search=this._parent?this.nextURLString()+(rc.length>0?"&"+rc:""):"",Object.keys(this.currentURLParams(!0)).length>0&&(Hl.hash=""),ut.search==Hl.search)return;const sc=this.currentURLParams().pic||"",oc=(null===(at=this._parent)||void 0===at||null===(st=at.psv)||void 0===st||null===(ot=st.getPictureId)||void 0===ot?void 0:ot.call(st))||"";try{if(sc!=oc?window.history.pushState(window.history.state,null,Hl.href):window.history.replaceState(window.history.state,null,Hl.href),this._parent){const at=new CustomEvent("url-changed",{detail:{url:Hl.href}});this.dispatchEvent(at)}}catch(_c){}}),500)}}},3606:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{forwardGeocodingBAN:()=>forwardGeocodingBAN,forwardGeocodingNominatim:()=>forwardGeocodingNominatim,forwardGeocodingStandard:()=>forwardGeocodingStandard,reverseGeocodingNominatim:()=>reverseGeocodingNominatim});var ut=ot(927),Hl=ot.n(ut),rc=ot(7208);const sc={house:20,housenumber:20,street:18,locality:15,district:13,municipality:12,city:12,county:8,region:7,state:7,country:5};function geocoderParamsToURLString(at){let st={};return Object.entries(at).filter((at=>void 0!==at[1]&&null!==at[1])).forEach((at=>st[at[0]]=at[1])),new URLSearchParams(st).toString()}function forwardGeocodingNominatim(at){const st={q:at.query,countrycodes:at.countries,limit:at.limit,viewbox:at.bbox};return fetch(`${(0,rc.NominatimBaseUrl)()}/search?${geocoderParamsToURLString(st)}&format=geocodejson&addressdetails=1`).then((at=>at.json())).then((at=>{const st={features:[]},ot=[];return(at.features||[]).forEach((at=>{var ut,rc,oc;const _c=geocodeJsonToPlaceName(null===(ut=at.properties)||void 0===ut?void 0:ut.geocoding)||(null===(rc=at.properties)||void 0===rc||null===(oc=rc.geocoding)||void 0===oc?void 0:oc.label);var wc,Sc;ot.includes(_c)||(st.features.push({place_type:["place"],place_name:_c,center:new(Hl().LngLat)(...at.geometry.coordinates),zoom:sc[null===(wc=at.properties)||void 0===wc||null===(Sc=wc.geocoding)||void 0===Sc?void 0:Sc.type]}),ot.push(_c))})),st}))}function reverseGeocodingNominatim(at,st){return fetch(`${(0,rc.NominatimBaseUrl)()}/reverse?lat=${at}&lon=${st}&zoom=18&format=geocodejson`).then((at=>at.json())).then((at=>{var st,ot,ut;return geocodeJsonToPlaceName(null===at||void 0===at||null===(st=at.features)||void 0===st||null===(ot=st.shift())||void 0===ot||null===(ut=ot.properties)||void 0===ut?void 0:ut.geocoding)}))}function forwardGeocodingBAN(at){return forwardGeocodingStandard(at,(0,rc.AdresseDataGouvBaseURL)())}function geocodeJsonToPlaceName(at){if(!at||"object"!=typeof at)return"";let st=at.name,ot=[],ut=[];switch(at.type){case"hamlet":case"croft":case"isolated_dwelling":case"neighbourhood":case"allotments":case"quarter":case"farm":case"farmyard":case"industrial":case"commercial":case"retail":case"city_block":case"residential":case"locality":case"district":ut.push(at.city),ut.push(at.county),ut.push(at.state),ut.push(at.country);break;case"city":case"region":ut.push(at.county),ut.push(at.state),ut.push(at.country);break;case"country":break;case"house":case"housenumber":ot.push(at.housenumber),ot.push(at.street),ot.push(at.locality),ot.push(at.district),ut.push(at.city),ut.push(at.county),ut.push(at.state),ut.push(at.country);break;default:ot.push(at.street),ot.push(at.locality),ot.push(at.district),ut.push(at.city),ut.push(at.county),ut.push(at.state),ut.push(at.country)}return ot=ot.filter((at=>at)),ot=ot.filter(((at,ut)=>at!=st&&(0===ut||ot[ut-1]!==at))),ot=ot.length>0?at.housenumber?ot.slice(0,2).join(" "):ot.shift():null,ot===st&&(ot=null),ut=ut.filter((at=>at)),ut=ut.filter(((at,Hl)=>at!=st&&(!ot||!ot.includes(at))&&(0===Hl||ut[Hl-1]!==at))),[st,ot,ut.shift()].filter((at=>at)).join(", ")}function forwardGeocodingStandard(at,st){const ot={q:at.query,limit:at.limit};if("string"===typeof at.proximity){const[st,ut]=at.proximity.split(",").map((at=>parseFloat(at.trim())));ot.lat=st,ot.lon=ut}return fetch(`${st}/?${geocoderParamsToURLString(ot)}`).then((at=>at.json())).then((at=>{const st={features:[]},ot=[];return(at.features||[]).forEach((at=>{const ut=geocodeJsonToPlaceName(at.properties);ot.includes(ut)||"other"==at.properties.type||(st.features.push({place_type:["place"],place_name:ut,center:new(Hl().LngLat)(...at.geometry.coordinates),zoom:sc[at.properties.type]}),ot.push(ut))})),st}))}},4964:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{autoDetectLocale:()=>autoDetectLocale,getTranslations:()=>getTranslations});var ut=ot(4149),Hl=ot(369),rc=ot(389),sc=ot(9946),oc=ot(8302),_c=ot(5222),wc=ot(6909),Sc=ot(4895),iu=ot(3979),su=ot(6920),lu=ot(9026),cu=ot(991),uu=ot(6984);const pu="en",mu={da:ut,de:Hl,eo:sc,en:rc,es:oc,fr:_c,hu:wc,it:Sc,ja:iu,nl:su,pl:lu,sv:cu,"zh-Hant":uu,zh:uu};function autoDetectLocale(at,st){for(const ot of window.navigator.languages){let st=ot;switch(st){case"zh-TW":case"zh-HK":case"zh-MO":st="zh-Hant";break;case"zh-CN":case"zh-SG":st="zh-Hans";break;default:st.length>2&&(st=ot.substring(0,2))}const ut=at.find((at=>at===st));if(ut)return ut}return st}function getTranslations(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const st=JSON.parse(JSON.stringify(rc));let ot;if(at||(at=autoDetectLocale(Object.keys(mu),pu)),mu[at]&&"en"!==at&&(ot=mu[at]),at.length>2){const st=at.substring(0,2);mu[st]&&(ot=mu[st])}return ot&&Object.entries(ot).forEach((at=>{let[ot,ut]=at;Object.entries(ut).forEach((at=>{let[ut,Hl]=at;Array.isArray(Hl)&&(Hl=Hl.filter((at=>null!=at))),st[ot][ut]=Hl}))})),st}},2030:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{API:()=>iu.A,PhotoAdapter:()=>su.A,PresetsManager:()=>lu.A,URLHandler:()=>cu.A,geocoder:()=>ut,i18n:()=>Hl,map:()=>rc,picture:()=>sc,semantics:()=>oc,services:()=>_c,utils:()=>wc,widgets:()=>Sc});var ut=ot(3606),Hl=ot(4964),rc=ot(8340),sc=ot(508),oc=ot(2283),_c=ot(7208),wc=ot(7343),Sc=ot(5995),iu=ot(5254),su=ot(3727),lu=ot(4207),cu=ot(4451)},8340:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{DEFAULT_TILES:()=>sc,MAP_EXPR_QUALITYSCORE:()=>lu,RASTER_LAYER_ID:()=>oc,TILES_PICTURES_SYMBOL_ZOOM:()=>wc,TILES_PICTURES_ZOOM:()=>_c,VECTOR_STYLES:()=>Sc,combineStyles:()=>combineStyles,getMapParamsFromLocalStorage:()=>getMapParamsFromLocalStorage,getMissingLayerStyles:()=>getMissingLayerStyles,getThumbGif:()=>getThumbGif,getUserLayerId:()=>getUserLayerId,getUserSourceId:()=>getUserSourceId,initMapKeyboardHandler:()=>initMapKeyboardHandler,isLabelLayer:()=>isLabelLayer,linkMapAndPhoto:()=>linkMapAndPhoto,saveMapParamsToLocalStorage:()=>saveMapParamsToLocalStorage,switchCoefValue:()=>switchCoefValue});var ut=ot(6883),Hl=ot(7343),rc=ot(4964);const sc="https://panoramax.openstreetmap.fr/pmtiles/basic.json",oc="pnx-aerial",_c=15,wc=18,Sc={PICTURES:{paint:{"circle-radius":["interpolate",["linear"],["zoom"],_c,4.5,wc,6,24,12],"circle-opacity":["interpolate",["linear"],["zoom"],_c,0,_c+1,1],"circle-stroke-color":"#ffffff","circle-stroke-width":["interpolate",["linear"],["zoom"],_c+1,0,_c+2,1,wc,1.5,24,3]},layout:{}},PICTURES_SYMBOLS:{paint:{"icon-opacity":["interpolate",["linear"],["zoom"],wc,0,wc+1,1]},layout:{"icon-image":["case",["==",["get","type"],"equirectangular"],"pnx-arrow-360","pnx-arrow-flat"],"icon-size":["interpolate",["linear"],["zoom"],wc,.5,24,1],"icon-rotate":["to-number",["get","heading"]],"icon-allow-overlap":!0}},SEQUENCES:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,.5,10,2,14,4,16,5,22,3]},layout:{"line-cap":"square"}},SEQUENCES_PLUS:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,15,_c+1,30,_c+2,0],"line-opacity":0,"line-color":"#ff0000"},layout:{"line-cap":"square"}}},iu=["case",["==",["get","type"],"equirectangular"],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Hl.QUALITYSCORE_RES_360_VALUES],1],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Hl.QUALITYSCORE_RES_FLAT_VALUES],1]],su=["case",["has","gps_accuracy"],["step",["get","gps_accuracy"],...Hl.QUALITYSCORE_GPS_VALUES],1],lu=["round",["+",["*",iu,Hl.QUALITYSCORE_POND_RES],["*",su,Hl.QUALITYSCORE_POND_GPS]]];function getThumbGif(at){const st=document.createElement("img");return st.src=ut,st.alt=at.loading,st.title=at.loading,st.classList.add("pnx-map-thumb","pnx-map-thumb-loader"),st}function isLabelLayer(at){var st;return"symbol"===at.type&&void 0!==(null===at||void 0===at||null===(st=at.layout)||void 0===st?void 0:st["text-field"])&&(void 0===at.minzoom||at.minzoom<15)}function combineStyles(at,st){var ot,ut;const Hl=at.api.getMapStyle();if(Hl.layers=Hl.layers||[],Hl.layers=Hl.layers.concat(getMissingLayerStyles(Hl.sources,Hl.layers)),Hl.metadata||(Hl.metadata={}),st.supplementaryStyle&&(Object.assign(Hl.sources,st.supplementaryStyle.sources||{}),Object.assign(Hl.metadata,st.supplementaryStyle.metadata||{}),Hl.layers=Hl.layers.concat(st.supplementaryStyle.layers||[])),Hl.layers=Hl.layers.filter((at=>at.id)),st.raster&&(Hl.sources["pnx-aerial"]=st.raster,Hl.layers.push({id:oc,type:"raster",source:"pnx-aerial",layout:{visibility:"aerial"===st.background?"visible":"none"}})),null!==at&&void 0!==at&&null!==(ot=at.users)&&void 0!==ot&&ot.includes("geovisio")||Hl.layers.forEach((at=>{"geovisio"===at.source&&(at.layout||(at.layout={}),at.layout.visibility="none")})),Hl.layers.sort(((at,st)=>isLabelLayer(at)&&!isLabelLayer(st)?1:!isLabelLayer(at)&&isLabelLayer(st)?-1:at.id.startsWith("geovisio")&&!st.id.startsWith("geovisio")?1:!at.id.startsWith("geovisio")&&st.id.startsWith("geovisio")?-1:at.id.endsWith("_pictures")&&!st.id.endsWith("_pictures")?1:!at.id.endsWith("_pictures")&&st.id.endsWith("_pictures")?-1:0)),null!==(ut=Hl.metadata)&&void 0!==ut&&ut["panoramax:locales"]||(Hl.metadata["panoramax:locales"]=["fr","en","de","es","ru","pt","zh","hi","latin"]),Hl.metadata["panoramax:locales"]){let st=at.lang||(0,rc.autoDetectLocale)(Hl.metadata["panoramax:locales"],"latin");st.includes("-")&&(st=st.split("-")[0]),st.includes("_")&&(st=st.split("_")[0]),Hl.layers.forEach((at=>{isLabelLayer(at)&&at.layout["text-field"].includes("name:latin")&&(at.layout["text-field"]=["coalesce",["get",`name:${st}`],["get","name:latin"],["get","name"]])}))}const sc=Hl.layers.find((at=>"place_label_city"==at.id));let _c=Hl.layers.find((at=>"place_label_capital"==at.id));return sc&&!_c&&(sc.paint={"text-color":"hsl(0, 0%, 0%)","text-halo-blur":0,"text-halo-color":"hsla(0, 0%, 100%, 1)","text-halo-width":3},sc.layout["text-letter-spacing"]=.1,_c=JSON.parse(JSON.stringify(sc)),_c.id="place_label_capital",_c.filter.push(["<=","capital",2]),sc.filter.push([">","capital",2]),Hl.layers.push(_c)),Hl}function getMissingLayerStyles(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const ot=[];return Object.keys(at).filter((at=>void 0===st.find((st=>(null===st||void 0===st?void 0:st.source)===at)))).forEach((at=>{at.startsWith("geovisio")&&(ot.push({id:`${at}_sequences`,type:"line",source:at,"source-layer":"sequences",layout:{...Sc.SEQUENCES.layout},paint:{...Sc.SEQUENCES.paint,"line-color":Hl.COLORS.BASE}}),ot.push({id:`${at}_sequences_plus`,type:"line",source:at,"source-layer":"sequences",layout:{...Sc.SEQUENCES_PLUS.layout},paint:{...Sc.SEQUENCES_PLUS.paint}}),ot.push({id:`${at}_pictures_symbols`,type:"symbol",source:at,"source-layer":"pictures",...Sc.PICTURES_SYMBOLS}),ot.push({id:`${at}_pictures_symbols`,type:"symbol",source:at,"source-layer":"pictures",...Sc.PICTURES_SYMBOLS}),ot.push({id:`${at}_pictures`,type:"circle",source:at,"source-layer":"pictures",layout:{...Sc.PICTURES.layout},paint:{...Sc.PICTURES.paint,"circle-color":Hl.COLORS.BASE}}))})),st.filter((at=>{var ot;return(null===at||void 0===at||null===(ot=at.id)||void 0===ot?void 0:ot.endsWith("_sequences"))&&void 0===st.find((st=>(null===st||void 0===st?void 0:st.id)===at.id+"_plus"))})).forEach((at=>{ot.push({id:`${at.id}_plus`,type:"line",source:at.source,"source-layer":at["source-layer"],layout:{...Sc.SEQUENCES_PLUS.layout},paint:{...Sc.SEQUENCES_PLUS.paint}})})),st.filter((at=>{var ot;return(null===at||void 0===at||null===(ot=at.id)||void 0===ot?void 0:ot.endsWith("_pictures"))&&void 0===st.find((st=>(null===st||void 0===st?void 0:st.id)===at.id+"_symbols"))})).forEach((at=>{ot.unshift({id:`${at.id}_symbols`,type:"symbol",source:at.source,"source-layer":"pictures",...Sc.PICTURES_SYMBOLS}),at.paint=Object.assign(at.paint||{},Sc.PICTURES.paint),at.layout=Object.assign(at.layout||{},Sc.PICTURES.layout)})),ot}function getUserLayerId(at,st){return`${getUserSourceId(at)}_${st}`}function getUserSourceId(at){return"geovisio"===at?"geovisio":"geovisio_"+at}function switchCoefValue(at,st){if(Array.isArray(at))return at.map((at=>switchCoefValue(at,st)));if("object"===typeof at&&null!==at){const ot={};for(const ut in at)ot[ut]=switchCoefValue(at[ut],st);return ot}return"string"===typeof at&&at.startsWith("coef")?st:at}function linkMapAndPhoto(at){const onPicLoad=st=>{var ot,ut,rc,sc;(0,Hl.isNullId)(st.detail.picId)?(at.map.displayPictureMarker(),null!==at&&void 0!==at&&null!==(ot=at.isMapWide)&&void 0!==ot&&ot.call(at)&&(null===at||void 0===at||null===(ut=at.mini)||void 0===ut||ut.setAttribute("collapsed",""))):(at.map.displayPictureMarker(st.detail.lon,st.detail.lat,at.psv.getXY().x,st.detail.first),null!==at&&void 0!==at&&null!==(rc=at.isMapWide)&&void 0!==rc&&rc.call(at)&&(null===at||void 0===at||null===(sc=at.mini)||void 0===sc||sc.removeAttribute("collapsed")))};at.psv.addEventListener("picture-loading",onPicLoad),at.psv.addEventListener("picture-loaded",onPicLoad),at.psv.addEventListener("view-rotated",(()=>{let st=at.psv.getPosition().yaw*(180/Math.PI);st+=at.psv.getPictureOriginalHeading(),at.map._picMarker.setRotation(st)})),at.psv.addEventListener("picture-preview-started",(st=>{at.map._picMarkerPreview.setLngLat(st.detail.coordinates).setRotation(st.detail.direction||0).addTo(at.map)})),at.psv.addEventListener("picture-preview-stopped",(()=>{at.map._picMarkerPreview.remove()})),at.psv.addEventListener("picture-loaded",(st=>{at.isWidthSmall()&&at._picPopup&&st.detail.picId==at._picPopup._picId&&at._picPopup.remove()})),at.map.on("picture-click",(st=>{at.select(st.seqId,st.picId),!at.psv._myVTour.state.currentNode&&null!==at&&void 0!==at&&at._setFocus&&at._setFocus("pic")})),at.map.on("sequence-click",(st=>{at.api.getPicturesAroundCoordinates(st.coordinates.lat,st.coordinates.lng,1,1,st.seqId).then((st=>{var ot,ut;(null===st||void 0===st||null===(ot=st.features)||void 0===ot?void 0:ot.length)>0&&(at.select(null===(ut=st.features[0])||void 0===ut?void 0:ut.collection,st.features[0].id),!at.psv.getPictureMetadata()&&null!==at&&void 0!==at&&at._setFocus&&at._setFocus("pic"))}))})),at._setFocus&&(at.psv.addEventListener("dblclick",(()=>{at.isMapWide()&&at._setFocus("pic")})),at.map.on("dblclick",(()=>{at.isMapWide()?at.select():at._setFocus("map")})))}function initMapKeyboardHandler(at){at.map.keyboard.keydown=function(st){if(st.altKey||st.ctrlKey||st.metaKey)return;switch(st.key){case"*":case"5":return void at.moveCenter();case"PageUp":case"9":return void at.psv.goToNextPicture();case"PageDown":case"3":return void at.psv.goToPrevPicture();case"Home":case"7":return st.stopPropagation(),void at._toggleFocus();case"End":case"1":return void at.mini.toggleAttribute("collapsed");case" ":case"0":return void at.psv.toggleSequencePlaying()}let ot=0,ut=0,Hl=0,rc=0,sc=0;switch(st.keyCode){case 61:case 107:case 171:case 187:ot=1;break;case 189:case 109:case 173:ot=-1;break;case 37:case 100:st.shiftKey?ut=-1:(st.preventDefault(),rc=-1);break;case 39:case 102:st.shiftKey?ut=1:(st.preventDefault(),rc=1);break;case 38:case 104:st.shiftKey?Hl=1:(st.preventDefault(),sc=-1);break;case 40:case 98:st.shiftKey?Hl=-1:(st.preventDefault(),sc=1);break;default:return}return this._rotationDisabled&&(ut=0,Hl=0),{cameraAnimation:at=>{const oc=this._tr;at.easeTo({duration:300,easeId:"keyboardHandler",easing:at=>at*(2-at),zoom:ot?Math.round(oc.zoom)+ot*(st.shiftKey?2:1):oc.zoom,bearing:oc.bearing+ut*this._bearingStep,pitch:oc.pitch+Hl*this._pitchStep,offset:[-rc*this._panStep,-sc*this._panStep],center:oc.center},{originalEvent:st})}}}.bind(at.map.keyboard)}const cu="pnx-map-parameters";function getMapParamsFromLocalStorage(){const at=localStorage.getItem(cu);if(!at)return{};try{return JSON.parse(at)}catch(st){return console.warn("Can't read map parameters stored in localStorage",st),{}}}function saveMapParamsToLocalStorage(at){const save=()=>localStorage.setItem(cu,JSON.stringify({center:Object.fromEntries(Object.entries(at.getCenter()).map((at=>{let[st,ot]=at;return[st,ot.toFixed(7)]}))),zoom:at.getZoom().toFixed(1),background:at.getBackground(),theme:at._mapFilters.theme}));at.on("background-changed",save),at.on("filters-changed",save),at.on("moveend",save),at.on("zoomend",save),at.on("dragend",save),at.on("boxzoomend",save)}},508:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{apiFeatureToPSVNode:()=>apiFeatureToPSVNode,filterRelatedPicsLinks:()=>filterRelatedPicsLinks,getCroppedPanoData:()=>getCroppedPanoData,getExifFloat:()=>getExifFloat,getGPSPrecision:()=>getGPSPrecision,getHashTags:()=>getHashTags,getNodeCaption:()=>getNodeCaption,getSphereCorrection:()=>getSphereCorrection,hasAnnotations:()=>hasAnnotations,sortPicturesInDirection:()=>sortPicturesInDirection});var ut=ot(8407),Hl=ot(6830),rc=ot(7343);const sc=(0,rc.svgToPSVLink)(ut,"white"),oc=(0,rc.svgToPSVLink)(Hl,rc.COLORS.NEXT);function getExifFloat(at){if(!([null,void 0,""].includes(at)||"string"===typeof at&&""===at.trim())){if("number"===typeof at)return at;if("string"!==typeof at);else{if(/^-?\d+(\.\d+)?\/-?\d+(\.\d+)?$/.test(at)){const st=at.split("/").map((at=>parseFloat(at)));return st[0]/st[1]}try{return parseFloat(at)}catch(st){}}}}function getGPSPrecision(at){var st,ot,ut,Hl,rc;let sc=null;const oc=(null===at||void 0===at||null===(st=at.properties)||void 0===st?void 0:st["quality:horizontal_accuracy"])||getExifFloat(null===at||void 0===at||null===(ot=at.properties)||void 0===ot||null===(ut=ot.exif)||void 0===ut?void 0:ut["Exif.GPSInfo.GPSHPositioningError"]),_c=getExifFloat(null===at||void 0===at||null===(Hl=at.properties)||void 0===Hl||null===(rc=Hl.exif)||void 0===rc?void 0:rc["Exif.GPSInfo.GPSDOP"]);return void 0!==oc?sc=`${oc} m`:void 0!==_c&&(sc=_c<1?"ideal":_c<2?"excellent":_c<5?"good":_c<10?"moderate":_c<20?"fair":"poor"),sc}function getSphereCorrection(at){var st,ot,ut,Hl;let rc=null===(st=at.properties)||void 0===st?void 0:st["view:azimuth"];if(void 0===rc){var sc,oc;const st=getExifFloat(null===(sc=at.properties)||void 0===sc||null===(oc=sc.exif)||void 0===oc?void 0:oc["Exif.GPSInfo.GPSImgDirection"]);void 0!==st&&(rc=st)}rc=rc||0;let _c=null===(ot=at.properties)||void 0===ot?void 0:ot["pers:yaw"],wc=["Xmp.GPano.PoseHeadingDegrees","Xmp.Camera.Yaw","Exif.MpfInfo.MPFYawAngle"];if(void 0===_c)for(let gu of wc){var Sc,iu;const st=getExifFloat(null===(Sc=at.properties)||void 0===Sc||null===(iu=Sc.exif)||void 0===iu?void 0:iu[gu]);if(void 0!==st){_c=st;break}}_c=_c||0,Math.round(rc)===Math.round(_c)&&_c>0&&console.warn("Picture with UUID",at.id,"has same GPS Image direction and Yaw, could cause rendering issues");let su=null===(ut=at.properties)||void 0===ut?void 0:ut["pers:pitch"];if(wc=["Xmp.GPano.PosePitchDegrees","Xmp.Camera.Pitch","Exif.MpfInfo.MPFPitchAngle"],void 0===su)for(let gu of wc){var lu,cu;const st=getExifFloat(null===(lu=at.properties)||void 0===lu||null===(cu=lu.exif)||void 0===cu?void 0:cu[gu]);if(void 0!==st){su=st;break}}su=su||0;let uu=null===(Hl=at.properties)||void 0===Hl?void 0:Hl["pers:roll"];if(wc=["Xmp.GPano.PoseRollDegrees","Xmp.Camera.Roll","Exif.MpfInfo.MPFRollAngle"],void 0===uu)for(let gu of wc){var pu,mu;const st=getExifFloat(null===(pu=at.properties)||void 0===pu||null===(mu=pu.exif)||void 0===mu?void 0:mu[gu]);if(void 0!==st){uu=st;break}}return uu=uu||0,0!==su&&0!==uu?{pan:_c*Math.PI/180,tilt:su*Math.PI/180,roll:uu*Math.PI/180}:{}}function getCroppedPanoData(at){var st,ot;let ut;var Hl,rc;if(null!==(st=at.properties)&&void 0!==st&&st["pers:interior_orientation"]&&(null!==(Hl=at.properties["pers:interior_orientation"])&&void 0!==Hl&&Hl.visible_area&&null!==(rc=at.properties["pers:interior_orientation"])&&void 0!==rc&&rc.sensor_array_dimensions)){const st=at.properties["pers:interior_orientation"].visible_area,ot=at.properties["pers:interior_orientation"].sensor_array_dimensions;try{ut={fullWidth:parseInt(ot[0]),fullHeight:parseInt(ot[1]),croppedX:parseInt(st[0]),croppedY:parseInt(st[1]),croppedWidth:parseInt(ot[0])-parseInt(st[2])-parseInt(st[0]),croppedHeight:parseInt(ot[1])-parseInt(st[3])-parseInt(st[1])}}catch(su){console.warn("Invalid pers:interior_orientation values for cropped panorama "+at.id)}}if(!ut&&null!==(ot=at.properties)&&void 0!==ot&&ot.exif)try{var sc,oc,_c,wc,Sc,iu;ut={fullWidth:parseInt(null===(sc=at.properties.exif)||void 0===sc?void 0:sc["Xmp.GPano.FullPanoWidthPixels"]),fullHeight:parseInt(null===(oc=at.properties.exif)||void 0===oc?void 0:oc["Xmp.GPano.FullPanoHeightPixels"]),croppedX:parseInt(null===(_c=at.properties.exif)||void 0===_c?void 0:_c["Xmp.GPano.CroppedAreaLeftPixels"]),croppedY:parseInt(null===(wc=at.properties.exif)||void 0===wc?void 0:wc["Xmp.GPano.CroppedAreaTopPixels"]),croppedWidth:parseInt(null===(Sc=at.properties.exif)||void 0===Sc?void 0:Sc["Xmp.GPano.CroppedAreaImageWidthPixels"]),croppedHeight:parseInt(null===(iu=at.properties.exif)||void 0===iu?void 0:iu["Xmp.GPano.CroppedAreaImageHeightPixels"])}}catch(su){console.warn("Invalid XMP.GPano values for cropped panorama "+at.id)}return ut&&(ut=Object.fromEntries(Object.entries(ut||{}).filter((at=>!isNaN(at[1])))),(!ut.fullWidth&&!ut.croppedWidth&&ut.fullHeight&&!ut.croppedHeight||ut.fullWidth&&!ut.croppedWidth&&!ut.fullHeight&&!ut.croppedHeight||ut.fullWidth&&!ut.croppedWidth&&ut.fullHeight&&!ut.croppedHeight||ut.fullWidth==ut.croppedWidth&&ut.fullHeight==ut.croppedHeight)&&(ut={})),ut||{}}function sortPicturesInDirection(at){return(st,ot)=>"related"!=st.rel&&"related"!=ot.rel?0:"related"!=st.rel?-1:"related"!=ot.rel?1:st.date==ot.date?(0,rc.getDistance)(at,st.geometry.coordinates)-(0,rc.getDistance)(at,ot.geometry.coordinates):ot.date.localeCompare(st.date)}function getNodeCaption(at,st){var ot,ut,Hl;const rc={};if(null!==at&&void 0!==at&&null!==(ot=at.properties)&&void 0!==ot&&ot.datetimetz){rc.date=new Date(at.properties.datetimetz);const st=at.properties.datetimetz.match(/([+-]\d{2}):(\d{2})$|Z$/);st&&("Z"===st[0]?rc.tz="UTC":rc.tz=st[0])}else null!==at&&void 0!==at&&null!==(ut=at.properties)&&void 0!==ut&&ut.datetime&&(rc.date=new Date(at.properties.datetime));if(null!==at&&void 0!==at&&at.providers){var sc;const st=null===at||void 0===at||null===(sc=at.providers)||void 0===sc?void 0:sc.filter((at=>{var st;return null===at||void 0===at||null===(st=at.roles)||void 0===st?void 0:st.includes("producer")}));if((null===st||void 0===st?void 0:st.length)>=0){const at={};st.map((at=>at.name)).forEach((st=>{const ot=st.toLowerCase().replace(/\s/g,"");at[ot]?at[ot].push(st):at[ot]=[st]})),rc.producer=[],Object.values(at).forEach((at=>{const st=at[0],ot=at.find((at=>at.toLowerCase()!=at));rc.producer.push(ot||st)}))}}if(null!==at&&void 0!==at&&null!==(Hl=at.properties)&&void 0!==Hl&&Hl.license&&(rc.license=at.properties.license,null!==at&&void 0!==at&&at.links)){const ot=at.links.find((at=>"license"===(null===at||void 0===at?void 0:at.rel)));ot&&(rc.license=`<a href="${ot.href}" title="${st.pnx.metadata_general_license_link}" target="_blank">${rc.license}</a>`)}return rc}function apiFeatureToPSVNode(at,st){var ot,ut,Hl,rc,sc,oc,_c,wc,Sc,iu,su,lu,cu,uu;let pu=arguments.length>2&&void 0!==arguments[2]&&arguments[2],mu=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const gu=null!=(null===(ot=at.properties)||void 0===ot||null===(ut=ot["pers:interior_orientation"])||void 0===ut?void 0:ut.field_of_view);let Au=gu?parseInt(at.properties["pers:interior_orientation"].field_of_view):70;const yu=360===Au,_u=(Object.values(at.assets).find((at=>{var st;return null===at||void 0===at||null===(st=at.roles)||void 0===st?void 0:st.includes("data")}))||{}).href,xu=null===at||void 0===at||null===(Hl=at.properties)||void 0===Hl||null===(rc=Hl["tiles:tile_matrix_sets"])||void 0===rc?void 0:rc.geovisio,Su=null===(sc=at.links)||void 0===sc||null===(oc=sc.find)||void 0===oc?void 0:oc.call(sc,(at=>"prev"===(null===at||void 0===at?void 0:at.rel)&&"application/geo+json"===(null===at||void 0===at?void 0:at.type))),Du=null===(_c=at.links)||void 0===_c||null===(wc=_c.find)||void 0===wc?void 0:wc.call(_c,(at=>"next"===(null===at||void 0===at?void 0:at.rel)&&"application/geo+json"===(null===at||void 0===at?void 0:at.type))),Lu=Object.values(at.assets).find((at=>{var st;return(null===(st=at.roles)||void 0===st?void 0:st.includes("visual"))&&"image/webp"===at.type})),$u=Object.values(at.assets).find((at=>{var st;return(null===(st=at.roles)||void 0===st?void 0:st.includes("visual"))&&"image/jpeg"===at.type})),hh=(Lu||$u).href,ed=null===(Sc=Object.values(at.assets).find((at=>{var st;return(null===(st=at.roles)||void 0===st?void 0:st.includes("thumbnail"))&&"image/jpeg"===at.type})))||void 0===Sc?void 0:Sc.href,td=(null===at||void 0===at||null===(iu=at.asset_templates)||void 0===iu?void 0:iu.tiles_webp)||(null===at||void 0===at||null===(su=at.asset_templates)||void 0===su?void 0:su.tiles),id=getCroppedPanoData(at),nd=null===(lu=at.links)||void 0===lu||null===(cu=lu.find)||void 0===cu?void 0:cu.call(lu,(at=>"via"===(null===at||void 0===at?void 0:at.rel)&&"application/json"===(null===at||void 0===at?void 0:at.type)));let rd;rd=Object.keys(id).length>0?{baseUrl:pu?_u:hh,origBaseUrl:pu?_u:hh,hdUrl:_u,thumbUrl:ed,basePanoData:id,cols:2,rows:1,width:2,tileUrl:()=>null}:yu&&xu?{baseUrl:hh,origBaseUrl:hh,basePanoData:at=>({fullWidth:at.width,fullHeight:at.height}),hdUrl:_u,thumbUrl:ed,cols:xu&&xu.tileMatrix[0].matrixWidth,rows:xu&&xu.tileMatrix[0].matrixHeight,width:xu&&xu.tileMatrix[0].matrixWidth*xu.tileMatrix[0].tileWidth,tileUrl:xu&&((at,st)=>td.href.replace(/\{TileCol\}/g,at).replace(/\{TileRow\}/g,st))}:{baseUrl:pu?_u:hh,origBaseUrl:pu?_u:hh,hdUrl:_u,thumbUrl:ed,basePanoData:at=>{at.width<at.height&&!gu&&(Au=35);const st=Au*at.height/at.width,ot=360*at.width/Au,ut=180*at.height/st;return{fullWidth:ot,fullHeight:ut,croppedWidth:at.width,croppedHeight:at.height,croppedX:(ot-at.width)/2,croppedY:(ut-at.height)/2}},cols:2,rows:1,width:2,tileUrl:()=>null},null!==(uu=at.properties)&&void 0!==uu&&uu.semantics&&(at.properties.semantics=at.properties.semantics.filter((at=>Object.keys(at).length>0)));return{id:at.id,caption:getNodeCaption(at,st),panorama:rd,links:filterRelatedPicsLinks(at,mu),gps:at.geometry.coordinates,sequence:{id:at.collection,nextPic:Du?Du.id:void 0,prevPic:Su?Su.id:void 0},sphereCorrection:getSphereCorrection(at),horizontalFov:Au,origInstance:nd,properties:at.properties}}function filterRelatedPicsLinks(at){var st;let ot=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const ut=at.links.filter((at=>["next","prev","related"].includes(null===at||void 0===at?void 0:at.rel)&&"application/geo+json"===(null===at||void 0===at?void 0:at.type))).filter((at=>!ot||ot(at))).map((at=>(at.datetime&&(at.date=at.datetime.split("T")[0]),at))),Hl=at.geometry.coordinates,_c=[],wc={N:[],ENE:[],ESE:[],S:[],WSW:[],WNW:[]};for(let sc of ut){wc[(0,rc.getSimplifiedAngle)(Hl,sc.geometry.coordinates)].push(sc)}for(let rc in wc){const at=wc[rc];0!=at.length&&(at.sort(sortPicturesInDirection(Hl)),_c.push(at.shift()))}let arrowStyle=at=>"related"===at.rel?{element:(0,rc.getArrow)(oc),size:{width:128/3,height:128}}:{element:(0,rc.getArrow)(sc),size:{width:75,height:75}};const Sc=-((null===(st=at.properties)||void 0===st?void 0:st["view:azimuth"])||0)*(Math.PI/180);return _c.map((at=>({nodeId:at.id,gps:at.geometry.coordinates,arrowStyle:arrowStyle(at),linkOffset:{yaw:Sc}})))}function getHashTags(at){var st;if(null===at||void 0===at||null===(st=at.properties)||void 0===st||!st.semantics)return[];const ot=at.properties.semantics.filter((at=>"hashtags"===at.key)),ut=[];return ot.forEach((at=>at.value.split(";").forEach((at=>ut.push(at.trim()))))),ut}function hasAnnotations(at){var st,ot;return(null===at||void 0===at||null===(st=at.properties)||void 0===st||null===(ot=st.annotations)||void 0===ot?void 0:ot.length)>0}},2283:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{decodeBasicTag:()=>decodeBasicTag,decodeKey:()=>decodeKey,groupByPrefix:()=>groupByPrefix});var ut=ot(4542),Hl=ot(5995),rc=ot(7929),sc=ot(1760),oc=ot(7091),_c=ot(7208);function valToValLink(at,st,ot){return ut.qy`
|
|
2384
|
+
`}}Zoom.properties={_lastWantedZoom:{state:!0}},customElements.define("pnx-widget-zoom",Zoom)},222:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{CopyCoordinates:()=>ut.A,GeoSearch:()=>Hl.A,Legend:()=>rc.A,MapFiltersButton:()=>sc.A,MapLayersButton:()=>oc.A,OSMEditors:()=>_c.A,PictureLegendActions:()=>wc.A,Player:()=>Sc.A,Zoom:()=>iu.A});var ut=ot(5114),Hl=ot(2603),rc=ot(4385),sc=ot(4529),oc=ot(1614),_c=ot(5789),wc=ot(8806),Sc=ot(8305),iu=ot(3023)},5254:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>API});var ut=ot(8340),Hl=ot(7343);class API extends EventTarget{constructor(at){let st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),null===at||void 0===at||"string"!==typeof at){const at=new Error("endpoint parameter is empty or not a valid string");throw this.dispatchEvent(new CustomEvent("broken",{detail:{error:at}})),at}if(at.startsWith("/")&&(at=window.location.href.split("/").slice(0,3).join("/")+at),!API.isValidHttpUrl(at)){const st=new Error(`endpoint parameter is not a valid URL: ${at}`);throw this.dispatchEvent(new CustomEvent("broken",{detail:{error:st}})),st}this._endpoint=at,this._isReady=0,this._dataBbox=null,this._fetchOpts=(null===st||void 0===st?void 0:st.fetch)||{},this._metadata={},st.skipReadLanding||(this._readLanding=fetch(at,this._getFetchOptions()).then((at=>at.json())).then((at=>this._parseLanding(at,st))).catch((at=>(this._isReady=-1,console.error(at),this.dispatchEvent(new CustomEvent("broken",{detail:{error:at}})),Promise.reject("Viewer failed to communicate with API")))).then((()=>this._loadMapStyles(st.style,st.users))).then((()=>(this._isReady=1,this.dispatchEvent(new Event("ready")),"API is ready"))))}onceReady(){return-1==this._isReady?Promise.reject("Viewer failed to communicate with API"):1==this._isReady?Promise.resolve("API is ready"):this._readLanding}isReady(){return 1==this._isReady}getAvailableFeatures(){return Object.entries(this._endpoints).filter((at=>null!==at[1])).map((at=>at[0]))}getUnavailableFeatures(){return Object.entries(this._endpoints).filter((at=>null===at[1])).map((at=>at[0]))}_parseLanding(at,st){var ot,ut;if(this._endpoints={collections:null,search:null,style:null,user_style:null,tiles:(null===st||void 0===st?void 0:st.tiles)||null,user_tiles:null,user_search:null,collection_preview:null,item_preview:null,rss:null,report:null},!at||!at.links||!Array.isArray(at.links))throw new Error("API Landing page doesn't contain 'links' list");if(!at.stac_version.startsWith("1."))throw new Error(`API is not in a supported STAC version (Panoramax viewer supports only 1.x, API is ${at.stac_version})`);this._metadata.name=at.title||"Unnamed",this._metadata.stac_version=at.stac_version,this._metadata.geovisio_version=at.geovisio_version;const Hl=[],rc=[];if([{rel:"search",type:"application/geo+json",endpointId:"search",mandatory:!0,missingIssue:"No direct access to pictures metadata."},{rel:"data",type:"application/json",endpointId:"collections",mandatory:!0,missingIssue:"No way for viewer to access sequences."},{rel:"data",type:"application/rss+xml",endpointId:"rss"},{rel:"xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"tiles"},{rel:"xyz-style",type:"application/json",endpointId:"style"},{rel:"user-xyz-style",type:"application/json",endpointId:"user_style"},{rel:"user-xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"user_tiles"},{rel:"user-search",type:"application/json",endpointId:"user_search",missingIssue:"Filter map data by user name will not be available."},{rel:"collection-preview",type:"image/jpeg",endpointId:"collection_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"item-preview",type:"image/jpeg",endpointId:"item_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"report",type:"application/json",endpointId:"report"}].forEach((st=>{const ot=at.links.find((at=>at.rel==st.rel&&at.type==st.type));if(ot){if(!API.isValidHttpUrl(ot.href))throw new Error(`API endpoint '${ot.rel}' (${ot.type}) is not a valid URL: ${ot.href}`);this._endpoints[st.endpointId]||(this._endpoints[st.endpointId]=ot.href)}else if(!this._endpoints[st.endpointId]){let at=`API doesn't offer a '${st.rel}' (${st.type}) endpoint in its links`;st.missingIssue&&(at+=`\n${st.missingIssue}`),st.mandatory?Hl.push(at):st.missingIssue&&rc.push(at)}})),this._endpoints.style||this._endpoints.tiles||rc.push("API doesn't offer 'xyz' or 'xyz-style' endpoints in its links.\nMap widget will not be available."),this._endpoints.user_style||this._endpoints.user_tiles||rc.push("API doesn't offer 'user-xyz' or 'user-xyz-style' endpoints in its links.\nFilter map data by user ID will not be available."),rc.forEach((at=>console.warn(at))),Hl.length>0)throw new Error(Hl.join("\n"));const sc=null===at||void 0===at||null===(ot=at.extent)||void 0===ot||null===(ut=ot.spatial)||void 0===ut?void 0:ut.bbox;this._dataBbox=sc&&Array.isArray(sc)&&sc.length>0&&Array.isArray(sc[0])&&4===sc[0].length?[[sc[0][0],sc[0][1]],[sc[0][2],sc[0][3]]]:null}_loadMapStyles(at,st){const ot=new Set(st||[]);this.mapStyle={version:8,sources:{},layers:[],metadata:{}};const ut=[this.getMapStyle()];if("string"===typeof at){const st=at.startsWith(this._endpoint)?this._getFetchOptions():void 0;ut.push(fetch(at,st).then((at=>at.json())))}else"object"===typeof at&&ut.push(Promise.resolve(at));return[...ot].filter((at=>"geovisio"!==at)).forEach((at=>{ut.push(this.getUserMapStyle(at,!0))})),Promise.all(ut).then((at=>{const st=["bearing","center","glyphs","light","name","pitch","sky","sprite","terrain","transition","zoom"];at.forEach((at=>{st.forEach((st=>{at[st]&&(this.mapStyle[st]=at[st]||this.mapStyle[st])})),Object.assign(this.mapStyle.sources,(null===at||void 0===at?void 0:at.sources)||{}),Object.assign(this.mapStyle.metadata,(null===at||void 0===at?void 0:at.metadata)||{}),this.mapStyle.layers=this.mapStyle.layers.concat((null===at||void 0===at?void 0:at.layers)||[])}))})).catch((at=>console.error(at)))}_getFetchOptions(){let at=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.assign({signal:at?void 0:AbortSignal.timeout(15e3)},this._fetchOpts)}_getMapRequestTransform(){const at=this._getFetchOptions();if(delete at.signal,Object.keys(at).length>0)return st=>{if(st.startsWith(this._endpoint))return{url:st,...at}}}_getPSVWithCredentials(){return"include"===this._getFetchOptions().credentials?at=>at.startsWith(this._endpoint):void 0}async getSequenceItems(at){let st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,ot=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!this.isReady())throw new Error("API is not ready to use");try{return API.isIdValid(at),fetch(st||`${this._endpoints.collections}/${at}/items`,this._getFetchOptions(!0)).then((at=>at.json())).then((st=>{let ut=st;ot&&(ut.features=ot.features.concat(ut.features));const Hl=st.links.find((at=>"next"===at.rel));return Hl?this.getSequenceItems(at,Hl.href,ut):ut}))}catch(ut){return Promise.reject(ut)}}getPicturesAroundCoordinatesUrl(at,st){let ot=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e-4,ut=arguments.length>3?arguments[3]:void 0,Hl=arguments.length>4?arguments[4]:void 0;if(!this.isReady())throw new Error("API is not ready to use");if(isNaN(parseFloat(at))||isNaN(parseFloat(st)))throw new Error("lat and lon parameters should be valid numbers");const rc=[st-ot,at-ot,st+ot,at+ot].map((at=>at.toFixed(4))).join(","),sc=ut?`&limit=${ut}`:"",oc=Hl?`&collections=${Hl}`:"";return`${this._endpoints.search}?bbox=${rc}${sc}${oc}`}getPicturesAroundCoordinates(at,st,ot,ut,Hl){return fetch(this.getPicturesAroundCoordinatesUrl(at,st,ot,ut,Hl),this._getFetchOptions()).then((at=>at.json()))}getPictureMetadataUrl(at,st){if(!this.isReady())throw new Error("API is not ready to use");if(API.isIdValid(at))return st?`${this._endpoints.collections}/${st}/items/${at}`:`${this._endpoints.search}?ids=${at}`}getMapStyle(){if(this.isReady())return this.mapStyle;let at;return at=this._endpoints.style?this._endpoints.style:this._endpoints.tiles?{version:8,sources:{geovisio:{type:"vector",tiles:[this._endpoints.tiles],minzoom:0,maxzoom:ut.TILES_PICTURES_ZOOM}}}:fetch(`${this._endpoint}/map/14/0/0.mvt`,this._getFetchOptions()).then((()=>(this._endpoints.tiles=`${this._endpoint}/map/{z}/{x}/{y}.mvt`,console.log("Using fallback endpoint for vector tiles"),this.getMapStyle()))).catch((at=>(console.error(at),Promise.reject(new Error("API doesn't offer a vector tiles endpoint"))))),"string"===typeof at?fetch(at,this._getFetchOptions()).then((at=>at.json())):Promise.resolve(at)}getUserMapStyle(at){let st;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.isReady()?at?(this._endpoints.user_style?st=this._endpoints.user_style.replace(/\{userId\}/g,at):this._endpoints.user_tiles&&(st={version:8,sources:{[`geovisio_${at}`]:{type:"vector",tiles:[this._endpoints.user_tiles.replace(/\{userId\}/g,at)],minzoom:0,maxzoom:ut.TILES_PICTURES_ZOOM}}}),st?"string"===typeof st?fetch(st,this._getFetchOptions()).then((at=>at.json())):Promise.resolve(st):Promise.reject(new Error("API doesn't offer map style for specific user"))):Promise.reject(new Error("Parameter userId is empty")):Promise.reject(new Error("API is not ready to use"))}findThumbnailInPictureFeature(at){if(!this.isReady())throw new Error("API is not ready to use");if(!at||!at.assets)return null;let st=null;for(let ot of Object.values(at.assets)){if(ot.roles.includes("thumbnail")&&"image/jpeg"==ot.type&&API.isValidHttpUrl(ot.href))return ot.href;ot.roles.includes("visual")&&"image/jpeg"==ot.type&&API.isValidHttpUrl(ot.href)&&(st=ot.href)}return st}getPictureThumbnailURLForSequence(at,st){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.collection_preview)return Promise.resolve(this._endpoints.collection_preview.replace("{id}",at));if(st&&Array.isArray(st.links)&&st.links.length>0){let at=st.links.find((at=>"preview"===at.rel&&"image/jpeg"===at.type));if(at&&API.isValidHttpUrl(at.href))return Promise.resolve(at.href)}const ot=`${this._endpoints.search}?limit=1&collections=${at}`;return fetch(ot,this._getFetchOptions()).then((at=>at.json())).then((at=>Array.isArray(at.features)&&0!=at.features.length?this.findThumbnailInPictureFeature(at.features.pop()):null))}getPictureThumbnailURL(at,st){if(!this.isReady())throw new Error("API is not ready to use");return at?this._endpoints.item_preview?Promise.resolve(this._endpoints.item_preview.replace("{id}",at)):at&&st?fetch(`${this._endpoints.collections}/${st}/items/${at}`,this._getFetchOptions()).then((at=>at.json())).then((at=>at?this.findThumbnailInPictureFeature(at):null)):fetch(`${this._endpoints.search}?ids=${at}`,this._getFetchOptions()).then((at=>at.json())).then((at=>at&&Array.isArray(at.features)&&0!=at.features.length?this.findThumbnailInPictureFeature(at.features.pop()):null)):Promise.resolve(null)}getRSSURL(at){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.rss){let st=this._endpoints.rss;return at&&(st+=st.includes("?")?"&":"?",st+="bbox="+[at.getWest(),at.getSouth(),at.getEast(),at.getNorth()].join(",")),st}return null}getSequenceMetadataUrl(at){if(!this.isReady())throw new Error("API is not ready to use");return`${this._endpoints.collections}/${at}`}getDataBbox(){if(!this.isReady())throw new Error("API is not ready to use");return this._dataBbox}searchUsers(at){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(`${this._endpoints.user_search}?q=${at}`,this._getFetchOptions()).then((at=>at.json())).then((at=>(null===at||void 0===at?void 0:at.features)||null))}getUserName(at){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(this._endpoints.user_search.replace(/\/search$/,`/${at}`),this._getFetchOptions()).then((at=>at.json())).then((at=>(null===at||void 0===at?void 0:at.name)||null))}sendReport(at){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.report)throw new Error("Report sending is not available");const st={...this._getFetchOptions(),method:"POST",body:JSON.stringify(at),headers:{"Content-Type":"application/json"}};return fetch(this._endpoints.report,st).then((async at=>{if(at.status>=400){let ot=await at.text();try{ot=JSON.parse(ot).message}catch(st){}return Promise.reject(ot)}return at.json()}))}static isValidHttpUrl(at){let st;try{st=new URL(at)}catch(ot){return!1}return"http:"===st.protocol||"https:"===st.protocol}static isIdValid(at){if((0,Hl.isNullId)(at))throw new Error("id should be a valid picture unique identifier");return!0}}},2118:(at,st,ot)=>{"use strict";ot.d(st,{Ay:()=>InitParameters,Qm:()=>ut,Vy:()=>alterPSVState,ai:()=>alterPhotoViewerState,iz:()=>alterViewerState,mK:()=>alterMapState});const ut={minDate:"date_from",maxDate:"date_to",pic_type:"pic_type",camera:"camera",theme:"theme",qualityscore:"pic_score"},Hl=Object.fromEntries(Object.entries(ut).map((at=>[at[1],at[0]]))),rc=["none","null","false",!1],sc=["antialias","bearing","bearingSnap","bounds","boxZoom","clickTolerance","collectResourceTiming","cooperativeGestures","crossSourceCollisions","doubleClickZoom","dragPan","dragRotate","fadeDuration","failIfMajorPerformanceCaveat","fitBoundsOptions","hash","interactive","localIdeographFontFamily","locale","logoPosition","maplibreLogo","maxBounds","maxCanvasSize","maxPitch","maxTileCacheSize","maxTileCacheZoomLevels","maxZoom","minPitch","minZoom","pitch","pitchWithRotate","pixelRatio","preserveDrawingBuffer","refreshExpiredTiles","renderWorldCopies","scrollZoom","touchPitch","touchZoomRotate","trackResize","transformCameraUpdate","transformRequest","validateStyle"];class InitParameters{constructor(){var at,st,ot,ut,Hl,oc;let _c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},wc=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},Sc=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"false"===_c["url-parameters"]&&(wc={});let iu={};"object"===typeof(null===_c||void 0===_c?void 0:_c.psv)&&(iu=_c.psv);let su={};"object"===typeof(null===_c||void 0===_c?void 0:_c.map)&&(su=_c.map);let lu={};"object"===typeof(null===Sc||void 0===Sc?void 0:Sc.map)&&(lu=Sc.map);let cu=wc.map&&"none"!==wc.map?getMapPositionFromString(wc.map):null,uu=!rc.includes(wc.map)&&!rc.includes(_c.map),pu=wc.focus||_c.focus,mu=wc.pic||_c.picture,gu=wc.users||_c.users,Au=wc.speed||(null===(at=iu)||void 0===at?void 0:at.transitionDuration),yu=wc.nav||(null===(st=iu)||void 0===st?void 0:st.picturesNavigation),_u=wc.theme||(null===(ot=lu)||void 0===ot?void 0:ot.theme)||su.theme,xu=wc.background||(null===(ut=lu)||void 0===ut?void 0:ut.background)||su.background,Su=(null===cu||void 0===cu?void 0:cu.center)||(null===(Hl=lu)||void 0===Hl?void 0:Hl.center)||su.center,Du=(null===cu||void 0===cu?void 0:cu.zoom)||(null===(oc=lu)||void 0===oc?void 0:oc.zoom)||su.zoom,Lu=(null===cu||void 0===cu?void 0:cu.pitch)||su.pitch,$u=(null===cu||void 0===cu?void 0:cu.bearing)||su.bearing,hh=_c.geocoder,ed=_c.widgets,td=_c.sequence,id=_c.fetchOptions,nd=_c.style,rd=_c.lang,ad=_c.endpoint,sd=su.raster,od=su.attributionControl,ld=(cd=su,Object.fromEntries(Object.entries(cd).filter((at=>{let[st]=at;return sc.includes(st)}))));var cd;let ud=_c["keyboard-shortcuts"],hd=wc.xyz,dd=wc.date_from,pd=wc.date_to,md=wc.pic_type,fd=wc.camera,gd=wc.pic_score;["map","pic"].includes(pu)?"map"!==pu||uu||(console.warn("Parameter focus can't be 'map' as map is disabled"),pu="pic"):(console.warn("Invalid value for parameter focus:",pu),pu=uu&&!mu?"map":"pic"),"aerial"!=xu||sd||(console.warn("Parameter background can't be 'aerial' as no aerial imagery is available"),xu="streets"),uu&&!mu&&(pu="map"),this._parentInit={map:uu,users:gu,fetchOptions:id,style:nd,lang:rd,endpoint:ad},this._parentPostInit={focus:pu,picture:mu,sequence:td,geocoder:hh,widgets:ed,forceFocus:!0,keyboardShortcuts:!0},this._psvInit=Object.fromEntries(Object.entries(iu).filter((at=>{let[st]=at;return!["transitionDuration","picturesNavigation"].includes(st)}))),this._psvAny={transitionDuration:Au,picturesNavigation:yu},this._psvPostInit={xyz:hd},this._mapInit={raster:sd,attributionControl:od,...ld},this._mapAny={theme:_u,background:xu,center:Su,zoom:Du,pitch:Lu,bearing:$u,users:gu},this._mapPostInit={date_from:dd,date_to:pd,pic_type:md,camera:fd,pic_score:gd},"false"===ud&&(this._psvInit.keyboard=!1,this._psvInit.keyboardActions={},this._mapInit.keyboard=!1,this._parentPostInit.keyboardShortcuts=!1)}_sanitize(at){return Object.fromEntries(Object.entries(at).filter((at=>{let[,st]=at;return void 0!==st})))}getParentInit(){return this._sanitize(this._parentInit)}getParentPostInit(){return this._sanitize(this._parentPostInit)}getPSVInit(){return this._sanitize(Object.assign({},this._psvInit,this._psvAny))}getPSVPostInit(){return this._sanitize(Object.assign({},this._psvPostInit,this._psvAny))}getMapInit(){return this._sanitize(Object.assign({},this._mapInit,this._mapAny))}getMapPostInit(){return this._sanitize(Object.assign({},this._mapPostInit,this._mapAny))}static GetComponentProperties(at,st){const ot={};for(let ut in at.properties){at.properties[ut].state||null==st[ut]||(ot[ut]=st[ut])}return ot}}function getMapPositionFromString(at,st){const ot=(at||"").split("/");if(ot.length>=3&&!ot.some((at=>isNaN(at)))){const at={center:[+ot[2],+ot[1]],zoom:+ot[0],pitch:+(ot[4]||0)};return st&&(at.bearing=st.dragRotate.isEnabled()&&st.touchZoomRotate.isEnabled()?+(ot[3]||0):st.getBearing()),at}return null}function alterPSVState(at,st){st.xyz&&at.addEventListener("picture-loaded",(()=>{const ot=function(at){const st=(at||"").split("/");return 3!==st.length||st.some((at=>isNaN(at)))?null:{x:+st[0],y:+st[1],z:+st[2]}}(st.xyz);at.setXYZ(ot.x,ot.y,ot.z)}),{once:!0});let ot=st.transitionDuration||st.speed;void 0!==ot&&at.setTransitionDuration(ot);let ut=st.picturesNavigation||st.nav;["none","pic","any","seq"].includes(ut)&&at.setPicturesNavigation(ut)}async function alterMapState(at,st){var ot;const ut=getMapPositionFromString(st.map,at);ut&&at.jumpTo(ut);let rc=Array.isArray(st.users)?st.users:(st.users||"").split(",");(0===rc.length||1===rc.length&&""===rc[0].trim())&&(rc=["geovisio"]),await at.setVisibleUsers(rc),null===(ot=at.setFilters)||void 0===ot||ot.call(at,function(at){const st={};for(let ot in Hl)at[ot]&&(st[Hl[ot]]=at[ot]);if(st.qualityscore){let at=st.qualityscore.split("");const ot={A:5,B:4,C:3,D:2,E:1};st.qualityscore=at.map((at=>ot[at]))}return st}(st)),["aerial","streets"].includes(st.background)&&at.setBackground(st.background)}function alterPhotoViewerState(at,st){let ot=st.picture||st.pic;if(ot){const st=ot.split(";");st.length>1&&console.warn("Multiple picture IDs passed in URL, only first one kept"),at.select(null,st[0],!0)}else at.select()}function alterViewerState(at,st){alterPhotoViewerState(at,st),"map"===st.focus&&null!==at&&void 0!==at&&at.map?(at.setPopup(!1),at._setFocus("map",null,st.forceFocus)):"pic"===st.focus&&null!==at&&void 0!==at&&at.mini?(at.setPopup(!1),at._setFocus("pic",null,st.forceFocus)):st.focus&&"meta"===st.focus&&null!==at&&void 0!==at&&at.mini&&at._setFocus("pic",null,st.forceFocus)}},3727:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>PhotoAdapter});var ut=ot(3890);class PhotoAdapter extends ut.D{constructor(at,st){super(at,st),this._shouldGoFast=st.shouldGoFast||(()=>!0)}loadTexture(at,st){return at.origBaseUrl?at.baseUrl=at.origBaseUrl:at.origBaseUrl=at.baseUrl,this._shouldGoFast()&&at.thumbUrl&&!at.hdLoaded&&1==at.rows&&(at.baseUrl=at.thumbUrl),super.loadTexture(at,st).then((st=>(at.baseUrl===at.origBaseUrl&&(at.hdLoaded=!0),st)))}__loadTiles(at){this._shouldGoFast()||super.__loadTiles(at)}}},4207:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>PresetManager});var ut=ot(7208);const Hl={fas:"fa6-solid"},rc={"fa6-solid:directions":"fa6-solid:diamond-turn-right"};class PresetManager{constructor(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,st=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._ready=!1,this._presets=null,this._translations={},st||this._load(at)}async _load(at){var st;at=at||(null===(st=window.navigator.languages[0])||void 0===st?void 0:st.substring(0,2));try{var ot,sc;const[st,wc,Sc]=await Promise.all([fetch(`${(0,ut.PanoramaxPresetsURL)()}/translations/en.min.json`),at?fetch(`${(0,ut.PanoramaxPresetsURL)()}/translations/${at}.min.json`):Promise.resolve({ok:!0}),fetch(`${(0,ut.PanoramaxPresetsURL)()}/presets.min.json`)]);if(!st||!wc||!Sc||!st.ok||!wc.ok||!Sc.ok)throw this._ready=-1,new Error("Presets service is not available");var oc,_c;if(this._presets=await Sc.json(),this._translations.en=null===(ot=await st.json())||void 0===ot||null===(sc=ot.en)||void 0===sc?void 0:sc.presets,at)this._translations[at]=null===(oc=await wc.json())||void 0===oc||null===(_c=oc[at])||void 0===_c?void 0:_c.presets;Object.entries(this._presets).forEach((st=>{var ot,ut,sc,oc,_c,wc;let[Sc,iu]=st;if(null!==(ot=this._translations[at])&&void 0!==ot&&null!==(ut=ot.presets)&&void 0!==ut&&null!==(sc=ut[Sc])&&void 0!==sc&&sc.name?iu.name=this._translations[at].presets[Sc].name:null!==(oc=this._translations.en)&&void 0!==oc&&null!==(_c=oc.presets)&&void 0!==_c&&null!==(wc=_c[Sc])&&void 0!==wc&&wc.name&&(iu.name=this._translations.en.presets[Sc].name),iu.icon){const at=iu.icon.split("-")[0],st=Hl[at];iu.iconify=st?iu.icon.replace(at+"-",st+":"):iu.icon.split("-")[0]+":"+iu.icon.split("-").slice(1).join("-"),rc[iu.iconify]&&(iu.iconify=rc[iu.iconify])}})),this._ready=!0}catch(wc){console.error("Presets service throws an error:",wc),this._ready=-1}}async onceReady(){return this._ready?-1===this._ready?Promise.reject():Promise.resolve():(await new Promise((at=>setTimeout(at,250))),this.onceReady())}async getPreset(at){return this.onceReady().then((()=>{const st=Object.values(this._presets).filter((st=>{if(0===Object.keys(st.tags).length)return!1;for(let ot in st.tags){const ut=st.tags[ot];if(!at.semantics.find((at=>at.key===ot&&("*"===ut||ut===at.value))))return!1}return!0}));return st.sort(((at,st)=>{const ot=Object.keys(at.tags).length,ut=Object.keys(st.tags).length;if(ot>ut)return-1;if(ot===ut){const ot=Object.values(at.tags).filter((at=>"*"===at)).length,ut=Object.values(st.tags).filter((at=>"*"===at)).length;return ot<ut?-1:ot>ut?1:0}return 1})),st.shift()}))}}},4451:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>URLHandler});var ut=ot(2118);const Hl=["speed","nav","focus","pic","xyz","map","background","users","pic_score","s"].concat(Object.values(ut.Qm)),rc=["focus-changed","pictures-navigation-changed"],sc=["position-updated","zoom-updated","view-rotated","picture-loaded","transition-duration-changed"],oc=["moveend","zoomend","boxzoomend","background-changed","users-changed","filters-changed"];class URLHandler extends EventTarget{constructor(at){super(),this._parent=at,this._delay=null}listenToChanges(){window.addEventListener("popstate",this._onURLChange.bind(this),!1),rc.forEach((at=>this._parent.addEventListener(at,this._onParentChange.bind(this)))),sc.forEach((at=>this._parent.psv.addEventListener(at,this._onParentChange.bind(this)))),this._parent.map&&oc.forEach((at=>this._parent.map.on(at,this._onParentChange.bind(this))))}destroy(){window.removeEventListener("popstate",this._onURLChange)}nextURLParams(){let at={};"number"==typeof this._parent.psv.getTransitionDuration()&&(at.speed=this._parent.psv.getTransitionDuration()),[null,"any"].includes(this._parent.psv.getPicturesNavigation())||(at.nav=this._parent.psv.getPicturesNavigation()),this._parent.psv.getPictureId()&&(at.pic=this._parent.psv.getPictureId());if(this._parent.psv.getPictureMetadata()&&(at.xyz=this.currentPSVString()),this._parent.map){at.map=this.currentMapString(),at.focus="pic",this._parent.isMapWide()&&(at.focus="map"),this._parent.map.hasTwoBackgrounds()&&this._parent.map.getBackground()&&(at.background=this._parent.map.getBackground());const st=this._parent.map.getVisibleUsers();if((st.length>1||!st.includes("geovisio"))&&(at.users=st.join(",")),this._parent.map._mapFilters){for(let st in ut.Qm)this._parent.map._mapFilters[st]&&(at[ut.Qm[st]]=this._parent.map._mapFilters[st]);if(at.pic_score){const st=[null,"E","D","C","B","A"];at.pic_score=at.pic_score.map((at=>st[at])).join("")}}}return at}nextURLString(){let at="";return Object.entries(this.nextURLParams()).sort(((at,st)=>at[0].localeCompare(st[0]))).forEach((st=>{let[ot,ut]=st,Hl=!1;const rc=at.split("&").map((at=>{const st=at.split("=")[0];return st===ot?(Hl=!0,`${st}=${ut}`):at})).filter((at=>at));Hl||rc.push(`${ot}=${ut}`),at=`${rc.join("&")}`})),`?${at}`.replace(/^\?+/,"?")}currentURLParams(){const at=(arguments.length>0&&void 0!==arguments[0]&&arguments[0]?window.location.hash:window.location.search).replace(/^[?#]/,"");let st={};if(at.split("&").map((at=>at.split("="))).filter((at=>void 0!==at[0]&&at[0].length>0&&Hl.includes(at[0]))).forEach((at=>{st[at[0]]=at[1]})),st.s){const at=Object.fromEntries(decodeURIComponent(st.s).split(";").map((at=>[at[0],at.substring(1)])));st={},"m"===at.f?st.focus="map":"p"===at.f?st.focus="pic":"t"===at.f&&(st.focus="meta"),""!==at.s&&(st.speed=100*parseFloat(at.s)),"a"===at.n?st.nav="any":"s"===at.n&&(st.nav="seq"),"n"===at.n&&(st.nav="none"),""!==at.p&&(st.pic=at.p),""!==at.c&&(st.xyz=at.c),""!==at.m&&(st.map=at.m),""!==at.d&&(st.date_from=at.d),""!==at.e&&(st.date_to=at.e),"f"===at.t?st.pic_type="flat":"e"===at.t&&(st.pic_type="equirectangular"),""!==at.k&&(st.camera=at.k),"d"===at.v?st.theme="default":"a"===at.v?st.theme="age":"t"===at.v?st.theme="type":"s"===at.v&&(st.theme="score"),"s"===at.b?st.background="streets":"a"===at.b&&(st.background="aerial"),""!==at.u&&(st.users=at.u),""!==at.q&&(st.pic_score=at.q)}return st}currentMapString(){const at=this._parent.map.getCenter(),st=Math.round(100*this._parent.map.getZoom())/100,ot=Math.ceil((st*Math.LN2+Math.log(512/360/.5))/Math.LN10),ut=Math.pow(10,ot),Hl=Math.round(at.lng*ut)/ut,rc=Math.round(at.lat*ut)/ut,sc=this._parent.map.getBearing(),oc=this._parent.map.getPitch();let _c=`${st}/${rc}/${Hl}`;return(sc||oc)&&(_c+="/"+Math.round(10*sc)/10),oc&&(_c+=`/${Math.round(oc)}`),_c}currentPSVString(){const at=this._parent.psv.getXYZ();return`${at.x.toFixed(2)}/${at.y.toFixed(2)}/${Math.round(at.z||0)}`}_onURLChange(){let at=this.currentURLParams();"Viewer"===this._parent.getClassName()?(0,ut.iz)(this._parent,at):(0,ut.ai)(this._parent,at),(0,ut.Vy)(this._parent.psv,at),this._parent.map&&(0,ut.mK)(this._parent.map,at)}nextShortLink(at){const st=new URL(at),ot=this.nextURLParams(),ut={f:(ot.focus||"").substring(0,1),s:isNaN(parseInt(ot.speed))?void 0:Math.floor(parseInt(ot.speed)/100),n:(ot.nav||"").substring(0,1),p:ot.pic,c:ot.xyz,m:ot.map,d:ot.date_from,e:ot.date_to,t:(ot.pic_type||"").substring(0,1),k:ot.camera,v:(ot.theme||"").substring(0,1),b:(ot.background||"").substring(0,1),u:ot.users,q:ot.pic_score},Hl=Object.entries(ut).filter((at=>{let[,st]=at;return void 0!=st&&""!=st})).map((at=>{let[st,ot]=at;return`${st}${ot}`})).join(";");return st.search=`s=${Hl}`,st}getUnmanagedParameters(at){return new URLSearchParams(Array.from(at.searchParams).filter((at=>{let[st]=at;return!Hl.includes(st)}))).toString()}_onParentChange(){this._delay&&(clearTimeout(this._delay),this._delay=null),this._delay=setTimeout((()=>{var at,st,ot;const ut=new URL(window.location.href),Hl=new URL(window.location.href),rc=this.getUnmanagedParameters(ut);if(Hl.search=this._parent?this.nextURLString()+(rc.length>0?"&"+rc:""):"",Object.keys(this.currentURLParams(!0)).length>0&&(Hl.hash=""),ut.search==Hl.search)return;const sc=this.currentURLParams().pic||"",oc=(null===(at=this._parent)||void 0===at||null===(st=at.psv)||void 0===st||null===(ot=st.getPictureId)||void 0===ot?void 0:ot.call(st))||"";try{if(sc!=oc?window.history.pushState(window.history.state,null,Hl.href):window.history.replaceState(window.history.state,null,Hl.href),this._parent){const at=new CustomEvent("url-changed",{detail:{url:Hl.href}});this.dispatchEvent(at)}}catch(_c){}}),500)}}},3606:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{forwardGeocodingBAN:()=>forwardGeocodingBAN,forwardGeocodingNominatim:()=>forwardGeocodingNominatim,forwardGeocodingStandard:()=>forwardGeocodingStandard,reverseGeocodingNominatim:()=>reverseGeocodingNominatim});var ut=ot(927),Hl=ot.n(ut),rc=ot(7208);const sc={house:20,housenumber:20,street:18,locality:15,district:13,municipality:12,city:12,county:8,region:7,state:7,country:5};function geocoderParamsToURLString(at){let st={};return Object.entries(at).filter((at=>void 0!==at[1]&&null!==at[1])).forEach((at=>st[at[0]]=at[1])),new URLSearchParams(st).toString()}function forwardGeocodingNominatim(at){const st={q:at.query,countrycodes:at.countries,limit:at.limit,viewbox:at.bbox};return fetch(`${(0,rc.NominatimBaseUrl)()}/search?${geocoderParamsToURLString(st)}&format=geocodejson&addressdetails=1`).then((at=>at.json())).then((at=>{const st={features:[]},ot=[];return(at.features||[]).forEach((at=>{var ut,rc,oc;const _c=geocodeJsonToPlaceName(null===(ut=at.properties)||void 0===ut?void 0:ut.geocoding)||(null===(rc=at.properties)||void 0===rc||null===(oc=rc.geocoding)||void 0===oc?void 0:oc.label);var wc,Sc;ot.includes(_c)||(st.features.push({place_type:["place"],place_name:_c,center:new(Hl().LngLat)(...at.geometry.coordinates),zoom:sc[null===(wc=at.properties)||void 0===wc||null===(Sc=wc.geocoding)||void 0===Sc?void 0:Sc.type]}),ot.push(_c))})),st}))}function reverseGeocodingNominatim(at,st){return fetch(`${(0,rc.NominatimBaseUrl)()}/reverse?lat=${at}&lon=${st}&zoom=18&format=geocodejson`).then((at=>at.json())).then((at=>{var st,ot,ut;return geocodeJsonToPlaceName(null===at||void 0===at||null===(st=at.features)||void 0===st||null===(ot=st.shift())||void 0===ot||null===(ut=ot.properties)||void 0===ut?void 0:ut.geocoding)}))}function forwardGeocodingBAN(at){return forwardGeocodingStandard(at,(0,rc.AdresseDataGouvBaseURL)())}function geocodeJsonToPlaceName(at){if(!at||"object"!=typeof at)return"";let st=at.name,ot=[],ut=[];switch(at.type){case"hamlet":case"croft":case"isolated_dwelling":case"neighbourhood":case"allotments":case"quarter":case"farm":case"farmyard":case"industrial":case"commercial":case"retail":case"city_block":case"residential":case"locality":case"district":ut.push(at.city),ut.push(at.county),ut.push(at.state),ut.push(at.country);break;case"city":case"region":ut.push(at.county),ut.push(at.state),ut.push(at.country);break;case"country":break;case"house":case"housenumber":ot.push(at.housenumber),ot.push(at.street),ot.push(at.locality),ot.push(at.district),ut.push(at.city),ut.push(at.county),ut.push(at.state),ut.push(at.country);break;default:ot.push(at.street),ot.push(at.locality),ot.push(at.district),ut.push(at.city),ut.push(at.county),ut.push(at.state),ut.push(at.country)}return ot=ot.filter((at=>at)),ot=ot.filter(((at,ut)=>at!=st&&(0===ut||ot[ut-1]!==at))),ot=ot.length>0?at.housenumber?ot.slice(0,2).join(" "):ot.shift():null,ot===st&&(ot=null),ut=ut.filter((at=>at)),ut=ut.filter(((at,Hl)=>at!=st&&(!ot||!ot.includes(at))&&(0===Hl||ut[Hl-1]!==at))),[st,ot,ut.shift()].filter((at=>at)).join(", ")}function forwardGeocodingStandard(at,st){const ot={q:at.query,limit:at.limit};if("string"===typeof at.proximity){const[st,ut]=at.proximity.split(",").map((at=>parseFloat(at.trim())));ot.lat=st,ot.lon=ut}return fetch(`${st}/?${geocoderParamsToURLString(ot)}`).then((at=>at.json())).then((at=>{const st={features:[]},ot=[];return(at.features||[]).forEach((at=>{const ut=geocodeJsonToPlaceName(at.properties);ot.includes(ut)||"other"==at.properties.type||(st.features.push({place_type:["place"],place_name:ut,center:new(Hl().LngLat)(...at.geometry.coordinates),zoom:sc[at.properties.type]}),ot.push(ut))})),st}))}},4964:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{autoDetectLocale:()=>autoDetectLocale,getTranslations:()=>getTranslations});var ut=ot(4149),Hl=ot(369),rc=ot(389),sc=ot(9946),oc=ot(8302),_c=ot(5222),wc=ot(6909),Sc=ot(4895),iu=ot(3979),su=ot(6920),lu=ot(9026),cu=ot(991),uu=ot(6984);const pu="en",mu={da:ut,de:Hl,eo:sc,en:rc,es:oc,fr:_c,hu:wc,it:Sc,ja:iu,nl:su,pl:lu,sv:cu,"zh-Hant":uu,zh:uu};function autoDetectLocale(at,st){for(const ot of window.navigator.languages){let st=ot;switch(st){case"zh-TW":case"zh-HK":case"zh-MO":st="zh-Hant";break;case"zh-CN":case"zh-SG":st="zh-Hans";break;default:st.length>2&&(st=ot.substring(0,2))}const ut=at.find((at=>at===st));if(ut)return ut}return st}function getTranslations(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const st=JSON.parse(JSON.stringify(rc));let ot;if(at||(at=autoDetectLocale(Object.keys(mu),pu)),mu[at]&&"en"!==at&&(ot=mu[at]),at.length>2){const st=at.substring(0,2);mu[st]&&(ot=mu[st])}return ot&&Object.entries(ot).forEach((at=>{let[ot,ut]=at;Object.entries(ut).forEach((at=>{let[ut,Hl]=at;Array.isArray(Hl)&&(Hl=Hl.filter((at=>null!=at))),st[ot][ut]=Hl}))})),st}},2030:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{API:()=>iu.A,PhotoAdapter:()=>su.A,PresetsManager:()=>lu.A,URLHandler:()=>cu.A,geocoder:()=>ut,i18n:()=>Hl,map:()=>rc,picture:()=>sc,semantics:()=>oc,services:()=>_c,utils:()=>wc,widgets:()=>Sc});var ut=ot(3606),Hl=ot(4964),rc=ot(8340),sc=ot(508),oc=ot(2283),_c=ot(7208),wc=ot(7343),Sc=ot(5995),iu=ot(5254),su=ot(3727),lu=ot(4207),cu=ot(4451)},8340:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{DEFAULT_TILES:()=>sc,MAP_EXPR_QUALITYSCORE:()=>lu,RASTER_LAYER_ID:()=>oc,TILES_PICTURES_SYMBOL_ZOOM:()=>wc,TILES_PICTURES_ZOOM:()=>_c,VECTOR_STYLES:()=>Sc,combineStyles:()=>combineStyles,getMapParamsFromLocalStorage:()=>getMapParamsFromLocalStorage,getMissingLayerStyles:()=>getMissingLayerStyles,getThumbGif:()=>getThumbGif,getUserLayerId:()=>getUserLayerId,getUserSourceId:()=>getUserSourceId,initMapKeyboardHandler:()=>initMapKeyboardHandler,isLabelLayer:()=>isLabelLayer,linkMapAndPhoto:()=>linkMapAndPhoto,saveMapParamsToLocalStorage:()=>saveMapParamsToLocalStorage,switchCoefValue:()=>switchCoefValue});var ut=ot(6883),Hl=ot(7343),rc=ot(4964);const sc="https://panoramax.openstreetmap.fr/pmtiles/basic.json",oc="pnx-aerial",_c=15,wc=18,Sc={PICTURES:{paint:{"circle-radius":["interpolate",["linear"],["zoom"],_c,4.5,wc,6,24,12],"circle-opacity":["interpolate",["linear"],["zoom"],_c,0,_c+1,1],"circle-stroke-color":"#ffffff","circle-stroke-width":["interpolate",["linear"],["zoom"],_c+1,0,_c+2,1,wc,1.5,24,3]},layout:{}},PICTURES_SYMBOLS:{paint:{"icon-opacity":["interpolate",["linear"],["zoom"],wc,0,wc+1,1]},layout:{"icon-image":["case",["==",["get","type"],"equirectangular"],"pnx-arrow-360","pnx-arrow-flat"],"icon-size":["interpolate",["linear"],["zoom"],wc,.5,24,1],"icon-rotate":["to-number",["get","heading"]],"icon-allow-overlap":!0}},SEQUENCES:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,.5,10,2,14,4,16,5,22,3]},layout:{"line-cap":"square"}},SEQUENCES_PLUS:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,15,_c+1,30,_c+2,0],"line-opacity":0,"line-color":"#ff0000"},layout:{"line-cap":"square"}}},iu=["case",["==",["get","type"],"equirectangular"],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Hl.QUALITYSCORE_RES_360_VALUES],1],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Hl.QUALITYSCORE_RES_FLAT_VALUES],1]],su=["case",["has","gps_accuracy"],["step",["get","gps_accuracy"],...Hl.QUALITYSCORE_GPS_VALUES],1],lu=["round",["+",["*",iu,Hl.QUALITYSCORE_POND_RES],["*",su,Hl.QUALITYSCORE_POND_GPS]]];function getThumbGif(at){const st=document.createElement("img");return st.src=ut,st.alt=at.loading,st.title=at.loading,st.classList.add("pnx-map-thumb","pnx-map-thumb-loader"),st}function isLabelLayer(at){var st;return"symbol"===at.type&&void 0!==(null===at||void 0===at||null===(st=at.layout)||void 0===st?void 0:st["text-field"])&&(void 0===at.minzoom||at.minzoom<15)}function combineStyles(at,st){var ot,ut;const Hl=at.api.getMapStyle();if(Hl.layers=Hl.layers||[],Hl.layers=Hl.layers.concat(getMissingLayerStyles(Hl.sources,Hl.layers)),Hl.metadata||(Hl.metadata={}),st.supplementaryStyle&&(Object.assign(Hl.sources,st.supplementaryStyle.sources||{}),Object.assign(Hl.metadata,st.supplementaryStyle.metadata||{}),Hl.layers=Hl.layers.concat(st.supplementaryStyle.layers||[])),Hl.layers=Hl.layers.filter((at=>at.id)),st.raster&&(Hl.sources["pnx-aerial"]=st.raster,Hl.layers.push({id:oc,type:"raster",source:"pnx-aerial",layout:{visibility:"aerial"===st.background?"visible":"none"}})),null!==at&&void 0!==at&&null!==(ot=at.users)&&void 0!==ot&&ot.includes("geovisio")||Hl.layers.forEach((at=>{"geovisio"===at.source&&(at.layout||(at.layout={}),at.layout.visibility="none")})),Hl.layers.sort(((at,st)=>isLabelLayer(at)&&!isLabelLayer(st)?1:!isLabelLayer(at)&&isLabelLayer(st)?-1:at.id.startsWith("geovisio")&&!st.id.startsWith("geovisio")?1:!at.id.startsWith("geovisio")&&st.id.startsWith("geovisio")?-1:at.id.endsWith("_pictures")&&!st.id.endsWith("_pictures")?1:!at.id.endsWith("_pictures")&&st.id.endsWith("_pictures")?-1:0)),null!==(ut=Hl.metadata)&&void 0!==ut&&ut["panoramax:locales"]||(Hl.metadata["panoramax:locales"]=["fr","en","de","es","ru","pt","zh","hi","latin"]),Hl.metadata["panoramax:locales"]){let st=at.lang||(0,rc.autoDetectLocale)(Hl.metadata["panoramax:locales"],"latin");st.includes("-")&&(st=st.split("-")[0]),st.includes("_")&&(st=st.split("_")[0]),Hl.layers.forEach((at=>{isLabelLayer(at)&&at.layout["text-field"].includes("name:latin")&&(at.layout["text-field"]=["coalesce",["get",`name:${st}`],["get","name:latin"],["get","name"]])}))}const sc=Hl.layers.find((at=>"place_label_city"==at.id));let _c=Hl.layers.find((at=>"place_label_capital"==at.id));return sc&&!_c&&(sc.paint={"text-color":"hsl(0, 0%, 0%)","text-halo-blur":0,"text-halo-color":"hsla(0, 0%, 100%, 1)","text-halo-width":3},sc.layout["text-letter-spacing"]=.1,_c=JSON.parse(JSON.stringify(sc)),_c.id="place_label_capital",_c.filter.push(["<=","capital",2]),sc.filter.push([">","capital",2]),Hl.layers.push(_c)),Hl}function getMissingLayerStyles(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const ot=[];return Object.keys(at).filter((at=>void 0===st.find((st=>(null===st||void 0===st?void 0:st.source)===at)))).forEach((at=>{at.startsWith("geovisio")&&(ot.push({id:`${at}_sequences`,type:"line",source:at,"source-layer":"sequences",layout:{...Sc.SEQUENCES.layout},paint:{...Sc.SEQUENCES.paint,"line-color":Hl.COLORS.BASE}}),ot.push({id:`${at}_sequences_plus`,type:"line",source:at,"source-layer":"sequences",layout:{...Sc.SEQUENCES_PLUS.layout},paint:{...Sc.SEQUENCES_PLUS.paint}}),ot.push({id:`${at}_pictures_symbols`,type:"symbol",source:at,"source-layer":"pictures",...Sc.PICTURES_SYMBOLS}),ot.push({id:`${at}_pictures_symbols`,type:"symbol",source:at,"source-layer":"pictures",...Sc.PICTURES_SYMBOLS}),ot.push({id:`${at}_pictures`,type:"circle",source:at,"source-layer":"pictures",layout:{...Sc.PICTURES.layout},paint:{...Sc.PICTURES.paint,"circle-color":Hl.COLORS.BASE}}))})),st.filter((at=>{var ot;return(null===at||void 0===at||null===(ot=at.id)||void 0===ot?void 0:ot.endsWith("_sequences"))&&void 0===st.find((st=>(null===st||void 0===st?void 0:st.id)===at.id+"_plus"))})).forEach((at=>{ot.push({id:`${at.id}_plus`,type:"line",source:at.source,"source-layer":at["source-layer"],layout:{...Sc.SEQUENCES_PLUS.layout},paint:{...Sc.SEQUENCES_PLUS.paint}})})),st.filter((at=>{var ot;return(null===at||void 0===at||null===(ot=at.id)||void 0===ot?void 0:ot.endsWith("_pictures"))&&void 0===st.find((st=>(null===st||void 0===st?void 0:st.id)===at.id+"_symbols"))})).forEach((at=>{ot.unshift({id:`${at.id}_symbols`,type:"symbol",source:at.source,"source-layer":"pictures",...Sc.PICTURES_SYMBOLS}),at.paint=Object.assign(at.paint||{},Sc.PICTURES.paint),at.layout=Object.assign(at.layout||{},Sc.PICTURES.layout)})),ot}function getUserLayerId(at,st){return`${getUserSourceId(at)}_${st}`}function getUserSourceId(at){return"geovisio"===at?"geovisio":"geovisio_"+at}function switchCoefValue(at,st){if(Array.isArray(at))return at.map((at=>switchCoefValue(at,st)));if("object"===typeof at&&null!==at){const ot={};for(const ut in at)ot[ut]=switchCoefValue(at[ut],st);return ot}return"string"===typeof at&&at.startsWith("coef")?st:at}function linkMapAndPhoto(at){const onPicLoad=st=>{var ot,ut,rc,sc;(0,Hl.isNullId)(st.detail.picId)?(at.map.displayPictureMarker(),null!==at&&void 0!==at&&null!==(ot=at.isMapWide)&&void 0!==ot&&ot.call(at)&&(null===at||void 0===at||null===(ut=at.mini)||void 0===ut||ut.setAttribute("collapsed",""))):(at.map.displayPictureMarker(st.detail.lon,st.detail.lat,at.psv.getXY().x,st.detail.first,st.detail.picId),null!==at&&void 0!==at&&null!==(rc=at.isMapWide)&&void 0!==rc&&rc.call(at)&&(null===at||void 0===at||null===(sc=at.mini)||void 0===sc||sc.removeAttribute("collapsed")))};at.psv.addEventListener("picture-loading",onPicLoad),at.psv.addEventListener("picture-loaded",onPicLoad),at.psv.addEventListener("view-rotated",(()=>{let st=at.psv.getPosition().yaw*(180/Math.PI);st+=at.psv.getPictureOriginalHeading(),at.map._picMarker.setRotation(st)})),at.psv.addEventListener("picture-preview-started",(st=>{at.map._picMarkerPreview.setLngLat(st.detail.coordinates).setRotation(st.detail.direction||0).addTo(at.map)})),at.psv.addEventListener("picture-preview-stopped",(()=>{at.map._picMarkerPreview.remove()})),at.psv.addEventListener("picture-loaded",(st=>{at.isWidthSmall()&&at._picPopup&&st.detail.picId==at._picPopup._picId&&at._picPopup.remove()})),at.map.on("picture-click",(st=>{at.select(st.seqId,st.picId),!at.psv._myVTour.state.currentNode&&null!==at&&void 0!==at&&at._setFocus&&at._setFocus("pic")})),at.map.on("sequence-click",(st=>{at.api.getPicturesAroundCoordinates(st.coordinates.lat,st.coordinates.lng,1,1,st.seqId).then((st=>{var ot,ut;(null===st||void 0===st||null===(ot=st.features)||void 0===ot?void 0:ot.length)>0&&(at.select(null===(ut=st.features[0])||void 0===ut?void 0:ut.collection,st.features[0].id),!at.psv.getPictureMetadata()&&null!==at&&void 0!==at&&at._setFocus&&at._setFocus("pic"))}))})),at._setFocus&&(at.psv.addEventListener("dblclick",(()=>{at.isMapWide()&&at._setFocus("pic")})),at.map.on("dblclick",(()=>{at.isMapWide()?at.select():at._setFocus("map")})))}function initMapKeyboardHandler(at){at.map.keyboard.keydown=function(st){if(st.altKey||st.ctrlKey||st.metaKey)return;switch(st.key){case"*":case"5":return void at.moveCenter();case"PageUp":case"9":return void at.psv.goToNextPicture();case"PageDown":case"3":return void at.psv.goToPrevPicture();case"Home":case"7":return st.stopPropagation(),void at._toggleFocus();case"End":case"1":return void at.mini.toggleAttribute("collapsed");case" ":case"0":return void at.psv.toggleSequencePlaying()}let ot=0,ut=0,Hl=0,rc=0,sc=0;switch(st.keyCode){case 61:case 107:case 171:case 187:ot=1;break;case 189:case 109:case 173:ot=-1;break;case 37:case 100:st.shiftKey?ut=-1:(st.preventDefault(),rc=-1);break;case 39:case 102:st.shiftKey?ut=1:(st.preventDefault(),rc=1);break;case 38:case 104:st.shiftKey?Hl=1:(st.preventDefault(),sc=-1);break;case 40:case 98:st.shiftKey?Hl=-1:(st.preventDefault(),sc=1);break;default:return}return this._rotationDisabled&&(ut=0,Hl=0),{cameraAnimation:at=>{const oc=this._tr;at.easeTo({duration:300,easeId:"keyboardHandler",easing:at=>at*(2-at),zoom:ot?Math.round(oc.zoom)+ot*(st.shiftKey?2:1):oc.zoom,bearing:oc.bearing+ut*this._bearingStep,pitch:oc.pitch+Hl*this._pitchStep,offset:[-rc*this._panStep,-sc*this._panStep],center:oc.center},{originalEvent:st})}}}.bind(at.map.keyboard)}const cu="pnx-map-parameters";function getMapParamsFromLocalStorage(){const at=localStorage.getItem(cu);if(!at)return{};try{return JSON.parse(at)}catch(st){return console.warn("Can't read map parameters stored in localStorage",st),{}}}function saveMapParamsToLocalStorage(at){const save=()=>localStorage.setItem(cu,JSON.stringify({center:Object.fromEntries(Object.entries(at.getCenter()).map((at=>{let[st,ot]=at;return[st,ot.toFixed(7)]}))),zoom:at.getZoom().toFixed(1),background:at.getBackground(),theme:at._mapFilters.theme}));at.on("background-changed",save),at.on("filters-changed",save),at.on("moveend",save),at.on("zoomend",save),at.on("dragend",save),at.on("boxzoomend",save)}},508:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{apiFeatureToPSVNode:()=>apiFeatureToPSVNode,filterRelatedPicsLinks:()=>filterRelatedPicsLinks,getCroppedPanoData:()=>getCroppedPanoData,getExifFloat:()=>getExifFloat,getGPSPrecision:()=>getGPSPrecision,getHashTags:()=>getHashTags,getNodeCaption:()=>getNodeCaption,getSphereCorrection:()=>getSphereCorrection,hasAnnotations:()=>hasAnnotations,sortPicturesInDirection:()=>sortPicturesInDirection});var ut=ot(8407),Hl=ot(6830),rc=ot(7343);const sc=(0,rc.svgToPSVLink)(ut,"white"),oc=(0,rc.svgToPSVLink)(Hl,rc.COLORS.NEXT);function getExifFloat(at){if(!([null,void 0,""].includes(at)||"string"===typeof at&&""===at.trim())){if("number"===typeof at)return at;if("string"!==typeof at);else{if(/^-?\d+(\.\d+)?\/-?\d+(\.\d+)?$/.test(at)){const st=at.split("/").map((at=>parseFloat(at)));return st[0]/st[1]}try{return parseFloat(at)}catch(st){}}}}function getGPSPrecision(at){var st,ot,ut,Hl,rc;let sc=null;const oc=(null===at||void 0===at||null===(st=at.properties)||void 0===st?void 0:st["quality:horizontal_accuracy"])||getExifFloat(null===at||void 0===at||null===(ot=at.properties)||void 0===ot||null===(ut=ot.exif)||void 0===ut?void 0:ut["Exif.GPSInfo.GPSHPositioningError"]),_c=getExifFloat(null===at||void 0===at||null===(Hl=at.properties)||void 0===Hl||null===(rc=Hl.exif)||void 0===rc?void 0:rc["Exif.GPSInfo.GPSDOP"]);return void 0!==oc?sc=`${oc} m`:void 0!==_c&&(sc=_c<1?"ideal":_c<2?"excellent":_c<5?"good":_c<10?"moderate":_c<20?"fair":"poor"),sc}function getSphereCorrection(at){var st,ot,ut,Hl;let rc=null===(st=at.properties)||void 0===st?void 0:st["view:azimuth"];if(void 0===rc){var sc,oc;const st=getExifFloat(null===(sc=at.properties)||void 0===sc||null===(oc=sc.exif)||void 0===oc?void 0:oc["Exif.GPSInfo.GPSImgDirection"]);void 0!==st&&(rc=st)}rc=rc||0;let _c=null===(ot=at.properties)||void 0===ot?void 0:ot["pers:yaw"],wc=["Xmp.GPano.PoseHeadingDegrees","Xmp.Camera.Yaw","Exif.MpfInfo.MPFYawAngle"];if(void 0===_c)for(let gu of wc){var Sc,iu;const st=getExifFloat(null===(Sc=at.properties)||void 0===Sc||null===(iu=Sc.exif)||void 0===iu?void 0:iu[gu]);if(void 0!==st){_c=st;break}}_c=_c||0,Math.round(rc)===Math.round(_c)&&_c>0&&console.warn("Picture with UUID",at.id,"has same GPS Image direction and Yaw, could cause rendering issues");let su=null===(ut=at.properties)||void 0===ut?void 0:ut["pers:pitch"];if(wc=["Xmp.GPano.PosePitchDegrees","Xmp.Camera.Pitch","Exif.MpfInfo.MPFPitchAngle"],void 0===su)for(let gu of wc){var lu,cu;const st=getExifFloat(null===(lu=at.properties)||void 0===lu||null===(cu=lu.exif)||void 0===cu?void 0:cu[gu]);if(void 0!==st){su=st;break}}su=su||0;let uu=null===(Hl=at.properties)||void 0===Hl?void 0:Hl["pers:roll"];if(wc=["Xmp.GPano.PoseRollDegrees","Xmp.Camera.Roll","Exif.MpfInfo.MPFRollAngle"],void 0===uu)for(let gu of wc){var pu,mu;const st=getExifFloat(null===(pu=at.properties)||void 0===pu||null===(mu=pu.exif)||void 0===mu?void 0:mu[gu]);if(void 0!==st){uu=st;break}}return uu=uu||0,0!==su&&0!==uu?{pan:_c*Math.PI/180,tilt:su*Math.PI/180,roll:uu*Math.PI/180}:{}}function getCroppedPanoData(at){var st,ot;let ut;var Hl,rc;if(null!==(st=at.properties)&&void 0!==st&&st["pers:interior_orientation"]&&(null!==(Hl=at.properties["pers:interior_orientation"])&&void 0!==Hl&&Hl.visible_area&&null!==(rc=at.properties["pers:interior_orientation"])&&void 0!==rc&&rc.sensor_array_dimensions)){const st=at.properties["pers:interior_orientation"].visible_area,ot=at.properties["pers:interior_orientation"].sensor_array_dimensions;try{ut={fullWidth:parseInt(ot[0]),fullHeight:parseInt(ot[1]),croppedX:parseInt(st[0]),croppedY:parseInt(st[1]),croppedWidth:parseInt(ot[0])-parseInt(st[2])-parseInt(st[0]),croppedHeight:parseInt(ot[1])-parseInt(st[3])-parseInt(st[1])}}catch(su){console.warn("Invalid pers:interior_orientation values for cropped panorama "+at.id)}}if(!ut&&null!==(ot=at.properties)&&void 0!==ot&&ot.exif)try{var sc,oc,_c,wc,Sc,iu;ut={fullWidth:parseInt(null===(sc=at.properties.exif)||void 0===sc?void 0:sc["Xmp.GPano.FullPanoWidthPixels"]),fullHeight:parseInt(null===(oc=at.properties.exif)||void 0===oc?void 0:oc["Xmp.GPano.FullPanoHeightPixels"]),croppedX:parseInt(null===(_c=at.properties.exif)||void 0===_c?void 0:_c["Xmp.GPano.CroppedAreaLeftPixels"]),croppedY:parseInt(null===(wc=at.properties.exif)||void 0===wc?void 0:wc["Xmp.GPano.CroppedAreaTopPixels"]),croppedWidth:parseInt(null===(Sc=at.properties.exif)||void 0===Sc?void 0:Sc["Xmp.GPano.CroppedAreaImageWidthPixels"]),croppedHeight:parseInt(null===(iu=at.properties.exif)||void 0===iu?void 0:iu["Xmp.GPano.CroppedAreaImageHeightPixels"])}}catch(su){console.warn("Invalid XMP.GPano values for cropped panorama "+at.id)}return ut&&(ut=Object.fromEntries(Object.entries(ut||{}).filter((at=>!isNaN(at[1])))),(!ut.fullWidth&&!ut.croppedWidth&&ut.fullHeight&&!ut.croppedHeight||ut.fullWidth&&!ut.croppedWidth&&!ut.fullHeight&&!ut.croppedHeight||ut.fullWidth&&!ut.croppedWidth&&ut.fullHeight&&!ut.croppedHeight||ut.fullWidth==ut.croppedWidth&&ut.fullHeight==ut.croppedHeight)&&(ut={})),ut||{}}function sortPicturesInDirection(at){return(st,ot)=>"related"!=st.rel&&"related"!=ot.rel?0:"related"!=st.rel?-1:"related"!=ot.rel?1:st.date==ot.date?(0,rc.getDistance)(at,st.geometry.coordinates)-(0,rc.getDistance)(at,ot.geometry.coordinates):ot.date.localeCompare(st.date)}function getNodeCaption(at,st){var ot,ut,Hl;const rc={};if(null!==at&&void 0!==at&&null!==(ot=at.properties)&&void 0!==ot&&ot.datetimetz){rc.date=new Date(at.properties.datetimetz);const st=at.properties.datetimetz.match(/([+-]\d{2}):(\d{2})$|Z$/);st&&("Z"===st[0]?rc.tz="UTC":rc.tz=st[0])}else null!==at&&void 0!==at&&null!==(ut=at.properties)&&void 0!==ut&&ut.datetime&&(rc.date=new Date(at.properties.datetime));if(null!==at&&void 0!==at&&at.providers){var sc;const st=null===at||void 0===at||null===(sc=at.providers)||void 0===sc?void 0:sc.filter((at=>{var st;return null===at||void 0===at||null===(st=at.roles)||void 0===st?void 0:st.includes("producer")}));if((null===st||void 0===st?void 0:st.length)>=0){const at={};st.map((at=>at.name)).forEach((st=>{const ot=st.toLowerCase().replace(/\s/g,"");at[ot]?at[ot].push(st):at[ot]=[st]})),rc.producer=[],Object.values(at).forEach((at=>{const st=at[0],ot=at.find((at=>at.toLowerCase()!=at));rc.producer.push(ot||st)}))}}if(null!==at&&void 0!==at&&null!==(Hl=at.properties)&&void 0!==Hl&&Hl.license&&(rc.license=at.properties.license,null!==at&&void 0!==at&&at.links)){const ot=at.links.find((at=>"license"===(null===at||void 0===at?void 0:at.rel)));ot&&(rc.license=`<a href="${ot.href}" title="${st.pnx.metadata_general_license_link}" target="_blank">${rc.license}</a>`)}return rc}function apiFeatureToPSVNode(at,st){var ot,ut,Hl,rc,sc,oc,_c,wc,Sc,iu,su,lu,cu,uu;let pu=arguments.length>2&&void 0!==arguments[2]&&arguments[2],mu=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const gu=null!=(null===(ot=at.properties)||void 0===ot||null===(ut=ot["pers:interior_orientation"])||void 0===ut?void 0:ut.field_of_view);let Au=gu?parseInt(at.properties["pers:interior_orientation"].field_of_view):70;const yu=360===Au,_u=(Object.values(at.assets).find((at=>{var st;return null===at||void 0===at||null===(st=at.roles)||void 0===st?void 0:st.includes("data")}))||{}).href,xu=null===at||void 0===at||null===(Hl=at.properties)||void 0===Hl||null===(rc=Hl["tiles:tile_matrix_sets"])||void 0===rc?void 0:rc.geovisio,Su=null===(sc=at.links)||void 0===sc||null===(oc=sc.find)||void 0===oc?void 0:oc.call(sc,(at=>"prev"===(null===at||void 0===at?void 0:at.rel)&&"application/geo+json"===(null===at||void 0===at?void 0:at.type))),Du=null===(_c=at.links)||void 0===_c||null===(wc=_c.find)||void 0===wc?void 0:wc.call(_c,(at=>"next"===(null===at||void 0===at?void 0:at.rel)&&"application/geo+json"===(null===at||void 0===at?void 0:at.type))),Lu=Object.values(at.assets).find((at=>{var st;return(null===(st=at.roles)||void 0===st?void 0:st.includes("visual"))&&"image/webp"===at.type})),$u=Object.values(at.assets).find((at=>{var st;return(null===(st=at.roles)||void 0===st?void 0:st.includes("visual"))&&"image/jpeg"===at.type})),hh=(Lu||$u).href,ed=null===(Sc=Object.values(at.assets).find((at=>{var st;return(null===(st=at.roles)||void 0===st?void 0:st.includes("thumbnail"))&&"image/jpeg"===at.type})))||void 0===Sc?void 0:Sc.href,td=(null===at||void 0===at||null===(iu=at.asset_templates)||void 0===iu?void 0:iu.tiles_webp)||(null===at||void 0===at||null===(su=at.asset_templates)||void 0===su?void 0:su.tiles),id=getCroppedPanoData(at),nd=null===(lu=at.links)||void 0===lu||null===(cu=lu.find)||void 0===cu?void 0:cu.call(lu,(at=>"via"===(null===at||void 0===at?void 0:at.rel)&&"application/json"===(null===at||void 0===at?void 0:at.type)));let rd;rd=Object.keys(id).length>0?{baseUrl:pu?_u:hh,origBaseUrl:pu?_u:hh,hdUrl:_u,thumbUrl:ed,basePanoData:id,cols:2,rows:1,width:2,tileUrl:()=>null}:yu&&xu?{baseUrl:hh,origBaseUrl:hh,basePanoData:at=>({fullWidth:at.width,fullHeight:at.height}),hdUrl:_u,thumbUrl:ed,cols:xu&&xu.tileMatrix[0].matrixWidth,rows:xu&&xu.tileMatrix[0].matrixHeight,width:xu&&xu.tileMatrix[0].matrixWidth*xu.tileMatrix[0].tileWidth,tileUrl:xu&&((at,st)=>td.href.replace(/\{TileCol\}/g,at).replace(/\{TileRow\}/g,st))}:{baseUrl:pu?_u:hh,origBaseUrl:pu?_u:hh,hdUrl:_u,thumbUrl:ed,basePanoData:at=>{at.width<at.height&&!gu&&(Au=35);const st=Au*at.height/at.width,ot=360*at.width/Au,ut=180*at.height/st;return{fullWidth:ot,fullHeight:ut,croppedWidth:at.width,croppedHeight:at.height,croppedX:(ot-at.width)/2,croppedY:(ut-at.height)/2}},cols:2,rows:1,width:2,tileUrl:()=>null},null!==(uu=at.properties)&&void 0!==uu&&uu.semantics&&(at.properties.semantics=at.properties.semantics.filter((at=>Object.keys(at).length>0)));return{id:at.id,caption:getNodeCaption(at,st),panorama:rd,links:filterRelatedPicsLinks(at,mu),gps:at.geometry.coordinates,sequence:{id:at.collection,nextPic:Du?Du.id:void 0,prevPic:Su?Su.id:void 0},sphereCorrection:getSphereCorrection(at),horizontalFov:Au,origInstance:nd,properties:at.properties}}function filterRelatedPicsLinks(at){var st;let ot=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const ut=at.links.filter((at=>["next","prev","related"].includes(null===at||void 0===at?void 0:at.rel)&&"application/geo+json"===(null===at||void 0===at?void 0:at.type))).filter((at=>!ot||ot(at))).map((at=>(at.datetime&&(at.date=at.datetime.split("T")[0]),at))),Hl=at.geometry.coordinates,_c=[],wc={N:[],ENE:[],ESE:[],S:[],WSW:[],WNW:[]};for(let sc of ut){wc[(0,rc.getSimplifiedAngle)(Hl,sc.geometry.coordinates)].push(sc)}for(let rc in wc){const at=wc[rc];0!=at.length&&(at.sort(sortPicturesInDirection(Hl)),_c.push(at.shift()))}let arrowStyle=at=>"related"===at.rel?{element:(0,rc.getArrow)(oc),size:{width:128/3,height:128}}:{element:(0,rc.getArrow)(sc),size:{width:75,height:75}};const Sc=-((null===(st=at.properties)||void 0===st?void 0:st["view:azimuth"])||0)*(Math.PI/180);return _c.map((at=>({nodeId:at.id,gps:at.geometry.coordinates,arrowStyle:arrowStyle(at),linkOffset:{yaw:Sc}})))}function getHashTags(at){var st;if(null===at||void 0===at||null===(st=at.properties)||void 0===st||!st.semantics)return[];const ot=at.properties.semantics.filter((at=>"hashtags"===at.key)),ut=[];return ot.forEach((at=>at.value.split(";").forEach((at=>ut.push(at.trim()))))),ut}function hasAnnotations(at){var st,ot;return(null===at||void 0===at||null===(st=at.properties)||void 0===st||null===(ot=st.annotations)||void 0===ot?void 0:ot.length)>0}},2283:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{decodeBasicTag:()=>decodeBasicTag,decodeKey:()=>decodeKey,groupByPrefix:()=>groupByPrefix});var ut=ot(4542),Hl=ot(5995),rc=ot(7929),sc=ot(1760),oc=ot(7091),_c=ot(7208);function valToValLink(at,st,ot){return ut.qy`
|
|
2385
2385
|
${at}
|
|
2386
2386
|
<pnx-link-button
|
|
2387
2387
|
kind="superinline"
|