@panoramax/web-viewer 4.0.2-develop-4d3bf829 → 4.0.2-develop-682e2a36
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
CHANGED
|
@@ -17,6 +17,10 @@ Before _2.0.0_, Viewer was embed in the [API repository](https://gitlab.com/pano
|
|
|
17
17
|
- The address search bar can now be configured to use any other [GeocodeJSON-compliant](https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md) search API. This setting can be passed through `geocoder` attribute of the viewer.
|
|
18
18
|
- Shown results in address search bar are more finely tuned, and may be more appropriate in more cases.
|
|
19
19
|
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Date and time were not properly translated in user language.
|
|
23
|
+
|
|
20
24
|
## [4.0.2] - 2025-05-13
|
|
21
25
|
|
|
22
26
|
### Added
|
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(Qe,rt){"object"===typeof exports&&"object"===typeof module?module.exports=rt():"function"===typeof define&&define.amd?define("Panoramax",[],rt):"object"===typeof exports?exports.Panoramax=rt():Qe.Panoramax=rt()}(this,(()=>(()=>{var Qe={9039:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Basic});var Co=Wn(4542),Dl=Wn(5254),Ll=Wn(4964),Rl=Wn(8340),Ul=Wn(5995),Gl=Wn(7343),Zl=Wn(2614),Hl=Wn.n(Zl),ql=Wn(8330);Wn(1865),Wn(3638);class Basic extends Co.WF{constructor(){let Qe=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this.mapstyle=this.getAttribute("mapstyle")||Rl.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 ${ql.rE} (4d3bf82)\n\n\ud83c\udd98 Issues can be reported at ${ql.Jk.O}`),Qe||(this._isInternetFast=null,(0,Gl.isInternetFast)().then((Qe=>this._isInternetFast=Qe)))}connectedCallback(){super.connectedCallback(),this._t=(0,Ll.getTranslations)(this.lang),this.loader=(0,Ul.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,Gl.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,Ul.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let Qe=this.endpoint;try{this.mapstyle=JSON.parse(this.mapstyle)}catch(Wn){}try{this.api=new Dl.A(this.endpoint,{users:this.users,fetch:this.fetchOptions,style:this.mapstyle}),this.api.onceReady().then((()=>{if(Qe!=this._loadsAPI||!this.api)return;let rt=this.api.getUnavailableFeatures(),Wn=this.api.getAvailableFeatures();Wn=0===rt.length?"\u2705 All features available":"\u2705 Available features: "+Wn.join(", "),rt=0===rt.length?"":"\ud83d\udeab Unavailable features: "+rt.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 ${Wn}\n ${rt}\n`.trim())})).catch((Qe=>this.loader.dismiss(Qe,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(Wn){var rt;delete this._loadsAPI,null!==(rt=this.loader)&&void 0!==rt&&rt.dismiss?this.loader.dismiss(Wn,this._t.pnx.error_api):console.error(Wn)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(Qe,rt,Wn){if(super.attributeChangedCallback(Qe,rt,Wn),"endpoint"===Qe&&(this._loadsAPI&&Wn&&this._loadsAPI===Wn||this.api&&this.api._endpoint===Wn||!Wn||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(Qe)){let Co,Dl,Ll,Rl;"picture"===Qe?(Co=this.sequence,Ll=this.sequence,Dl=Wn,Rl=rt):(Co=Wn,Ll=rt,Dl=this.picture,Rl=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:Co,picId:Dl,prevSeqId:Ll,prevPicId:Rl}}))}}getClassName(){return"Basic"}select(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,rt=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=rt,this.sequence=Qe}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 Co.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(Qe,rt,Wn){let Co=Qe.split(":").shift();if(Co&&this.getSubComponentsNames().includes(Co)){var Dl;const Ll=Qe.substring(Co.length+1);null!==(Dl=this[Co])&&void 0!==Dl&&Dl.addEventListener?this[Co].addEventListener(Ll,rt,Wn):setTimeout((()=>this.addEventListener(Qe,rt,Wn)),50)}else super.addEventListener(Qe,rt,Wn)}static GetJSONConverter(){return{fromAttribute:Qe=>"object"===typeof Qe?Qe:Hl().parse(Qe),toAttribute:Qe=>JSON.stringify(Qe)}}}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:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>CoverageMap});var Co=Wn(9039),Dl=Wn(5642),Ll=Wn(8340),Rl=Wn(927),Ul=(Wn(7776),Wn(2118));class CoverageMap extends Co.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new Ul.Ay(Ul.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const Qe=super.getSubComponentsNames();return Qe.push("map"),Qe}_initMap(){class MyMap extends Dl.A{_getLayerStyleProperties(Qe){return"pictures_symbols"===Qe?{layout:{visibility:"none"}}:super._getLayerStyleProperties(Qe)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new Rl.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(Qe=>this.select(Qe.seqId,Qe.picId))),this.map.on("sequence-click",(Qe=>this.select(Qe.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,Ul.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(Qe){if(Qe.detail.picId||Qe.detail.seqId){const rt=Qe.detail.picId?"pictures":"sequences",Wn=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((Qe=>(0,Ll.getUserLayerId)(Qe,rt))),filter:["==",["get","id"],Qe.detail.picId||Qe.detail.seqId]});Wn.length>=0&&null!=Wn[0]&&this.map._attachPreviewToPictures({features:Wn},rt)}}}CoverageMap.properties={map:{converter:Co.A.GetJSONConverter()},...Co.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Editor});Wn(7365);var Co=Wn(9039),Dl=Wn(5642),Ll=Wn(9048),Rl=(Wn(7534),Wn(6810),Wn(508)),Ul=Wn(8340),Gl=Wn(1545),Zl=(Wn(4542),Wn(5995));const Hl="sequence-headings";class Editor extends Co.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 Qe,rt;return this.map&&this.psv&&null!==(Qe=(rt=this.map).loaded)&&void 0!==Qe&&Qe.call(rt)?Promise.resolve():new Promise((Qe=>setTimeout(Qe,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(Qe,rt,Wn){"users"===Qe&&Array.isArray(Wn)&&Wn.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(Qe,rt,Wn)}render(){return[this.loader,this._psvContainer,this._mapContainer]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv"])}_initPSV(){try{this.psv=new Ll.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(Qe){let rt=Gl.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(Qe,rt)}}_initMap(){try{this.map=new Dl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15}),(0,Ul.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const Qe=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=rt=>(rt=void 0===this._lastRelHeading?rt:rt+this._lastRelHeading-this.psv.getPictureRelativeHeading(),Qe(rt))}catch(Qe){this.loader.dismiss(Qe,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:{...Ul.VECTOR_STYLES.SEQUENCES.layout},paint:{...Ul.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...Ul.VECTOR_STYLES.PICTURES.layout},paint:{...Ul.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((Qe=>{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=Qe.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:Qe.features.map((Qe=>Qe.geometry.coordinates))}},...Qe.features.map((Qe=>(Qe.properties.id=Qe.id,Qe.properties.sequences=[this.sequence],Qe)))]}),this.picture){const rt=Qe.features.find((Qe=>Qe.id===this.picture));rt?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:rt.geometry.coordinates,zoom:18})):console.log("Picture with ID",rt,"was not found")}else{const rt=[...Qe.features[0].geometry.coordinates,...Qe.features[0].geometry.coordinates];for(let Wn=1;Wn<Qe.features.length;Wn++){const Co=Qe.features[Wn].geometry.coordinates;Co[0]<rt[0]&&(rt[0]=Co[0]),Co[1]<rt[1]&&(rt[1]=Co[1]),Co[0]>rt[2]&&(rt[2]=Co[0]),Co[1]>rt[3]&&(rt[3]=Co[1])}this.map.fitBounds(rt,{animate:!1})}})).catch((Qe=>this.loader.dismiss(Qe,this._t.pnx.error_api)))}_getNode(Qe){const rt=this._sequenceData.find((rt=>rt.properties.id===Qe)),Wn=rt?(0,Rl.apiFeatureToPSVNode)(rt,this._t,this._isInternetFast):null;return Wn&&delete Wn.links,Wn}_addMapBackgroundWidget(){const Qe=(0,Zl.createWebComp)("pnx-map-background",{_parent:this,size:"sm"});this._mapContainer.appendChild(Qe)}previewSequenceHeadingChange(Qe){const rt=void 0!==this.map.getLayer(Hl);if(this.map._picMarkerPreview.remove(),void 0===Qe)return delete this._lastRelHeading,rt&&this.map.setLayoutProperty(Hl,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=Qe,rt||this.map.addLayer({id:Hl,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const Wn=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Hl,"visibility","visible"),this.map.setLayoutProperty(Hl,"icon-rotate",["+",["get","view:azimuth"],Wn,Qe]);const Co=[["==",["geometry-type"],"Point"]];this.picture&&Co.push(["!=",["get","id"],this.picture]),this.map.setFilter(Hl,["all",...Co]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{converter:Co.A.GetJSONConverter()},background:{type:String},...Co.A.properties},customElements.define("pnx-editor",Editor)},3407:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PhotoViewer});Wn(970);var Co=Wn(1545),Dl=Wn(4451),Ll=Wn(9039),Rl=Wn(9048),Ul=Wn(5995),Gl=Wn(7343),Zl=Wn(2118),Hl=Wn(4207);const ql=Math.PI/6;class PhotoViewer extends Ll.A{constructor(){super(),this.psv={},this["url-parameters"]=this.getAttribute("url-parameters")||!0,this.widgets=this.getAttribute("widgets")||"true",this.grid=(0,Ul.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,Ul.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)})}_createInitParamsHandler(){var Qe,rt;this._initParams=new Zl.Ay(Zl.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(Qe=this.urlHandler)||void 0===Qe?void 0:Qe.currentURLParams(),null===(rt=this.urlHandler)||void 0===rt?void 0:rt.currentURLParams(!0)),{})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,Ul.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,Ul.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,Ul.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",(Qe=>{(0,Gl.isNullId)(Qe.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,Ul.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,Ul.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend),this.grid.appendChild((0,Ul.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))))}connectedCallback(){super.connectedCallback(),this.presetsManager=new Hl.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new Dl.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 Qe;return new Promise((rt=>{Qe=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(Qe),rt()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(Qe),rt()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((Qe=>{this.psv.addEventListener("picture-loaded",Qe,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const Qe=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,Zl.ai)(this,Qe),this._handleKeyboardManagement(),Qe.picture?this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new Rl.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...Co.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,Zl.Vy)(this.psv,this._initParams.getPSVPostInit())}))}catch(Qe){let rt=Co.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(Qe,rt)}}_handleKeyboardManagement(){const keytonone=()=>this.psv.stopKeyboardControl(),keytopsv=()=>this.psv.startKeyboardControl();this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytopsv()));for(let Qe of this.grid.childNodes)"bg"!==Qe.getAttribute("slot")&&(Qe.addEventListener("focusin",(()=>keytonone())),Qe.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytopsv()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((Qe=>{var rt;null!==(rt=Qe.tagName)&&void 0!==rt&&rt.toLowerCase().startsWith("pnx-")&&(Qe._parent=this,Qe._t=this._t),"editors"===Qe.getAttribute("slot")?this.onceReady().then((()=>{var rt;return null===(rt=this.legend)||void 0===rt?void 0:rt.appendChild(Qe)})):this.grid.appendChild(Qe)}))}setPopup(Qe){let rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Qe?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof rt?this.popup.innerHTML=rt:Array.isArray(rt)&&rt.forEach((Qe=>this.popup.appendChild(Qe)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,Ul.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,Ul.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,Ul.createWebComp)("pnx-share-menu",{_parent:this})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:Rl.LM,yaw:0,pitch:0,zoom:Rl.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(Qe){let rt=this.psv.getPosition();switch(Qe){case"up":rt.pitch+=ql;break;case"left":rt.yaw-=ql;break;case"down":rt.pitch-=ql;break;case"right":rt.yaw+=ql}this._psvAnimate({speed:Rl.LM,...rt})}_psvAnimate(Qe){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(Qe)}addEventListener(Qe,rt,Wn){super.addEventListener(Qe,rt,Wn)}}PhotoViewer.properties={psv:{converter:Ll.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},...Ll.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{$:()=>Ql,A:()=>Viewer});Wn(9616);var Co=Wn(8340),Dl=Wn(3407),Ll=(Wn(9039),Wn(2771)),Rl=Wn(7343),Ul=Wn(5995),Gl=Wn(9683),Zl=Wn(2e3),Hl=Wn(9438),ql=Wn(2118);const Ql=20,Kl=(Math.PI,100);class Viewer extends Dl.A{constructor(){super(),this.map=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,Ul.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,Rl.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 Qe,rt;this._initParams=new ql.Ay(ql.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(Qe=this.urlHandler)||void 0===Qe?void 0:Qe.currentURLParams(),null===(rt=this.urlHandler)||void 0===rt?void 0:rt.currentURLParams(!0)),{map:(0,Co.getMapParamsFromLocalStorage)()})}_initWidgets(){var Qe,rt;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,Ul.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,Ul.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,Ul.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",(Qe=>{(0,Rl.isNullId)(Qe.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,Ul.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,Ul.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,Ul.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,Ul.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===(Qe=this.map)||void 0===Qe||null===(rt=Qe._hasQualityScore)||void 0===rt?void 0:rt.call(Qe))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,Ul.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(Qe,rt,Wn){var Co,Dl,Ll,Ul;(super.attributeChangedCallback(Qe,rt,Wn),"picture"===Qe)&&(null===(Co=this.legend)||void 0===Co||null===(Dl=Co.setAttribute)||void 0===Dl||Dl.call(Co,"picture",Wn),(0,Rl.isNullId)(rt)&&!(0,Rl.isNullId)(Wn)&&this.mini.removeAttribute("collapsed"),(0,Rl.isNullId)(Wn)?this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map"):(this.mini.classList.remove("pnx-hidden"),(0,Rl.isNullId)(rt)&&(this._setFocus("pic"),"closed"===(null===(Ll=this.bottomDrawer)||void 0===Ll||null===(Ul=Ll.getAttribute)||void 0===Ul?void 0:Ul.call(Ll,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened"))));"focus"===Qe&&this._setFocus(Wn)}onceMapReady(){if(!this.map)return Promise.resolve();let Qe;return new Promise((rt=>{Qe=setInterval((()=>{var Wn,Co,Dl;"object"===typeof this.map&&(null!==(Wn=this.map)&&void 0!==Wn&&null!==(Co=Wn.loaded)&&void 0!==Co&&Co.call(Wn)?(clearInterval(Qe),rt()):null!==(Dl=this.map)&&void 0!==Dl&&Dl.once&&this.map.once("render",(()=>{clearInterval(Qe),rt()})))}),250)}))}async _initMap(){await new Promise((Qe=>{this.map=new Ll.A(this,this.mapContainer,this._initParams.getMapInit()),(0,Co.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),Qe()}))})),await(0,ql.mK)(this.map,this._initParams.getMapPostInit()),(0,Co.initMapKeyboardHandler)(this),(0,Co.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const Qe=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,ql.iz)(this,Qe),this._handleKeyboardManagement(),Qe.picture?this.psv.addEventListener("picture-loaded",(()=>{(0,ql.iz)(this,Qe),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",(Qe=>{"map"===Qe.detail.focus&&keytomap(),this.popup.getAttribute("visible")?keytonone():keytopsv()})),this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytofocused()));for(let Qe of this.grid.childNodes)"bg"!==Qe.getAttribute("slot")&&(Qe.addEventListener("focusin",(()=>keytonone())),Qe.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytofocused()})))}moveCenter(){const Qe=this.psv.getPictureMetadata();Qe&&(this.map&&this.isMapWide()?this.map.flyTo({center:Qe.gps,zoom:20}):super.moveCenter())}_moveToDirection(Qe){if(this.map&&this.isMapWide()){let rt;switch(Qe){case"up":rt=[0,-100];break;case"left":rt=[-100,0];break;case"down":rt=[0,Kl];break;case"right":rt=[Kl,0]}this.map.panBy(rt)}else super._moveToDirection(Qe)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(Qe){var rt,Wn,Co,Dl;let Ll=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Hl=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===Qe&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(Qe))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=Qe,(Hl||("map"!==Qe||!this.map||!this.isMapWide())&&("pic"!==Qe||this.map&&this.isMapWide()))&&("map"===Qe?(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,Ul.fa)(Gl.pt),(0,Rl.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,Ul.fa)(Zl.e5),this.psvContainer.focus()),null===this||void 0===this||null===(rt=this.map)||void 0===rt||null===(Wn=rt.resize)||void 0===Wn||Wn.call(rt),this.psv.autoSize(),this.psv.forceRefresh(),null===(Co=this.legend)||void 0===Co||null===(Dl=Co.setAttribute)||void 0===Dl||Dl.call(Co,"focus",this.focus),!Ll)){const rt=new CustomEvent("focus-changed",{detail:{focus:Qe}});this.dispatchEvent(rt)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var Qe;const rt=(0,Hl.qi)("#pnx-map-filters-menu"),Wn=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-date-from"),Co=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-date-end"),Dl=null===rt||void 0===rt?void 0:rt.shadowRoot.querySelectorAll("input[name='pnx-filter-type']"),Ll=(0,Hl.qi)("#pnx-map-theme");let Rl="";for(let Zl=0;Zl<Dl.length;Zl++){const Qe=Dl[Zl];if(Qe.checked){Rl=Qe.value;break}}let Ul=[];if(null!==(Qe=this.map)&&void 0!==Qe&&Qe._hasQualityScore()){const Qe=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-qualityscore");Ul=((null===Qe||void 0===Qe?void 0:Qe.grade)||"").split(",").map((Qe=>parseInt(Qe))).filter((Qe=>!isNaN(Qe))),5==Ul.length&&(Ul=[])}const Gl={minDate:null===Wn||void 0===Wn?void 0:Wn.value,maxDate:null===Co||void 0===Co?void 0:Co.value,pic_type:Rl,theme:null===Ll||void 0===Ll?void 0:Ll.value,qualityscore:Ul};this.map.setFilters(Gl)}}Viewer.properties={map:{converter:Dl.A.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},...Dl.A.properties},customElements.define("pnx-viewer",Viewer)},3921:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{Basic:()=>Co.A,CoverageMap:()=>Dl.A,Editor:()=>Ll.A,PhotoViewer:()=>Ul.A,Viewer:()=>Rl.A});var Co=Wn(9039),Dl=Wn(153),Ll=Wn(1752),Rl=Wn(8743),Ul=Wn(3407)},9341:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{core:()=>Co,layout:()=>Dl,menus:()=>Ll,ui:()=>Rl});var Co=Wn(3921),Dl=Wn(456),Ll=Wn(8794),Rl=Wn(9472)},6784:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>BottomDrawer});var Co=Wn(4542),Dl=Wn(1198);const Ll={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends Co.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){var Qe;super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const rt=this._getDrawer();rt&&(rt.style.height=`${this._drawerHeight}px`,rt.style.maxHeight=`${this._drawerHeight}px`,null===(Qe=this._parent)||void 0===Qe||Qe.onceReady().then((()=>{var Qe,rt;null===(Qe=this._parent.map)||void 0===Qe||Qe.addEventListener("click",(()=>this.openness="closed")),null===(rt=this._parent.psv)||void 0===rt||rt.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(Qe,rt,Wn){if(super.attributeChangedCallback(Qe,rt,Wn),"openness"===Qe){if("opened"!==Wn){const Qe=this.shadowRoot.querySelector(".content");Qe&&(Qe.scrollTop=0)}const Qe=this._getDrawer();Qe&&(Qe.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var Qe;return null===(Qe=this.shadowRoot)||void 0===Qe?void 0:Qe.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(Qe){this._isDragging=!0,this._startFingerY=Qe.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*Ll[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(Qe){if(!this._isDragging)return;const rt=this.shadowRoot.querySelector(".content");rt.scrollHeight>rt.offsetHeight&&rt.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=Qe.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(Qe){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||Qe.target.closest(".handle"))&&(Qe.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(Qe){let rt=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const Wn=this._getDrawer();Wn&&(Qe=Math.max(0,Math.min(Qe,this._drawerHeight-30)),rt&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-Ll["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,Qe=Math.max(0,Math.min(Ll[this.openness]*this._drawerHeight,this._drawerHeight-30))),Wn.style.transform=`translateY(${Qe}px)`)}render(){const Qe={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return Co.qy`
|
|
12
|
+
!function(Qe,rt){"object"===typeof exports&&"object"===typeof module?module.exports=rt():"function"===typeof define&&define.amd?define("Panoramax",[],rt):"object"===typeof exports?exports.Panoramax=rt():Qe.Panoramax=rt()}(this,(()=>(()=>{var Qe={9039:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Basic});var Co=Wn(4542),Dl=Wn(5254),Ll=Wn(4964),Rl=Wn(8340),Ul=Wn(5995),Gl=Wn(7343),Zl=Wn(2614),Hl=Wn.n(Zl),ql=Wn(8330);Wn(1865),Wn(3638);class Basic extends Co.WF{constructor(){let Qe=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this.mapstyle=this.getAttribute("mapstyle")||Rl.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 ${ql.rE} (682e2a3)\n\n\ud83c\udd98 Issues can be reported at ${ql.Jk.O}`),Qe||(this._isInternetFast=null,(0,Gl.isInternetFast)().then((Qe=>this._isInternetFast=Qe)))}connectedCallback(){super.connectedCallback(),this._t=(0,Ll.getTranslations)(this.lang),this.loader=(0,Ul.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,Gl.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,Ul.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let Qe=this.endpoint;try{this.mapstyle=JSON.parse(this.mapstyle)}catch(Wn){}try{this.api=new Dl.A(this.endpoint,{users:this.users,fetch:this.fetchOptions,style:this.mapstyle}),this.api.onceReady().then((()=>{if(Qe!=this._loadsAPI||!this.api)return;let rt=this.api.getUnavailableFeatures(),Wn=this.api.getAvailableFeatures();Wn=0===rt.length?"\u2705 All features available":"\u2705 Available features: "+Wn.join(", "),rt=0===rt.length?"":"\ud83d\udeab Unavailable features: "+rt.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 ${Wn}\n ${rt}\n`.trim())})).catch((Qe=>this.loader.dismiss(Qe,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(Wn){var rt;delete this._loadsAPI,null!==(rt=this.loader)&&void 0!==rt&&rt.dismiss?this.loader.dismiss(Wn,this._t.pnx.error_api):console.error(Wn)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(Qe,rt,Wn){if(super.attributeChangedCallback(Qe,rt,Wn),"endpoint"===Qe&&(this._loadsAPI&&Wn&&this._loadsAPI===Wn||this.api&&this.api._endpoint===Wn||!Wn||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(Qe)){let Co,Dl,Ll,Rl;"picture"===Qe?(Co=this.sequence,Ll=this.sequence,Dl=Wn,Rl=rt):(Co=Wn,Ll=rt,Dl=this.picture,Rl=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:Co,picId:Dl,prevSeqId:Ll,prevPicId:Rl}}))}}getClassName(){return"Basic"}select(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,rt=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=rt,this.sequence=Qe}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 Co.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(Qe,rt,Wn){let Co=Qe.split(":").shift();if(Co&&this.getSubComponentsNames().includes(Co)){var Dl;const Ll=Qe.substring(Co.length+1);null!==(Dl=this[Co])&&void 0!==Dl&&Dl.addEventListener?this[Co].addEventListener(Ll,rt,Wn):setTimeout((()=>this.addEventListener(Qe,rt,Wn)),50)}else super.addEventListener(Qe,rt,Wn)}static GetJSONConverter(){return{fromAttribute:Qe=>"object"===typeof Qe?Qe:Hl().parse(Qe),toAttribute:Qe=>JSON.stringify(Qe)}}}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:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>CoverageMap});var Co=Wn(9039),Dl=Wn(5642),Ll=Wn(8340),Rl=Wn(927),Ul=(Wn(7776),Wn(2118));class CoverageMap extends Co.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new Ul.Ay(Ul.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const Qe=super.getSubComponentsNames();return Qe.push("map"),Qe}_initMap(){class MyMap extends Dl.A{_getLayerStyleProperties(Qe){return"pictures_symbols"===Qe?{layout:{visibility:"none"}}:super._getLayerStyleProperties(Qe)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new Rl.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(Qe=>this.select(Qe.seqId,Qe.picId))),this.map.on("sequence-click",(Qe=>this.select(Qe.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,Ul.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(Qe){if(Qe.detail.picId||Qe.detail.seqId){const rt=Qe.detail.picId?"pictures":"sequences",Wn=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((Qe=>(0,Ll.getUserLayerId)(Qe,rt))),filter:["==",["get","id"],Qe.detail.picId||Qe.detail.seqId]});Wn.length>=0&&null!=Wn[0]&&this.map._attachPreviewToPictures({features:Wn},rt)}}}CoverageMap.properties={map:{converter:Co.A.GetJSONConverter()},...Co.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Editor});Wn(7365);var Co=Wn(9039),Dl=Wn(5642),Ll=Wn(9048),Rl=(Wn(7534),Wn(6810),Wn(508)),Ul=Wn(8340),Gl=Wn(1545),Zl=(Wn(4542),Wn(5995));const Hl="sequence-headings";class Editor extends Co.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 Qe,rt;return this.map&&this.psv&&null!==(Qe=(rt=this.map).loaded)&&void 0!==Qe&&Qe.call(rt)?Promise.resolve():new Promise((Qe=>setTimeout(Qe,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(Qe,rt,Wn){"users"===Qe&&Array.isArray(Wn)&&Wn.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(Qe,rt,Wn)}render(){return[this.loader,this._psvContainer,this._mapContainer]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv"])}_initPSV(){try{this.psv=new Ll.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(Qe){let rt=Gl.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(Qe,rt)}}_initMap(){try{this.map=new Dl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15}),(0,Ul.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const Qe=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=rt=>(rt=void 0===this._lastRelHeading?rt:rt+this._lastRelHeading-this.psv.getPictureRelativeHeading(),Qe(rt))}catch(Qe){this.loader.dismiss(Qe,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:{...Ul.VECTOR_STYLES.SEQUENCES.layout},paint:{...Ul.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...Ul.VECTOR_STYLES.PICTURES.layout},paint:{...Ul.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((Qe=>{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=Qe.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:Qe.features.map((Qe=>Qe.geometry.coordinates))}},...Qe.features.map((Qe=>(Qe.properties.id=Qe.id,Qe.properties.sequences=[this.sequence],Qe)))]}),this.picture){const rt=Qe.features.find((Qe=>Qe.id===this.picture));rt?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:rt.geometry.coordinates,zoom:18})):console.log("Picture with ID",rt,"was not found")}else{const rt=[...Qe.features[0].geometry.coordinates,...Qe.features[0].geometry.coordinates];for(let Wn=1;Wn<Qe.features.length;Wn++){const Co=Qe.features[Wn].geometry.coordinates;Co[0]<rt[0]&&(rt[0]=Co[0]),Co[1]<rt[1]&&(rt[1]=Co[1]),Co[0]>rt[2]&&(rt[2]=Co[0]),Co[1]>rt[3]&&(rt[3]=Co[1])}this.map.fitBounds(rt,{animate:!1})}})).catch((Qe=>this.loader.dismiss(Qe,this._t.pnx.error_api)))}_getNode(Qe){const rt=this._sequenceData.find((rt=>rt.properties.id===Qe)),Wn=rt?(0,Rl.apiFeatureToPSVNode)(rt,this._t,this._isInternetFast):null;return Wn&&delete Wn.links,Wn}_addMapBackgroundWidget(){const Qe=(0,Zl.createWebComp)("pnx-map-background",{_parent:this,size:"sm"});this._mapContainer.appendChild(Qe)}previewSequenceHeadingChange(Qe){const rt=void 0!==this.map.getLayer(Hl);if(this.map._picMarkerPreview.remove(),void 0===Qe)return delete this._lastRelHeading,rt&&this.map.setLayoutProperty(Hl,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=Qe,rt||this.map.addLayer({id:Hl,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const Wn=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Hl,"visibility","visible"),this.map.setLayoutProperty(Hl,"icon-rotate",["+",["get","view:azimuth"],Wn,Qe]);const Co=[["==",["geometry-type"],"Point"]];this.picture&&Co.push(["!=",["get","id"],this.picture]),this.map.setFilter(Hl,["all",...Co]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{converter:Co.A.GetJSONConverter()},background:{type:String},...Co.A.properties},customElements.define("pnx-editor",Editor)},3407:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PhotoViewer});Wn(970);var Co=Wn(1545),Dl=Wn(4451),Ll=Wn(9039),Rl=Wn(9048),Ul=Wn(5995),Gl=Wn(7343),Zl=Wn(2118),Hl=Wn(4207);const ql=Math.PI/6;class PhotoViewer extends Ll.A{constructor(){super(),this.psv={},this["url-parameters"]=this.getAttribute("url-parameters")||!0,this.widgets=this.getAttribute("widgets")||"true",this.grid=(0,Ul.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,Ul.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)})}_createInitParamsHandler(){var Qe,rt;this._initParams=new Zl.Ay(Zl.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(Qe=this.urlHandler)||void 0===Qe?void 0:Qe.currentURLParams(),null===(rt=this.urlHandler)||void 0===rt?void 0:rt.currentURLParams(!0)),{})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,Ul.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,Ul.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,Ul.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",(Qe=>{(0,Gl.isNullId)(Qe.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,Ul.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,Ul.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend),this.grid.appendChild((0,Ul.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))))}connectedCallback(){super.connectedCallback(),this.presetsManager=new Hl.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new Dl.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 Qe;return new Promise((rt=>{Qe=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(Qe),rt()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(Qe),rt()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((Qe=>{this.psv.addEventListener("picture-loaded",Qe,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const Qe=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,Zl.ai)(this,Qe),this._handleKeyboardManagement(),Qe.picture?this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new Rl.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...Co.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,Zl.Vy)(this.psv,this._initParams.getPSVPostInit())}))}catch(Qe){let rt=Co.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(Qe,rt)}}_handleKeyboardManagement(){const keytonone=()=>this.psv.stopKeyboardControl(),keytopsv=()=>this.psv.startKeyboardControl();this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytopsv()));for(let Qe of this.grid.childNodes)"bg"!==Qe.getAttribute("slot")&&(Qe.addEventListener("focusin",(()=>keytonone())),Qe.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytopsv()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((Qe=>{var rt;null!==(rt=Qe.tagName)&&void 0!==rt&&rt.toLowerCase().startsWith("pnx-")&&(Qe._parent=this,Qe._t=this._t),"editors"===Qe.getAttribute("slot")?this.onceReady().then((()=>{var rt;return null===(rt=this.legend)||void 0===rt?void 0:rt.appendChild(Qe)})):this.grid.appendChild(Qe)}))}setPopup(Qe){let rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Qe?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof rt?this.popup.innerHTML=rt:Array.isArray(rt)&&rt.forEach((Qe=>this.popup.appendChild(Qe)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,Ul.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,Ul.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,Ul.createWebComp)("pnx-share-menu",{_parent:this})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:Rl.LM,yaw:0,pitch:0,zoom:Rl.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(Qe){let rt=this.psv.getPosition();switch(Qe){case"up":rt.pitch+=ql;break;case"left":rt.yaw-=ql;break;case"down":rt.pitch-=ql;break;case"right":rt.yaw+=ql}this._psvAnimate({speed:Rl.LM,...rt})}_psvAnimate(Qe){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(Qe)}addEventListener(Qe,rt,Wn){super.addEventListener(Qe,rt,Wn)}}PhotoViewer.properties={psv:{converter:Ll.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},...Ll.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{$:()=>Ql,A:()=>Viewer});Wn(9616);var Co=Wn(8340),Dl=Wn(3407),Ll=(Wn(9039),Wn(2771)),Rl=Wn(7343),Ul=Wn(5995),Gl=Wn(9683),Zl=Wn(2e3),Hl=Wn(9438),ql=Wn(2118);const Ql=20,Kl=(Math.PI,100);class Viewer extends Dl.A{constructor(){super(),this.map=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,Ul.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,Rl.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 Qe,rt;this._initParams=new ql.Ay(ql.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(Qe=this.urlHandler)||void 0===Qe?void 0:Qe.currentURLParams(),null===(rt=this.urlHandler)||void 0===rt?void 0:rt.currentURLParams(!0)),{map:(0,Co.getMapParamsFromLocalStorage)()})}_initWidgets(){var Qe,rt;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,Ul.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,Ul.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,Ul.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",(Qe=>{(0,Rl.isNullId)(Qe.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,Ul.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,Ul.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,Ul.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,Ul.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===(Qe=this.map)||void 0===Qe||null===(rt=Qe._hasQualityScore)||void 0===rt?void 0:rt.call(Qe))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,Ul.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(Qe,rt,Wn){var Co,Dl,Ll,Ul;(super.attributeChangedCallback(Qe,rt,Wn),"picture"===Qe)&&(null===(Co=this.legend)||void 0===Co||null===(Dl=Co.setAttribute)||void 0===Dl||Dl.call(Co,"picture",Wn),(0,Rl.isNullId)(rt)&&!(0,Rl.isNullId)(Wn)&&this.mini.removeAttribute("collapsed"),(0,Rl.isNullId)(Wn)?this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map"):(this.mini.classList.remove("pnx-hidden"),(0,Rl.isNullId)(rt)&&(this._setFocus("pic"),"closed"===(null===(Ll=this.bottomDrawer)||void 0===Ll||null===(Ul=Ll.getAttribute)||void 0===Ul?void 0:Ul.call(Ll,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened"))));"focus"===Qe&&this._setFocus(Wn)}onceMapReady(){if(!this.map)return Promise.resolve();let Qe;return new Promise((rt=>{Qe=setInterval((()=>{var Wn,Co,Dl;"object"===typeof this.map&&(null!==(Wn=this.map)&&void 0!==Wn&&null!==(Co=Wn.loaded)&&void 0!==Co&&Co.call(Wn)?(clearInterval(Qe),rt()):null!==(Dl=this.map)&&void 0!==Dl&&Dl.once&&this.map.once("render",(()=>{clearInterval(Qe),rt()})))}),250)}))}async _initMap(){await new Promise((Qe=>{this.map=new Ll.A(this,this.mapContainer,this._initParams.getMapInit()),(0,Co.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),Qe()}))})),await(0,ql.mK)(this.map,this._initParams.getMapPostInit()),(0,Co.initMapKeyboardHandler)(this),(0,Co.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const Qe=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,ql.iz)(this,Qe),this._handleKeyboardManagement(),Qe.picture?this.psv.addEventListener("picture-loaded",(()=>{(0,ql.iz)(this,Qe),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",(Qe=>{"map"===Qe.detail.focus&&keytomap(),this.popup.getAttribute("visible")?keytonone():keytopsv()})),this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytofocused()));for(let Qe of this.grid.childNodes)"bg"!==Qe.getAttribute("slot")&&(Qe.addEventListener("focusin",(()=>keytonone())),Qe.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytofocused()})))}moveCenter(){const Qe=this.psv.getPictureMetadata();Qe&&(this.map&&this.isMapWide()?this.map.flyTo({center:Qe.gps,zoom:20}):super.moveCenter())}_moveToDirection(Qe){if(this.map&&this.isMapWide()){let rt;switch(Qe){case"up":rt=[0,-100];break;case"left":rt=[-100,0];break;case"down":rt=[0,Kl];break;case"right":rt=[Kl,0]}this.map.panBy(rt)}else super._moveToDirection(Qe)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(Qe){var rt,Wn,Co,Dl;let Ll=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Hl=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===Qe&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(Qe))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=Qe,(Hl||("map"!==Qe||!this.map||!this.isMapWide())&&("pic"!==Qe||this.map&&this.isMapWide()))&&("map"===Qe?(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,Ul.fa)(Gl.pt),(0,Rl.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,Ul.fa)(Zl.e5),this.psvContainer.focus()),null===this||void 0===this||null===(rt=this.map)||void 0===rt||null===(Wn=rt.resize)||void 0===Wn||Wn.call(rt),this.psv.autoSize(),this.psv.forceRefresh(),null===(Co=this.legend)||void 0===Co||null===(Dl=Co.setAttribute)||void 0===Dl||Dl.call(Co,"focus",this.focus),!Ll)){const rt=new CustomEvent("focus-changed",{detail:{focus:Qe}});this.dispatchEvent(rt)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var Qe;const rt=(0,Hl.qi)("#pnx-map-filters-menu"),Wn=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-date-from"),Co=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-date-end"),Dl=null===rt||void 0===rt?void 0:rt.shadowRoot.querySelectorAll("input[name='pnx-filter-type']"),Ll=(0,Hl.qi)("#pnx-map-theme");let Rl="";for(let Zl=0;Zl<Dl.length;Zl++){const Qe=Dl[Zl];if(Qe.checked){Rl=Qe.value;break}}let Ul=[];if(null!==(Qe=this.map)&&void 0!==Qe&&Qe._hasQualityScore()){const Qe=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-qualityscore");Ul=((null===Qe||void 0===Qe?void 0:Qe.grade)||"").split(",").map((Qe=>parseInt(Qe))).filter((Qe=>!isNaN(Qe))),5==Ul.length&&(Ul=[])}const Gl={minDate:null===Wn||void 0===Wn?void 0:Wn.value,maxDate:null===Co||void 0===Co?void 0:Co.value,pic_type:Rl,theme:null===Ll||void 0===Ll?void 0:Ll.value,qualityscore:Ul};this.map.setFilters(Gl)}}Viewer.properties={map:{converter:Dl.A.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},...Dl.A.properties},customElements.define("pnx-viewer",Viewer)},3921:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{Basic:()=>Co.A,CoverageMap:()=>Dl.A,Editor:()=>Ll.A,PhotoViewer:()=>Ul.A,Viewer:()=>Rl.A});var Co=Wn(9039),Dl=Wn(153),Ll=Wn(1752),Rl=Wn(8743),Ul=Wn(3407)},9341:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{core:()=>Co,layout:()=>Dl,menus:()=>Ll,ui:()=>Rl});var Co=Wn(3921),Dl=Wn(456),Ll=Wn(8794),Rl=Wn(9472)},6784:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>BottomDrawer});var Co=Wn(4542),Dl=Wn(1198);const Ll={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends Co.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){var Qe;super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const rt=this._getDrawer();rt&&(rt.style.height=`${this._drawerHeight}px`,rt.style.maxHeight=`${this._drawerHeight}px`,null===(Qe=this._parent)||void 0===Qe||Qe.onceReady().then((()=>{var Qe,rt;null===(Qe=this._parent.map)||void 0===Qe||Qe.addEventListener("click",(()=>this.openness="closed")),null===(rt=this._parent.psv)||void 0===rt||rt.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(Qe,rt,Wn){if(super.attributeChangedCallback(Qe,rt,Wn),"openness"===Qe){if("opened"!==Wn){const Qe=this.shadowRoot.querySelector(".content");Qe&&(Qe.scrollTop=0)}const Qe=this._getDrawer();Qe&&(Qe.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var Qe;return null===(Qe=this.shadowRoot)||void 0===Qe?void 0:Qe.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(Qe){this._isDragging=!0,this._startFingerY=Qe.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*Ll[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(Qe){if(!this._isDragging)return;const rt=this.shadowRoot.querySelector(".content");rt.scrollHeight>rt.offsetHeight&&rt.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=Qe.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(Qe){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||Qe.target.closest(".handle"))&&(Qe.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(Qe){let rt=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const Wn=this._getDrawer();Wn&&(Qe=Math.max(0,Math.min(Qe,this._drawerHeight-30)),rt&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-Ll["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,Qe=Math.max(0,Math.min(Ll[this.openness]*this._drawerHeight,this._drawerHeight-30))),Wn.style.transform=`translateY(${Qe}px)`)}render(){const Qe={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return Co.qy`
|
|
13
13
|
<div
|
|
14
14
|
class=${(0,Dl.H)(Qe)}
|
|
15
15
|
@touchstart="${this._onTouchStart}"
|
|
@@ -640,7 +640,7 @@
|
|
|
640
640
|
small {
|
|
641
641
|
font-size: 1em;
|
|
642
642
|
}
|
|
643
|
-
`,customElements.define("pnx-map-legend",MapLegend)},3589:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PictureLegend});var Co=Wn(4542),Dl=Wn(1198),Ll=Wn(5995),Rl=Wn(8466),Ul=Wn(4336),Gl=Wn(2593),Zl=Wn(7879),Hl=Wn(4927),ql=Wn(6311),Ql=Wn(1260),Kl=Wn(8591),$l=Wn(3606);class PictureLegend extends Co.WF{constructor(){super(),this._expanded=!0,this.collapsable=!1}connectedCallback(){super.connectedCallback(),this._expanded=!this.collapsable,this._prevSearches={},this._parent.onceReady().then((()=>{this._onPicChange(this._parent.psv.getPictureMetadata()),this._parent.psv.addEventListener("picture-loaded",(()=>{this._onPicChange(this._parent.psv.getPictureMetadata())})),this._parent.psv.addEventListener("sequence-stopped",(()=>{this._onPicChange(this._parent.psv.getPictureMetadata())})),this._parent.psv.addEventListener("annotation-click",(()=>{this._expanded=!0}))}))}_onPicChange(Qe){if(clearTimeout(this._addrTimer1),this._caption=null===Qe||void 0===Qe?void 0:Qe.caption,Qe){const rt=`${Qe.gps[0].toFixed(4)}/${Qe.gps[1].toFixed(4)}`;this._prevSearches[rt]?this._addr=this._prevSearches[rt]:this._parent.psv._sequencePlaying||(this._addr="",this._addrTimer1=setTimeout((()=>{(0,$l.reverseGeocodingNominatim)(Qe.gps[1],Qe.gps[0]).then((Qe=>{clearTimeout(this._addrTimer2),this._addr=Qe,this._prevSearches[rt]=Qe}))}),500))}else this._addr=""}_onBackClick(){var Qe,rt;this._parent.isWidthSmall()&&"map"===this._parent.focus?this._parent.select():null===(Qe=(rt=this._parent)._setFocus)||void 0===Qe||Qe.call(rt,"map")}render(){var Qe,rt,Wn,Kl;if(!this._caption)return Co.s6;const
|
|
643
|
+
`,customElements.define("pnx-map-legend",MapLegend)},3589:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PictureLegend});var Co=Wn(4542),Dl=Wn(1198),Ll=Wn(5995),Rl=Wn(8466),Ul=Wn(4336),Gl=Wn(2593),Zl=Wn(7879),Hl=Wn(4927),ql=Wn(6311),Ql=Wn(1260),Kl=Wn(8591),$l=Wn(3606);class PictureLegend extends Co.WF{constructor(){super(),this._expanded=!0,this.collapsable=!1}connectedCallback(){super.connectedCallback(),this._expanded=!this.collapsable,this._prevSearches={},this._parent.onceReady().then((()=>{this._onPicChange(this._parent.psv.getPictureMetadata()),this._parent.psv.addEventListener("picture-loaded",(()=>{this._onPicChange(this._parent.psv.getPictureMetadata())})),this._parent.psv.addEventListener("sequence-stopped",(()=>{this._onPicChange(this._parent.psv.getPictureMetadata())})),this._parent.psv.addEventListener("annotation-click",(()=>{this._expanded=!0}))}))}_onPicChange(Qe){if(clearTimeout(this._addrTimer1),this._caption=null===Qe||void 0===Qe?void 0:Qe.caption,Qe){const rt=`${Qe.gps[0].toFixed(4)}/${Qe.gps[1].toFixed(4)}`;this._prevSearches[rt]?this._addr=this._prevSearches[rt]:this._parent.psv._sequencePlaying||(this._addr="",this._addrTimer1=setTimeout((()=>{(0,$l.reverseGeocodingNominatim)(Qe.gps[1],Qe.gps[0]).then((Qe=>{clearTimeout(this._addrTimer2),this._addr=Qe,this._prevSearches[rt]=Qe}))}),500))}else this._addr=""}_onBackClick(){var Qe,rt;this._parent.isWidthSmall()&&"map"===this._parent.focus?this._parent.select():null===(Qe=(rt=this._parent)._setFocus)||void 0===Qe||Qe.call(rt,"map")}render(){var Qe,rt,Wn,Kl,$l;if(!this._caption)return Co.s6;const Tc=(0,Dl.H)({"pnx-hidden":this._expanded}),tu=(0,Dl.H)({"pnx-hidden":!this._expanded});return Co.qy`
|
|
644
644
|
<div class="headline">
|
|
645
645
|
${this._parent._setFocus?Co.qy`
|
|
646
646
|
<pnx-button
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
></pnx-picture-legend-actions>
|
|
663
663
|
</div>
|
|
664
664
|
|
|
665
|
-
<div id="pic-legend-info" class=${
|
|
665
|
+
<div id="pic-legend-info" class=${Tc}>
|
|
666
666
|
${(null===(rt=this._caption.producer)||void 0===rt?void 0:rt.length)>0?Co.qy`<div class="info-block">
|
|
667
667
|
${(0,Ll.fa)(Zl.X4)}
|
|
668
668
|
${this._caption.producer[this._caption.producer.length-1]}
|
|
@@ -670,19 +670,19 @@
|
|
|
670
670
|
|
|
671
671
|
${this._caption.date?Co.qy`<div class="info-block">
|
|
672
672
|
${(0,Ll.fa)(Hl.BE)}
|
|
673
|
-
${this._caption.date.toLocaleDateString(void 0,{year:"numeric",month:"long"})}
|
|
673
|
+
${this._caption.date.toLocaleDateString((null===(Wn=this._parent)||void 0===Wn?void 0:Wn.lang)||window.navigator.language,{year:"numeric",month:"long"})}
|
|
674
674
|
</div>`:Co.s6}
|
|
675
675
|
</div>
|
|
676
676
|
|
|
677
|
-
<div id="pic-legend-cta" class=${
|
|
677
|
+
<div id="pic-legend-cta" class=${tu}>
|
|
678
678
|
${this._parent.api._endpoints.report?Co.qy`
|
|
679
679
|
<pnx-button size="sm" @click=${()=>this._parent._showReportForm()}>
|
|
680
|
-
${(0,Ll.fa)(ql.JA)} ${null===(
|
|
680
|
+
${(0,Ll.fa)(ql.JA)} ${null===(Kl=this._parent)||void 0===Kl?void 0:Kl._t.pnx.report}
|
|
681
681
|
</pnx-button>
|
|
682
682
|
`:Co.s6}
|
|
683
683
|
|
|
684
684
|
<pnx-button size="sm" @click=${()=>this._parent._showShareOptions()}>
|
|
685
|
-
${(0,Ll.fa)(Ql.faShareNodes)} ${null===(
|
|
685
|
+
${(0,Ll.fa)(Ql.faShareNodes)} ${null===($l=this._parent)||void 0===$l?void 0:$l._t.pnx.share}
|
|
686
686
|
</pnx-button>
|
|
687
687
|
|
|
688
688
|
<slot name="editors">
|
|
@@ -690,7 +690,7 @@
|
|
|
690
690
|
</slot>
|
|
691
691
|
</div>
|
|
692
692
|
|
|
693
|
-
<pnx-picture-metadata class=${
|
|
693
|
+
<pnx-picture-metadata class=${tu} ._parent=${this._parent}></pnx-picture-metadata>
|
|
694
694
|
|
|
695
695
|
${this.collapsable?Co.qy`<pnx-button
|
|
696
696
|
kind="inline"
|
|
@@ -796,26 +796,26 @@
|
|
|
796
796
|
<div style=${Qe.content_style}>${Qe.content}</div>
|
|
797
797
|
</div>`))}
|
|
798
798
|
</div>
|
|
799
|
-
`}render(){var Qe,rt,Wn,Ql,lu,yu,Eu,Tu,Lu,Zu,Xu,Ju,$u,ed,td,id,nd,rd,sd,ad,od,ld,cd,ud,hd,dd,pd,md,fd,gd,Ad,yd,vd,_d,xd,bd,wd,Ed,Md,Sd,Td,Cd,kd,Id,Dd,Ld,Pd,zd,Nd,Rd,Bd,Od;if(!this._meta)return Co.s6;const
|
|
800
|
-
<strong>${new Intl.DateTimeFormat(
|
|
801
|
-
<br />${new Intl.DateTimeFormat(
|
|
802
|
-
`}],
|
|
799
|
+
`}render(){var Qe,rt,Wn,Ql,lu,yu,Eu,Tu,Lu,Zu,Xu,Ju,$u,ed,td,id,nd,rd,sd,ad,od,ld,cd,ud,hd,dd,pd,md,fd,gd,Ad,yd,vd,_d,xd,bd,wd,Ed,Md,Sd,Td,Cd,kd,Id,Dd,Ld,Pd,zd,Nd,Rd,Bd,Od,Fd;if(!this._meta)return Co.s6;const jd=(null===(Qe=this._parent)||void 0===Qe?void 0:Qe.lang)||window.navigator.language,Ud=null===(rt=this._meta)||void 0===rt||null===(Wn=rt.properties)||void 0===Wn?void 0:Wn["pers:interior_orientation"],Vd=[Ud.camera_manufacturer,Ud.camera_model].filter((Qe=>Qe)).join(" "),Gd=null!==Ud&&void 0!==Ud&&Ud.focal_length?`${null===Ud||void 0===Ud?void 0:Ud.focal_length} mm`:missing();let Zd=null===Ud||void 0===Ud?void 0:Ud.sensor_array_dimensions;Zd&&(Zd=`${Zd[0]} x ${Zd[1]} px (${Math.floor(Zd[0]*Zd[1]/1e6)} Mpx)`);let Hd=null===(Ql=this._parent)||void 0===Ql?void 0:Ql._t.pnx.picture_flat,Wd=null===(lu=this._parent)||void 0===lu?void 0:lu._t.pnx.picture_flat_long,qd=null===Ud||void 0===Ud?void 0:Ud.field_of_view;var Yd,Qd;null!==qd&&void 0!==qd&&(360===qd?(Hd=null===(Yd=this._parent)||void 0===Yd?void 0:Yd._t.pnx.picture_360,Wd=null===(Qd=this._parent)||void 0===Qd?void 0:Qd._t.pnx.picture_360_long):Hd+=` (${qd}\xb0)`);const Kd=[{title:null===(yu=this._parent)||void 0===yu?void 0:yu._t.pnx.metadata_camera_make,content:(null===Ud||void 0===Ud?void 0:Ud.camera_manufacturer)||missing()},{title:null===(Eu=this._parent)||void 0===Eu?void 0:Eu._t.pnx.metadata_camera_model,content:(null===Ud||void 0===Ud?void 0:Ud.camera_model)||missing()},{title:null===(Tu=this._parent)||void 0===Tu?void 0:Tu._t.pnx.metadata_camera_type,content:Hd},{title:null===(Lu=this._parent)||void 0===Lu?void 0:Lu._t.pnx.metadata_camera_resolution,content:Zd||missing()},{title:null===(Zu=this._parent)||void 0===Zu?void 0:Zu._t.pnx.metadata_camera_focal_length,content:Gd},(null===(Xu=this._meta)||void 0===Xu||null===(Ju=Xu.caption)||void 0===Ju?void 0:Ju.date)&&{title:null===($u=this._parent)||void 0===$u?void 0:$u._t.pnx.metadata_general_date,content:Dl.qy`
|
|
800
|
+
<strong>${new Intl.DateTimeFormat(jd,{timeZone:this._meta.caption.tz,dateStyle:"short"}).format(this._meta.caption.date)}</strong>
|
|
801
|
+
<br />${new Intl.DateTimeFormat(jd,{timeZone:this._meta.caption.tz,hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,timeZoneName:"longOffset"}).format(this._meta.caption.date)}
|
|
802
|
+
`}],Xd=void 0!==(null===(ed=this._meta)||void 0===ed||null===(td=ed.properties)||void 0===td?void 0:td["view:azimuth"])&&`${this._meta.properties["view:azimuth"]}\xb0`,Jd=[{title:null===(id=this._parent)||void 0===id?void 0:id._t.pnx.metadata_location_coordinates,content:Dl.qy`
|
|
803
803
|
${this._meta.gps[0]}, ${this._meta.gps[1]}
|
|
804
804
|
<pnx-copy-coordinates
|
|
805
805
|
._parent=${this._parent}
|
|
806
806
|
.gps=${this._meta.gps}
|
|
807
807
|
style="margin-left: 10px"
|
|
808
808
|
></pnx-copy-coordinates>
|
|
809
|
-
`,style:"width: 100%"},{title:null===(
|
|
810
|
-
${null===(
|
|
809
|
+
`,style:"width: 100%"},{title:null===(nd=this._parent)||void 0===nd?void 0:nd._t.pnx.metadata_location_orientation,content:Xd||missing()},{title:null===(rd=this._parent)||void 0===rd?void 0:rd._t.pnx.metadata_location_precision,content:(0,du.getGPSPrecision)(this._meta)||missing()}],$d=(null===(sd=this._parent)||void 0===sd||null===(ad=sd.map)||void 0===ad||null===(od=ad._hasQualityScore)||void 0===od?void 0:od.call(ad))||(null===(ld=this._meta)||void 0===ld||null===(cd=ld.properties)||void 0===cd?void 0:cd["quality:horizontal_accuracy"])||(null===(ud=this._meta)||void 0===ud||null===(hd=ud.properties)||void 0===hd?void 0:hd["panoramax:horizontal_pixel_density"]);let up,gp;if($d){var Ap,vp,_p,xp,bp,wp,Ep,Mp,Sp,Tp,Cp;const Qe=(0,fu.getGrade)(fu.QUALITYSCORE_GPS_VALUES,null===(Ap=this._meta)||void 0===Ap||null===(vp=Ap.properties)||void 0===vp?void 0:vp["quality:horizontal_accuracy"]),rt=(0,fu.getGrade)(360===(null===(_p=this._meta)||void 0===_p?void 0:_p.horizontalFov)?fu.QUALITYSCORE_RES_360_VALUES:fu.QUALITYSCORE_RES_FLAT_VALUES,null===(xp=this._meta)||void 0===xp||null===(bp=xp.properties)||void 0===bp?void 0:bp["panoramax:horizontal_pixel_density"]);gp=Math.round((rt||1)*fu.QUALITYSCORE_POND_RES+(Qe||1)*fu.QUALITYSCORE_POND_GPS),up=[{title:Dl.qy`
|
|
810
|
+
${null===(wp=this._parent)||void 0===wp?void 0:wp._t.pnx.metadata_quality_score}
|
|
811
811
|
<pnx-button
|
|
812
|
-
title="${null===(
|
|
812
|
+
title="${null===(Ep=this._parent)||void 0===Ep?void 0:Ep._t.pnx.metadata_quality_help}"
|
|
813
813
|
kind="superinline"
|
|
814
814
|
@click=${()=>{var Qe;return null===(Qe=this._parent)||void 0===Qe?void 0:Qe._showQualityScoreDoc()}}
|
|
815
815
|
>
|
|
816
816
|
${(0,Ll.fa)(Kl.iW)}
|
|
817
817
|
</pnx-button>
|
|
818
|
-
`,content:Dl.qy`<pnx-quality-score grade=${
|
|
818
|
+
`,content:Dl.qy`<pnx-quality-score grade=${gp} style="font-size: 16px"></pnx-quality-score>`,style:"width: 100%"},{title:null===(Mp=this._parent)||void 0===Mp?void 0:Mp._t.pnx.metadata_quality_gps_score,content:(0,Ll.createWebComp)("pnx-grade",{stars:Qe,_t:null===(Sp=this._parent)||void 0===Sp?void 0:Sp._t})},{title:null===(Tp=this._parent)||void 0===Tp?void 0:Tp._t.pnx.metadata_quality_resolution_score,content:(0,Ll.createWebComp)("pnx-grade",{stars:rt,_t:null===(Cp=this._parent)||void 0===Cp?void 0:Cp._t})}]}const kp=(this._meta.properties.semantics||[]).length>0||(this._meta.properties.annotations||[]).length>0;let Ip=[];var Dp,Lp,Pp,zp,Np,Rp,Bp,Op,Fp;kp&&(Ip.push({title:null===(Dp=this._parent)||void 0===Dp?void 0:Dp._t.pnx.semantics_tags_picture,style:"width: 100%",content:Dl.qy`${(null===(Lp=this._meta.properties.semantics)||void 0===Lp?void 0:Lp.length)>0?Dl.qy`
|
|
819
819
|
<pnx-button
|
|
820
820
|
kind="outline"
|
|
821
821
|
size="sm"
|
|
@@ -823,69 +823,69 @@
|
|
|
823
823
|
@click=${()=>this._semanticsPicShowAll=!this._semanticsPicShowAll}
|
|
824
824
|
>
|
|
825
825
|
${this._semanticsPicShowAll?(0,Ll.fa)(Tc.w2):(0,Ll.fa)($l.Jt)}
|
|
826
|
-
${this._semanticsPicShowAll?null===(
|
|
826
|
+
${this._semanticsPicShowAll?null===(Pp=this._parent)||void 0===Pp?void 0:Pp._t.pnx.semantics_hide_all_tags:null===(zp=this._parent)||void 0===zp?void 0:zp._t.pnx.semantics_show_all_tags}
|
|
827
827
|
</pnx-button>
|
|
828
828
|
<pnx-semantics-table
|
|
829
|
-
._t=${null===(
|
|
829
|
+
._t=${null===(Np=this._parent)||void 0===Np?void 0:Np._t}
|
|
830
830
|
.source=${this._meta.properties}
|
|
831
831
|
style="margin-top: 5px"
|
|
832
832
|
class=${this._semanticsPicShowAll?"":"pnx-hidden"}
|
|
833
833
|
/>
|
|
834
|
-
`:null===(
|
|
835
|
-
${(null===(
|
|
836
|
-
`}));const
|
|
834
|
+
`:null===(Rp=this._parent)||void 0===Rp?void 0:Rp._t.pnx.semantics_tags_picture_none}`}),Ip.push({title:null===(Bp=this._parent)||void 0===Bp?void 0:Bp._t.pnx.semantics_features,style:"width: 100%",content:Dl.qy`
|
|
835
|
+
${(null===(Op=this._meta.properties.annotations)||void 0===Op?void 0:Op.length)>0?Dl.qy`<pnx-annotations-list ._parent=${this._parent} />`:null===(Fp=this._parent)||void 0===Fp?void 0:Fp._t.pnx.semantics_features_none}
|
|
836
|
+
`}));const jp=Object.entries(this._meta.properties.exif).sort().filter((Qe=>{let[,rt]=Qe;return rt})).map((Qe=>{let[rt,Wn]=Qe;return JSON.stringify(Wn).includes("\\u")&&(Wn=JSON.stringify(Wn).replace(/\\u[0-9A-Fa-f]{4}/g,(Qe=>" 0x"+parseInt(Qe.slice(2),16).toString(16).toUpperCase().padStart(4,"0"))).slice(1,-1).trim()),{title:rt,content:Wn.length>30?Dl.qy`<textarea readonly>${Wn}</textarea>`:Wn,style:Wn.length>30?"width: 100%":void 0}}));jp.unshift({content:Dl.qy`
|
|
837
837
|
<pnx-link-button
|
|
838
838
|
size="sm"
|
|
839
839
|
target="_blank"
|
|
840
840
|
href="https://exiv2.org/metadata.html"
|
|
841
|
-
title=${null===(
|
|
842
|
-
>${(0,Ll.fa)(Kl.iW)} ${null===(
|
|
843
|
-
`,style:"width: 100%"});const
|
|
841
|
+
title=${null===(dd=this._parent)||void 0===dd?void 0:dd._t.pnx.metadata_exif_doc_title}
|
|
842
|
+
>${(0,Ll.fa)(Kl.iW)} ${null===(pd=this._parent)||void 0===pd?void 0:pd._t.pnx.metadata_exif_doc}</pnx-link-button>
|
|
843
|
+
`,style:"width: 100%"});const Up=[(null===(md=this._meta)||void 0===md||null===(fd=md.caption)||void 0===fd||null===(gd=fd.producer)||void 0===gd?void 0:gd.length)>0&&{title:null===(Ad=this._parent)||void 0===Ad?void 0:Ad._t.pnx.metadata_general_author,content:Dl.qy`
|
|
844
844
|
<strong>${this._meta.caption.producer[this._meta.caption.producer.length-1]}</strong>
|
|
845
845
|
${this._meta.caption.producer.length>1?Dl.qy`<br />${this._meta.caption.producer.slice(0,-1).join(", ")}`:Co.s6}
|
|
846
|
-
`},(null===(
|
|
847
|
-
<strong>${new Intl.DateTimeFormat(
|
|
848
|
-
<br />${new Intl.DateTimeFormat(
|
|
849
|
-
`},
|
|
850
|
-
<strong>${
|
|
851
|
-
<br />${
|
|
852
|
-
`},(null===(
|
|
853
|
-
grade=${
|
|
846
|
+
`},(null===(yd=this._meta)||void 0===yd||null===(vd=yd.caption)||void 0===vd?void 0:vd.date)&&{title:null===(_d=this._parent)||void 0===_d?void 0:_d._t.pnx.metadata_general_date,content:Dl.qy`
|
|
847
|
+
<strong>${new Intl.DateTimeFormat(jd,{timeZone:this._meta.caption.tz,dateStyle:"long"}).format(this._meta.caption.date)}</strong>
|
|
848
|
+
<br />${new Intl.DateTimeFormat(jd,{timeZone:this._meta.caption.tz,hour:"numeric",minute:"numeric"}).format(this._meta.caption.date)}
|
|
849
|
+
`},Ud&&{title:null===(xd=this._parent)||void 0===xd?void 0:xd._t.pnx.metadata_camera,content:Dl.qy`
|
|
850
|
+
<strong>${Vd.length>0?Vd:missing()}</strong>
|
|
851
|
+
<br />${Wd}
|
|
852
|
+
`},(null===(bd=this._meta)||void 0===bd||null===(wd=bd.caption)||void 0===wd?void 0:wd.license)&&{title:null===(Ed=this._parent)||void 0===Ed?void 0:Ed._t.pnx.metadata_general_license,content:Dl.qy`${(0,Dl.Bk)(this._meta.caption.license)}`},$d&&{title:null===(Md=this._parent)||void 0===Md?void 0:Md._t.pnx.metadata_quality,content:Dl.qy`<pnx-quality-score
|
|
853
|
+
grade=${gp}
|
|
854
854
|
style="font-size: 14px; cursor: pointer"
|
|
855
855
|
@click=${this._onQualityScoreClick}
|
|
856
|
-
/>`},{title:null===(
|
|
856
|
+
/>`},{title:null===(Sd=this._parent)||void 0===Sd?void 0:Sd._t.pnx.metadata_general_copy_id,content_style:"display: flex; gap: 5px;",content:Dl.qy`
|
|
857
857
|
<pnx-copy-button
|
|
858
858
|
kind="outline"
|
|
859
859
|
size="sm"
|
|
860
|
-
._t=${null===(
|
|
860
|
+
._t=${null===(Td=this._parent)||void 0===Td?void 0:Td._t}
|
|
861
861
|
text=${this._meta.id}
|
|
862
862
|
style="flex: 1"
|
|
863
863
|
>
|
|
864
|
-
${(0,Ll.fa)(Zl.jb)} ${null===(
|
|
864
|
+
${(0,Ll.fa)(Zl.jb)} ${null===(Cd=this._parent)||void 0===Cd?void 0:Cd._t.pnx.metadata_general_picid}
|
|
865
865
|
</pnx-copy-button>
|
|
866
866
|
<pnx-copy-button
|
|
867
867
|
kind="outline"
|
|
868
868
|
size="sm"
|
|
869
|
-
._t=${null===(
|
|
869
|
+
._t=${null===(kd=this._parent)||void 0===kd?void 0:kd._t}
|
|
870
870
|
text=${this._meta.sequence.id}
|
|
871
871
|
style="flex: 1"
|
|
872
872
|
>
|
|
873
|
-
${(0,Ll.fa)(Hl.yv)} ${null===(
|
|
873
|
+
${(0,Ll.fa)(Hl.yv)} ${null===(Id=this._parent)||void 0===Id?void 0:Id._t.pnx.metadata_general_seqid}
|
|
874
874
|
</pnx-copy-button>
|
|
875
|
-
`},(null===(
|
|
875
|
+
`},(null===(Dd=this._meta)||void 0===Dd?void 0:Dd.origInstance)&&{title:null===(Ld=this._parent)||void 0===Ld?void 0:Ld._t.pnx.metadata_general_instance,content:Dl.qy`<strong><a href=${this._meta.origInstance.href+window.location.search} target="_blank">
|
|
876
876
|
${this._meta.origInstance.instance_name||this._meta.origInstance.href.replace(/^http.?:\/\//,"")}
|
|
877
877
|
</a></strong>`}];return Dl.qy`<pnx-tabs>
|
|
878
|
-
${this._toTab(Dl.qy`${(0,Ll.fa)(Zl.jb)} ${null===(
|
|
878
|
+
${this._toTab(Dl.qy`${(0,Ll.fa)(Zl.jb)} ${null===(Pd=this._parent)||void 0===Pd?void 0:Pd._t.pnx.metadata_summary}`,Up)}
|
|
879
879
|
|
|
880
|
-
${this._toTab(Dl.qy`${(0,Ll.fa)(Gl.rw)} ${null===(
|
|
880
|
+
${this._toTab(Dl.qy`${(0,Ll.fa)(Gl.rw)} ${null===(zd=this._parent)||void 0===zd?void 0:zd._t.pnx.metadata_camera}`,Kd)}
|
|
881
881
|
|
|
882
|
-
${this._toTab(Dl.qy`${(0,Ll.fa)(Rl.gK)} ${null===(
|
|
882
|
+
${this._toTab(Dl.qy`${(0,Ll.fa)(Rl.gK)} ${null===(Nd=this._parent)||void 0===Nd?void 0:Nd._t.pnx.metadata_location}`,Jd)}
|
|
883
883
|
|
|
884
|
-
${
|
|
884
|
+
${$d?this._toTab(Dl.qy`${(0,Ll.fa)(Ul.B9)} ${null===(Rd=this._parent)||void 0===Rd?void 0:Rd._t.pnx.metadata_quality}`,up):Co.s6}
|
|
885
885
|
|
|
886
|
-
${
|
|
886
|
+
${kp?this._toTab(Dl.qy`${(0,Ll.fa)(tu.DX)} ${null===(Bd=this._parent)||void 0===Bd?void 0:Bd._t.pnx.semantics_title}`,Ip):Co.s6}
|
|
887
887
|
|
|
888
|
-
${null!==(
|
|
888
|
+
${null!==(Od=this._meta.properties)&&void 0!==Od&&Od.exif?this._toTab(Dl.qy`${(0,Ll.fa)(ql.DD)} ${null===(Fd=this._parent)||void 0===Fd?void 0:Fd._t.pnx.metadata_exif}`,jp):Co.s6}
|
|
889
889
|
</pnx-tabs>`}}PictureMetadata.styles=[lu.Op,lu.YC,lu.PC,lu.R,Co.AH`
|
|
890
890
|
div[slot="content"] {
|
|
891
891
|
padding: 5px 10px;
|