@panoramax/web-viewer 4.0.3-develop-85c1e9c4 → 4.0.3-develop-001b0de1
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/CHANGELOG.md +1 -0
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/photo.html +1 -1
- package/build/viewer.html +1 -1
- package/docs/reference/utils/URLHandler.md +7 -0
- package/package.json +1 -1
- package/public/photo.html +1 -1
- package/public/viewer.html +1 -1
- package/src/components/core/CoverageMap.js +6 -0
- package/src/components/core/Editor.js +7 -0
- package/src/components/core/PhotoViewer.js +7 -0
- package/src/components/core/Viewer.js +6 -0
- package/src/utils/URLHandler.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -25,6 +25,7 @@ Before _2.0.0_, Viewer was embed in the [API repository](https://gitlab.com/pano
|
|
|
25
25
|
|
|
26
26
|
- Map filters were not correctly applied after user change.
|
|
27
27
|
- Pause button & keyboard shortcut was not always properly working.
|
|
28
|
+
- Listeners of global events remained after disconnect of components.
|
|
28
29
|
|
|
29
30
|
## [4.0.3] - 2025-05-23
|
|
30
31
|
|
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} (85c1e9c)\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()}))}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()}))}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))}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"})))}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} (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`
|
|
13
13
|
<div
|
|
14
14
|
class=${(0,Hl.H)(at)}
|
|
15
15
|
@touchstart="${this._onTouchStart}"
|
|
@@ -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))))}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),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"
|