diff --git a/g3w-admin/client/static/client/app.min.js b/g3w-admin/client/static/client/app.min.js index 89c79f8fd..e76faed52 100644 --- a/g3w-admin/client/static/client/app.min.js +++ b/g3w-admin/client/static/client/app.min.js @@ -1334,7 +1334,7 @@ ${dc(this.code(n,i))} `);else{let g=document.createTextNode(f),d=c.element.childNodes;d[p]&&c.element.removeChild(d[p]),d.length?c.element.insertBefore(g,d[p]):c.element.appendChild(g)}}}}var RJ,MJ,AJ,OJ,PJ,FJ,DJ,qJ,OO,PO=W(()=>{RJ={name:"relations",props:["relations","feature","loading"],methods:{async showRelation(e){await this.$parent.showRelation(e)},featureInfo(){return Object.entries(this.feature.attributes).filter(([e,n])=>n&&typeof n=="string"&&!n.includes("/")).map(([e,n])=>({key:e,value:n})).slice(0,3)}},async mounted(){this.relations.length===1&&(this.relations[0].noback=!0,await this.showRelation(this.relations[0]))},beforeDestroy(){this.relations.length===1&&delete this.relations[0].noback}},MJ=function(){var e=this,n=e.$createElement,i=e._self._c||n;return i("div",{staticClass:"query-relations"},[i("div",{staticClass:"header skin-background-color lighten"},[i("div",{staticClass:"skin-color-dark"},[i("span",{directives:[{name:"t",rawName:"v-t:pre",value:"sdk.relations.list_of_relations_feature",expression:"'sdk.relations.list_of_relations_feature'",arg:"pre"}],staticStyle:{"font-size":"1.1em"}}),e._v(" "),e._l(e.featureInfo(),function(r){return i("div",[e._v(" - "),i("b",[e._v(e._s(r.key))]),e._v(": "+e._s(r.value))])})],2)]),e._v(" "),i("div",{staticClass:"query-relations-content"},e._l(e.relations,function(r){return i("div",{staticClass:"skin-border-color relation-grid-item",on:{click:function(o){return o.stopPropagation(),e.showRelation(r)}}},[i("span",{staticClass:"skin-color g3w-long-text"},[e._v(e._s(r.name))])])}),0)])},AJ=[],OJ=function(e){e&&e("data-v-3cffdc37_0",{source:".relation-grid-item[data-v-3cffdc37]{min-width:0;min-height:80px;border:2px solid;cursor:pointer;border-radius:4px;background-color:#fff;display:flex;align-items:center}.relation-grid-item[data-v-3cffdc37]:hover{background-color:transparent}.query-relations[data-v-3cffdc37]{overflow-y:auto}.query-relations>.header[data-v-3cffdc37]{margin-bottom:10px;border-radius:4px;padding:5px}.query-relations>.query-relations-content[data-v-3cffdc37]{display:grid;grid-template-columns:repeat(2,auto);grid-column-gap:5px;grid-row-gap:5px}.relation-grid-item>.g3w-long-text[data-v-3cffdc37]{font-weight:700;padding:5px}",map:void 0,media:void 0})},PJ="data-v-3cffdc37",FJ=void 0,DJ=!1;qJ=jJ({render:MJ,staticRenderFns:AJ},OJ,RJ,PJ,DJ,FJ,!1,C1,void 0,void 0),OO=qJ});var DO={};hi(DO,{default:()=>k1});function zJ(e=[],n){let i=V.project.getLayerById(n),r=Object.keys(e[0]?e[0].attributes:{}),o=i.getTableHeaders().filter(u=>r.includes(u.name));return{columns:o.map(u=>u.label),rows:e.map(u=>o.map(c=>u.attributes[c.name])),rows_fid:e.map(u=>u.attributes[Cn]),features:e,fields:o.length?o:null,formStructure:i.getLayerEditingFormStructure(),rowFormStructure:null,layerId:i.getId(),title:i.getName()||i.getTitle()}}function YJ(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};d.__file="Relation.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r;{let v;if(n&&(v=c?function(y){n.call(this,g(y,this.$root.$options.shadowRoot))}:function(y){n.call(this,f(y))}),v!==void 0)if(d.functional){let y=d.render;d.render=function(w,E){return v.call(E),y(w,E)}}else{let y=d.beforeCreate;d.beforeCreate=y?[].concat(y,v):[v]}}return d}function I1(){let e=I1.styles||(I1.styles={}),n=typeof navigator<"u"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(r,o){if(document.querySelector('style[data-vue-ssr-id~="'+r+'"]'))return;let u=n?o.media||"default":r,c=e[u]||(e[u]={ids:[],parts:[],element:void 0});if(!c.ids.includes(r)){let f=o.source,p=c.ids.length;if(c.ids.push(r),o.map&&(f+=` /*# sourceURL=`+o.map.sources[0]+" */",f+=` /*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(o.map))))+" */"),n&&(c.element=c.element||document.querySelector("style[data-group="+u+"]")),!c.element){let g=document.head||document.getElementsByTagName("head")[0],d=c.element=document.createElement("style");d.type="text/css",o.media&&d.setAttribute("media",o.media),n&&(d.setAttribute("data-group",u),d.setAttribute("data-next-index","0")),g.appendChild(d)}if(n&&(p=parseInt(c.element.getAttribute("data-next-index")),c.element.setAttribute("data-next-index",p+1)),c.element.styleSheet)c.parts.push(f),c.element.styleSheet.cssText=c.parts.filter(Boolean).join(` -`);else{let g=document.createTextNode(f),d=c.element.childNodes;d[p]&&c.element.removeChild(d[p]),d.length?c.element.insertBefore(g,d[p]):c.element.appendChild(g)}}}}var FO,GJ,$J,BJ,UJ,VJ,WJ,HJ,XJ,k1,L1=W(()=>{Nt();vt();qs();zx();w1();bt();rr();_a();zi();$o();Bn();xi();Hx();bu();yc();GJ={name:"relation",props:{feature:{default:null},relation:{},previousview:{},cardinality:{},layer:{},showrelationslist:{default:!1},chartRelationIds:{default:[]}},mixins:[cs,vr],components:{Field:d_},data(){return{fields:null,chart:!1,headercomponent:null,downloadButton:null,downloadLayer:{state:null,config:{downloads:[]}},page:1,page_size:oo[0],start:0,table:{rows:[]},ordering:null,order:{column:0,sort:"asc"},nmRelation:V.project.getRelationById(this.relation.nmRelationId),showChartButton:!!this.chartRelationIds.find(e=>e===this.relation.referencingLayer)}},computed:{showTools(){return[!!this.isEditable,!!this.table.formStructure,!!this.isGeoLayer].filter(Boolean).length},one(){return this.relation.type==="ONE"}},methods:{zoomToGeometry(e){e&&U.getService("map").zoomToGeometry(new ol.geom[e.type](e.coordinates),{highlight:!0})},async getRelationsNM({nmRelation:e,features:n=[]}={}){let{referencedLayer:i,fieldRef:{referencingField:r,referencedField:o}}=e,u=[];if(n.length){let c=n.map(p=>p.attributes[r]),{data:f}=await Ht.getData("search:features",{inputs:{layer:st(i),filter:c.map(p=>`${o}|eq|${encodeURIComponent(p)}`).join("|OR,"),formatter:1},outputs:null});f&&f[0]&&Array.isArray(f[0].features)&&(u=f[0].features.map(p=>({id:p.getId(),geometry:p.getGeometry(),attributes:co(p.getProperties()).reduce((g,d)=>(g[d]=p.get(d),g),{})})))}return u},async getRelationDataTable({page:e,page_size:n,ordering:i}={}){U.setLoadingContent(!0);let r={rows:[]};try{let o=this.relation.referencingLayer,u,c=await ht.get({url:lp({layer:this.layer,fid:this.feature.attributes[Cn],relation:this.relation,page:e,page_size:n,ordering:i})});u=c.result?(c.vector.data.features||[]).map(p=>(p.properties[Cn]=p.id,{geometry:p.geometry,attributes:p.properties,id:p.id})):null;let f=u&&c.vector.count;this.nmRelation&&(o=this.nmRelation.referencedLayer,u=await this.getRelationsNM({nmRelation:this.nmRelation,features:u})),r=zJ(u,o),r.count=f}catch(o){console.warn(o)}return U.setLoadingContent(!1),r},async createTable(){let e=st(this.table.layerId);this.isEditable=e.isEditable()&&!e.isInEditing(),this.isGeoLayer=this.table.features.find(i=>i.geometry)!==void 0;let n=e.getDownloadableFormats().filter(i=>i!=="pdf");if(n.length>0&&(this.downloadButton={toggled:!1,tooltip:n.length>1?"Downloads":`sdk.tooltips.download_${n[0]}`,handler:n.length>1?async()=>{this.downloadButton.toggled=!this.downloadButton.toggled,this.downloadLayer.state=this.downloadLayer.state||e.state,this.downloadLayer.config.downloads=this.downloadLayer.config.downloads.length?this.downloadLayer.config.downloads:n.map(i=>({id:i,format:i,cbk:()=>{this.saveRelation(e.getDownloadUrl(i)),this.headercomponent=null},download:!0})),this.headercomponent=this.downloadButton.toggled?Sp:null}:()=>this.saveRelation(e.getDownloadUrl(n[0]))}),nn.$on("reload-relations",()=>{this.reloadLayout()}),this.showChart=Hn(async()=>{this.chart=!this.chart,await this.$nextTick(),this.chartContainer=this.chartContainer||$("#chart_content"),this.$emit(this.chart?"show-chart":"hide-chart",this.chartContainer,{relations:[this.relation],fid:this.feature.attributes[Cn]})}),await this.$nextTick(),FO=U.getSize({element:"sidebar",what:"width"}),this.relation.title=this.relation.name,!this.one){let i=this.table.rows.length{try{this.relationDataTable.destroy(!0),this.relationDataTable=null,this.table.rows=[],await this.$nextTick();let o=r.length!==this.page_size||r.start!==this.start;this.page_size=r.length,this.start=r.start;let u=r.order[0].column-1,c=u===this.order.column?o?this.order.sort:this.order.sort==="desc"?"asc":"desc":"asc";this.order.column=u,this.order.sort=c,this.ordering=`${c==="desc"?"-":""}${this.table.fields[r.order[0].column-1].name}`,this.table=await this.getRelationDataTable({page:r.start===0?1:r.start/r.length+1,page_size:r.length,ordering:this.ordering})}catch(o){console.warn(o)}U.setLoadingContent(!1)}:null,serverSide:i}),this.tableHeaderHeight=$(".query-relation div.dataTables_scrollHeadInner").height()}U.on("pop-content",()=>setTimeout(()=>this.resize())),this.resize()},async resize(){if(!this.$refs.query_relation||this.$refs.query_relation.parentNode.style.display==="none")return;$(this.$refs.query_relation).find("div.dataTables_scrollBody").height($(".content").height()-this.tableHeaderHeight-$(".content_breadcrumb").outerHeight()-$(".navbar").outerHeight()-$(".close-panel-block").outerHeight()-$(this.$refs["relation-header"]).outerHeight()-$(".dataTables_filter").last().outerHeight()-$(".dataTables_paginate.paging_simple_numbers").outerHeight()-$(".dataTables_scrollHead").last().outerHeight()),this.reloadLayout()},async saveRelation(e){V.download=!0;try{let n=await fetch(lp(Object.assign({layer:this.layer,fid:this.feature.attributes[Cn],relation:this.relation},{type:e})),{headers:{"Access-Control-Expose-Headers":"Content-Disposition"},signal:AbortSignal.timeout(ji)});if(!n?.ok)throw(await n.json()).message;Ur(await n.blob(),n.headers.get("content-disposition").split("filename=").at(-1))}catch(n){console.warn(n),U.showUserMessage({type:"alert",message:n||"info.server_error",closable:!0})}V.download=!1,this.downloadButton.toggled=!1},async showFormStructureRow({title:e,layerid:n,feature:i,fields:r,tabs:o}={}){U.showContent({content:new zt({internalComponent:new(Vue.extend({data(){return{layerid:n,feature:i,fields:r,formStructure:o}},template:` +`);else{let g=document.createTextNode(f),d=c.element.childNodes;d[p]&&c.element.removeChild(d[p]),d.length?c.element.insertBefore(g,d[p]):c.element.appendChild(g)}}}}var FO,GJ,$J,BJ,UJ,VJ,WJ,HJ,XJ,k1,L1=W(()=>{Nt();vt();qs();zx();w1();bt();rr();_a();zi();$o();Bn();xi();Hx();bu();yc();GJ={name:"relation",props:{feature:{default:null},relation:{},previousview:{},cardinality:{},layer:{},showrelationslist:{default:!1},chartRelationIds:{default:[]}},mixins:[cs,vr],components:{Field:d_},data(){return{fields:null,chart:!1,headercomponent:null,downloadButton:null,downloadLayer:{state:null,config:{downloads:[]}},page:1,page_size:oo[0],start:0,table:{rows:[]},ordering:null,order:{column:0,sort:"asc"},nmRelation:V.project.getRelationById(this.relation.nmRelationId),showChartButton:!!this.chartRelationIds.find(e=>e===this.relation.referencingLayer)}},computed:{showTools(){return[!!this.isEditable,!!this.table.formStructure,!!this.isGeoLayer].filter(Boolean).length},one(){return this.relation.type==="ONE"}},methods:{zoomToGeometry(e){e&&U.getService("map").zoomToGeometry(new ol.geom[e.type](e.coordinates),{highlight:!0})},async getRelationsNM({nmRelation:e,features:n=[]}={}){let{referencedLayer:i,fieldRef:{referencingField:r,referencedField:o}}=e,u=[];if(n.length){let c=n.map(p=>p.attributes[r]),{data:f}=await Ht.getData("search:features",{inputs:{layer:st(i),filter:c.map(p=>`${o}|eq|${encodeURIComponent(p)}`).join("|OR,"),formatter:1},outputs:null});f&&f[0]&&Array.isArray(f[0].features)&&(u=f[0].features.map(p=>({id:p.getId(),geometry:p.getGeometry(),attributes:co(p.getProperties()).reduce((g,d)=>(g[d]=p.get(d),g),{})})))}return u},async getRelationDataTable({page:e,page_size:n,ordering:i}={}){U.setLoadingContent(!0);let r={rows:[]};try{let o=this.relation.referencingLayer,u,c=await ht.get({url:lp({layer:this.layer,fid:this.feature.attributes[Cn],relation:this.relation,page:e,page_size:n,ordering:i})});u=c.result?(c.vector.data.features||[]).map(p=>(p.properties[Cn]=p.id,{geometry:p.geometry,attributes:p.properties,id:p.id})):null;let f=u&&c.vector.count;this.nmRelation&&(o=this.nmRelation.referencedLayer,u=await this.getRelationsNM({nmRelation:this.nmRelation,features:u})),r=zJ(u,o),r.count=f}catch(o){console.warn(o)}return U.setLoadingContent(!1),r},async createTable(){let e=st(this.table.layerId);this.isEditable=e.isEditable()&&!e.isInEditing(),this.isGeoLayer=this.table.features.find(i=>i.geometry)!==void 0;let n=e.getDownloadableFormats().filter(i=>i!=="pdf");if(n.length>0&&(this.downloadButton={toggled:!1,tooltip:n.length>1?"Downloads":`sdk.tooltips.download_${n[0]}`,handler:n.length>1?async()=>{this.downloadButton.toggled=!this.downloadButton.toggled,this.downloadLayer.state=this.downloadLayer.state||e.state,this.downloadLayer.config.downloads=this.downloadLayer.config.downloads.length?this.downloadLayer.config.downloads:n.map(i=>({id:i,format:i,cbk:()=>{this.saveRelation(e.getDownloadUrl(i)),this.headercomponent=null},download:!0})),this.headercomponent=this.downloadButton.toggled?Sp:null}:()=>this.saveRelation(e.getDownloadUrl(n[0]))}),nn.$on("reload-relations",()=>{this.reloadLayout()}),this.showChart=Hn(async()=>{this.chart=!this.chart,await this.$nextTick(),this.chartContainer=this.chartContainer||$("#chart_content"),this.$emit(this.chart?"show-chart":"hide-chart",this.chartContainer,{relations:[this.relation],fid:this.feature.attributes[Cn]})}),await this.$nextTick(),FO=U.getSize({element:"sidebar",what:"width"}),this.relation.title=this.relation.name,!this.one){let i=this.table.rows.length{try{this.relationDataTable.destroy(!0),this.relationDataTable=null,this.table.rows=[],await this.$nextTick();let o=r.length!==this.page_size||r.start!==this.start;this.page_size=r.length,this.start=r.start;let u=r.order[0].column-1,c=u===this.order.column?o?this.order.sort:this.order.sort==="desc"?"asc":"desc":"asc";this.order.column=u,this.order.sort=c,this.ordering=`${c==="desc"?"-":""}${this.table.fields[r.order[0].column-1].name}`,this.table=await this.getRelationDataTable({page:r.start===0?1:r.start/r.length+1,page_size:r.length,ordering:this.ordering})}catch(o){console.warn(o)}U.setLoadingContent(!1)}:null,serverSide:i}),this.tableHeaderHeight=$(".query-relation div.dataTables_scrollHeadInner").height()}U.on("pop-content",()=>setTimeout(()=>this.resize())),this.resize()},async resize(){if(!this.$refs.query_relation||this.$refs.query_relation.parentNode.style.display==="none")return;$(this.$refs.query_relation).find("div.dataTables_scrollBody").height($(".content").height()-this.tableHeaderHeight-$(".content_breadcrumb").outerHeight()-$(".navbar").outerHeight()-$(".close-panel-block").outerHeight()-$(this.$refs["relation-header"]).outerHeight()-$(".dataTables_filter").last().outerHeight()-$(".dataTables_paginate.paging_simple_numbers").outerHeight()-$(".dataTables_scrollHead").last().outerHeight()),this.reloadLayout()},async saveRelation(e){V.download=!0;try{let n=await fetch(lp(Object.assign({layer:this.layer,fid:this.feature.attributes[Cn],relation:this.relation},{type:e})),{headers:{"Access-Control-Expose-Headers":"Content-Disposition"},signal:AbortSignal.timeout(ji)});if(!n?.ok)throw(await n.json()).message;Ur(await n.blob(),n.headers.get("content-disposition").split("filename=").at(-1))}catch(n){console.warn(n),U.showUserMessage({type:"alert",message:n||"info.server_error",closable:!0})}V.download=!1,this.downloadButton.toggled=!1},async showFormStructureRow({title:e,layerid:n,feature:i,fields:r,tabs:o}={}){U.showContent({content:new zt({internalComponent:new(Vue.extend({data(){return{layerid:n,feature:i,fields:r,formStructure:o}},template:`
@@ -1352,7 +1352,7 @@ ${dc(this.code(n,i))}
- `,async mounted(){await this.$nextTick(),this.$refs.table.click()}}))}),push:!0,showgoback:!0,closable:!1,title:e})},editFeature(e){U.getService("queryresults").editFeature({layer:{id:this.table.layerId,attributes:this.table.fields},feature:this.table.features[e]})},getRowFields(e){return this.table.fields.map((n,i)=>(n.value=e[i],n.query=!0,n.input={type:`${this.getFieldType(n)}`},n))},reloadLayout(){this.relationDataTable&&this.relationDataTable.columns.adjust()},back(){this.$parent.setRelationsList()},fieldIs(e,n){return this.getFieldType(n)===e},is(e,n){return this.fieldIs(e,n)},wrapMoveFnc(e){this.moveFnc(e)},resizeStart(){document.getElementById("g3w-view-content").addEventListener("mousemove",this.wrapMoveFnc),document.getElementById("g3w-view-content").addEventListener("mouseup",this.resizeStop,{once:!0})},async resizeStop(){document.getElementById("g3w-view-content").removeEventListener("mousemove",this.wrapMoveFnc),await this.$nextTick(),U.emit("resize")},moveFnc(e){let n=$(".sidebar-collapse").length?0:FO,i=e.pageX+2-n;this.$refs.tablecontent.style.width=`${i}px`,this.$refs.chartcontent.style.width=`${$(this.$refs.relationwrapper).width()-i-10}px`}},watch:{table(e){e&&e.rows.length&&this.createTable()},async chart(){await this.$nextTick(),this.resize()},async headercomponent(){await this.$nextTick(),this.resize()}},beforeCreate(){this.delayType="debounce"},async created(){try{this.table=await this.getRelationDataTable({page:this.page,page_size:this.page_size,ordering:this.ordering})}catch(e){console.warn(e)}},async beforeDestroy(){this.relationDataTable&&(this.relationDataTable.destroy(),this.relationDataTable=null,this.chartContainer&&this.$emit("hide-chart",this.chartContainer),this.chartContainer=null,this.tableHeaderHeight=null,U.off("pop-content",this.resize))}},$J=function(){var e=this,n=e.$createElement,i=e._self._c||n;return e.table?i("div",{ref:"query_relation",staticClass:"query-relation",class:e.isMobile()?"mobile":null},[i("div",{ref:"relation-header",staticClass:"header skin-background-color lighten"},[i("div",{staticClass:"g3w-long-text"},[e.showrelationslist?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:right.create",value:"sdk.relations.back_to_relations",expression:"'sdk.relations.back_to_relations'",arg:"right",modifiers:{create:!0}}],staticClass:"action-button-icon action-button back-button",class:e.$fa("exit"),on:{click:function(r){return r.stopPropagation(),e.back.apply(null,arguments)}}}):e._e(),e._v(" "),i("b",{staticClass:"relation-tile skin-color"},[e._v(" "+e._s(e.relation.name)+" ")])]),e._v(" "),e.table.rows.length?i("div",{staticClass:"relations-table-tools"},[e.downloadButton?i("span",{directives:[{name:"download",rawName:"v-download"},{name:"t-tooltip",rawName:"v-t-tooltip:left.create",value:e.downloadButton.tooltip,expression:"downloadButton.tooltip",arg:"left",modifiers:{create:!0}}],staticClass:"action-button-icon action-button",class:[e.$fa("download"),{"toggled-white":e.downloadButton.toggled}],on:{click:function(r){return r.stopPropagation(),e.downloadButton.handler.apply(null,arguments)}}}):e._e(),e._v(" "),e.showChartButton?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:bottom.create",value:"sdk.tooltips.show_chart",expression:"'sdk.tooltips.show_chart'",arg:"bottom",modifiers:{create:!0}}],staticClass:"action-button-icon action-button",class:[e.$fa("chart"),e.chart?"toggled-white":""],on:{click:function(r){return r.stopPropagation(),e.showChart.apply(null,arguments)}}}):e._e()]):e._e()]),e._v(" "),e.table.rows.length?i("div",{ref:"relationwrapper",staticClass:"relation-wrapper"},[i("div",{ref:"tablecontent",style:{width:e.chart?"70%":"100%",marginRight:e.chart?"8px":"3px",position:"relative"},attrs:{id:"table_content"}},[e.headercomponent?i("div",{staticClass:"header-component"},[i(e.headercomponent,{tag:"component",attrs:{layer:e.downloadLayer.state,config:e.downloadLayer.config}})],1):e._e(),e._v(" "),i("table",{ref:"relationtable",staticClass:"hover relationtable table table-striped row-border compact nowrap"},[i("thead",[i("tr",{staticStyle:{height:"0! important"}},[e.showTools?i("th",{style:{minWidth:this.showTools*30+"px",padding:"0 !important"}}):e._e(),e._v(" "),e._l(e.table.columns,function(r){return i("th",[e._v(e._s(r))])})],2)]),e._v(" "),i("tbody",e._l(e.table.rows,function(r,o){return i("tr",{key:e.table.rows_fid[o],class:{selected:e.table.rowFormStructure===r}},[e.showTools?i("td",{staticClass:"table-tools"},[e.table.features[o].geometry?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:right.create",value:"sdk.tooltips.relations.zoomtogeometry",expression:"'sdk.tooltips.relations.zoomtogeometry'",arg:"right",modifiers:{create:!0}}],staticClass:"action-button row-form skin-color",class:e.$fa("marker"),on:{click:function(u){return u.stopPropagation(),e.zoomToGeometry(e.table.features[o].geometry)}}}):e._e(),e._v(" "),e.table.formStructure?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:right.create",value:"sdk.tooltips.relations.row_to_form",expression:"`sdk.tooltips.relations.row_to_form`",arg:"right",modifiers:{create:!0}}],staticClass:"action-button row-form skin-color",class:e.$fa("table"),on:{click:function(u){u.stopPropagation(),e.showFormStructureRow({title:e.table.title,layerid:e.table.layerId,feature:e.table.features[o],fields:e.getRowFields(r),tabs:e.table.formStructure})}}}):e._e(),e._v(" "),e.isEditable?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:right.create",value:"Edit",expression:"'Edit'",arg:"right",modifiers:{create:!0}}],staticClass:"action-button row-form skin-color",class:e.$fa("pencil"),on:{click:function(u){return u.stopPropagation(),e.editFeature(o)}}}):e._e()]):e._e(),e._v(" "),e._l(r,function(u){return i("td",[i("field",{attrs:{state:{value:u}}})],1)})],2)}),0)])]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.chart,expression:"chart"}],staticClass:"skin-border-color lighten",staticStyle:{"border-style":"solid","border-width":"0 1px 0 1px"},style:{minWidth:"5px",backgroundColor:"#dddddd",cursor:"col-resize"},on:{mousedown:function(r){return r.stopPropagation(),e.resizeStart.apply(null,arguments)}}}),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.chart,expression:"chart"}],ref:"chartcontent",style:{width:e.chart?"30%":"0"},attrs:{id:"chart_content"}})]):i("div",{staticClass:"dataTables_scrollBody"},[i("span",{directives:[{name:"t",rawName:"v-t",value:"sdk.relations.no_relations_found",expression:"'sdk.relations.no_relations_found'"}]})])]):e._e()},BJ=[],UJ=function(e){e&&(e("data-v-8b4f301e_0",{source:".query-relation[data-v-8b4f301e]{margin-top:3px}.query-relation>.header[data-v-8b4f301e]{padding:3px;display:flex;justify-content:space-between;align-items:center;width:100%;margin:0!important}.query-relation>.header>.g3w-long-text[data-v-8b4f301e]{border-radius:3px;font-size:1.3em}.query-relation.mobile>.header>.g3w-long-text[data-v-8b4f301e]{font-size:1em}.relations-table-tools[data-v-8b4f301e]{font-size:1.1em;margin-bottom:3px}.relations-table-tools>.action-button[data-v-8b4f301e]{padding:5px}.relation-wrapper[data-v-8b4f301e]{display:flex;justify-content:space-between;margin-bottom:5px;margin-top:3px;height:95%}.back-button[data-v-8b4f301e]{font-size:.8em}.header-component[data-v-8b4f301e]{width:100%;display:flex;margin-left:auto;margin-bottom:5px;margin-right:4px}.relationtable .table-tools .action-button[data-v-8b4f301e]:hover{background-color:transparent}.relationtable.dataTable tbody tr.selected[data-v-8b4f301e]{background-color:#e4e4e4!important}.relationtable.dataTable tbody tr.selected .row-wrap-tabs .tabs-wrapper[data-v-8b4f301e]{background-color:#fff!important}#chart_content[data-v-8b4f301e]{padding-bottom:5px;margin-bottom:5px;margin-left:8px}.dataTables_scrollBody[data-v-8b4f301e]{font-weight:700;margin-top:10px;font-size:1.1em;display:flex;justify-content:space-between}",map:void 0,media:void 0}),e("data-v-8b4f301e_1",{source:".relation-wrapper .dataTables_length select{border:1px solid #ccc;background:#fff;height:27px}.relation-wrapper .paginate_button{background:0 0!important;color:currentColor!important;box-shadow:none!important}.relation-wrapper .paginate_button.disabled{opacity:.25!important}.relation-wrapper .dataTables_scroll{background:#fff}",map:void 0,media:void 0}))},VJ="data-v-8b4f301e",WJ=void 0,HJ=!1;XJ=YJ({render:$J,staticRenderFns:BJ},UJ,GJ,VJ,HJ,WJ,!1,I1,void 0,void 0),k1=XJ});var jO={};hi(jO,{default:()=>see});function iee(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};return d.__file="RelationsPage.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r,d}var ZJ,KJ,QJ,JJ,eee,tee,nee,ree,see,qO=W(()=>{_a();bt();PO();L1();ZJ={name:"relation-page",data(){let{relation:e=null,relations:n=[],nmRelation:i,feature:r=null,currentview:o="relations",chartRelationIds:u=[],layer:c}=this.$options;return{loading:!1,state:null,error:!1,previousview:o,feature:r,currentview:o,relation:e,relations:n,nmRelation:i,chartRelationIds:u,layer:c}},components:{relations:OO,relation:k1},computed:{showrelationslist(){return this.previousview==="relations"&&this.relations.length>1}},methods:{reloadLayout(){nn.$emit("reload-relations")},showChart(e,n){U.getService("queryresults").showChart([this.relation.referencingLayer],e,n)},hideChart(e){U.getService("queryresults").hideChart(e)},async showRelation(e){this.loading=!0,this.relation=e;try{U.setCurrentContentOptions({title:e.name,crumb:{title:e.name,text:!0}}),await this.$nextTick(),this.previousview=this.currentview,this.currentview="relation"}catch(n){console.warn(n)}this.loading=!0},setRelationsList(){this.previousview="relation",this.currentview="relations",U.setCurrentContentOptions({crumb:{title:"info.list_of_relations"}}),this.loading=!1}},beforeMount(){(this.currentview==="relation"||this.relations.length===1&&this.relations[0].type==="ONE")&&this.showRelation(this.relations[0])},async mounted(){this.relations.sort(({name:e},{name:n})=>en?1:0),await this.$nextTick(),this.error&&requestAnimationFrame(()=>U.popContent()),this.error=!1},created(){this.$on("resize-component",this.reloadLayout)}},KJ=function(){var e=this,n=e.$createElement,i=e._self._c||n;return i("div",{staticClass:"query-relations-page"},[i(e.currentview,{ref:e.currentview,tag:"component",attrs:{loading:e.loading,previousview:e.previousview,relations:e.relations,relation:e.relation,feature:e.feature,layer:e.layer,chartRelationIds:e.chartRelationIds,showrelationslist:e.showrelationslist},on:{"show-chart":e.showChart,"hide-chart":e.hideChart}})],1)},QJ=[],JJ=void 0,eee=void 0,tee=void 0,nee=!1;ree=iee({render:KJ,staticRenderFns:QJ},JJ,ZJ,eee,nee,tee,!1,void 0,void 0,void 0),see=ree});var GO={};hi(GO,{default:()=>oee});function zO(e){if(e.nodes)for(let n of e.nodes)zO(n);else e.name&&(e.relation=!0)}var oee,$O=W(()=>{_a();bt();Nt();Yn();qs();_c();vt();zi();w1();AO();bu();Nw();Tw();l1();yc();$o();bn();E1();Bn();bc();Ld();cn();oee=new class extends Et{constructor(){super(),this.setters={setQueryResponse(n,i={add:!1,update:!1}){if(n.data||(n.data=[]),n.query||(n.query={external:{add:!1,filter:{SELECTED:!1}}}),n.query.external||(n.query.external={add:!1,filter:{SELECTED:!1}}),i.add===!1&&i.update&&(this.state.query=n.query,this.state.type=n.type),i.add===!1&&!i.update&&(this.clearState(),this.state.query=n.query,this.state.type=n.type),n.query.external.add===!0&&i.add===!1){let u=U.getService("catalog"),c=n.query.external.filter.SELECTED;this._vectorLayers.forEach(f=>{let p=f.get("id");f.getVisible()&&[void 0,!!(u.state.external.vector.find(g=>g.id===p)||{}).selected].includes(c)&&n.data[p==="__g3w_marker"?"unshift":"push"](this.getVectorLayerFeaturesFromQueryRequest(f,n.query))})}let r=i.add===!1&&{coordinates:(this.state.query.coordinates||[]).length===2&&new ol.geom.Point(this.state.query.coordinates),bbox:(this.state.query.bbox||[]).length===4&&ol.geom.Polygon.fromExtent(this.state.query.bbox),polygon:this.state.query.geometry,drawpolygon:this.state.query.geometry,circle:this.state.query.geometry}[this.state.query.type];if(r){let u=new ol.Feature(r);u.setId(void 0),this.resultsQueryLayer.getSource().clear(),U.getService("map").getMap().removeLayer(this.resultsQueryLayer),this.resultsQueryLayer.getSource().addFeature(u),U.getService("map").getMap().addLayer(this.resultsQueryLayer),this.resultsQueryLayer.setZIndex(U.getService("map").getMap().getLayers().getLength())}let o=n.data.flatMap(u=>[].concat(u)).filter(u=>u&&(u.rawdata!==void 0||Array.isArray(u.features)&&u.features.length>0)).map(({layer:u,features:c,rawdata:f,error:p}={})=>{let g=u instanceof ai,d=u instanceof ol.layer.Vector,v=typeof u=="string"||u instanceof String,y;if(v)y=ai.LayerTypes.VECTOR;else if(g)try{y=u.getSourceType()}catch(z){console.warn("uknown source type for layer:",z,u)}let S=v&&u.split("_"),w=(g?u.getId():void 0)||(d?u.get("id"):void 0)||(v?u:void 0),E,I;(!c||!c.length)&&(E=[]),!E&&u instanceof ai&&(I=u.getAttributes().map(z=>this.state.type==="ows"?{...z,name:z.name.replace(/ /g,"_")}:z)),!E&&u instanceof ol.layer.Vector&&(I=u.getProperties()),(!E&&typeof u=="string"||u instanceof String)&&(I=c[0]?c[0].getProperties():[]);let O=(!E&&u instanceof ai&&I||[]).filter(z=>{try{return z.name[0]==="_"||Number.isInteger(1*z.name[0])}catch{return!1}}).map(z=>({alias:z.name.replace(/_/,""),name:z.name}));!E&&O.length&&c.forEach(z=>{let Z=Object.keys(z.getProperties());O.forEach(te=>{Z.find(ee=>{if(ee===te.alias)return z.set(te.name,z.get(ee)),!0})})});let H=!E&&co(Object.keys(c[0]instanceof ol.Feature?c[0].getProperties():c[0].properties));E||(E=I&&I.length>0?I.filter(z=>H.includes(z.name)):H.map(z=>({name:z,label:z,show:Cn!==z&&[void 0,"gdal","wms","wcs","wmst","postgresraster"].includes(y),type:"varchar"})));let X=d||v,re=g&&u.hasFormStructure()&&u.getLayerEditingFormStructure();if(re&&Array.isArray(this._relations[u.getId()])&&this._relations[u.getId()].length>0)for(let z of re)zO(z);return{id:w,attributes:E,external:X,features:(!f&&c||[]).map(z=>({id:X||z instanceof ol.Feature?z.getId():z.id,attributes:z instanceof ol.Feature?z.getProperties():z.properties,geometry:z instanceof ol.Feature?z.getGeometry():z.geometry,selection:{selected:!1},show:!0})),hasgeometry:Array.isArray(c)&&!f&&c.some(z=>z instanceof ol.Feature?z.getGeometry():z.geometry),hasImageField:Array.isArray(c)&&!f&&c.length&&E.some(z=>z.type==="image"),loading:!1,show:!0,expandable:!0,addfeaturesresults:{active:!1},downloadformats:{active:!1},editable:g?u.isEditable()&&u.config.editing.visible:!1,inediting:g?u.isInEditing():!1,source:g?u.getSource():void 0,infoformat:g?u.getInfoFormat():void 0,infoformats:g?u.getInfoFormats():[],downloads:g?u.getDownloadableFormats():[],formStructure:re?{structure:re,fields:u.getFields().filter(z=>z.show).concat((Array.isArray(c)&&!f&&c.length>0&&E||[]).filter(z=>u.getFields().some(Z=>Z.name===z.name)))}:void 0,relationsattributes:g||d||v?[]:void 0,filter:g&&!["wms","wcs","wmst"].includes(y)?u.state.filter:{},selection:g&&!["wms","wcs","wmst"].includes(y)&&u.state.selection||d&&u.selection||{},title:g&&u.getTitle()||d&&u.get("name")||v&&S&&(S.length>4?S.slice(0,S.length-4).join(" "):u)||void 0,atlas:this._atlas.filter(z=>z.atlas.qgs_layer_id===w),rawdata:f||null,error:p||"",toc:X||u.state.toc}});this.setLayersData(o,i)},setLayersData(n=[],i={add:!1,update:!1}){i.add===!1&&n.sort((r,o)=>r.external?0:this._projectLayerIds.indexOf(r.id)>this._projectLayerIds.indexOf(o.id)?1:-1),n.forEach((r,o)=>{r.filter.pagination=r.filter.pagination||!!(this.state.query.pagination&&this.state.query.pagination.counts[o]>r.features.length),i.add||i.update?this.updateLayerResultFeatures(r,i.update):this.state.layers.push(r)}),this.setActionsForLayers(n,{add:i.add,update:i.update}),this.state.changed=!0},addComponent(n){this.state.components.push(n)},addActionsForLayers(n,i){},postRender(n){},closeComponent(){},changeLayerResult(n){this.state.layersactions[n.id].forEach(i=>i.change&&i.change(n)),(n.features||[]).forEach((i,r)=>{let o=this.state.currentactiontools[n.id];o!==void 0&&(o[r]===void 0&&Vue.set(o,r,null),o[r]=null)})},activeMapInteraction(){},editFeature({layer:n,feature:i}={}){},openCloseFeatureResult({open:n,layer:i,feature:r,container:o}={}){},removeFeatureLayerFromResult(n,i){this.updateLayerResultFeatures({id:n.id,external:n.external,features:[i]})}},this.unlistenerlayeractionevents=[],this._relations={},this._atlas=[],this.plotLayerIds=[],this.state={logged:V.user.id!==void 0,components:[],layers:[],changed:!1,query:null,type:"ows",layersactions:{},actiontools:{},currentactiontools:{},currentactionfeaturelayer:{},layeractiontool:{},layersFeaturesBoxes:{},layerscustomcomponents:{}},this._vectorLayers=[],this._addFeaturesLayerResultInteraction={id:null,interaction:null,mapcontrol:null,toggleeventhandler:null},this._asyncFnc={todo:()=>{},zoomToLayerFeaturesExtent:{async:!1},highLightLayerFeatures:{async:!1},goToGeometry:{async:!1}},this.resultsQueryLayer=new ol.layer.Vector({source:new ol.source.Vector,style:n=>new ol.style.Style(n.getGeometry().getType()==="Point"?{text:new ol.style.Text({fill:new ol.style.Stroke({color:"black"}),text:"\uF3C5",font:'900 3em "Font Awesome 5 Free"',offsetY:-15})}:{stroke:new ol.style.Stroke({color:"black"})})}),this._project=V.project,this._projectLayerIds=(()=>{let n=[],i=r=>{(r.nodes||[r]).forEach(o=>{o.id?n.push(o.id):i(o)})};return this._project.state.layerstree.forEach(i),n})(),this._setRelations(this._project),this._atlas=this._project.getPrint().filter(n=>n.atlas)||[],U.onbefore("setContent",n=>{n.perc===100&&U.isMobile()&&(this._asyncFnc.zoomToLayerFeaturesExtent.async=!0,this._asyncFnc.highLightLayerFeatures.async=!0,this._asyncFnc.goToGeometry.async=!0)})}async loadPaginationData(n,i,r,o){this.state.query.autofilter&&this.state.query.pagination&&(this.state.query.autofilter=!1,this.state.query.pagination.getData.params.forEach(d=>delete d.autofilter)),r&&(this.state.query.pagination.getData.params[n].page_size=r,this.state.query.pagination.pages[n]=Math.round(this.state.query.pagination.counts[n]/r));let{layers:u=[],method:c,params:f}=this.state.query.pagination.getData,p=u[n],g=!!p.getFilterToken();try{let d=await p[c]({...f[n],page:i});this.setQueryResponse({...d,query:o},{add:!1,update:!0}),this.state.query.pagination.current[n]=i;let v=p.state.selection.active||g,y=this.state.layersactions[p.getId()].find(({id:S})=>S==="selection");this.state.layers[n].features.forEach((S,w)=>{if(v&&!S.selection.selected&&p.isGeoLayer()&&S.geometry){let E=this._getFeatureId(S,this.state.layers[n].external);p.addOlSelectionFeature({id:E,feature:S}).selected=!0,p.includeSelectionFid(E,!1)}S.selection.selected=v,y.state.toggled[w]=v}),p.state.filter.active=v,p.state.selection.active=v,this.state.layers[n].filter.pagination=this.state.layers[n].features.lengthf.id===n.id),o=n.features||[],u=(this.state.layers.find(f=>f.id===n.id)||{}).external;if(r&&(r.features||[]).length>0){let f=i?[]:r.features.map(g=>u?g.id:g.attributes[Cn]),p=this.state.layersactions[r.id].find(g=>g.id==="selection");i&&(r.features.forEach(g=>delete this.state.layersFeaturesBoxes[this.getBoxId(r,g)]),r.features.splice(0)),o.forEach((g,d)=>{let v=this._getFeatureId(g,u);f.some(y=>y===v)?(p&&g.selection.selected&&(u?r:st(r.id)).excludeSelectionFid(v,r.filter.active),r.features.splice(d,1),delete this.state.layersFeaturesBoxes[this.getBoxId(r,g)],p&&(delete p.state.toggled[d],p.state.toggled=Vue.observable(r.features.reduce((y,S,w)=>(y[w]=S.selection.selected,y),{})))):r.features.push(g)}),(r.features||[]).forEach(g=>{let d=(r.features||[]).length>1,v=this.state.layersFeaturesBoxes[this.getBoxId(r,g)];v&&setTimeout(()=>v.collapsed=d)})}r&&(r.features||[]).length===0&&setTimeout(()=>{this.state.layers=this.state.layers.filter(f=>f.id!==r.id),this.clearHighlightGeometry(r),this.removeAddFeaturesLayerResultInteraction(!0)}),this.state.layers.length===1&&U.getService("map").highlightFeatures(this.state.layers[0].features,{duration:1/0}),this.changeLayerResult(r)}getBoxId(n,i,r){return r!=null?`${n.id}_${i.id}_${r}`:`${n.id}_${i.id}`}setActionsForLayers(n,i={add:!1,update:!1}){i.add||i.update||(this.unlistenerlayeractionevents=[],n.forEach(r=>{let o=this.state;this.state.layeractiontool[r.id]=Vue.observable({component:null,config:null}),this.state.currentactiontools[r.id]=Vue.observable({...Array((r.features||[]).length).fill(null)}),this.state.currentactionfeaturelayer[r.id]=Vue.observable({...Array((r.features||[]).length).fill(null)}),this.state.layersactions[r.id]=this.state.layersactions[r.id]||[];let u=r.downloads.length===1&&(r.downloads||[]).at(0),c=(this._relations[r.id]||[]).filter(p=>p.type==="MANY"),f=c.map(p=>this.plotLayerIds.find(g=>g===p.referencingLayer)).filter(Boolean);if(u&&(r[u]=Vue.observable({active:!1})),r.downloads.length>1&&(this.state.actiontools.downloadformats=this.state.actiontools.downloadformats||{},this.state.actiontools.downloadformats[r.id]={downloads:r.downloads.map(p=>({id:`download_${p}_feature`,download:!0,format:p,class:U.getFontClass(p),hint:`sdk.tooltips.download_${p}`,cbk:(g,d,v,y,S)=>{if(this.downloadFeatures(p,g,d,v,y,S),this.state.query.type!=="polygon"){let w=this.state.layersactions[g.id].find(E=>E.id==="downloads");w.cbk(g,d,w,y,S)}}}))}),this.state.layersactions[r.id].push(...[r.hasgeometry&&{id:"gotogeometry",mouseover:!0,class:U.getFontClass("marker"),hint:"sdk.mapcontrols.query.actions.zoom_to_feature.hint",cbk:Hn(this.goToGeometry.bind(this))},c.length&&{id:"show-query-relations",class:U.getFontClass("relation"),hint:"sdk.mapcontrols.query.actions.relations.hint",cbk(p,g,d){U.setCurrentContentOptions({title:p.title,crumb:{text:!0,title:p.title}}),U.pushContent({content:new zt({internalComponent:new(Vue.extend((qO(),Wn(jO)).default))({relations:d.relations,chartRelationIds:d.chartRelationIds,feature:g,layer:p})}),backonclose:!0,title:"info.list_of_relations",id:"__G3W_LIST_OF_RELATIONS_ID__",crumb:{title:"info.list_of_relations",trigger:null},closable:!1})},relations:c,chartRelationIds:f},f.length&&{id:"show-plots-relations",opened:!0,class:U.getFontClass("chart"),state:Vue.observable({toggled:r.features.reduce((p,g,d)=>(p[d]=null,p),{})}),hint:"sdk.mapcontrols.query.actions.relations_charts.hint",cbk:Hn((p,g,d,v,y)=>{d.state.toggled[v]=!d.state.toggled[v],d.state.toggled[v]?this.emit("show-chart",f,y,{relations:this._relations[p.id],fid:g.attributes[Cn],height:400}):this.hideChart(y)})},this._atlas.filter(p=>p.atlas.qgs_layer_id===r.id).length&&{id:"printatlas",download:!0,class:U.getFontClass("print"),hint:"sdk.tooltips.atlas",cbk:this.printAtlas.bind(this)},u&&{id:`download_${u}_feature`,download:!0,state:Vue.observable({toggled:r.features.reduce((p,g,d)=>(p[d]=null,p),{})}),class:U.getFontClass("download"),hint:`sdk.tooltips.download_${u}`,cbk:(p,g,d,v,y)=>{d.state.toggled[v]=!d.state.toggled[v],d.state.toggled[v]?this.downloadFeatures(u,p,g,d,v,u==="pdf"?y[0].innerHTML:null):this.setCurrentActionLayerFeatureTool({index:v,action:d,layer:p})}},r.downloads.length>1&&{id:"downloads",download:!0,class:U.getFontClass("download"),state:Vue.observable({toggled:r.features.reduce((p,g,d)=>(p[d]=null,p),{})}),toggleable:!0,hint:"Downloads",change({features:p}){p.forEach((g,d)=>this.state.toggled[d]===void 0?nn.$set(this.state.toggled,d,!1):this.state.toggled[d]=!1)},cbk:(p,g,d,v)=>{d.state.toggled[v]=!d.state.toggled[v],this.setCurrentActionLayerFeatureTool({layer:p,index:v,action:d,component:d.state.toggled[v]?Sp:null})}},(r.id==="__g3w_marker"||!r.external&&(r.source||{}).type!=="wms")&&{id:"removefeaturefromresult",mouseover:!0,class:U.getFontClass("minus-square"),style:{color:"red"},state:Vue.observable({show:!o.query.pagination&&!r.filter.pagination}),hint:"sdk.mapcontrols.query.actions.remove_feature_from_results.hint",cbk:this.removeFeatureLayerFromResult.bind(this),init(){this.unwatch=nn.$watch(()=>r.filter.pagination,p=>this.state.show=!p)},clear(){this.unwatch&&this.unwatch()},change(){this.state.disabled=!o.query.pagination&&!r.filter.pagination}},r.toc&&r.selection.active!==void 0&&{id:"selection",class:U.getFontClass("success"),hint:"sdk.mapcontrols.query.actions.add_selection.hint",state:Vue.observable({toggled:r.features.reduce((p,g,d)=>(p[d]=null,p),{}),show:!o.query.pagination&&!r.filter.pagination}),init:({feature:p,index:g,action:d}={})=>{if(r.external&&r.selection.active!==void 0)d.state.toggled[g]=p.selection.selected;else if(p&&r.selection.active!==void 0){let v=st(r.id),y=this._getFeatureId(p,r.external),S=p?v.hasSelectionFid(y):!1;!this.state.query.pagination&&v.state.filter.active&&!S&&(S=!0,v.addOlSelectionFeature({id:y,feature:p}).selected=!0,v.includeSelectionFid(y,!1)),p.selection.selected=S,d.state.toggled[g]=v.state.filter.active&&v.state.filter.current==null||S,d.unwatch=nn.$watch(()=>r.filter.pagination,w=>d.state.show=!w)}},clear(){this.unwatch&&this.unwatch()},change({features:p}){this.state.show=!o.query.pagination&&!r.filter.pagination,p.forEach((g,d)=>this.state.toggled[d]===void 0&&nn.$set(this.state.toggled,d,!1))},cbk:Hn(this.addToSelection.bind(this))},r.hasgeometry&&!r.external&&(r.source||{}).type!=="wms"&&{id:"link_zoom_to_fid",class:U.getFontClass("share-alt"),hint:"sdk.mapcontrols.query.actions.copy_zoom_to_fid_url.hint",hint_change:{hint:"sdk.mapcontrols.query.actions.copy_zoom_to_fid_url.hint_change",duration:1e3},cbk(p,g,d){let v=new URL(location.href);v.searchParams.set("zoom_to_fid",`${p.id}|${g.attributes[Cn]}`),sy(v.toString()),d.hint_changed=!0}},r.editable&&r.inediting===!1&&{id:"editing",class:U.getFontClass("pencil"),hint:"sdk.tooltips.editing",cbk:(p,g)=>this.editFeature({layer:p,feature:g})}].filter(Boolean)),r.external&&r.toc&&r.selection.active!==void 0)r.features.forEach(p=>p.selection=(r.selection.features.find(g=>p.id===g.getId())||{selection:{selected:!1}}).selection);else if(!r.external&&r.toc&&r.selection.active!==void 0){let p=()=>r.features.forEach((g,d)=>this.state.layersactions[r.id].find(v=>v.id==="selection").state.toggled[d]=!1);st(r.id).on("unselectionall",p),this.unlistenerlayeractionevents.push({layer:st(r.id),event:"unselectionall",handler:p})}}),this.addActionsForLayers(this.state.layersactions,this.state.layers))}getActionLayerById({layer:n,id:i}={}){if(this.state.layersactions[n.id])return this.state.layersactions[n.id].find(r=>r.id===i)}setCurrentActionLayerFeatureTool({layer:n,action:i,index:r,component:o=null}={}){let u=this.state.currentactiontools[n.id],c=this.state.currentactionfeaturelayer[n.id];c[r]=o?i:null,u[r]=o,u[r]&&i.id!==c[r].id&&c[r].toggleable&&(c[r].state.toggled[r]=!1)}addCurrentActionToolsLayer({id:n,layer:i,config:r={},action:o}){i&&(this.state.actiontools[n]={[i.id]:r},o&&(this.state.layersactions[i.id]=this.state.layersactions[i.id]||[],this.state.layersactions[i.id].push(o)))}setLayerActionTool({layer:n,component:i=null,config:r=null}={}){this.state.layeractiontool[n.id].component=i,this.state.layeractiontool[n.id].config=r}clear(){this._asyncFnc.todo(),this.unlistenerlayeractionevents.forEach(n=>n.layer.off(n.event,n.handler)),this.unlistenerlayeractionevents=[],U.getService("map").clearHighlightGeometry(),this.resultsQueryLayer.getSource().clear(),this.removeAddFeaturesLayerResultInteraction(!0),this._asyncFnc={todo:()=>{},zoomToLayerFeaturesExtent:{async:!1},highLightLayerFeatures:{async:!1},goToGeometry:{async:!1}},this.clearState(),this.closeComponent(),this.resultsQueryLayer.getSource().clear(),U.getService("map").getMap().removeLayer(this.resultsQueryLayer)}isOneLayerResult(){return this.state.layers.length===1}removeAddFeaturesLayerResultInteraction(n){let i=this._addFeaturesLayerResultInteraction;i.toggleeventhandler!==null&&U.getService("map").off("mapcontrol:toggled",i.toggleeventhandler),i.interaction!==null&&U.getService("map").removeInteraction(i.interaction),i.mapcontrol!==null&&i.mapcontrol.toggle(n),Object.assign(i,{interaction:null,id:null,toggleeventhandler:null,mapcontrol:null})}addLayerFeaturesToResultsAction(n){let i=this._addFeaturesLayerResultInteraction,r=![null,n.id].includes(i.id),o=r&&this.state.layers.find(u=>u.id===i.id);if(r&&o&&(o.addfeaturesresults.active=!1),r&&i.interaction&&U.getService("map").removeInteraction(i.interaction),i.id=n.id,n.addfeaturesresults.active=!n.addfeaturesresults.active,n.addfeaturesresults.active===!1)this.removeAddFeaturesLayerResultInteraction(!0);else{this.activeMapInteraction();let u=(this.state.layers.find(c=>c.id===n.id)||{}).external;i.mapcontrol=i.mapcontrol||U.getService("map").getCurrentToggledMapControl()||null,i.interaction=new Hi,U.getService("map").addInteraction(i.interaction,{close:!1}),i.interaction.on("picked",async({coordinate:c})=>{u?this.setQueryResponse({data:[this.getVectorLayerFeaturesFromQueryRequest(this._vectorLayers.find(f=>n.id===f.get("id")),{coordinates:c})],query:{coordinates:c}},{add:!0}):await Ht.getData("query:coordinates",{inputs:{coordinates:c,query_point_tolerance:this._project.getQueryPointTolerance(),layerIds:[n.id],multilayers:!1},outputs:{show:{add:!0}}})}),i.toggleeventhandler=c=>{c.target.isToggled()&&c.target.isClickMap()&&(n.addfeaturesresults.active=!1)},U.getService("map").once("mapcontrol:toggled",i.toggleeventhandler)}}deactiveQueryInteractions(){this.state.layers.forEach(n=>{n.addfeaturesresults&&(n.addfeaturesresults.active=!1)}),this.removeAddFeaturesLayerResultInteraction()}zoomToLayerFeaturesExtent(n,i={}){i.highlight=!this.isOneLayerResult(),this._asyncFnc.zoomToLayerFeaturesExtent.async?this._asyncFnc.todo=U.getService("map").zoomToFeatures.bind(U.getService("map"),n.features||[],i):U.getService("map").zoomToFeatures(n.features||[],i)}highLightLayerFeatures(n,i={}){this._asyncFnc.highLightLayerFeatures.async?this._asyncFnc.todo=U.getService("map").highlightFeatures.bind(U.getService("map"),n.features||[],i):U.getService("map").highlightFeatures(n.features||[],i)}clearState(){this.state.layers.splice(0),this.state.query=null,this.state.querytitle="",this.state.changed=!1,Object.values(this.state.layersactions).forEach(n=>n.forEach(i=>i.clear&&i.clear())),this.state.layersactions={},this.state.actiontools={},this.state.layeractiontool={},this.state.currentactiontools={},this.state.layersFeaturesBoxes={},this.removeAddFeaturesLayerResultInteraction()}getState(){return this.state}setState(n){this.state=n}_setRelations(n){this._relations=(n.getRelations()||[]).reduce((i,r)=>(i[r.referencedLayer]=i[r.referencedLayer]||[],i[r.referencedLayer].push(r),i),{})}setTitle(n){this.state.querytitle=n||""}async trigger(n,i,r,o,u){if(n==="highlightgeometry"&&this.highlightGeometry(i,r,o),n==="clearHighlightGeometry"&&this.clearHighlightGeometry(i,r,o),i&&this.state.layersactions[i.id]){let c=this.state.layersactions[i.id].find(f=>f.id===n);if(c&&c.cbk&&await c.cbk(i,r,c,o,u),c&&c.route){let f=c.route.replace(/{(\w*)}/g,(p,g)=>r.attributes.hasOwnProperty(g)?r.attributes[g]:"");f&&f!==""&&U.goto(f)}}}registerVectorLayer(n){this._vectorLayers.includes(n)||this._vectorLayers.push(n)}unregisterVectorLayer(n){this._vectorLayers=this._vectorLayers.filter(i=>(this.state.layers=this.state.layers.filter(r=>r.id!==n.get("id")),i!==n))}getVectorLayerFeaturesFromQueryRequest(n,i={}){let{coordinates:r,bbox:o,geometry:u,filterConfig:c={}}=i,f=[],p=r&&Array.isArray(r),g=o&&Array.isArray(o);p&&U.getService("map").viewer.map.forEachFeatureAtPixel(U.getService("map").viewer.map.getPixelFromCoordinate(r),v=>{f.push(v)},{layerFilter:v=>v===n}),g&&!p&&(u=ol.geom.Polygon.fromExtent(o));let d=u instanceof ol.geom.Polygon||u instanceof ol.geom.MultiPolygon;return d&&!p&&Lr===n.constructor?f=n.getIntersectedFeatures(u):d&&!p&&ol.layer.Vector===n.constructor&&n.getSource().getFeatures().forEach(v=>{let y;switch(c.spatialMethod){case"within":y=A_(u,v.getGeometry());break;case"intersects":default:y=O_(u,v.getGeometry());break}y===!0&&f.push(v)}),{features:f,layer:n}}async _printSingleAtlas({atlas:n={},features:i=[]}={}){let r=n.atlas?.field_name||"$id",{url:o}=await ny({field:r,values:i.map(u=>u.attributes[r==="$id"?Cn:r]),template:n.name,download:!0});U.setLoadingContent(!0);try{let u=o&&await fetch(o);if(!u?.ok)throw(await u.json()).message;Ur(await u.blob(),n.name||(u.headers.get("content-disposition")||"filename=g3w_download_file").split("filename=").at(1))}catch(u){U.showUserMessage({type:"alert",message:u||"server_error",textMessage:!!u})}V.download=!0,V.download=!1,U.setLoadingContent(!1)}showChart(n,i,r){this.emit("show-chart",n,i,r)}hideChart(n){this.emit("hide-chart",n)}printAtlas(n,i){let r=i?[i]:n.features,o=this._atlas.filter(c=>c.atlas.qgs_layer_id===n.id);if(o.length<=1){this._printSingleAtlas({features:r,atlas:o[0]});return}let u="";o.forEach((c,f)=>{let p=ut();u+=``,u+=``,u+="
"}),U.showModalDialog({title:He("sdk.atlas.template_dialog.title"),message:u,buttons:{success:{label:"OK",className:"skin-button",callback:()=>{let c=$('input[name="template"]:checked').attr("g3w_atlas_index");if(c===void 0)return!1;this._printSingleAtlas({features:r,atlas:o[c]})}}}})}showLayerDownloadFormats(n){n.downloadformats.active=!n.downloadformats.active,this.setLayerActionTool({layer:n,component:n.downloadformats.active?Sp:null,config:n.downloadformats.active?{...this.state.actiontools.downloadformats[n.id],downloads:this.state.actiontools.downloadformats[n.id].downloads.filter(i=>i.format!=="pdf")}:null})}async downloadFeatures(n,i,r=[],o,u,c){r&&!Array.isArray(r)&&(r=[r]);let{query:f={}}=this.state,p={fids:r.map(y=>y.attributes[Cn]).join(",")};n==="pdf"&&(p.html=c);let g=async(y=!1)=>{r.length>1&&(i.downloadformats.active=y,this.setLayerActionTool({layer:i})),await U.downloadWrapper(({layer:w,type:E,data:I}={})=>st(w.id).getDownloadFilefromDownloadDataType(E,{data:I})||Promise.resolve(),{layer:i,type:n,data:p});let S=this.state.layersactions[i.id].find(w=>w.id==="downloads");r.length>1&&S===void 0&&(i[n].active=!1,this.setLayerActionTool({layer:i})),r.length>1&&S!==void 0&&(i.downloadformats.active=!1),r.length<=1&&S===void 0&&(o.state.toggled[u]=!1),r.length<=1&&S!==void 0&&(S.state.toggled[u]=!1),r.length<=1&&this.setCurrentActionLayerFeatureTool({index:u,action:o,layer:i})};if(f.type!=="polygon"){await g();return}let d=this.state.layersactions[i.id].find(y=>y.id==="downloads"),v={choices:[{id:ut(),type:"feature",label:"sdk.mapcontrols.querybypolygon.download.choiches.feature.label"},{id:ut(),type:"polygon",label:"sdk.mapcontrols.querybypolygon.download.choiches.feature_polygon.label"}],download:y=>{y==="polygon"?(p.sbp_qgs_layer_id=i.id,p.sbp_fid=f.fid):(delete p.sbp_fid,delete p.sbp_qgs_layer_id),g(!0)}};if(r.length===1&&d===void 0&&(o.state.toggled[u]=!0),r.length===1&&(this.state.actiontools[Ep.name]=this.state.actiontools[i.id]||{},this.state.actiontools[Ep.name][i.id]=v,this.setCurrentActionLayerFeatureTool({layer:i,index:u,action:o,component:Ep})),d===void 0&&r.length!==1&&(i[n].active=!i[n].active),r.length!==1){let y=d||i[n].active&&d===void 0;this.setLayerActionTool({layer:i,component:y?Ep:null,config:y?v:null})}}goToGeometry(n,i){i.geometry&&(this._asyncFnc.goToGeometry.async?this._asyncFnc.todo=U.getService("map")[this.isOneLayerResult()?"zoomToFeatures":"highlightGeometry"].bind(U.getService("map"),this.isOneLayerResult()?[i]:i.geometry,this.isOneLayerResult()?{}:{layerId:n.id,duration:1500}):setTimeout(()=>U.getService("map")[this.isOneLayerResult()?"zoomToFeatures":"highlightGeometry"](this.isOneLayerResult()?[i]:i.geometry,this.isOneLayerResult()?{}:{layerId:n.id,duration:1500})))}highlightGeometry(n,i){i.geometry&&U.getService("map").highlightGeometry(i.geometry,{layerId:n.id,zoom:!1,duration:1/0})}clearHighlightGeometry(n){U.getService("map").clearHighlightGeometry()}showRelation({relation:n,layerId:i,feature:r}={}){let o=this._project.getRelationById(n.name);U.pushContent({content:new zt({vueComponentObject:(L1(),Wn(DO)).default,propsData:{relation:o,chartRelationIds:this.plotLayerIds.find(u=>u==o.referencingLayer)?[o.referencingLayer]:[],nmRelation:this._project.getRelationById(n.nmRelationId),layer:{id:i},feature:r}}),crumb:{title:o.name,text:!0},title:o.name,text:!0,closable:!1})}_getFeatureId(n,i){return i?n.id:n.attributes[Cn]}addToSelection(n,i,r,o){let u=U.getService("queryresults"),c=U.getService("map"),f=u._getFeatureId.bind(u),p=u.getActionLayerById.bind(u),g=i===void 0&&r===void 0&&o===void 0,d=g?p({layer:n,id:"selection"}):r,v=g&&Object.values(d.state.toggled).reduce((E,I)=>E&&I,!0),y=g?n.external?n:st(n.id):(u.state.layers.find(E=>E.id===n.id)||{}).external?n:st(n.id),S=g?n.features&&n.features.length?n.features:[]:[i],w=g?{fids:S.length>0?S.map(E=>y.external?E.id:E.attributes[Cn]):null,features:S,force:v?"remove":"add"}:{fids:[i?f(i,y.external):null],features:S,index:o,force:void 0};if(g?n.features.forEach((E,I)=>{d.state.toggled[I]=!v,E.selection.selected=d.state.toggled[I]}):(d.state.toggled[o]=!d.state.toggled[o],i.selection.selected=d.state.toggled[o]),v&&g){y.clearSelectionFids();return}if(!n.external&&![null,void 0].includes(w.fids)){let E=y,{fids:I,features:O,force:H}=w;I=Array.isArray(I)?I:[I],O=Array.isArray(O)?O:[O];let X=[],re=[];I.forEach((z,Z)=>{let te=O[Z],ee=E.state.filter.active||E.hasSelectionFid(z);!ee&&te&&te.geometry&&!E.getOlSelectionFeature(z)&&E.addOlSelectionFeature({id:z,feature:te}),H===void 0&&E[ee?"excludeSelectionFid":"includeSelectionFid"](z),H==="add"&&!ee&&X.push(z),H==="remove"&&re.push(z)}),E.includeSelectionFids(X,!1),E.excludeSelectionFids(re,!1),(E.state.filter.active?E.createFilterToken():Promise.resolve()).then(()=>{let{layers:z}=U.getService("queryresults").getState();I.forEach((Z,te)=>{let ee=!E.hasSelectionFid(Z)&&E.state.filter.active&&E.getSelectionFids().size>0&&z.find(ve=>ve.id===E.getId());ee&&ee.features.splice(o===void 0?te:o,1)}),c.clearHighlightGeometry(),z.length===1&&!z[0].features.length&&z.splice(0)})}if(n.external&&![null,void 0].includes(w.fids)){let E=y,{fids:I,features:O,force:H}=w;O=Array.isArray(O)?O:[O],E.selection.features===void 0&&(E.selection.features=[]),I.forEach((X,re)=>{let z=O[re];if(E.selection.features.find(Z=>Z.getId()===X)===void 0){let Z=z,{attributes:te}=z;z.geometry&&(Z=new ol.Feature(z.geometry),Z.setId(X)),Object.keys(te).forEach(ee=>Z.set(ee,te[ee])),Z.__layerId=E.id,Z.selection=z.selection,E.selection.features.push(Z)}H==="add"&&z.selection.selected||H==="remove"&&!z.selection.selected||c.setSelectionFeatures(z.selection.selected?"add":"remove",{feature:E.selection.features.find(Z=>X===Z.getId())})}),E.selection.active=E.selection.features.reduce((X,re)=>X||re.selection.selected,!1)}}}});function pee(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};return d.__file="QueryResultsTableAttributeFieldValue.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r,d}var aee,lee,cee,uee,dee,hee,fee,gee,BO,UO=W(()=>{Vv();Qv();Zv();rr();aee={name:"tableattributefieldvalue",props:{field:{type:Object},feature:{type:Object}},mixins:[cs],components:{"g3w-link":Lg,"g3w-vue":Ag,"g3w-image":mf}},lee=function(){var e=this,n=e.$createElement,i=e._self._c||n;return e.isVue(e.field)?i("g3w-vue",{attrs:{feature:e.feature,state:e.field}}):e.isSimple(e.field)?i("span",{domProps:{innerHTML:e._s(e.field.value)}}):e.isPhoto(e.field)?i("g3w-image",{attrs:{state:e.field}}):e.isImage(e.field)?i("g3w-image",{attrs:{state:e.field}}):e.isLink(e.field)?i("g3w-link",{attrs:{state:{value:e.field.value}}}):e._e()},cee=[],uee=void 0,dee="data-v-019d651d",hee=void 0,fee=!1;gee=pee({render:lee,staticRenderFns:cee},uee,aee,dee,fee,hee,!1,void 0,void 0,void 0),BO=gee});function See(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};return d.__file="QueryResultsActionInfoFormats.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r,d}var mee,_ee,yee,vee,bee,xee,wee,Eee,VO,WO=W(()=>{bt();h_();bu();Bn();mee={name:"Infoformats",props:{layer:{type:Object,required:!0}},data(){return{infoformat:this.layer.infoformat}},computed:{infoformats(){return this.layer.infoformats||[]},hasInfo(){return this.infoformats.length}},methods:{async reloadLayerDataWithChangedContentType(e){this.layer.loading=!0,this.$el.disabled=!0;try{let n=await this.projectLayer.changeProxyDataAndReloadFromServer("wms",{headers:{"Content-Type":e},params:{INFO_FORMAT:e}});this.layer.infoformat=e,this.projectLayer.setInfoFormat(this.layer.infoformat);let[i]=vs.get(e)({layers:[this.projectLayer],response:n});i.features?this.__parsedata(i):this.__parserawdata(i)}catch(n){console.warn(n)}this.layer.loading=!1,this.$el.disabled=!1},__parsedata(e){let n=U.getService("queryresults");this.layer.rawdata=null,e.features.forEach(i=>{let{id:r,geometry:o,properties:u}={properties:i instanceof ol.Feature?i.getProperties():i.properties,geometry:i instanceof ol.Feature?i.getGeometry():i.geometry,id:i instanceof ol.Feature?i.getId():i.id};this.layer.attributes.length===0&&(this.layer.hasgeometry=!!o,n.setActionsForLayers([this.layer]),co(u).forEach(c=>{this.layer.attributes.push({name:c,label:c,show:!0})})),this.layer.features.push({id:r,attributes:u,geometry:o,show:!0})})},async __parserawdata(e){this.layer.features.splice(0),await this.$nextTick(),this.layer.rawdata=e.rawdata}},watch:{infoformat(e){this.reloadLayerDataWithChangedContentType(e)}},created(){this.projectLayer=st(this.layer.id)},beforeDestroy(){this.projectLayer&&this.projectLayer.clearProxyData("wms"),this.projectLayer=null}},_ee=function(){var e=this,n=e.$createElement,i=e._self._c||n;return e.hasInfo?i("select",{directives:[{name:"select2",rawName:"v-select2",value:"infoformat",expression:"'infoformat'"}],staticClass:"skin-color",attrs:{select2_value:e.infoformat,search:!1}},e._l(e.infoformats,function(r){return i("option",{key:r,domProps:{value:r}},[e._v(` + `,async mounted(){await this.$nextTick(),this.$refs.table.click()}}))}),push:!0,showgoback:!0,closable:!1,title:e})},editFeature(e){U.getService("queryresults").editFeature({layer:{id:this.table.layerId,attributes:this.table.fields},feature:this.table.features[e]})},getRowFields(e){return this.table.fields.map((n,i)=>(n.value=e[i],n.query=!0,n.input={type:`${this.getFieldType(n)}`},n))},reloadLayout(){this.relationDataTable&&this.relationDataTable.columns.adjust()},back(){this.$parent.setRelationsList()},fieldIs(e,n){return this.getFieldType(n)===e},is(e,n){return this.fieldIs(e,n)},wrapMoveFnc(e){this.moveFnc(e)},resizeStart(){document.getElementById("g3w-view-content").addEventListener("mousemove",this.wrapMoveFnc),document.getElementById("g3w-view-content").addEventListener("mouseup",this.resizeStop,{once:!0})},async resizeStop(){document.getElementById("g3w-view-content").removeEventListener("mousemove",this.wrapMoveFnc),await this.$nextTick(),U.emit("resize")},moveFnc(e){let n=$(".sidebar-collapse").length?0:FO,i=e.pageX+2-n;this.$refs.tablecontent.style.width=`${i}px`,this.$refs.chartcontent.style.width=`${$(this.$refs.relationwrapper).width()-i-10}px`}},watch:{table(e){e&&e.rows.length&&this.createTable()},async chart(){await this.$nextTick(),this.resize()},async headercomponent(){await this.$nextTick(),this.resize()}},beforeCreate(){this.delayType="debounce"},async created(){try{this.table=await this.getRelationDataTable({page:this.page,page_size:this.page_size,ordering:this.ordering})}catch(e){console.warn(e)}},async beforeDestroy(){this.relationDataTable&&(this.relationDataTable.destroy(),this.relationDataTable=null,this.chartContainer&&this.$emit("hide-chart",this.chartContainer),this.chartContainer=null,this.tableHeaderHeight=null,U.off("pop-content",this.resize))}},$J=function(){var e=this,n=e.$createElement,i=e._self._c||n;return e.table?i("div",{ref:"query_relation",staticClass:"query-relation",class:e.isMobile()?"mobile":null},[i("div",{ref:"relation-header",staticClass:"header skin-background-color lighten"},[i("div",{staticClass:"g3w-long-text"},[e.showrelationslist?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:right.create",value:"sdk.relations.back_to_relations",expression:"'sdk.relations.back_to_relations'",arg:"right",modifiers:{create:!0}}],staticClass:"action-button-icon action-button back-button",class:e.$fa("exit"),on:{click:function(r){return r.stopPropagation(),e.back.apply(null,arguments)}}}):e._e(),e._v(" "),i("b",{staticClass:"relation-tile skin-color"},[e._v(" "+e._s(e.relation.name)+" ")])]),e._v(" "),e.table.rows.length?i("div",{staticClass:"relations-table-tools"},[e.downloadButton?i("span",{directives:[{name:"download",rawName:"v-download"},{name:"t-tooltip",rawName:"v-t-tooltip:left.create",value:e.downloadButton.tooltip,expression:"downloadButton.tooltip",arg:"left",modifiers:{create:!0}}],staticClass:"action-button-icon action-button",class:[e.$fa("download"),{"toggled-white":e.downloadButton.toggled}],on:{click:function(r){return r.stopPropagation(),e.downloadButton.handler.apply(null,arguments)}}}):e._e(),e._v(" "),e.showChartButton?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:bottom.create",value:"sdk.tooltips.show_chart",expression:"'sdk.tooltips.show_chart'",arg:"bottom",modifiers:{create:!0}}],staticClass:"action-button-icon action-button",class:[e.$fa("chart"),e.chart?"toggled-white":""],on:{click:function(r){return r.stopPropagation(),e.showChart.apply(null,arguments)}}}):e._e()]):e._e()]),e._v(" "),e.table.rows.length?i("div",{ref:"relationwrapper",staticClass:"relation-wrapper"},[i("div",{ref:"tablecontent",style:{width:e.chart?"70%":"100%",marginRight:e.chart?"8px":"3px",position:"relative"},attrs:{id:"table_content"}},[e.headercomponent?i("div",{staticClass:"header-component"},[i(e.headercomponent,{tag:"component",attrs:{layer:e.downloadLayer.state,config:e.downloadLayer.config}})],1):e._e(),e._v(" "),i("table",{ref:"relationtable",staticClass:"hover relationtable table table-striped row-border compact nowrap"},[i("thead",[i("tr",{staticStyle:{height:"0! important"}},[e.showTools?i("th",{style:{minWidth:this.showTools*30+"px",padding:"0 !important"}}):e._e(),e._v(" "),e._l(e.table.columns,function(r){return i("th",[e._v(e._s(r))])})],2)]),e._v(" "),i("tbody",e._l(e.table.rows,function(r,o){return i("tr",{key:e.table.rows_fid[o],class:{selected:e.table.rowFormStructure===r}},[e.showTools?i("td",{staticClass:"table-tools"},[e.table.features[o].geometry?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:right.create",value:"sdk.tooltips.relations.zoomtogeometry",expression:"'sdk.tooltips.relations.zoomtogeometry'",arg:"right",modifiers:{create:!0}}],staticClass:"action-button row-form skin-color",class:e.$fa("marker"),on:{click:function(u){return u.stopPropagation(),e.zoomToGeometry(e.table.features[o].geometry)}}}):e._e(),e._v(" "),e.table.formStructure?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:right.create",value:"sdk.tooltips.relations.row_to_form",expression:"`sdk.tooltips.relations.row_to_form`",arg:"right",modifiers:{create:!0}}],staticClass:"action-button row-form skin-color",class:e.$fa("table"),on:{click:function(u){u.stopPropagation(),e.showFormStructureRow({title:e.table.title,layerid:e.table.layerId,feature:e.table.features[o],fields:e.getRowFields(r),tabs:e.table.formStructure})}}}):e._e(),e._v(" "),e.isEditable?i("span",{directives:[{name:"t-tooltip",rawName:"v-t-tooltip:right.create",value:"Edit",expression:"'Edit'",arg:"right",modifiers:{create:!0}}],staticClass:"action-button row-form skin-color",class:e.$fa("pencil"),on:{click:function(u){return u.stopPropagation(),e.editFeature(o)}}}):e._e()]):e._e(),e._v(" "),e._l(r,function(u){return i("td",[i("field",{attrs:{state:{value:u}}})],1)})],2)}),0)])]),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.chart,expression:"chart"}],staticClass:"skin-border-color lighten",staticStyle:{"border-style":"solid","border-width":"0 1px 0 1px"},style:{minWidth:"5px",backgroundColor:"#dddddd",cursor:"col-resize"},on:{mousedown:function(r){return r.stopPropagation(),e.resizeStart.apply(null,arguments)}}}),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.chart,expression:"chart"}],ref:"chartcontent",style:{width:e.chart?"30%":"0"},attrs:{id:"chart_content"}})]):i("div",{staticClass:"dataTables_scrollBody"},[i("span",{directives:[{name:"t",rawName:"v-t",value:"sdk.relations.no_relations_found",expression:"'sdk.relations.no_relations_found'"}]})])]):e._e()},BJ=[],UJ=function(e){e&&(e("data-v-13699f31_0",{source:".query-relation[data-v-13699f31]{margin-top:3px}.query-relation>.header[data-v-13699f31]{padding:3px;display:flex;justify-content:space-between;align-items:center;width:100%;margin:0!important}.query-relation>.header>.g3w-long-text[data-v-13699f31]{border-radius:3px;font-size:1.3em}.query-relation.mobile>.header>.g3w-long-text[data-v-13699f31]{font-size:1em}.relations-table-tools[data-v-13699f31]{font-size:1.1em;margin-bottom:3px}.relations-table-tools>.action-button[data-v-13699f31]{padding:5px}.relation-wrapper[data-v-13699f31]{display:flex;justify-content:space-between;margin-bottom:5px;margin-top:3px;height:95%}.back-button[data-v-13699f31]{font-size:.8em}.header-component[data-v-13699f31]{width:100%;display:flex;margin-left:auto;margin-bottom:5px;margin-right:4px}.relationtable .table-tools .action-button[data-v-13699f31]:hover{background-color:transparent}.relationtable.dataTable tbody tr.selected[data-v-13699f31]{background-color:#e4e4e4!important}.relationtable.dataTable tbody tr.selected .row-wrap-tabs .tabs-wrapper[data-v-13699f31]{background-color:#fff!important}#chart_content[data-v-13699f31]{padding-bottom:5px;margin-bottom:5px;margin-left:8px}.dataTables_scrollBody[data-v-13699f31]{font-weight:700;margin-top:10px;font-size:1.1em;display:flex;justify-content:space-between}",map:void 0,media:void 0}),e("data-v-13699f31_1",{source:".relation-wrapper .dataTables_length select{border:1px solid #ccc;background:#fff;height:27px}.relation-wrapper .paginate_button{background:0 0!important;color:currentColor!important;box-shadow:none!important}.relation-wrapper .paginate_button.disabled{opacity:.25!important}.relation-wrapper .dataTables_scroll{background:#fff}",map:void 0,media:void 0}))},VJ="data-v-13699f31",WJ=void 0,HJ=!1;XJ=YJ({render:$J,staticRenderFns:BJ},UJ,GJ,VJ,HJ,WJ,!1,I1,void 0,void 0),k1=XJ});var jO={};hi(jO,{default:()=>see});function iee(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};return d.__file="RelationsPage.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r,d}var ZJ,KJ,QJ,JJ,eee,tee,nee,ree,see,qO=W(()=>{_a();bt();PO();L1();ZJ={name:"relation-page",data(){let{relation:e=null,relations:n=[],nmRelation:i,feature:r=null,currentview:o="relations",chartRelationIds:u=[],layer:c}=this.$options;return{loading:!1,state:null,error:!1,previousview:o,feature:r,currentview:o,relation:e,relations:n,nmRelation:i,chartRelationIds:u,layer:c}},components:{relations:OO,relation:k1},computed:{showrelationslist(){return this.previousview==="relations"&&this.relations.length>1}},methods:{reloadLayout(){nn.$emit("reload-relations")},showChart(e,n){U.getService("queryresults").showChart([this.relation.referencingLayer],e,n)},hideChart(e){U.getService("queryresults").hideChart(e)},async showRelation(e){this.loading=!0,this.relation=e;try{U.setCurrentContentOptions({title:e.name,crumb:{title:e.name,text:!0}}),await this.$nextTick(),this.previousview=this.currentview,this.currentview="relation"}catch(n){console.warn(n)}this.loading=!0},setRelationsList(){this.previousview="relation",this.currentview="relations",U.setCurrentContentOptions({crumb:{title:"info.list_of_relations"}}),this.loading=!1}},beforeMount(){(this.currentview==="relation"||this.relations.length===1&&this.relations[0].type==="ONE")&&this.showRelation(this.relations[0])},async mounted(){this.relations.sort(({name:e},{name:n})=>en?1:0),await this.$nextTick(),this.error&&requestAnimationFrame(()=>U.popContent()),this.error=!1},created(){this.$on("resize-component",this.reloadLayout)}},KJ=function(){var e=this,n=e.$createElement,i=e._self._c||n;return i("div",{staticClass:"query-relations-page"},[i(e.currentview,{ref:e.currentview,tag:"component",attrs:{loading:e.loading,previousview:e.previousview,relations:e.relations,relation:e.relation,feature:e.feature,layer:e.layer,chartRelationIds:e.chartRelationIds,showrelationslist:e.showrelationslist},on:{"show-chart":e.showChart,"hide-chart":e.hideChart}})],1)},QJ=[],JJ=void 0,eee=void 0,tee=void 0,nee=!1;ree=iee({render:KJ,staticRenderFns:QJ},JJ,ZJ,eee,nee,tee,!1,void 0,void 0,void 0),see=ree});var GO={};hi(GO,{default:()=>oee});function zO(e){if(e.nodes)for(let n of e.nodes)zO(n);else e.name&&(e.relation=!0)}var oee,$O=W(()=>{_a();bt();Nt();Yn();qs();_c();vt();zi();w1();AO();bu();Nw();Tw();l1();yc();$o();bn();E1();Bn();bc();Ld();cn();oee=new class extends Et{constructor(){super(),this.setters={setQueryResponse(n,i={add:!1,update:!1}){if(n.data||(n.data=[]),n.query||(n.query={external:{add:!1,filter:{SELECTED:!1}}}),n.query.external||(n.query.external={add:!1,filter:{SELECTED:!1}}),i.add===!1&&i.update&&(this.state.query=n.query,this.state.type=n.type),i.add===!1&&!i.update&&(this.clearState(),this.state.query=n.query,this.state.type=n.type),n.query.external.add===!0&&i.add===!1){let u=U.getService("catalog"),c=n.query.external.filter.SELECTED;this._vectorLayers.forEach(f=>{let p=f.get("id");f.getVisible()&&[void 0,!!(u.state.external.vector.find(g=>g.id===p)||{}).selected].includes(c)&&n.data[p==="__g3w_marker"?"unshift":"push"](this.getVectorLayerFeaturesFromQueryRequest(f,n.query))})}let r=i.add===!1&&{coordinates:(this.state.query.coordinates||[]).length===2&&new ol.geom.Point(this.state.query.coordinates),bbox:(this.state.query.bbox||[]).length===4&&ol.geom.Polygon.fromExtent(this.state.query.bbox),polygon:this.state.query.geometry,drawpolygon:this.state.query.geometry,circle:this.state.query.geometry}[this.state.query.type];if(r){let u=new ol.Feature(r);u.setId(void 0),this.resultsQueryLayer.getSource().clear(),U.getService("map").getMap().removeLayer(this.resultsQueryLayer),this.resultsQueryLayer.getSource().addFeature(u),U.getService("map").getMap().addLayer(this.resultsQueryLayer),this.resultsQueryLayer.setZIndex(U.getService("map").getMap().getLayers().getLength())}let o=n.data.flatMap(u=>[].concat(u)).filter(u=>u&&(u.rawdata!==void 0||Array.isArray(u.features)&&u.features.length>0)).map(({layer:u,features:c,rawdata:f,error:p}={})=>{let g=u instanceof ai,d=u instanceof ol.layer.Vector,v=typeof u=="string"||u instanceof String,y;if(v)y=ai.LayerTypes.VECTOR;else if(g)try{y=u.getSourceType()}catch(z){console.warn("uknown source type for layer:",z,u)}let S=v&&u.split("_"),w=(g?u.getId():void 0)||(d?u.get("id"):void 0)||(v?u:void 0),E,I;(!c||!c.length)&&(E=[]),!E&&u instanceof ai&&(I=u.getAttributes().map(z=>this.state.type==="ows"?{...z,name:z.name.replace(/ /g,"_")}:z)),!E&&u instanceof ol.layer.Vector&&(I=u.getProperties()),(!E&&typeof u=="string"||u instanceof String)&&(I=c[0]?c[0].getProperties():[]);let O=(!E&&u instanceof ai&&I||[]).filter(z=>{try{return z.name[0]==="_"||Number.isInteger(1*z.name[0])}catch{return!1}}).map(z=>({alias:z.name.replace(/_/,""),name:z.name}));!E&&O.length&&c.forEach(z=>{let Z=Object.keys(z.getProperties());O.forEach(te=>{Z.find(ee=>{if(ee===te.alias)return z.set(te.name,z.get(ee)),!0})})});let H=!E&&co(Object.keys(c[0]instanceof ol.Feature?c[0].getProperties():c[0].properties));E||(E=I&&I.length>0?I.filter(z=>H.includes(z.name)):H.map(z=>({name:z,label:z,show:Cn!==z&&[void 0,"gdal","wms","wcs","wmst","postgresraster"].includes(y),type:"varchar"})));let X=d||v,re=g&&u.hasFormStructure()&&u.getLayerEditingFormStructure();if(re&&Array.isArray(this._relations[u.getId()])&&this._relations[u.getId()].length>0)for(let z of re)zO(z);return{id:w,attributes:E,external:X,features:(!f&&c||[]).map(z=>({id:X||z instanceof ol.Feature?z.getId():z.id,attributes:z instanceof ol.Feature?z.getProperties():z.properties,geometry:z instanceof ol.Feature?z.getGeometry():z.geometry,selection:{selected:!1},show:!0})),hasgeometry:Array.isArray(c)&&!f&&c.some(z=>z instanceof ol.Feature?z.getGeometry():z.geometry),hasImageField:Array.isArray(c)&&!f&&c.length&&E.some(z=>z.type==="image"),loading:!1,show:!0,expandable:!0,addfeaturesresults:{active:!1},downloadformats:{active:!1},editable:g?u.isEditable()&&u.config.editing.visible:!1,inediting:g?u.isInEditing():!1,source:g?u.getSource():void 0,infoformat:g?u.getInfoFormat():void 0,infoformats:g?u.getInfoFormats():[],downloads:g?u.getDownloadableFormats():[],formStructure:re?{structure:re,fields:u.getFields().filter(z=>z.show).concat((Array.isArray(c)&&!f&&c.length>0&&E||[]).filter(z=>u.getFields().some(Z=>Z.name===z.name)))}:void 0,relationsattributes:g||d||v?[]:void 0,filter:g&&!["wms","wcs","wmst"].includes(y)?u.state.filter:{},selection:g&&!["wms","wcs","wmst"].includes(y)&&u.state.selection||d&&u.selection||{},title:g&&u.getTitle()||d&&u.get("name")||v&&S&&(S.length>4?S.slice(0,S.length-4).join(" "):u)||void 0,atlas:this._atlas.filter(z=>z.atlas.qgs_layer_id===w),rawdata:f||null,error:p||"",toc:X||u.state.toc}});this.setLayersData(o,i)},setLayersData(n=[],i={add:!1,update:!1}){i.add===!1&&n.sort((r,o)=>r.external?0:this._projectLayerIds.indexOf(r.id)>this._projectLayerIds.indexOf(o.id)?1:-1),n.forEach((r,o)=>{r.filter.pagination=r.filter.pagination||!!(this.state.query.pagination&&this.state.query.pagination.counts[o]>r.features.length),i.add||i.update?this.updateLayerResultFeatures(r,i.update):this.state.layers.push(r)}),this.setActionsForLayers(n,{add:i.add,update:i.update}),this.state.changed=!0},addComponent(n){this.state.components.push(n)},addActionsForLayers(n,i){},postRender(n){},closeComponent(){},changeLayerResult(n){this.state.layersactions[n.id].forEach(i=>i.change&&i.change(n)),(n.features||[]).forEach((i,r)=>{let o=this.state.currentactiontools[n.id];o!==void 0&&(o[r]===void 0&&Vue.set(o,r,null),o[r]=null)})},activeMapInteraction(){},editFeature({layer:n,feature:i}={}){},openCloseFeatureResult({open:n,layer:i,feature:r,container:o}={}){},removeFeatureLayerFromResult(n,i){this.updateLayerResultFeatures({id:n.id,external:n.external,features:[i]})}},this.unlistenerlayeractionevents=[],this._relations={},this._atlas=[],this.plotLayerIds=[],this.state={logged:V.user.id!==void 0,components:[],layers:[],changed:!1,query:null,type:"ows",layersactions:{},actiontools:{},currentactiontools:{},currentactionfeaturelayer:{},layeractiontool:{},layersFeaturesBoxes:{},layerscustomcomponents:{}},this._vectorLayers=[],this._addFeaturesLayerResultInteraction={id:null,interaction:null,mapcontrol:null,toggleeventhandler:null},this._asyncFnc={todo:()=>{},zoomToLayerFeaturesExtent:{async:!1},highLightLayerFeatures:{async:!1},goToGeometry:{async:!1}},this.resultsQueryLayer=new ol.layer.Vector({source:new ol.source.Vector,style:n=>new ol.style.Style(n.getGeometry().getType()==="Point"?{text:new ol.style.Text({fill:new ol.style.Stroke({color:"black"}),text:"\uF3C5",font:'900 3em "Font Awesome 5 Free"',offsetY:-15})}:{stroke:new ol.style.Stroke({color:"black"})})}),this._project=V.project,this._projectLayerIds=(()=>{let n=[],i=r=>{(r.nodes||[r]).forEach(o=>{o.id?n.push(o.id):i(o)})};return this._project.state.layerstree.forEach(i),n})(),this._setRelations(this._project),this._atlas=this._project.getPrint().filter(n=>n.atlas)||[],U.onbefore("setContent",n=>{n.perc===100&&U.isMobile()&&(this._asyncFnc.zoomToLayerFeaturesExtent.async=!0,this._asyncFnc.highLightLayerFeatures.async=!0,this._asyncFnc.goToGeometry.async=!0)})}async loadPaginationData(n,i,r,o){this.state.query.autofilter&&this.state.query.pagination&&(this.state.query.autofilter=!1,this.state.query.pagination.getData.params.forEach(d=>delete d.autofilter)),r&&(this.state.query.pagination.getData.params[n].page_size=r,this.state.query.pagination.pages[n]=Math.round(this.state.query.pagination.counts[n]/r));let{layers:u=[],method:c,params:f}=this.state.query.pagination.getData,p=u[n],g=!!p.getFilterToken();try{let d=await p[c]({...f[n],page:i});this.setQueryResponse({...d,query:o},{add:!1,update:!0}),this.state.query.pagination.current[n]=i;let v=p.state.selection.active||g,y=this.state.layersactions[p.getId()].find(({id:S})=>S==="selection");this.state.layers[n].features.forEach((S,w)=>{if(v&&!S.selection.selected&&p.isGeoLayer()&&S.geometry){let E=this._getFeatureId(S,this.state.layers[n].external);p.addOlSelectionFeature({id:E,feature:S}).selected=!0,p.includeSelectionFid(E,!1)}S.selection.selected=v,y.state.toggled[w]=v}),p.state.filter.active=v,p.state.selection.active=v,this.state.layers[n].filter.pagination=this.state.layers[n].features.lengthf.id===n.id),o=n.features||[],u=(this.state.layers.find(f=>f.id===n.id)||{}).external;if(r&&(r.features||[]).length>0){let f=i?[]:r.features.map(g=>u?g.id:g.attributes[Cn]),p=this.state.layersactions[r.id].find(g=>g.id==="selection");i&&(r.features.forEach(g=>delete this.state.layersFeaturesBoxes[this.getBoxId(r,g)]),r.features.splice(0)),o.forEach((g,d)=>{let v=this._getFeatureId(g,u);f.some(y=>y===v)?(p&&g.selection.selected&&(u?r:st(r.id)).excludeSelectionFid(v,r.filter.active),r.features.splice(d,1),delete this.state.layersFeaturesBoxes[this.getBoxId(r,g)],p&&(delete p.state.toggled[d],p.state.toggled=Vue.observable(r.features.reduce((y,S,w)=>(y[w]=S.selection.selected,y),{})))):r.features.push(g)}),(r.features||[]).forEach(g=>{let d=(r.features||[]).length>1,v=this.state.layersFeaturesBoxes[this.getBoxId(r,g)];v&&setTimeout(()=>v.collapsed=d)})}r&&(r.features||[]).length===0&&setTimeout(()=>{this.state.layers=this.state.layers.filter(f=>f.id!==r.id),this.clearHighlightGeometry(r),this.removeAddFeaturesLayerResultInteraction(!0)}),this.state.layers.length===1&&U.getService("map").highlightFeatures(this.state.layers[0].features,{duration:1/0}),this.changeLayerResult(r)}getBoxId(n,i,r){return r!=null?`${n.id}_${i.id}_${r}`:`${n.id}_${i.id}`}setActionsForLayers(n,i={add:!1,update:!1}){i.add||i.update||(this.unlistenerlayeractionevents=[],n.forEach(r=>{let o=this.state;this.state.layeractiontool[r.id]=Vue.observable({component:null,config:null}),this.state.currentactiontools[r.id]=Vue.observable({...Array((r.features||[]).length).fill(null)}),this.state.currentactionfeaturelayer[r.id]=Vue.observable({...Array((r.features||[]).length).fill(null)}),this.state.layersactions[r.id]=this.state.layersactions[r.id]||[];let u=r.downloads.length===1&&(r.downloads||[]).at(0),c=(this._relations[r.id]||[]).filter(p=>p.type==="MANY"),f=c.map(p=>this.plotLayerIds.find(g=>g===p.referencingLayer)).filter(Boolean);if(u&&(r[u]=Vue.observable({active:!1})),r.downloads.length>1&&(this.state.actiontools.downloadformats=this.state.actiontools.downloadformats||{},this.state.actiontools.downloadformats[r.id]={downloads:r.downloads.map(p=>({id:`download_${p}_feature`,download:!0,format:p,class:U.getFontClass(p),hint:`sdk.tooltips.download_${p}`,cbk:(g,d,v,y,S)=>{if(this.downloadFeatures(p,g,d,v,y,S),this.state.query.type!=="polygon"){let w=this.state.layersactions[g.id].find(E=>E.id==="downloads");w.cbk(g,d,w,y,S)}}}))}),this.state.layersactions[r.id].push(...[r.hasgeometry&&{id:"gotogeometry",mouseover:!0,class:U.getFontClass("marker"),hint:"sdk.mapcontrols.query.actions.zoom_to_feature.hint",cbk:Hn(this.goToGeometry.bind(this))},c.length&&{id:"show-query-relations",class:U.getFontClass("relation"),hint:"sdk.mapcontrols.query.actions.relations.hint",cbk(p,g,d){U.setCurrentContentOptions({title:p.title,crumb:{text:!0,title:p.title}}),U.pushContent({content:new zt({internalComponent:new(Vue.extend((qO(),Wn(jO)).default))({relations:d.relations,chartRelationIds:d.chartRelationIds,feature:g,layer:p})}),backonclose:!0,title:"info.list_of_relations",id:"__G3W_LIST_OF_RELATIONS_ID__",crumb:{title:"info.list_of_relations",trigger:null},closable:!1})},relations:c,chartRelationIds:f},f.length&&{id:"show-plots-relations",opened:!0,class:U.getFontClass("chart"),state:Vue.observable({toggled:r.features.reduce((p,g,d)=>(p[d]=null,p),{})}),hint:"sdk.mapcontrols.query.actions.relations_charts.hint",cbk:Hn((p,g,d,v,y)=>{d.state.toggled[v]=!d.state.toggled[v],d.state.toggled[v]?this.emit("show-chart",f,y,{relations:this._relations[p.id],fid:g.attributes[Cn],height:400}):this.hideChart(y)})},this._atlas.filter(p=>p.atlas.qgs_layer_id===r.id).length&&{id:"printatlas",download:!0,class:U.getFontClass("print"),hint:"sdk.tooltips.atlas",cbk:this.printAtlas.bind(this)},u&&{id:`download_${u}_feature`,download:!0,state:Vue.observable({toggled:r.features.reduce((p,g,d)=>(p[d]=null,p),{})}),class:U.getFontClass("download"),hint:`sdk.tooltips.download_${u}`,cbk:(p,g,d,v,y)=>{d.state.toggled[v]=!d.state.toggled[v],d.state.toggled[v]?this.downloadFeatures(u,p,g,d,v,u==="pdf"?y[0].innerHTML:null):this.setCurrentActionLayerFeatureTool({index:v,action:d,layer:p})}},r.downloads.length>1&&{id:"downloads",download:!0,class:U.getFontClass("download"),state:Vue.observable({toggled:r.features.reduce((p,g,d)=>(p[d]=null,p),{})}),toggleable:!0,hint:"Downloads",change({features:p}){p.forEach((g,d)=>this.state.toggled[d]===void 0?nn.$set(this.state.toggled,d,!1):this.state.toggled[d]=!1)},cbk:(p,g,d,v)=>{d.state.toggled[v]=!d.state.toggled[v],this.setCurrentActionLayerFeatureTool({layer:p,index:v,action:d,component:d.state.toggled[v]?Sp:null})}},(r.id==="__g3w_marker"||!r.external&&(r.source||{}).type!=="wms")&&{id:"removefeaturefromresult",mouseover:!0,class:U.getFontClass("minus-square"),style:{color:"red"},state:Vue.observable({show:!o.query.pagination&&!r.filter.pagination}),hint:"sdk.mapcontrols.query.actions.remove_feature_from_results.hint",cbk:this.removeFeatureLayerFromResult.bind(this),init(){this.unwatch=nn.$watch(()=>r.filter.pagination,p=>this.state.show=!p)},clear(){this.unwatch&&this.unwatch()},change(){this.state.disabled=!o.query.pagination&&!r.filter.pagination}},r.toc&&r.selection.active!==void 0&&{id:"selection",class:U.getFontClass("success"),hint:"sdk.mapcontrols.query.actions.add_selection.hint",state:Vue.observable({toggled:r.features.reduce((p,g,d)=>(p[d]=null,p),{}),show:!o.query.pagination&&!r.filter.pagination}),init:({feature:p,index:g,action:d}={})=>{if(r.external&&r.selection.active!==void 0)d.state.toggled[g]=p.selection.selected;else if(p&&r.selection.active!==void 0){let v=st(r.id),y=this._getFeatureId(p,r.external),S=p?v.hasSelectionFid(y):!1;!this.state.query.pagination&&v.state.filter.active&&!S&&(S=!0,v.addOlSelectionFeature({id:y,feature:p}).selected=!0,v.includeSelectionFid(y,!1)),p.selection.selected=S,d.state.toggled[g]=v.state.filter.active&&v.state.filter.current==null||S,d.unwatch=nn.$watch(()=>r.filter.pagination,w=>d.state.show=!w)}},clear(){this.unwatch&&this.unwatch()},change({features:p}){this.state.show=!o.query.pagination&&!r.filter.pagination,p.forEach((g,d)=>this.state.toggled[d]===void 0&&nn.$set(this.state.toggled,d,!1))},cbk:Hn(this.addToSelection.bind(this))},r.hasgeometry&&!r.external&&(r.source||{}).type!=="wms"&&{id:"link_zoom_to_fid",class:U.getFontClass("share-alt"),hint:"sdk.mapcontrols.query.actions.copy_zoom_to_fid_url.hint",hint_change:{hint:"sdk.mapcontrols.query.actions.copy_zoom_to_fid_url.hint_change",duration:1e3},cbk(p,g,d){let v=new URL(location.href);v.searchParams.set("zoom_to_fid",`${p.id}|${g.attributes[Cn]}`),sy(v.toString()),d.hint_changed=!0}},r.editable&&r.inediting===!1&&{id:"editing",class:U.getFontClass("pencil"),hint:"sdk.tooltips.editing",cbk:(p,g)=>this.editFeature({layer:p,feature:g})}].filter(Boolean)),r.external&&r.toc&&r.selection.active!==void 0)r.features.forEach(p=>p.selection=(r.selection.features.find(g=>p.id===g.getId())||{selection:{selected:!1}}).selection);else if(!r.external&&r.toc&&r.selection.active!==void 0){let p=()=>r.features.forEach((g,d)=>this.state.layersactions[r.id].find(v=>v.id==="selection").state.toggled[d]=!1);st(r.id).on("unselectionall",p),this.unlistenerlayeractionevents.push({layer:st(r.id),event:"unselectionall",handler:p})}}),this.addActionsForLayers(this.state.layersactions,this.state.layers))}getActionLayerById({layer:n,id:i}={}){if(this.state.layersactions[n.id])return this.state.layersactions[n.id].find(r=>r.id===i)}setCurrentActionLayerFeatureTool({layer:n,action:i,index:r,component:o=null}={}){let u=this.state.currentactiontools[n.id],c=this.state.currentactionfeaturelayer[n.id];c[r]=o?i:null,u[r]=o,u[r]&&i.id!==c[r].id&&c[r].toggleable&&(c[r].state.toggled[r]=!1)}addCurrentActionToolsLayer({id:n,layer:i,config:r={},action:o}){i&&(this.state.actiontools[n]={[i.id]:r},o&&(this.state.layersactions[i.id]=this.state.layersactions[i.id]||[],this.state.layersactions[i.id].push(o)))}setLayerActionTool({layer:n,component:i=null,config:r=null}={}){this.state.layeractiontool[n.id].component=i,this.state.layeractiontool[n.id].config=r}clear(){this._asyncFnc.todo(),this.unlistenerlayeractionevents.forEach(n=>n.layer.off(n.event,n.handler)),this.unlistenerlayeractionevents=[],U.getService("map").clearHighlightGeometry(),this.resultsQueryLayer.getSource().clear(),this.removeAddFeaturesLayerResultInteraction(!0),this._asyncFnc={todo:()=>{},zoomToLayerFeaturesExtent:{async:!1},highLightLayerFeatures:{async:!1},goToGeometry:{async:!1}},this.clearState(),this.closeComponent(),this.resultsQueryLayer.getSource().clear(),U.getService("map").getMap().removeLayer(this.resultsQueryLayer)}isOneLayerResult(){return this.state.layers.length===1}removeAddFeaturesLayerResultInteraction(n){let i=this._addFeaturesLayerResultInteraction;i.toggleeventhandler!==null&&U.getService("map").off("mapcontrol:toggled",i.toggleeventhandler),i.interaction!==null&&U.getService("map").removeInteraction(i.interaction),i.mapcontrol!==null&&i.mapcontrol.toggle(n),Object.assign(i,{interaction:null,id:null,toggleeventhandler:null,mapcontrol:null})}addLayerFeaturesToResultsAction(n){let i=this._addFeaturesLayerResultInteraction,r=![null,n.id].includes(i.id),o=r&&this.state.layers.find(u=>u.id===i.id);if(r&&o&&(o.addfeaturesresults.active=!1),r&&i.interaction&&U.getService("map").removeInteraction(i.interaction),i.id=n.id,n.addfeaturesresults.active=!n.addfeaturesresults.active,n.addfeaturesresults.active===!1)this.removeAddFeaturesLayerResultInteraction(!0);else{this.activeMapInteraction();let u=(this.state.layers.find(c=>c.id===n.id)||{}).external;i.mapcontrol=i.mapcontrol||U.getService("map").getCurrentToggledMapControl()||null,i.interaction=new Hi,U.getService("map").addInteraction(i.interaction,{close:!1}),i.interaction.on("picked",async({coordinate:c})=>{u?this.setQueryResponse({data:[this.getVectorLayerFeaturesFromQueryRequest(this._vectorLayers.find(f=>n.id===f.get("id")),{coordinates:c})],query:{coordinates:c}},{add:!0}):await Ht.getData("query:coordinates",{inputs:{coordinates:c,query_point_tolerance:this._project.getQueryPointTolerance(),layerIds:[n.id],multilayers:!1},outputs:{show:{add:!0}}})}),i.toggleeventhandler=c=>{c.target.isToggled()&&c.target.isClickMap()&&(n.addfeaturesresults.active=!1)},U.getService("map").once("mapcontrol:toggled",i.toggleeventhandler)}}deactiveQueryInteractions(){this.state.layers.forEach(n=>{n.addfeaturesresults&&(n.addfeaturesresults.active=!1)}),this.removeAddFeaturesLayerResultInteraction()}zoomToLayerFeaturesExtent(n,i={}){i.highlight=!this.isOneLayerResult(),this._asyncFnc.zoomToLayerFeaturesExtent.async?this._asyncFnc.todo=U.getService("map").zoomToFeatures.bind(U.getService("map"),n.features||[],i):U.getService("map").zoomToFeatures(n.features||[],i)}highLightLayerFeatures(n,i={}){this._asyncFnc.highLightLayerFeatures.async?this._asyncFnc.todo=U.getService("map").highlightFeatures.bind(U.getService("map"),n.features||[],i):U.getService("map").highlightFeatures(n.features||[],i)}clearState(){this.state.layers.splice(0),this.state.query=null,this.state.querytitle="",this.state.changed=!1,Object.values(this.state.layersactions).forEach(n=>n.forEach(i=>i.clear&&i.clear())),this.state.layersactions={},this.state.actiontools={},this.state.layeractiontool={},this.state.currentactiontools={},this.state.layersFeaturesBoxes={},this.removeAddFeaturesLayerResultInteraction()}getState(){return this.state}setState(n){this.state=n}_setRelations(n){this._relations=(n.getRelations()||[]).reduce((i,r)=>(i[r.referencedLayer]=i[r.referencedLayer]||[],i[r.referencedLayer].push(r),i),{})}setTitle(n){this.state.querytitle=n||""}async trigger(n,i,r,o,u){if(n==="highlightgeometry"&&this.highlightGeometry(i,r,o),n==="clearHighlightGeometry"&&this.clearHighlightGeometry(i,r,o),i&&this.state.layersactions[i.id]){let c=this.state.layersactions[i.id].find(f=>f.id===n);if(c&&c.cbk&&await c.cbk(i,r,c,o,u),c&&c.route){let f=c.route.replace(/{(\w*)}/g,(p,g)=>r.attributes.hasOwnProperty(g)?r.attributes[g]:"");f&&f!==""&&U.goto(f)}}}registerVectorLayer(n){this._vectorLayers.includes(n)||this._vectorLayers.push(n)}unregisterVectorLayer(n){this._vectorLayers=this._vectorLayers.filter(i=>(this.state.layers=this.state.layers.filter(r=>r.id!==n.get("id")),i!==n))}getVectorLayerFeaturesFromQueryRequest(n,i={}){let{coordinates:r,bbox:o,geometry:u,filterConfig:c={}}=i,f=[],p=r&&Array.isArray(r),g=o&&Array.isArray(o);p&&U.getService("map").viewer.map.forEachFeatureAtPixel(U.getService("map").viewer.map.getPixelFromCoordinate(r),v=>{f.push(v)},{layerFilter:v=>v===n}),g&&!p&&(u=ol.geom.Polygon.fromExtent(o));let d=u instanceof ol.geom.Polygon||u instanceof ol.geom.MultiPolygon;return d&&!p&&Lr===n.constructor?f=n.getIntersectedFeatures(u):d&&!p&&ol.layer.Vector===n.constructor&&n.getSource().getFeatures().forEach(v=>{let y;switch(c.spatialMethod){case"within":y=A_(u,v.getGeometry());break;case"intersects":default:y=O_(u,v.getGeometry());break}y===!0&&f.push(v)}),{features:f,layer:n}}async _printSingleAtlas({atlas:n={},features:i=[]}={}){let r=n.atlas?.field_name||"$id",{url:o}=await ny({field:r,values:i.map(u=>u.attributes[r==="$id"?Cn:r]),template:n.name,download:!0});U.setLoadingContent(!0);try{let u=o&&await fetch(o);if(!u?.ok)throw(await u.json()).message;Ur(await u.blob(),n.name||(u.headers.get("content-disposition")||"filename=g3w_download_file").split("filename=").at(1))}catch(u){U.showUserMessage({type:"alert",message:u||"server_error",textMessage:!!u})}V.download=!0,V.download=!1,U.setLoadingContent(!1)}showChart(n,i,r){this.emit("show-chart",n,i,r)}hideChart(n){this.emit("hide-chart",n)}printAtlas(n,i){let r=i?[i]:n.features,o=this._atlas.filter(c=>c.atlas.qgs_layer_id===n.id);if(o.length<=1){this._printSingleAtlas({features:r,atlas:o[0]});return}let u="";o.forEach((c,f)=>{let p=ut();u+=``,u+=``,u+="
"}),U.showModalDialog({title:He("sdk.atlas.template_dialog.title"),message:u,buttons:{success:{label:"OK",className:"skin-button",callback:()=>{let c=$('input[name="template"]:checked').attr("g3w_atlas_index");if(c===void 0)return!1;this._printSingleAtlas({features:r,atlas:o[c]})}}}})}showLayerDownloadFormats(n){n.downloadformats.active=!n.downloadformats.active,this.setLayerActionTool({layer:n,component:n.downloadformats.active?Sp:null,config:n.downloadformats.active?{...this.state.actiontools.downloadformats[n.id],downloads:this.state.actiontools.downloadformats[n.id].downloads.filter(i=>i.format!=="pdf")}:null})}async downloadFeatures(n,i,r=[],o,u,c){r&&!Array.isArray(r)&&(r=[r]);let{query:f={}}=this.state,p={fids:r.map(y=>y.attributes[Cn]).join(",")};n==="pdf"&&(p.html=c);let g=async(y=!1)=>{r.length>1&&(i.downloadformats.active=y,this.setLayerActionTool({layer:i})),await U.downloadWrapper(({layer:w,type:E,data:I}={})=>st(w.id).getDownloadFilefromDownloadDataType(E,{data:I})||Promise.resolve(),{layer:i,type:n,data:p});let S=this.state.layersactions[i.id].find(w=>w.id==="downloads");r.length>1&&S===void 0&&(i[n].active=!1,this.setLayerActionTool({layer:i})),r.length>1&&S!==void 0&&(i.downloadformats.active=!1),r.length<=1&&S===void 0&&(o.state.toggled[u]=!1),r.length<=1&&S!==void 0&&(S.state.toggled[u]=!1),r.length<=1&&this.setCurrentActionLayerFeatureTool({index:u,action:o,layer:i})};if(f.type!=="polygon"){await g();return}let d=this.state.layersactions[i.id].find(y=>y.id==="downloads"),v={choices:[{id:ut(),type:"feature",label:"sdk.mapcontrols.querybypolygon.download.choiches.feature.label"},{id:ut(),type:"polygon",label:"sdk.mapcontrols.querybypolygon.download.choiches.feature_polygon.label"}],download:y=>{y==="polygon"?(p.sbp_qgs_layer_id=i.id,p.sbp_fid=f.fid):(delete p.sbp_fid,delete p.sbp_qgs_layer_id),g(!0)}};if(r.length===1&&d===void 0&&(o.state.toggled[u]=!0),r.length===1&&(this.state.actiontools[Ep.name]=this.state.actiontools[i.id]||{},this.state.actiontools[Ep.name][i.id]=v,this.setCurrentActionLayerFeatureTool({layer:i,index:u,action:o,component:Ep})),d===void 0&&r.length!==1&&(i[n].active=!i[n].active),r.length!==1){let y=d||i[n].active&&d===void 0;this.setLayerActionTool({layer:i,component:y?Ep:null,config:y?v:null})}}goToGeometry(n,i){i.geometry&&(this._asyncFnc.goToGeometry.async?this._asyncFnc.todo=U.getService("map")[this.isOneLayerResult()?"zoomToFeatures":"highlightGeometry"].bind(U.getService("map"),this.isOneLayerResult()?[i]:i.geometry,this.isOneLayerResult()?{}:{layerId:n.id,duration:1500}):setTimeout(()=>U.getService("map")[this.isOneLayerResult()?"zoomToFeatures":"highlightGeometry"](this.isOneLayerResult()?[i]:i.geometry,this.isOneLayerResult()?{}:{layerId:n.id,duration:1500})))}highlightGeometry(n,i){i.geometry&&U.getService("map").highlightGeometry(i.geometry,{layerId:n.id,zoom:!1,duration:1/0})}clearHighlightGeometry(n){U.getService("map").clearHighlightGeometry()}showRelation({relation:n,layerId:i,feature:r}={}){let o=this._project.getRelationById(n.name);U.pushContent({content:new zt({vueComponentObject:(L1(),Wn(DO)).default,propsData:{relation:o,chartRelationIds:this.plotLayerIds.find(u=>u==o.referencingLayer)?[o.referencingLayer]:[],nmRelation:this._project.getRelationById(n.nmRelationId),layer:{id:i},feature:r}}),crumb:{title:o.name,text:!0},title:o.name,text:!0,closable:!1})}_getFeatureId(n,i){return i?n.id:n.attributes[Cn]}addToSelection(n,i,r,o){let u=U.getService("queryresults"),c=U.getService("map"),f=u._getFeatureId.bind(u),p=u.getActionLayerById.bind(u),g=i===void 0&&r===void 0&&o===void 0,d=g?p({layer:n,id:"selection"}):r,v=g&&Object.values(d.state.toggled).reduce((E,I)=>E&&I,!0),y=g?n.external?n:st(n.id):(u.state.layers.find(E=>E.id===n.id)||{}).external?n:st(n.id),S=g?n.features&&n.features.length?n.features:[]:[i],w=g?{fids:S.length>0?S.map(E=>y.external?E.id:E.attributes[Cn]):null,features:S,force:v?"remove":"add"}:{fids:[i?f(i,y.external):null],features:S,index:o,force:void 0};if(g?n.features.forEach((E,I)=>{d.state.toggled[I]=!v,E.selection.selected=d.state.toggled[I]}):(d.state.toggled[o]=!d.state.toggled[o],i.selection.selected=d.state.toggled[o]),v&&g){y.clearSelectionFids();return}if(!n.external&&![null,void 0].includes(w.fids)){let E=y,{fids:I,features:O,force:H}=w;I=Array.isArray(I)?I:[I],O=Array.isArray(O)?O:[O];let X=[],re=[];I.forEach((z,Z)=>{let te=O[Z],ee=E.state.filter.active||E.hasSelectionFid(z);!ee&&te&&te.geometry&&!E.getOlSelectionFeature(z)&&E.addOlSelectionFeature({id:z,feature:te}),H===void 0&&E[ee?"excludeSelectionFid":"includeSelectionFid"](z),H==="add"&&!ee&&X.push(z),H==="remove"&&re.push(z)}),E.includeSelectionFids(X,!1),E.excludeSelectionFids(re,!1),(E.state.filter.active?E.createFilterToken():Promise.resolve()).then(()=>{let{layers:z}=U.getService("queryresults").getState();I.forEach((Z,te)=>{let ee=!E.hasSelectionFid(Z)&&E.state.filter.active&&E.getSelectionFids().size>0&&z.find(ve=>ve.id===E.getId());ee&&ee.features.splice(o===void 0?te:o,1)}),c.clearHighlightGeometry(),z.length===1&&!z[0].features.length&&z.splice(0)})}if(n.external&&![null,void 0].includes(w.fids)){let E=y,{fids:I,features:O,force:H}=w;O=Array.isArray(O)?O:[O],E.selection.features===void 0&&(E.selection.features=[]),I.forEach((X,re)=>{let z=O[re];if(E.selection.features.find(Z=>Z.getId()===X)===void 0){let Z=z,{attributes:te}=z;z.geometry&&(Z=new ol.Feature(z.geometry),Z.setId(X)),Object.keys(te).forEach(ee=>Z.set(ee,te[ee])),Z.__layerId=E.id,Z.selection=z.selection,E.selection.features.push(Z)}H==="add"&&z.selection.selected||H==="remove"&&!z.selection.selected||c.setSelectionFeatures(z.selection.selected?"add":"remove",{feature:E.selection.features.find(Z=>X===Z.getId())})}),E.selection.active=E.selection.features.reduce((X,re)=>X||re.selection.selected,!1)}}}});function pee(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};return d.__file="QueryResultsTableAttributeFieldValue.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r,d}var aee,lee,cee,uee,dee,hee,fee,gee,BO,UO=W(()=>{Vv();Qv();Zv();rr();aee={name:"tableattributefieldvalue",props:{field:{type:Object},feature:{type:Object}},mixins:[cs],components:{"g3w-link":Lg,"g3w-vue":Ag,"g3w-image":mf}},lee=function(){var e=this,n=e.$createElement,i=e._self._c||n;return e.isVue(e.field)?i("g3w-vue",{attrs:{feature:e.feature,state:e.field}}):e.isSimple(e.field)?i("span",{domProps:{innerHTML:e._s(e.field.value)}}):e.isPhoto(e.field)?i("g3w-image",{attrs:{state:e.field}}):e.isImage(e.field)?i("g3w-image",{attrs:{state:e.field}}):e.isLink(e.field)?i("g3w-link",{attrs:{state:{value:e.field.value}}}):e._e()},cee=[],uee=void 0,dee="data-v-019d651d",hee=void 0,fee=!1;gee=pee({render:lee,staticRenderFns:cee},uee,aee,dee,fee,hee,!1,void 0,void 0,void 0),BO=gee});function See(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};return d.__file="QueryResultsActionInfoFormats.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r,d}var mee,_ee,yee,vee,bee,xee,wee,Eee,VO,WO=W(()=>{bt();h_();bu();Bn();mee={name:"Infoformats",props:{layer:{type:Object,required:!0}},data(){return{infoformat:this.layer.infoformat}},computed:{infoformats(){return this.layer.infoformats||[]},hasInfo(){return this.infoformats.length}},methods:{async reloadLayerDataWithChangedContentType(e){this.layer.loading=!0,this.$el.disabled=!0;try{let n=await this.projectLayer.changeProxyDataAndReloadFromServer("wms",{headers:{"Content-Type":e},params:{INFO_FORMAT:e}});this.layer.infoformat=e,this.projectLayer.setInfoFormat(this.layer.infoformat);let[i]=vs.get(e)({layers:[this.projectLayer],response:n});i.features?this.__parsedata(i):this.__parserawdata(i)}catch(n){console.warn(n)}this.layer.loading=!1,this.$el.disabled=!1},__parsedata(e){let n=U.getService("queryresults");this.layer.rawdata=null,e.features.forEach(i=>{let{id:r,geometry:o,properties:u}={properties:i instanceof ol.Feature?i.getProperties():i.properties,geometry:i instanceof ol.Feature?i.getGeometry():i.geometry,id:i instanceof ol.Feature?i.getId():i.id};this.layer.attributes.length===0&&(this.layer.hasgeometry=!!o,n.setActionsForLayers([this.layer]),co(u).forEach(c=>{this.layer.attributes.push({name:c,label:c,show:!0})})),this.layer.features.push({id:r,attributes:u,geometry:o,show:!0})})},async __parserawdata(e){this.layer.features.splice(0),await this.$nextTick(),this.layer.rawdata=e.rawdata}},watch:{infoformat(e){this.reloadLayerDataWithChangedContentType(e)}},created(){this.projectLayer=st(this.layer.id)},beforeDestroy(){this.projectLayer&&this.projectLayer.clearProxyData("wms"),this.projectLayer=null}},_ee=function(){var e=this,n=e.$createElement,i=e._self._c||n;return e.hasInfo?i("select",{directives:[{name:"select2",rawName:"v-select2",value:"infoformat",expression:"'infoformat'"}],staticClass:"skin-color",attrs:{select2_value:e.infoformat,search:!1}},e._l(e.infoformats,function(r){return i("option",{key:r,domProps:{value:r}},[e._v(` `+e._s(r)+` `)])}),0):e._e()},yee=[],vee=void 0,bee=void 0,xee=void 0,wee=!1;Eee=See({render:_ee,staticRenderFns:yee},vee,mee,bee,wee,xee,!1,void 0,void 0,void 0),VO=Eee});function Mee(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};return d.__file="QueryResultsAction.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r,d}var Cee,Iee,kee,Lee,Tee,Nee,Ree,Aee,HO,YO=W(()=>{cn();Cee={name:"action",data(){return{show:!0}},props:{featureIndex:{type:Number},feature:{type:Object},layer:{type:Object},trigger:{type:Function},action:{type:Object,required:!0}},methods:{async clickAction(e,n,i,r,o){if(await this.trigger(e,n,i,r),e.hint_change){let u=$(o.target).parent(),c=u.attr("data-original-title");u.attr("data-original-title",He(e.hint_change.hint)),u.tooltip("show"),setTimeout(()=>{u.attr("data-original-title",c),u.tooltip("show")},e.hint_change.duration||600)}this.$emit("action-clicked",e)}},async created(){if(this.action.init&&this.action.init({layer:this.layer,feature:this.feature,index:this.featureIndex,action:this.action}),typeof this.action.condition=="function"){let e=this.action.condition({layer:this.layer,feature:this.feature});this.show=e instanceof Promise?await e:e}},beforeDestroy(){typeof this.action.clear=="function"&&this.action.clear({layer:this.layer,feature:this.feature})}},Iee=function(){var e=this,n=e.$createElement,i=e._self._c||n;return e.show&&((e.action.state||{}).show===void 0?e.show:e.action.state.show)?i("span",{directives:[{name:"download",rawName:"v-download",value:e.action.download,expression:"action.download"},{name:"disabled",rawName:"v-disabled",value:!!(e.action.state||{}).disabled,expression:"!!(action.state || {}).disabled"},{name:"t-tooltip",rawName:"v-t-tooltip:top.create",value:e.action.hint,expression:"action.hint",arg:"top",modifiers:{create:!0}}],staticClass:"action-button",class:{toggled:(e.action.state||{}).toggled&&e.action.state.toggled[e.featureIndex]},on:{contextmenu:function(r){r.preventDefault(),r.stopPropagation()},click:function(r){return r.stopPropagation(),e.clickAction(e.action,e.layer,e.feature,e.featureIndex,r)}}},[i("span",{class:"action-button-icon "+e.action.class,staticStyle:{padding:"2px"},style:e.action.style})]):e._e()},kee=[],Lee=void 0,Tee=void 0,Nee=void 0,Ree=!1;Aee=Mee({render:Iee,staticRenderFns:kee},Lee,Cee,Tee,Ree,Nee,!1,void 0,void 0,void 0),HO=Aee});function Gee(e,n,i,r,o,u,c,f,p,g){let d=(typeof i=="function"?i.options:i)||{};d.__file="QueryResultsActions.vue",d.render||(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),d._scopeId=r;{let v;if(n&&(v=c?function(y){n.call(this,g(y,this.$root.$options.shadowRoot))}:function(y){n.call(this,f(y))}),v!==void 0)if(d.functional){let y=d.render;d.render=function(w,E){return v.call(E),y(w,E)}}else{let y=d.beforeCreate;d.beforeCreate=y?[].concat(y,v):[v]}}return d}function T1(){let e=T1.styles||(T1.styles={}),n=typeof navigator<"u"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(r,o){if(document.querySelector('style[data-vue-ssr-id~="'+r+'"]'))return;let u=n?o.media||"default":r,c=e[u]||(e[u]={ids:[],parts:[],element:void 0});if(!c.ids.includes(r)){let f=o.source,p=c.ids.length;if(c.ids.push(r),o.map&&(f+=` /*# sourceURL=`+o.map.sources[0]+" */",f+=` diff --git a/g3w-admin/client/static/client/app.min.js.map b/g3w-admin/client/static/client/app.min.js.map index ffd83e745..66e0cb9c3 100644 --- a/g3w-admin/client/static/client/app.min.js.map +++ b/g3w-admin/client/static/client/app.min.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../../../g3w-client-feature-fix/package.json", "../../../../../g3w-client-feature-fix/src/g3w-constants.js", "../../../../../g3w-client-feature-fix/src/utils/noop.js", "../../../../../g3w-client-feature-fix/src/utils/debounce.js", "../../../../../g3w-client-feature-fix/src/utils/throttle.js", "../../../../../g3w-client-feature-fix/node_modules/wolfy87-eventemitter/EventEmitter.js", "../../../../../g3w-client-feature-fix/src/g3w-object.js", "../../../../../g3w-client-feature-fix/src/store/application.js", "../../../../../g3w-client-feature-fix/src/services/application.js", "../../../../../g3w-client-feature-fix/src/utils/is3DGeometry.js", "../../../../../g3w-client-feature-fix/src/utils/addZValue.js", "../../../../../g3w-client-feature-fix/src/utils/removeZValue.js", "../../../../../g3w-client-feature-fix/src/utils/isMultiGeometry.js", "../../../../../g3w-client-feature-fix/src/utils/isPointGeometryType.js", "../../../../../g3w-client-feature-fix/src/utils/isLineGeometryType.js", "../../../../../g3w-client-feature-fix/src/utils/isPolygonGeometryType.js", "../../../../../g3w-client-feature-fix/node_modules/jszip/dist/jszip.min.js", "../../../../../g3w-client-feature-fix/node_modules/proj4/dist/proj4-src.js", "../../../../../g3w-client-feature-fix/src/utils/getUniqueDomId.js", "../../../../../g3w-client-feature-fix/src/utils/createSelectedStyle.js", "../../../../../g3w-client-feature-fix/src/utils/getAlphanumericPropertiesFromFeature.js", "../../../../../g3w-client-feature-fix/node_modules/localforage/dist/localforage.js", "../../../../../g3w-client-feature-fix/src/store/plugins.js", "../../../../../g3w-client-feature-fix/src/utils/normalizeEpsg.js", "../../../../../g3w-client-feature-fix/src/store/projections.js", "../../../../../g3w-client-feature-fix/src/utils/getScaleFromResolution.js", "../../../../../g3w-client-feature-fix/src/utils/getResolutionFromScale.js", "../../../../../g3w-client-feature-fix/src/utils/createFilterFromString.js", "../../../../../g3w-client-feature-fix/src/utils/promisify.js", "../../../../../g3w-client-feature-fix/node_modules/lodash.clonedeep/index.js", "../../../../../g3w-client-feature-fix/node_modules/util-deprecate/browser.js", "../../../../../g3w-client-feature-fix/src/g3w-component.js", "../../../../../g3w-client-feature-fix/src/g3w-panel.js", "../../../../../g3w-client-feature-fix/src/utils/groupBy.js", "../../../../../g3w-client-feature-fix/src/utils/XHR.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/typeof.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/toPrimitive.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/toPropertyKey.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/defineProperty.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/objectSpread.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/classCallCheck.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/createClass.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/assertThisInitialized.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/getPrototypeOf.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/setPrototypeOf.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/inherits.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/arrayLikeToArray.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/iterableToArray.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/nonIterableSpread.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/toConsumableArray.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/arrayWithHoles.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/nonIterableRest.js", "../../../../../g3w-client-feature-fix/node_modules/@babel/runtime/helpers/slicedToArray.js", "../../../../../g3w-client-feature-fix/node_modules/i18next/dist/cjs/i18next.js", "../../../../../g3w-client-feature-fix/src/g3w-i18n.js", "../../../../../g3w-client-feature-fix/src/services/data.js", "../../../../../g3w-client-feature-fix/src/services/iframe.js", "../../../../../g3w-client-feature-fix/src/utils/toRawType.js", "../../../../../g3w-client-feature-fix/src/utils/getListableProjects.js", "../../../../../g3w-client-feature-fix/src/utils/getProjectUrl.js", "../../../../../g3w-client-feature-fix/src/components/SidebarItem.vue", "../../../../../g3w-client-feature-fix/src/components/FormHeader.vue", "../../../../../g3w-client-feature-fix/src/components/FormFooter.vue", "../../../../../g3w-client-feature-fix/src/components/Form.vue", "../../../../../g3w-client-feature-fix/src/utils/getCatalogLayerById.js", "../../../../../g3w-client-feature-fix/src/mixins/autocomplete.js", "../../../../../g3w-client-feature-fix/src/components/Field.vue", "../../../../../g3w-client-feature-fix/src/components/FieldText.vue", "../../../../../g3w-client-feature-fix/src/components/FieldLink.vue", "../../../../../g3w-client-feature-fix/node_modules/vue2-teleport/dist/teleport.esm.js", "../../../../../g3w-client-feature-fix/src/components/FieldImage.vue", "../../../../../g3w-client-feature-fix/src/components/FieldGeo.vue", "../../../../../g3w-client-feature-fix/src/components/FieldMedia.vue", "../../../../../g3w-client-feature-fix/src/components/FieldVue.vue", "../../../../../g3w-client-feature-fix/src/app/gui/fields/fields.js", "../../../../../g3w-client-feature-fix/src/app/gui/fields/fieldsservice.js", "../../../../../g3w-client-feature-fix/src/mixins/fields.js", "../../../../../g3w-client-feature-fix/src/mixins/media.js", "../../../../../g3w-client-feature-fix/src/mixins/geo.js", "../../../../../g3w-client-feature-fix/src/mixins/resize.js", "../../../../../g3w-client-feature-fix/src/mixins/select.js", "../../../../../g3w-client-feature-fix/src/mixins/select2.js", "../../../../../g3w-client-feature-fix/src/mixins/form-inputs.js", "../../../../../g3w-client-feature-fix/src/mixins/base-input.js", "../../../../../g3w-client-feature-fix/src/mixins/index.js", "../../../../../g3w-client-feature-fix/src/components/InputBase.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/integer/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/float/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/radio/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/checkbox/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/range/service.js", "../../../../../g3w-client-feature-fix/src/utils/convertQGISDateTimeFormatToMoment.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/datetimepicker/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/unique/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/select/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/media/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/sliderrange/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/lonlat/service.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/services.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/input.js", "../../../../../g3w-client-feature-fix/src/components/InputText.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/text/vue/text.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_freeGlobal.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_root.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_Symbol.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getRawTag.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_objectToString.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseGetTag.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isObjectLike.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isObject.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/identity.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isFunction.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_coreJsData.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_isMasked.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_toSource.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseIsNative.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getValue.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getNative.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_WeakMap.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseCreate.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_apply.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_copyArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_shortOut.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/constant.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_defineProperty.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseSetToString.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_setToString.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_arrayEach.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_isIndex.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseAssignValue.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/eq.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_assignValue.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_copyObject.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_overRest.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseRest.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isLength.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isArrayLike.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_isIterateeCall.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_createAssigner.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_isPrototype.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseTimes.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseIsArguments.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isArguments.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/stubFalse.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isBuffer.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseIsTypedArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseUnary.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_nodeUtil.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isTypedArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_arrayLikeKeys.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_overArg.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_nativeKeys.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseKeys.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/keys.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_nativeKeysIn.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseKeysIn.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/keysIn.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_nativeCreate.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_hashClear.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_hashDelete.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_hashGet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_hashHas.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_hashSet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_Hash.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_listCacheClear.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_assocIndexOf.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_listCacheDelete.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_listCacheGet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_listCacheHas.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_listCacheSet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_ListCache.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_Map.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_mapCacheClear.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_isKeyable.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getMapData.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_mapCacheDelete.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_mapCacheGet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_mapCacheHas.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_mapCacheSet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_MapCache.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_arrayPush.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getPrototype.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isPlainObject.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_stackClear.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_stackDelete.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_stackGet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_stackHas.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_stackSet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_Stack.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseAssign.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseAssignIn.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_cloneBuffer.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_arrayFilter.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/stubArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getSymbols.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_copySymbols.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getSymbolsIn.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_copySymbolsIn.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseGetAllKeys.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getAllKeys.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getAllKeysIn.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_DataView.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_Promise.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_Set.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_getTag.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_initCloneArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_Uint8Array.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_cloneArrayBuffer.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_cloneDataView.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_cloneRegExp.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_cloneSymbol.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_cloneTypedArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_initCloneByTag.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_initCloneObject.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseIsMap.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isMap.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseIsSet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isSet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseClone.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/cloneDeep.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_setCacheAdd.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_setCacheHas.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_SetCache.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_arraySome.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_cacheHas.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_equalArrays.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_mapToArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_setToArray.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_equalByTag.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_equalObjects.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseIsEqualDeep.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseIsEqual.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_createBaseFor.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseFor.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_assignMergeValue.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isArrayLikeObject.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_safeGet.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/toPlainObject.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseMergeDeep.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/_baseMerge.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/isEqual.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/merge.js", "../../../../../g3w-client-feature-fix/node_modules/lodash-es/lodash.js", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/scope.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/attributor/attributor.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/error.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/registry.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/attributor/class.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/attributor/style.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/attributor/store.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/abstract/shadow.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/abstract/leaf.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/collection/linked-list.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/abstract/parent.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/inline.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/block.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/abstract/container.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/embed.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/scroll.ts", "../../../../../g3w-client-feature-fix/node_modules/parchment/src/blot/text.ts", "../../../../../g3w-client-feature-fix/node_modules/fast-diff/diff.js", "../../../../../g3w-client-feature-fix/node_modules/lodash.isequal/index.js", "../../../../../g3w-client-feature-fix/node_modules/quill-delta/src/AttributeMap.ts", "../../../../../g3w-client-feature-fix/node_modules/quill-delta/src/Op.ts", "../../../../../g3w-client-feature-fix/node_modules/quill-delta/src/OpIterator.ts", "../../../../../g3w-client-feature-fix/node_modules/quill-delta/src/Delta.ts", "../../../../../g3w-client-feature-fix/node_modules/src/blots/break.ts", "../../../../../g3w-client-feature-fix/node_modules/src/blots/text.ts", "../../../../../g3w-client-feature-fix/node_modules/src/blots/inline.ts", "../../../../../g3w-client-feature-fix/node_modules/src/blots/block.ts", "../../../../../g3w-client-feature-fix/node_modules/src/blots/cursor.ts", "../../../../../g3w-client-feature-fix/node_modules/eventemitter3/index.js", "../../../../../g3w-client-feature-fix/node_modules/eventemitter3/index.mjs", "../../../../../g3w-client-feature-fix/node_modules/src/core/instances.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/logger.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/emitter.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/selection.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/editor.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/module.ts", "../../../../../g3w-client-feature-fix/node_modules/src/blots/embed.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/composition.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/theme.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/utils/scrollRectIntoView.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/utils/createRegistryWithFormats.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core/quill.ts", "../../../../../g3w-client-feature-fix/node_modules/src/blots/container.ts", "../../../../../g3w-client-feature-fix/node_modules/src/blots/scroll.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/align.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/color.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/background.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/code.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/direction.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/font.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/size.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/keyboard.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/normalizeExternalHTML/normalizers/googleDocs.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/normalizeExternalHTML/normalizers/msWord.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/normalizeExternalHTML/index.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/clipboard.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/history.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/uploader.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/input.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/uiNode.ts", "../../../../../g3w-client-feature-fix/node_modules/src/core.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/indent.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/blockquote.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/header.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/list.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/bold.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/italic.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/link.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/script.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/strike.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/underline.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/formula.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/image.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/video.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/syntax.ts", "../../../../../g3w-client-feature-fix/node_modules/src/formats/table.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/table.ts", "../../../../../g3w-client-feature-fix/node_modules/src/modules/toolbar.ts", "../../../../../g3w-client-feature-fix/node_modules/src/ui/icons.ts", "../../../../../g3w-client-feature-fix/node_modules/src/ui/picker.ts", "../../../../../g3w-client-feature-fix/node_modules/src/ui/color-picker.ts", "../../../../../g3w-client-feature-fix/node_modules/src/ui/icon-picker.ts", "../../../../../g3w-client-feature-fix/node_modules/src/ui/tooltip.ts", "../../../../../g3w-client-feature-fix/node_modules/src/themes/base.ts", "../../../../../g3w-client-feature-fix/node_modules/src/themes/bubble.ts", "../../../../../g3w-client-feature-fix/node_modules/src/themes/snow.ts", "../../../../../g3w-client-feature-fix/node_modules/src/quill.ts", "../../../../../g3w-client-feature-fix/src/components/InputTextHtml.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/texthtml/vue/texthtml.js", "../../../../../g3w-client-feature-fix/src/components/InputTextArea.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/textarea/vue/textarea.js", "../../../../../g3w-client-feature-fix/src/components/InputInteger.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/integer/vue/integer.js", "../../../../../g3w-client-feature-fix/src/components/InputFloat.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/float/vue/float.js", "../../../../../g3w-client-feature-fix/src/components/InputRadio.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/radio/vue/radio.js", "../../../../../g3w-client-feature-fix/src/components/InputCheckbox.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/checkbox/vue/checkbox.js", "../../../../../g3w-client-feature-fix/src/components/InputRange.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/range/vue/range.js", "../../../../../g3w-client-feature-fix/src/components/InputDateTimePicker.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/datetimepicker/vue/datetimepicker.js", "../../../../../g3w-client-feature-fix/src/components/InputUnique.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/unique/vue/unique.js", "../../../../../g3w-client-feature-fix/src/map/interactions/pickfeatureinteraction.js", "../../../../../g3w-client-feature-fix/src/map/interactions/pickcoordinatesinteraction.js", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/picklayer/service.js", "../../../../../g3w-client-feature-fix/src/utils/saveBlob.js", "../../../../../g3w-client-feature-fix/src/utils/prompt.js", "../../../../../g3w-client-feature-fix/src/components/FieldG3W.vue", "../../../../../g3w-client-feature-fix/src/components/Table.vue", "../../../../../g3w-client-feature-fix/src/utils/sanitizeFidFeature.js", "../../../../../g3w-client-feature-fix/src/utils/reverseGeometry.js", "../../../../../g3w-client-feature-fix/src/map/layers/feature.js", "../../../../../g3w-client-feature-fix/src/utils/parsers/index.js", "../../../../../g3w-client-feature-fix/src/utils/get_legend_params.js", "../../../../../g3w-client-feature-fix/src/utils/createRelationsUrl.js", "../../../../../g3w-client-feature-fix/src/map/layers/layer.js", "../../../../../g3w-client-feature-fix/src/components/InputSelect.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/select/vue/select.js", "../../../../../g3w-client-feature-fix/src/components/InputMedia.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/media/vue/media.js", "../../../../../g3w-client-feature-fix/src/components/InputPickLayer.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/picklayer/vue/picklayer.js", "../../../../../g3w-client-feature-fix/src/components/InputColor.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/color/vue/color.js", "../../../../../g3w-client-feature-fix/src/components/InputSliderRange.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/sliderrange/vue/sliderrange.js", "../../../../../g3w-client-feature-fix/src/components/InputLonLat.vue", "../../../../../g3w-client-feature-fix/src/app/gui/inputs/lonlat/vue/lonlat.js", "../../../../../g3w-client-feature-fix/src/components/InputG3W.vue", "../../../../../g3w-client-feature-fix/src/components/InputG3WFormInputs.vue", "../../../../../g3w-client-feature-fix/src/components/FormBody.vue", "../../../../../g3w-client-feature-fix/src/utils/getDefaultExpression.js", "../../../../../g3w-client-feature-fix/src/utils/getFilterExpression.js", "../../../../../g3w-client-feature-fix/src/components/g3w-form.js", "../../../../../g3w-client-feature-fix/src/components/ProjectsMenu.vue", "../../../../../g3w-client-feature-fix/src/services/gui.js", "../../../../../g3w-client-feature-fix/src/map/controls/interactioncontrol.js", "../../../../../g3w-client-feature-fix/src/g3w-eventbus.js", "../../../../../g3w-client-feature-fix/src/map/controls/queryby.js", "../../../../../g3w-client-feature-fix/src/map/controls/geolocationcontrol.js", "../../../../../g3w-client-feature-fix/src/map/controls/streetviewcontrol.js", "../../../../../g3w-client-feature-fix/src/map/controls/scalecontrol.js", "../../../../../g3w-client-feature-fix/src/utils/sameOrigin.js", "../../../../../g3w-client-feature-fix/src/map/controls/screenshotcontrol.js", "../../../../../g3w-client-feature-fix/src/utils/createMeasureTooltip.js", "../../../../../g3w-client-feature-fix/src/utils/removeMeasureTooltip.js", "../../../../../g3w-client-feature-fix/src/map/controls/measurecontrol.js", "../../../../../g3w-client-feature-fix/src/components/MapControlZoomHistory.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResultsActionChooseLayer.vue", "../../../../../g3w-client-feature-fix/src/utils/flattenObject.js", "../../../../../g3w-client-feature-fix/src/utils/convertSingleMultiGeometry.js", "../../../../../g3w-client-feature-fix/src/utils/getCatalogLayers.js", "../../../../../g3w-client-feature-fix/src/components/MapControlGeocoding.vue", "../../../../../g3w-client-feature-fix/src/utils/waitFor.js", "../../../../../g3w-client-feature-fix/src/map/layers/featuresstore.js", "../../../../../g3w-client-feature-fix/src/map/layers/tablelayer.js", "../../../../../g3w-client-feature-fix/src/map/layers/geo-mixin.js", "../../../../../g3w-client-feature-fix/src/map/layers/vectorlayer.js", "../../../../../g3w-client-feature-fix/src/map/layers/imagelayer.js", "../../../../../g3w-client-feature-fix/src/map/layers/layersstore.js", "../../../../../g3w-client-feature-fix/src/utils/getProject.js", "../../../../../g3w-client-feature-fix/src/services/map.js", "../../../../../g3w-client-feature-fix/src/utils/getMapLayersByFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/NumberUtil.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/Exception.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/IllegalArgumentException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/Long.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/Double.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/Comparable.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/io/Serializable.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/RuntimeException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/AssertionFailedException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/Assert.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/Cloneable.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/Comparator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Coordinate.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateXY.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateXYM.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateXYZM.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/hasInterface.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/Collection.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/IndexOutOfBoundsException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/List.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/NoSuchElementException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/ArrayList.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateList.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateSequenceFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Envelope.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/StringBuffer.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/Integer.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/Character.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/IllegalStateException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/math/DD.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/CGAlgorithmsDD.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateSequence.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/Orientation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/Intersection.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/System.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/math/MathUtil.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/Distance.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/Length.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/GeometryComponentFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/UnsupportedOperationException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Coordinates.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateArrays.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Dimension.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Geometry.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Lineal.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateSequences.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/GeometryFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/LineString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/LinearRing.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/CoordinateSequenceFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/lang/StringBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/impl/CoordinateArraySequence.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/impl/CoordinateArraySequenceFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/Set.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/SortedSet.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/TreeSet.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/Arrays.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/GeometryCollection.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Polygonal.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/MultiPolygon.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/Map.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/HashSet.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/HashMap.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/PrecisionModel.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/MultiLineString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Puntal.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Point.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/Area.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Polygon.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/MultiPoint.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/GeometryFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/io/WKTParser.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/io/WKTWriter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/LineIntersector.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/RobustLineIntersector.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/LineSegment.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Location.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/IntersectionMatrix.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/Angle.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/NotRepresentableException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/HCoordinate.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/Triangle.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/NoninvertibleTransformationException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/AffineTransformation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/math/Matrix.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/AffineTransformationBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/AffineTransformationFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/ComponentCoordinateExtracter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/GeometryCollectionMapper.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/GeometryCombiner.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/GeometryEditor.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/GeometryExtracter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/GeometryMapper.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/GeometryTransformer.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/LineStringExtracter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/LinearComponentExtracter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/Collections.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/PointExtracter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/PolygonExtracter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/ShortCircuitedGeometryVisitor.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/GeometricShapeFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/util/SineStarFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/distance/PointPairDistance.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/distance/DistanceToPoint.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/distance/DiscreteHausdorffDistance.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/ItemVisitor.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/locate/PointOnGeometryLocator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/intervalrtree/IntervalRTreeNode.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/intervalrtree/IntervalRTreeLeafNode.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/intervalrtree/IntervalRTreeBranchNode.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/intervalrtree/SortedPackedIntervalRTree.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/ArrayListVisitor.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/RayCrossingCounter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/locate/IndexedPointInAreaLocator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/PointLocation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/Iterator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/GeometryCollectionIterator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/locate/SimplePointInAreaLocator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/match/SimilarityMeasure.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/BufferParameters.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/SegmentPointComparator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/SegmentNode.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/SortedMap.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/TreeMap.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/SegmentNodeList.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/Octant.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/SegmentString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/NodableSegmentString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/NodedSegmentString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/Noder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/ScaledNoder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geom/TopologyException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/NodingValidator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/strtree/Boundable.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/strtree/ItemBoundable.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/node_modules/fastpriorityqueue/FastPriorityQueue.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/PriorityQueue.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/SpatialIndex.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/strtree/AbstractNode.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/strtree/EnvelopeDistance.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/strtree/BoundablePair.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/strtree/AbstractSTRtree.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/strtree/ItemDistance.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/strtree/STRtree.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/chain/MonotoneChainOverlapAction.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/chain/MonotoneChain.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/Quadrant.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/chain/MonotoneChainBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/SinglePassNoder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/MCIndexNoder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/snapround/HotPixel.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/chain/MonotoneChainSelectAction.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/snapround/MCIndexPointSnapper.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/SegmentIntersector.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/InteriorIntersectionFinderAdder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/snapround/MCIndexSnapRounder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/Position.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/EmptyStackException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/Stack.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/RightmostEdgeFinder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/util/LinkedList.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/BufferSubgraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/BufferInputLineSimplifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/OffsetSegmentString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/OffsetSegmentGenerator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/OffsetCurveBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/TopologyLocation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/Label.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/GraphComponent.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/Node.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/NodeMap.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/NodeFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/EdgeEnd.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/DirectedEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/PlanarGraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/EdgeRing.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/MinimalEdgeRing.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/MaximalEdgeRing.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/PolygonBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/SubgraphDepthLocater.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/OffsetCurveSetBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/EdgeEndStar.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/DirectedEdgeStar.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/OverlayNodeFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/OrientedCoordinateArray.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/EdgeList.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/IntersectionAdder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/EdgeIntersection.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/EdgeIntersectionList.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/Depth.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/IntArrayList.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/index/MonotoneChainIndexer.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/index/MonotoneChainEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/Edge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/BufferBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/buffer/BufferOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/snap/LineStringSnapper.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/snap/GeometrySnapper.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/precision/CommonBits.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/precision/CommonBitsRemover.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/LineBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/PointBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/BoundaryNodeRule.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/PointLocator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/BasicSegmentString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/NodingIntersectionFinder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/noding/FastNodingValidator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/EdgeNodingValidator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/index/EdgeSetIntersector.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/index/SegmentIntersector.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/index/MonotoneChain.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/index/SweepLineEvent.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/index/SimpleMCSweepLineIntersector.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/geomgraph/GeometryGraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/GeometryGraphOperation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/OverlayOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/snap/SnapOverlayOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/overlay/snap/SnapIfNeededOverlayOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/union/UnionOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/match/HausdorffSimilarityMeasure.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/match/AreaSimilarityMeasure.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/match/SimilarityMeasureCombiner.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/Centroid.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/UniqueCoordinateArrayFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/ConvexHull.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/InteriorPointArea.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/InteriorPointLine.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/InteriorPointPoint.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/MinimumBoundingCircle.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/MinimumDiameter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/densify/Densifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/edgegraph/HalfEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/edgegraph/MarkHalfEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/edgegraph/EdgeGraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/dissolve/DissolveHalfEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/dissolve/DissolveEdgeGraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/dissolve/LineDissolver.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/kdtree/KdNodeVisitor.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/kdtree/KdNode.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/kdtree/KdTree.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/quadtree/NodeBase.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/quadtree/DoubleBits.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/quadtree/Key.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/quadtree/Node.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/quadtree/IntervalSize.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/quadtree/Root.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/index/quadtree/Quadtree.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/io/GeoJSONParser.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/io/OL3Parser.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/io/GeoJSONReader.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/io/GeoJSONWriter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/io/WKTReader.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/BoundaryOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/IsSimpleOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/distance/GeometryLocation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/distance/ConnectedElementLocationFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/distance/DistanceOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/linemerge/EdgeString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/GraphComponent.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/DirectedEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/linemerge/LineMergeDirectedEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/Edge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/DirectedEdgeStar.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/Node.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/linemerge/LineMergeEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/NodeMap.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/PlanarGraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/linemerge/LineMergeGraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/linemerge/LineMerger.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/Subgraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/planargraph/algorithm/ConnectedSubgraphFinder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/linemerge/LineSequencer.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/valid/ConnectedInteriorTester.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/relate/EdgeEndBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/relate/EdgeEndBundle.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/relate/EdgeEndBundleStar.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/relate/RelateNode.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/relate/RelateNodeFactory.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/relate/RelateNodeGraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/valid/ConsistentAreaTester.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/valid/IndexedNestedRingTester.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/valid/TopologyValidationError.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/valid/IsValidOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/polygonize/EdgeRing.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/polygonize/HoleAssigner.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/polygonize/PolygonizeDirectedEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/polygonize/PolygonizeEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/polygonize/PolygonizeGraph.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/polygonize/Polygonizer.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/relate/RelateComputer.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/predicate/RectangleContains.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/algorithm/RectangleLineIntersector.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/predicate/RectangleIntersects.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/relate/RelateOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/union/InputExtracter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/union/PointGeometryUnion.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/union/OverlapUnion.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/union/CascadedPolygonUnion.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/union/UnaryUnionOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/precision/CommonBitsOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/precision/PrecisionReducerCoordinateOperation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/precision/GeometryPrecisionReducer.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/distance/FacetSequence.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/operation/distance/FacetSequenceTreeBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/precision/MinimumClearance.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/precision/SimpleMinimumClearance.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/precision/EnhancedPrecisionOp.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/DouglasPeuckerLineSimplifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/DouglasPeuckerSimplifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/TaggedLineSegment.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/TaggedLineString.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/LineSegmentIndex.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/TaggedLineStringSimplifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/TaggedLinesSimplifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/TopologyPreservingSimplifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/VWLineSimplifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/simplify/VWSimplifier.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/quadedge/QuadEdgeLocator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/quadedge/LastFoundQuadEdgeLocator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/Segment.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/SplitSegment.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/ConstraintSplitPointFinder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/NonEncroachingSplitPointFinder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/quadedge/TrianglePredicate.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/quadedge/Vertex.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/ConstraintVertex.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/quadedge/QuadEdge.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/IncrementalDelaunayTriangulator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/quadedge/LocateFailureException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/quadedge/TriangleVisitor.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/quadedge/QuadEdgeSubdivision.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/ConstraintEnforcementException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/ConformingDelaunayTriangulator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/DelaunayTriangulationBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/ConformingDelaunayTriangulationBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/triangulate/VoronoiDiagramBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LinearIterator.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LengthIndexOfPoint.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LinearGeometryBuilder.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/ExtractLineByLocation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LinearLocation.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LocationIndexOfPoint.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LocationIndexOfLine.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LengthLocationMap.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LengthIndexedLine.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/linearref/LocationIndexedLine.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/CollectionUtil.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/CoordinateArrayFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/CoordinateCountFilter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/ObjectCounter.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/PriorityQueue.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/io/PrintStream.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/io/StringReader.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/io/LineNumberReader.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/io/ByteArrayOutputStream.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/java/io/IOException.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/util/StringUtil.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/org/locationtech/jts/monkey.js", "../../../../../g3w-client-feature-fix/node_modules/jsts/src/jsts.js", "../../../../../g3w-client-feature-fix/src/utils/within.js", "../../../../../g3w-client-feature-fix/src/utils/intersects.js", "../../../../../g3w-client-feature-fix/src/utils/createFilterFormInputs.js", "../../../../../g3w-client-feature-fix/src/utils/getDataForSearchInput.js", "../../../../../g3w-client-feature-fix/src/components/SearchPanel.vue", "../../../../../g3w-client-feature-fix/src/components/g3w-search.js", "../../../../../g3w-client-feature-fix/node_modules/vue-cookie-law/dist/vue-cookie-law.js", "../../../../../g3w-client-feature-fix/node_modules/vue-color/dist/vue-color.min.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/types.js", "../../../../../g3w-client-feature-fix/node_modules/dbf/src/fieldsize.js", "../../../../../g3w-client-feature-fix/node_modules/dbf/src/lib.js", "../../../../../g3w-client-feature-fix/node_modules/dbf/src/fields.js", "../../../../../g3w-client-feature-fix/node_modules/dbf/src/structure.js", "../../../../../g3w-client-feature-fix/node_modules/dbf/index.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/prj.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/extent.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/points.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/poly.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/write.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/geojson.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/zip.js", "../../../../../g3w-client-feature-fix/node_modules/file-saver/src/FileSaver.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/src/download.js", "../../../../../g3w-client-feature-fix/node_modules/@mapbox/shp-write/dist/index.js", "../../../../../g3w-client-feature-fix/node_modules/tiny-cookie/tiny-cookie.js", "../../../../../g3w-client-feature-fix/node_modules/vue-cookie/src/vue-cookie.js", "../../../../../g3w-client-feature-fix/src/components/SpatialBookMarks.vue", "../../../../../g3w-client-feature-fix/src/utils/printAtlas.js", "../../../../../g3w-client-feature-fix/src/components/PrintPage.vue", "../../../../../g3w-client-feature-fix/src/components/Print.vue", "../../../../../g3w-client-feature-fix/src/components/QueryBuilder.vue", "../../../../../g3w-client-feature-fix/src/components/Tool.vue", "../../../../../g3w-client-feature-fix/src/components/Search.vue", "../../../../../g3w-client-feature-fix/src/components/CatalogChangeMapThemes.vue", "../../../../../g3w-client-feature-fix/src/mixins/click.js", "../../../../../g3w-client-feature-fix/src/components/CatalogLayerLegend.vue", "../../../../../g3w-client-feature-fix/src/components/CatalogTristateTree.vue", "../../../../../g3w-client-feature-fix/src/components/Catalog.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResultsActionDownloadFormats.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResultsActionQueryPolygonCSVAttributes.vue", "../../../../../g3w-client-feature-fix/src/utils/copyUrl.js", "../../../../../g3w-client-feature-fix/src/components/Relations.vue", "../../../../../g3w-client-feature-fix/src/components/Relation.vue", "../../../../../g3w-client-feature-fix/src/components/RelationsPage.vue", "../../../../../g3w-client-feature-fix/src/services/queryresults.js", "../../../../../g3w-client-feature-fix/src/components/QueryResultsTableAttributeFieldValue.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResultsActionInfoFormats.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResultsAction.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResultsActions.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResultsHeaderFeatureBody.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResultsHeaderFeatureActionsBody.vue", "../../../../../g3w-client-feature-fix/src/components/QueryResults.vue", "../../../../../g3w-client-feature-fix/src/components/Map.vue", "../../../../../g3w-client-feature-fix/src/g3w-globals.js", "../../../../../g3w-client-feature-fix/src/utils/getOLGeometry.js", "../../../../../g3w-client-feature-fix/src/utils/createVectorLayerFromFile.js", "../../../../../g3w-client-feature-fix/node_modules/shpjs/lib/index.js", "../../../../../g3w-client-feature-fix/node_modules/but-unzip/index.browser.min.mjs", "../../../../../g3w-client-feature-fix/node_modules/shpjs/lib/unzip.js", "../../../../../g3w-client-feature-fix/node_modules/shpjs/lib/combine.js", "../../../../../g3w-client-feature-fix/node_modules/shpjs/lib/binaryajax.js", "../../../../../g3w-client-feature-fix/node_modules/shpjs/lib/parseShp.js", "../../../../../g3w-client-feature-fix/node_modules/parsedbf/decoder.js", "../../../../../g3w-client-feature-fix/node_modules/parsedbf/index.js", "../../../../../g3w-client-feature-fix/src/utils/areCoordinatesEqual.js", "../../../../../g3w-client-feature-fix/src/utils/splitFeature.js", "../../../../../g3w-client-feature-fix/src/utils/dissolve.js", "../../../../../g3w-client-feature-fix/src/utils/distance.js", "../../../../../g3w-client-feature-fix/src/utils/getProjectConfigByGid.js", "../../../../../g3w-client-feature-fix/src/services/tasks.js", "../../../../../g3w-client-feature-fix/src/utils/inherit.js", "../../../../../g3w-client-feature-fix/src/utils/base.js", "../../../../../g3w-client-feature-fix/src/g3w-plugin.js", "../../../../../g3w-client-feature-fix/src/index.prod.js", "../../../../../g3w-client-feature-fix/src/locales/it.js", "../../../../../g3w-client-feature-fix/src/locales/en.js", "../../../../../g3w-client-feature-fix/src/locales/fi.js", "../../../../../g3w-client-feature-fix/src/locales/se.js", "../../../../../g3w-client-feature-fix/src/locales/fr.js", "../../../../../g3w-client-feature-fix/src/locales/de.js", "../../../../../g3w-client-feature-fix/src/locales/ro.js", "../../../../../g3w-client-feature-fix/src/locales/pl.js", "../../../../../g3w-client-feature-fix/src/locales/index.js", "../../../../../g3w-client-feature-fix/src/components/App.vue", "../../../../../g3w-client-feature-fix/src/components/UserMessage.vue", "../../../../../g3w-client-feature-fix/src/components/CatalogContextMenu.vue", "../../../../../g3w-client-feature-fix/src/components/ModalLogin.vue", "../../../../../g3w-client-feature-fix/src/components/ModalAddLayer.vue", "../../../../../g3w-client-feature-fix/src/components/ModalChangeMap.vue", "../../../../../g3w-client-feature-fix/src/components/ModalMetadata.vue", "../../../../../g3w-client-feature-fix/src/components/GlobalBarLoader.vue", "../../../../../g3w-client-feature-fix/src/components/GlobalProgressBar.vue", "../../../../../g3w-client-feature-fix/src/components/GlobalHelpDiv.vue", "../../../../../g3w-client-feature-fix/src/components/GlobalDateTime.vue", "../../../../../g3w-client-feature-fix/src/components/GlobalRange.vue", "../../../../../g3w-client-feature-fix/src/components/GlobalTabs.vue", "../../../../../g3w-client-feature-fix/src/components/GlobalTabsNode.vue", "../../../../../g3w-client-feature-fix/src/components/GlobalDivider.vue", "../../../../../g3w-client-feature-fix/src/directives/v-disabled.js", "../../../../../g3w-client-feature-fix/src/directives/v-select2.js", "../../../../../g3w-client-feature-fix/src/directives/utils.js", "../../../../../g3w-client-feature-fix/src/directives/v-t-tooltip.js", "../../../../../g3w-client-feature-fix/src/directives/v-t-html.js", "../../../../../g3w-client-feature-fix/src/directives/v-t.js", "../../../../../g3w-client-feature-fix/src/directives/v-t-plugin.js", "../../../../../g3w-client-feature-fix/src/directives/v-download.js"], - "sourcesContent": ["{\n \"name\": \"g3w-client\",\n \"version\": \"4.0.0-alpha.0\",\n \"description\": \"Gis3W WebGIS Client\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"preinstall\": \"\",\n \"build\": \"gulp version && gulp build\",\n \"dev\": \"gulp dev\",\n \"docker\": \"docker compose --env-file ../g3w-suite-docker/.env --file ../g3w-suite-docker/docker-compose-dev.yml --project-name g3w-suite-docker --project-directory ../g3w-suite-docker\",\n \"docker:pull\": \"npm run docker pull\",\n \"docker:up\": \"npm run docker up -- -d\",\n \"docker:down\": \"npm run docker down\",\n \"docker:config\": \"npm run docker config\",\n \"docker:logs\": \"npm run docker logs\",\n \"test\": \"\",\n \"preversion\": \"npm run test\",\n \"version\": \"npm run build && git add -A\",\n \"postversion\": \"git push && git push --tags\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/g3w-suite/g3w-client.git\"\n },\n \"author\": \"\",\n \"license\": \"MPL-2.0\",\n \"homepage\": \"https://github.com/g3w-suite/g3w-client.git\",\n \"dependencies\": {\n \"@fortawesome/fontawesome-free\": \"^5.15.4\",\n \"@mapbox/shp-write\": \"^0.4.3\",\n \"@ungap/with-resolvers\": \"^0.1.0\",\n \"bootstrap\": \"^3.3.7\",\n \"datatables.net-dt\": \"^1.10.16\",\n \"eonasdan-bootstrap-datetimepicker\": \"^4.17.49\",\n \"i18next\": \"^18.0.1\",\n \"ismobilejs\": \"^1.1.1\",\n \"jquery\": \"^2.2.1\",\n \"jsts\": \"^2.11.3\",\n \"jszip\": \"^3.10.1\",\n \"localforage\": \"^1.10.0\",\n \"lodash.clonedeep\": \"^4.5.0\",\n \"moment\": \"^2.19.1\",\n \"ol\": \"^10.3.1\",\n \"proj4\": \"^2.14.0\",\n \"quill\": \"^2.0.0-dev.4\",\n \"scriptjs\": \"^2.5.9\",\n \"select2\": \"^4.0.4\",\n \"shpjs\": \"^6.1.0\",\n \"util-deprecate\": \"^1.0.2\",\n \"vue\": \"2.7.16\",\n \"vue-color\": \"^2.8.1\",\n \"vue-cookie\": \"^1.1.4\",\n \"vue-cookie-law\": \"^1.13.3\",\n \"vue2-teleport\": \"^1.1.4\",\n \"wolfy87-eventemitter\": \"^5.2.9\"\n },\n \"devDependencies\": {\n \"del\": \"^2.2.2\",\n \"esbuild\": \"^0.24.0\",\n \"esbuild-vue\": \"^1.2.2\",\n \"gulp\": \"^4.0.2\",\n \"gulp-flatten\": \"^0.2.0\",\n \"gulp-prompt\": \"^1.2.0\",\n \"gulp-rename\": \"^1.2.2\",\n \"jshint\": \"^2.9.1\",\n \"jshint-stylish\": \"^2.1.0\",\n \"uglify-js\": \"^2.6.2\",\n \"vue-template-compiler\": \"2.7.16\"\n },\n \"engines\": {\n \"node\": \">=22.9.0\",\n \"npm\": \">=10.8.3\"\n }\n}\n", "/**\n * @file all contants values used on application\n * @since 3.11.0\n */\n\n//@ts-check\n\n/**\n * @TODO we can safely import \"version\" from \"package.json\" when we will use native ES Modules\n */\nexport { version as APP_VERSION } from '../package.json';\n\n/**\n * Default editing capabilities\n * @deprecated Will be removed in 4.x. Moved to g3w-client-plugin-editing\n * \n * @type {string[]}\n */\nexport const DEFAULT_EDITING_CAPABILITIES = [\n 'add_feature',\n 'change_feature',\n 'change_attr_feature',\n 'delete_feature'\n];\n\n/**\n * fid name field referred to fid feature\n * \n * @type {string}\n */\nexport const G3W_FID = 'g3w_fid'; \n\n/**\n * @type {Object}\n * @since v3.5\n */\nexport const FILTER_OPERATORS = {\n gte: '>=',\n lte: '<=',\n NOT: '!=',\n eq: '=',\n gt: '>',\n lt: '<',\n IN: 'IN',\n LIKE: 'LIKE',\n ILIKE: 'ILIKE',\n AND: 'AND',\n OR: 'OR',\n};\n\n/**\n * @type {Object}\n * @since v3.5\n */\nexport const FILTER_EXPRESSION_OPERATORS = {\n lte: '<=',\n ltgt: '!=',\n ilike: 'ILIKE',\n like: 'LIKE',\n ...FILTER_OPERATORS,\n};\n\n/**\n * Geometry fields used to exclude or get geometry information from server request\n * \n * @type {string[]}\n */\n export const GEOMETRY_FIELDS = [\n 'geometryProperty',\n 'boundedBy',\n 'geom',\n 'the_geom',\n 'geometry',\n 'bbox',\n 'GEOMETRY',\n 'geoemtria',\n 'geometria'\n];\n\n/**\n * @type {Object}\n */\nexport const GEOMETRY_TYPES = {\n POINT: \"Point\",\n POINTZ: \"PointZ\",\n POINTM: \"PointM\",\n POINTZM: \"PointZM\",\n POINT25D: \"Point25D\",\n MULTIPOINT: \"MultiPoint\",\n MULTIPOINTZ: \"MultiPointZ\",\n MULTIPOINTM: \"MutliPointM\",\n MULTIPOINTZM: \"MultiPointZM\",\n MULTIPOINT25D: \"MultiPoint25D\",\n LINESTRING: \"LineString\", // QGis definition .GeometryType, Line intead di Linestring.\n LINESTRINGZ: \"LineStringZ\",\n LINESTRINGM: \"LineStringM\",\n LINESTRINGZM: \"LineStringZM\",\n LINESTRING25D: \"LineString25D\",\n LINE: \"Line\",\n LINEZ: \"LineZ\",\n LINEM: \"LineM\",\n LINEZM: \"LineZM\",\n LINE25D: \"Line25D\",\n MULTILINESTRING: \"MultiLineString\",\n MULTILINESTRINGZ: \"MultiLineStringZ\",\n MULTILINESTRINGM: \"MultiLineStringM\",\n MULTILINESTRINGZM: \"MultiLineStringZM\",\n MULTILINESTRING25D: \"MultiLineString25D\",\n MULTILINE: \"MultiLine\",\n MULTILINEZ: \"MultiLineZ\",\n MULTILINEM: \"MultiLineM\",\n MULTILINEZM: \"MultiLineZM\",\n MULTILINE25D: \"MultiLine25D\",\n POLYGON: \"Polygon\",\n POLYGONZ: \"PolygonZ\",\n POLYGONM: \"PolygonM\",\n POLYGONZM: \"PolygonZM\",\n POLYGON25D: \"Polygon25D\",\n MULTIPOLYGON: \"MultiPolygon\",\n MULTIPOLYGONZ: \"MultiPolygonZ\",\n MULTIPOLYGONM: \"MultiPolygonM\",\n MULTIPOLYGONZM: \"MultiPolygonZM\",\n MULTIPOLYGON25D: \"MultiPolygon25D\",\n GEOMETRYCOLLECTION: \"GeometryCollection\",\n GEOMETRYCOLLECTIONZ: \"GeometryCollectionZ\",\n GEOMETRYCOLLECTIONM: \"GeometryCollectionM\",\n GEOMETRYCOLLECTIONZM: \"GeometryCollectionZM\",\n GEOMETRYCOLLECTION25D: \"GeometryCollection25D\"\n};\n\n/**\n * @type {Array<{ value: number, label: string }>}\n * @since v3.5\n */\nexport const PRINT_SCALES = [\n { value: 100, label: '1:100' },\n { value: 200, label: '1:200' },\n { value: 500, label: '1:500' },\n { value: 1000, label: '1:1.000' },\n { value: 2000, label: '1:2.000' },\n { value: 2500, label: '1:2.500' },\n { value: 5000, label: '1:5.000' },\n { value: 10000, label: '1:10.000' },\n { value: 20000, label: '1:20.000' },\n { value: 25000, label: '1:25.000' },\n { value: 50000, label: '1:50.000' },\n { value: 100000, label: '1:100.000' },\n { value: 250000, label: '1:250.000' },\n { value: 500000, label: '1:500.000' },\n { value: 1000000, label: '1:1.000.000' },\n { value: 2500000, label: '1:2.500.000' },\n { value: 5000000, label: '1:5.000.000' },\n { value: 10000000, label: '1:10.000.000' },\n { value: 20000000, label: '1:20.000.000' },\n { value: 50000000, label: '1:50.000.000' },\n { value: 100000000, label: '1:100.000.000' },\n { value: 250000000, label: '1:250.000.000' },\n { value: 500000000, label: '1:500.000.000' }\n];\n\n/**\n * Point tolerance when clicking on map\n * \n * @type {{unit: string, value: number}}\n */\nexport const QUERY_POINT_TOLERANCE = {\n unit: 'pixel',\n value: 10\n};\n\n/**\n * @type {string}\n * @since v3.5\n */\nexport const SEARCH_ALLVALUE = '__G3W_ALL__';\n\n/**\n * TIMEOUT (1 minute = 60000)\n * \n * @type {number}\n */\nexport const TIMEOUT = 60000;\n\n/**\n * @type {{resize: Object}}\n * @since v3.5\n */\nexport const VIEWPORT = {\n resize: {\n map: { min: 200 },\n content: { min: 200 },\n }\n};\n\n/**\n * List of default Font Awesome classes for current project\n * \n * @type {Object}\n * @since v3.8\n */\nexport const FONT_AWESOME_ICONS = {\n 'change-map': \"fas fa-map-signs\",\n map: \"far fa-map\",\n file: \"fas fa-file-code\",\n marker: \"fas fa-map-marker-alt\",\n relation: \"fas fa-sitemap\",\n tools: \"fas fa-cogs\",\n tool: \"fas fa-cog\",\n search: \"fas fa-search\",\n print: \"fas fa-print\",\n info: \"fas fa-info-circle\",\n 'info-circle': \"fas fa-info-circle\",\n globe: \"fas fa-globe\",\n mail: \"fas fa-envelope\",\n mobile: \"fas fa-mobile\",\n fax: \"fas fa-fax\",\n user: \"fas fa-user\",\n bars: \"fas fa-bars\",\n uncheck: \"far fa-square\",\n check: \"far fa-check-square\",\n /** @since 3.10.0 */\n checkmark: \"fa fa-check\",\n filluncheck: \"fas fa-square\",\n table: \"fas fa-table\",\n trash: \"fas fa-trash\",\n 'trash-o': \"far fa-trash-alt\",\n pencil: \"fas fa-pencil-alt\",\n 'ellips-h': \"fas fa-ellipsis-h\",\n 'ellips-v': \"fas fa-ellipsis-v\",\n 'arrow-up': \"fas fa-chevron-up\",\n 'arrow-down': \"fas fa-chevron-down\",\n 'arrow-left': \"fas fa-chevron-left\",\n 'arrow-right': \"fas fa-chevron-right\",\n 'resize-h': \"fas fa-arrows-alt-h\",\n 'resize-v': \"fas fa-arrows-alt-v\",\n 'resize-default': \"fas fa-compress\",\n 'caret-up': \"fas fa-caret-up\",\n 'caret-down': \"fas fa-caret-down\",\n 'caret-left': \"fas fa-caret-left\",\n 'caret-right': \"fas fa-caret-right\",\n 'empty-circle': \"far fa-circle\",\n 'cloud-upload': \"fas fa-cloud-upload-alt\",\n spinner: \"fas fa-spinner\",\n minus: \"fas fa-minus\",\n \"minus-square\": \"far fa-minus-square\",\n plus: \"fas fa-plus\",\n 'plus-circle': \"fas fa-plus-circle\",\n 'plus-square': \"far fa-plus-square\",\n grid: \"fas fa-th\",\n home: \"fas fa-home\",\n folder: \"fas fa-folder\",\n 'sign-out': \"fas fa-sign-out-alt\",\n close: \"fas fa-times\",\n time: \"far fa-clock\",\n calendar: \"fas fa-calendar-alt\",\n list: \"fas fa-list-alt\",\n link: \"fas fa-link\",\n unlink: \"fas fa-unlink\",\n eye: \"far fa-eye\",\n 'eye-close': \"far fa-eye-slash\",\n save: \"far fa-save\",\n pdf: \"fas fa-file-pdf\",\n image: \"far fa-image\",\n video: \"far fa-file-video\",\n unknow: \"far fa-question-circle\",\n zip: \"far fa-file-archive\",\n text: \"far fa-file-alt\",\n excel: \"far fa-file-excel\",\n xls: \"far fa-file-excel\",\n gpx: \"fas fa-location-arrow\",\n gpkg: \"fas fa-box-open\",\n shapefile: \"fas fa-file-archive\",\n csv: \"fas fa-file-csv\",\n geotiff: \"fas fa-th\",\n ppt: \"far fa-file-powerpoint\",\n circle: \"fas fa-circle\",\n calculator: \"fas fa-calculator\",\n picture: \"far fa-image\",\n keyboard: \"far fa-keyboard\",\n 'file-download': \"fas fa-file-download\",\n copy: \"far fa-copy\",\n draw: \"fas fa-draw-polygon\",\n chart: \"fas fa-chart-bar\",\n 'chart-line': \"fas fa-chart-line\",\n 'chart-area': \"fas fa-chart-area\",\n 'chart-pie': \"fas fa-chart-pie\",\n run: \"fas fa-play\",\n warning: \"fas fa-exclamation-circle\",\n alert: \"fas fa-exclamation-triangle\",\n crosshairs: \"fas fa-crosshairs\",\n success: \"far fa-check-circle\",\n back: \"fas fa-chevron-circle-left\",\n 'file-upload': \"fas fa-file-upload\",\n wifi: \"fas fa-wifi\",\n mouse: \"fas fa-mouse\",\n 'copy-paste': \"far fa-copy\",\n 'vector-square': \"fas fa-vector-square\",\n download: \"fas fa-download\",\n credits: \"fas fa-euro-sign\",\n filter: \"fas fa-filter\",\n plugin: \"fas fa-plug\",\n invert: \"fas fa-exchange-alt\",\n clear: \"fas fa-broom\",\n palette: \"fas fa-palette\",\n layers: \"fas fa-layer-group\",\n 'sign-in': \"fas fa-sign-in-alt\",\n language: \"fas fa-language\",\n target: \"fas fa-bullseye\",\n pin: \"fas fa-map-pin\",\n square: \"far fa-square\",\n move: \"fas fa-arrows-alt\",\n moon: \"fas fa-moon\",\n sun: \"fas fa-sun\",\n refresh: \"fas fa-sync-alt\",\n pause: \"fas fa-pause\",\n 'step-backward': \"fas fa-step-backward\",\n 'fast-backward': \"fas fa-fast-backward\",\n 'step-forward': \"fas fa-step-forward\",\n 'fast-forward': \"fas fa-fast-forward\",\n crop: \"fas fa-crop-alt\",\n exit: \"fas fa-door-open\",\n slider: \"fas fa-sliders-h\",\n /** @since 3.8.0 */\n bookmark: \"fas fa-bookmark\",\n /** @since 3.8.0 */\n reply: \"fas fa-reply\",\n /** @since 3.8.0 */\n share: \"fas fa-share\",\n /** @since 3.10.0 */\n 'share-alt': 'fa fa-share-alt',\n /**@since 3.10.0 */\n 'external-link': \"fa fa-external-link-alt\",\n /** @since 3.11.0 */\n pointer: 'fa fa-hand-pointer',\n /** @since 3.11.0 */\n camera: 'fas fa-camera-retro',\n /** @since 3.11.0 */\n measure: 'fas fa-ruler-horizontal',\n /** @since 3.11.0 */\n tint: 'fa fa-tint',\n /** @since 3.11.0 */\n sort: 'fa fa-sort',\n /** @since 3.11.0 */\n copyright: 'fa fa-copyright',\n /** @since 3.11.0 **/\n \"forward\": 'fas fa-angle-double-right',\n \"backward\": 'fas fa-angle-double-left'\n};\n\n/**\n * @typedef LocalItem\n * @property {string} id unique identifier\n * @property {any} value initial value\n */\n\n/**\n * LOCAL ITEM IDS - used to store id used by application\n * \n * @type {Object}\n * \n * @since v3.8\n */\nexport const LOCAL_ITEM_IDS = {\n\n MESSAGES: {\n id: 'MESSAGES',\n value: {}\n },\n\n SPATIALBOOKMARKS: {\n id: 'SPATIALBOOKMARKS',\n value: {}\n },\n\n};\n\n/**\n * List of Open Layers spatial methods used to find features\n * \n * @since 3.9.0\n */\nexport const SPATIAL_METHODS = ['intersects', 'within'];\n\n/**\n * DPI96\n * \n * DOTS_PER_INCH = ol.has.DEVICE_PIXEL_RATIO * 96;\n * \n * @since 3.10.0\n */\nexport const DOTS_PER_INCH = 96;\n\n/**\n * @since 3.10.0\n */\nexport const INCHES_PER_UNIT = {\n m: 39.37,\n degrees: 4374754\n};\n\n/**\n * Selection state \n * \n * @since 3.11.0\n */\nexport const SELECTION = {\n ALL: '__ALL__',\n EXCLUDE: '__EXCLUDE__'\n};\n\n/**\n * @since 3.11.0\n * Page length for pagination\n * @type {number[]}\n */\nexport const PAGELENGTHS = [10, 25, 50, 100];\n\nexport default {\n DEFAULT_EDITING_CAPABILITIES,\n DOTS_PER_INCH,\n FILTER_OPERATORS,\n FILTER_EXPRESSION_OPERATORS,\n FONT_AWESOME_ICONS,\n G3W_FID,\n GEOMETRY_FIELDS,\n GEOMETRY_TYPES,\n INCHES_PER_UNIT,\n LOCAL_ITEM_IDS,\n PRINT_SCALES,\n QUERY_POINT_TOLERANCE,\n SEARCH_ALLVALUE,\n SPATIAL_METHODS,\n TIMEOUT,\n VIEWPORT,\n PAGELENGTHS,\n};", "export function noop() {}", "\n/**\n * build debounce function\n */\nexport function debounce(func, delay = 500) {\n let timeout;\n return function (...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => func(...args), delay);\n };\n}", "/**\n * build throttle function\n */\nexport function throttle(fnc, delay = 500) {\n let lastCall;\n return function (...args) {\n let previousCall = lastCall;\n lastCall = Date.now();\n if (previousCall === undefined // function is being called for the first time\n || (lastCall - previousCall) > delay) { // throttle time has elapsed\n fnc(...args);\n }\n }\n}", "/*!\n * EventEmitter v5.2.9 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n", "/**\n * @file ORIGINAL SOURCE: src/app/core/g3w-object.js@v3.10.2\n * @since 3.11.0\n */\n\nimport { noop } from 'utils/noop';\nimport { debounce } from 'utils/debounce';\nimport { throttle } from 'utils/throttle';\nimport EventEmitter from 'wolfy87-eventemitter';\n\n/**\n * Base object to handle a setter and its listeners.\n */\nexport default class G3WObject extends EventEmitter {\n\n /**\n * @TODO end support for legacy classes (ES5) and use private class fields instead (eg. `___setters` \u2192 `#setters`)\n */\n\n /** @type { Object } */\n ___setters;\n\n /** @type { Object } */\n ___throttles;\n\n /** @type { Object } */\n ___debounces;\n\n /** @type { Object } */\n ___listeners;\n\n get setters() {\n return this.___setters;\n };\n\n set setters(value) {\n this.___setters = value;\n if (value) {\n // all methods inside object \"setters\" of child class.\n this.___listeners = {\n after: {},\n before: {},\n };\n \n for (const setter in this.___setters) {\n // Array to push before and after subscribers\n this.___listeners.after[setter] = [];\n this.___listeners.before[setter] = [];\n \n // assign the property setter name to the object as own method\n this[setter] = function(...args) {\n //Return a Deferred object\n // When then method of defferred object is called, a new promise is return\n // and not the deferred.resolve value directly.\n // This is the reason why when we call setter methods return a promise and not the value\n return $.Deferred(deferred => {\n // listener count\n let count = 0;\n /**\n *\n * @param {undefined | Boolean} bool\n */\n const next = (bool) => {\n //check if it needs to skip (exit)\n const skip = (true === bool || false === bool) ? !bool : false;\n //get count of before subscribers on setter function\n const len = this.___listeners.before[setter].length;\n \n // abort in case of error bool false,\n // or we reached the end of onbefore subscriber\n if (skip) {\n (this.___setters[setter] instanceof Function ? noop : (this.___setters[setter].fallback || noop)).apply(this, args);\n deferred.reject();\n return;\n }\n \n // call complete method methods and check what returns\n if (count === len) {\n // run setter function (resolve promise)\n deferred.resolve((this.___setters[setter] instanceof Function ? this.___setters[setter] : this.___setters[setter].fnc).apply(this, args));\n // call all subscribed methods after setter\n const onceListeners = [];\n this\n .___listeners\n .after[setter]\n .forEach(listener => {\n listener.fnc.apply(this, args);\n if (listener.once) {\n onceListeners.push(listener.key);\n }\n });\n onceListeners.forEach(key => this.un(setter, key));\n this.emitEvent(`set:${setter}`, args);\n }\n // still call an onbefore listener subscribers\n if (count < len) {\n //get on before listener subscribes and increment count to 1\n const listener = this.___listeners.before[setter][count++];\n //check if it is async\n if (listener.async) {\n // add function next to argument of listener function\n args.push(next);\n listener.fnc.apply(this, args)\n } else {\n // return or undefined or a boolean to tell if ok(true) can continue or not (false)\n next(listener.fnc.apply(this, args));\n }\n //in case of listener subscribe function need to run just one time\n // after call remove it from listeners\n if (listener.once) {\n this.___listeners.before[setter].splice(count - 1, 1);\n }\n }\n };\n // run all the subscribers and setters\n next(true);\n });\n }\n }\n }\n };\n\n get throttles() {\n return this.___throttles;\n };\n\n set throttles(value) {\n this.___throttles = value;\n if (value) {\n console.warn('[G3W-CLIENT] throttles option is deprecated');\n console.trace();\n for (const name in this.___throttles) {\n this[name] = throttle(this.___throttles[name].fnc, this.___throttles[name].delay);\n }\n }\n };\n\n get debounces() {\n return this.___debounces;\n };\n\n set debounces(value) {\n this.___debounces = value;\n if (value) {\n console.warn('[G3W-CLIENT] debounces option is deprecated');\n console.trace();\n for (const name in this.___debounces) {\n this[name] = debounce(this.___debounces[name].fnc, this.___debounces[name].delay);\n }\n }\n };\n\n constructor(opts) {\n super(opts);\n\n opts = opts || {};\n\n // Register the chain of events\n this.setters = opts.setters || this.setters;\n this.throttles = opts.throttles || this.throttles;\n this.throttles = opts.debounces || this.debounces;\n }\n\n /**\n * Attach an event listener after executing a setter method\n * \n * @param {string} setter - function name to listen for \n * @param {function} listener - event listener (sync)\n * @param {number} priority - priority (lowest value executes first)\n */\n onafter(setter, listener, priority) {\n return this._onsetter('after', setter, listener, false, priority);\n }\n\n /**\n * Attach an event listener after executing a setter method (once)\n * \n * @param {string} setter - function name to listen for \n * @param {function} listener - event listener (sync)\n * @param {number} priority - priority (lowest value executes first)\n */\n onceafter(setter, listener, priority) {\n return this._onsetter('after', setter, listener, false, priority, true);\n }\n\n /**\n * Attach an event listener before executing a setter method\n * \n * @param {string} setter - function name to listen for\n * @param {function} listener - event listener (sync)\n * @param {number} priority - priority (lowest value executes first)\n */\n onbefore(setter, listener, priority) {\n return this._onsetter('before', setter, listener, false, priority);\n }\n\n /**\n * Attach an event listener before executing a setter method (once)\n * \n * @param {string} setter - function name to listen for\n * @param {function} listener - event listener (sync)\n * @param {number} priority - priority (lowest value executes first)\n */\n oncebefore(setter, listener, priority) {\n return this._onsetter('before', setter, listener, false, priority, true);\n }\n\n /**\n * Attatch an event listener before executing a setter method (once)\n * \n * @param {string} setter - function name to listen for\n * @param {function} listener - event listener (async)\n * @param {number} priority - priority (lowest value executes first)\n */\n onbeforeasync(setter, listener, priority) {\n return this._onsetter('before', setter, listener, true, priority);\n }\n\n /**\n * Loop each listeners (array) and find a setter key (before/after) to be removed\n */\n un(setter, key) {\n Object.entries(this.___listeners)\n .forEach(([_key, setters]) => {\n if (undefined === key) {\n setters[setter].splice(0);\n } else {\n setters[setter].forEach((listener, idx) => { listener.key === key && setters[setter].splice(idx, 1); })\n }\n });\n };\n\n/**\n * Register and handle listeners\n * \n * @param { 'before' | 'after' } when\n * @param { string } setter function name\n * @param { Object } listener\n * @param { Boolean } async\n * @param { Number } priority\n * @param { Boolean } once\n */\n _onsetter(when, setter, listener, async, priority = 0, once = false) {\n // unique listenerKey\n let key;\n // check if setter function is registered\n // and then add an info object to setter listeners\n // (sorted based on priority)\n if (this.___listeners && undefined !== this.___listeners[when][setter]) {\n key = `${Math.floor(Math.random() * 1000000) + Date.now()}`;\n this.___listeners[when][setter].push({ key, fnc: listener, async, priority, once});\n this.___listeners[when][setter] = this.___listeners[when][setter].sort((l1, l2) => l2.priority - l1.priority);\n }\n return key // in case of no setter register return undefined listenerKey\n }\n\n get(key) {\n return this[key] && !(this[key] instanceof Function) ? this[key] : null;\n }\n\n set(key, value) {\n this[key] = value;\n }\n\n};", "/**\n * @file State and methods to query the STATE of application\n * @since v3.6\n */\n\nimport G3WObject from 'g3w-object';\n\n/**\n * State of application reactive\n * @type {object}\n */\nconst STATE = Vue.observable({\n\n /**\n * true = application is ready\n */\n ready: false,\n\n /**\n * true = application is loaded inside an iframe\n */\n iframe: window.top !== window.self,\n\n /**\n * true = application is connected\n */\n online: navigator.onLine,\n\n /**\n * true = application is loaded on a mobile device\n */\n ismobile: isMobile.any,\n \n /**\n * true = there is a pending download \n */\n download: false,\n\n /**\n * true = there is a pending upload\n */\n upload: false,\n\n /**\n * Store current map base layer id\n */\n baseLayerId: null,\n\n /**\n * en = default language\n */\n language: 'en',\n\n /**\n * @deprecated Since v3.8. Will be deleted in v4.x. Use ApplicationState.language instead\n */\n lng: 'en',\n\n /**\n * Store Array of loading plugins (by name)\n * Every time a plugin is loaded, plugin name is removed from Array\n * It used in v-plugins directive\n */\n plugins: [],\n\n /** @since 3.11.0 - plugin configs filtered by gid */\n pluginsConfigs: {},\n\n /** @since 3.11.0 - array of initConfig.plugins names */\n configurationPlugins: [],\n\n /**\n * Store application current user\n */\n user: null,\n\n /**\n * Store info of the application map\n */\n map: {\n epsg: '',\n unit: 'metric'\n },\n\n /**\n * Store info of the elements of GUI of the application\n */\n gui: {\n\n app: {\n /**\n * true = application is disabled and unclickable (waiting)\n */\n disabled: false\n },\n\n sidebar: {\n /**\n * true = sidebar is disabled (not responsive)\n */\n disabled: false,\n /**\n * @since v3.11.0\n * true open, false hide - icons only\n */\n open : true\n },\n\n layout: {\n /**\n * store the current layout owner (\"app\" = default)\n */\n __current: 'app',\n\n /**\n * Store application layout info (rightpanel)\n */\n app: {}\n\n }\n\n },\n\n /**\n * Sore vendor keys need it by application third part script\n */\n keys: {\n vendorkeys: {\n google: undefined,\n bing: undefined\n }\n },\n\n /**\n * Store tokens, used by server, for example, to filter features\n */\n tokens: {\n filtertoken: undefined\n },\n\n /**\n * @since 3.10.0\n */\n querybuilder: {\n cache: {},\n searches: JSON.parse(window.localStorage.getItem('QUERYBUILDERSEARCHES') || \"{}\"),\n },\n\n /**\n * @since 3.11.0\n */\n navbaritems: [],\n\n /**\n * @since 3.11.0\n */\n sidebar: {\n title: '',\n components: [],\n /** DOM element where insert the component/panel */\n parent: null,\n /** barstack state. It stores the panel array */\n contentsdata: [], // Array<{ content, options }> \n },\n\n contentsdata: [],\n\n /**\n * @since 3.11.0\n */\n viewport: {\n primaryView: 'map', // primary view (default)\n // percentage of secondary view\n secondaryPerc: 0, // setted to 0 at beginning (not visible)\n // used to store if content vertical or horizontal is changed by resised\n resized: {\n start: false,\n 'h': false,\n 'v': false\n },\n // splitting orientation (h = horizontal, v = vertical)\n split: 'h',\n //map\n map: {\n sizes: {\n width: 0,\n height: 0\n },\n aside: false\n },\n //content\n content: {\n loading: false,\n disabled: false,\n sizes: {\n width: 0,\n height: 0\n },\n // store the resize vertical or horizontal\n resize: {\n 'h': { perc: 0 },\n 'v': { perc: 0 }\n },\n aside: true,\n showgoback: true,\n stack: [], // array elements of stack contents\n closable: true, // (x) is closable\n backonclose: false, // back on prevoius content\n contentsdata: [], // content data array\n },\n usermessage: {\n id: null, // unique identify\n show: false,\n title: null,\n message: null,\n position: null,\n type: null,\n draggable: null,\n cloasable: null,\n autoclose: null,\n textMessage: false,\n hooks: {\n header: null,\n body: null,\n footer: null\n }\n },\n // content of viewport (map and content)\n components: {\n map: null,\n content: null\n },\n },\n\n sizes: {\n sidebar: {\n width:0\n }\n },\n\n /** @since 3.11.0 */\n i18n: {\n plugins: {} // plugins configs\n },\n\n /** @since 3.11.0 */\n project: new G3WObject,\n\n /** @since 3.11.0 */\n catalog: {},\n\n /** @since 3.11.0 */\n highlightlayers: false,\n\n});\n\nexport default STATE;", "/**\n * @file\n * @since v3.6\n */\nimport { APP_VERSION } from 'g3w-constants';\nimport G3WObject from 'g3w-object';\n\nconst ApplicationService = new G3WObject({ setters: { online(){}, offline(){} }});\nApplicationService.version = APP_VERSION;\n\nexport default ApplicationService;", "import { GEOMETRY_TYPES } from 'g3w-constants';\n\nexport function is3DGeometry(geometryType) {\n return [\n GEOMETRY_TYPES.POINTZ,\n GEOMETRY_TYPES.POINTM,\n GEOMETRY_TYPES.POINTZM,\n GEOMETRY_TYPES.POINT25D,\n GEOMETRY_TYPES.MULTIPOINTZ,\n GEOMETRY_TYPES.MULTIPOINTM,\n GEOMETRY_TYPES.MULTIPOINTZM,\n GEOMETRY_TYPES.MULTIPOINT25D,\n GEOMETRY_TYPES.LINESTRINGZ,\n GEOMETRY_TYPES.LINESTRINGM,\n GEOMETRY_TYPES.LINESTRINGZM,\n GEOMETRY_TYPES.LINESTRING25D,\n GEOMETRY_TYPES.MULTILINESTRINGZ,\n GEOMETRY_TYPES.MULTILINESTRINGM,\n GEOMETRY_TYPES.MULTILINESTRINGZM,\n GEOMETRY_TYPES.MULTILINESTRING25D,\n GEOMETRY_TYPES.LINEZ,\n GEOMETRY_TYPES.LINEM,\n GEOMETRY_TYPES.LINEZM,\n GEOMETRY_TYPES.LINE25D,\n GEOMETRY_TYPES.MULTILINEZ,\n GEOMETRY_TYPES.MULTILINEM,\n GEOMETRY_TYPES.MULTILINEZM,\n GEOMETRY_TYPES.MULTILINE25D,\n GEOMETRY_TYPES.POLYGONZ,\n GEOMETRY_TYPES.POLYGONM,\n GEOMETRY_TYPES.POLYGONZM,\n GEOMETRY_TYPES.POLYGON25D,\n GEOMETRY_TYPES.MULTIPOLYGONZ,\n GEOMETRY_TYPES.MULTIPOLYGONM,\n GEOMETRY_TYPES.MULTIPOLYGONZM,\n GEOMETRY_TYPES.MULTIPOLYGON25D\n ].find(type3D => type3D === geometryType);\n}", "import { GEOMETRY_TYPES } from 'g3w-constants';\nimport { is3DGeometry } from 'utils/is3DGeometry';\n\n/**\n * @since 3.10.0 Add a 3d coordinate eventually, if coordinates are 2 (x, y)\n * @param coords\n * @return {*}\n */\nfunction add3DCoordinate(coords) {\n if (2 === coords.length) {\n coords.push(0);\n }\n return coords;\n}\n\n/**\n * core/geometry/geometry::addZValueToOLFeatureGeometry@v3.4\n */\nexport function addZValue({\n feature,\n geometryType,\n} = {}) {\n\n if (!is3DGeometry(geometryType)) {\n console.warn('Invalid 3D Geometry Type:', geometryType);\n return feature;\n }\n\n const geometry = feature.getGeometry();\n const coords = geometry.getCoordinates();\n\n switch (geometryType || geometry.getType()) {\n\n // POINT: [x, y]\n case GEOMETRY_TYPES.POINTZ:\n case GEOMETRY_TYPES.POINTM:\n case GEOMETRY_TYPES.POINTZM:\n case GEOMETRY_TYPES.POINT25D:\n feature.getGeometry().setCoordinates(add3DCoordinate(coords));\n break;\n\n // MULTIPOINT: [ [x1, y1], [x2, y2] ]\n case GEOMETRY_TYPES.MULTIPOINTZ:\n case GEOMETRY_TYPES.MULTIPOINTM:\n case GEOMETRY_TYPES.MULTIPOINTZM:\n case GEOMETRY_TYPES.MULTIPOINT25D:\n // LINE: [ [x1, y1], [x2, y2] ]\n case GEOMETRY_TYPES.LINESTRINGZ:\n case GEOMETRY_TYPES.LINESTRINGM:\n case GEOMETRY_TYPES.LINESTRINGZM:\n case GEOMETRY_TYPES.LINESTRING25D:\n case GEOMETRY_TYPES.LINEZ:\n case GEOMETRY_TYPES.LINEM:\n case GEOMETRY_TYPES.LINEZM:\n case GEOMETRY_TYPES.LINE25D:\n coords.forEach(c => add3DCoordinate(c));\n feature.getGeometry().setCoordinates(coords);\n break;\n\n // MULTILINE: [\n // [ [x1, y1], [x2, y2] ],\n // [ [x3, y3], [x4, y4] ]\n // ]\n case GEOMETRY_TYPES.MULTILINESTRINGZ:\n case GEOMETRY_TYPES.MULTILINESTRINGM:\n case GEOMETRY_TYPES.MULTILINESTRINGZM:\n case GEOMETRY_TYPES.MULTILINESTRING25D:\n case GEOMETRY_TYPES.MULTILINEZ:\n case GEOMETRY_TYPES.MULTILINEM:\n case GEOMETRY_TYPES.MULTILINEZM:\n case GEOMETRY_TYPES.MULTILINE25D:\n coords.forEach(l => l.forEach(c => add3DCoordinate(c)));\n feature.getGeometry().setCoordinates(coords);\n break;\n\n // POLYGON: [\n // [ [x1, y1], [x2, y2], [x3, y3], [x1, y1] ]\n // ]\n case GEOMETRY_TYPES.POLYGONZ:\n case GEOMETRY_TYPES.POLYGONM:\n case GEOMETRY_TYPES.POLYGONZM:\n case GEOMETRY_TYPES.POLYGON25D:\n coords[0].forEach(c => add3DCoordinate(c));\n feature.getGeometry().setCoordinates(coords);\n break;\n\n // MULTIPOLYGON:[\n // [ [x1, y1], [x2, y2], [x3, y3], [x1, y1] ],\n // [ [xa, ya], [xb, yb], [xc, yc], [xa, ya] ]\n // ]\n case GEOMETRY_TYPES.MULTIPOLYGONZ:\n case GEOMETRY_TYPES.MULTIPOLYGONM:\n case GEOMETRY_TYPES.MULTIPOLYGOZM:\n case GEOMETRY_TYPES.MULTIPOLYGON25D:\n coords.forEach(poly => poly[0].forEach(c => add3DCoordinate(c)));\n feature.getGeometry().setCoordinates(coords);\n break;\n\n default:\n console.warn('invalid geometry type:', geometryType || geometry.getType());\n\n }\n\n return feature;\n}", "import { GEOMETRY_TYPES } from 'g3w-constants';\n\n/**\n * Remove Z values from geometry coordinates\n */\nexport function removeZValue({ feature } = {}) {\n\n const geometry = feature.getGeometry();\n\n // skip when feature has no geometry (alphanumerical feature)\n if (!geometry) {\n return feature;\n }\n\n const coords = geometry.getCoordinates();\n\n switch (geometry.getType()) {\n\n // POINT: [x, y]\n case GEOMETRY_TYPES.POINT:\n coords.splice(2);\n geometry.setCoordinates(coords);\n break;\n\n // MULTIPOINT: [ [x1, y1], [x2, y2] ]\n case GEOMETRY_TYPES.MULTIPOINT:\n // LINE: [ [x1, y1], [x2, y2] ]\n case GEOMETRY_TYPES.LINESTRING:\n case GEOMETRY_TYPES.LINE:\n coords.forEach(c => c.splice(2));\n geometry.setCoordinates(coords);\n break;\n\n // MULTILINE: [\n // [ [x1, y1], [x2, y2] ],\n // [ [x3, y3], [x4, y4] ]\n // ]\n case GEOMETRY_TYPES.MULTILINESTRING:\n case GEOMETRY_TYPES.MULTILINE:\n coords.forEach(line => line.forEach(c => c.splice(2)));\n geometry.setCoordinates(coords);\n break;\n\n // POLYGON: [\n // [ [x1, y1], [x2, y2], [x3, y3], [x1, y1] ]\n // ]\n case GEOMETRY_TYPES.POLYGON:\n coords[0].forEach(c => c.splice(2));\n geometry.setCoordinates(coords);\n break;\n\n // MULTIPOLYGON: [\n // [ [x1, y1], [x2, y2], [x3, y3], [x1, y1] ],\n // [ [xa, ya], [xb, yb], [xc, yc], [xa, ya] ]\n // ]\n case GEOMETRY_TYPES.MULTIPOLYGON:\n coords.forEach(poly => poly[0].forEach(c => c.splice(2)));\n geometry.setCoordinates(coords);\n break;\n\n default:\n console.warn('unsupported geometry type: ' + geometry.getType());\n\n }\n \n return feature;\n}", "import { GEOMETRY_TYPES } from 'g3w-constants';\n\n/**\n * core/geometry/geometry::isMultiGeometry@v3.4\n */\nexport function isMultiGeometry(geometryType) {\n return [\n GEOMETRY_TYPES.MULTIPOINT,\n GEOMETRY_TYPES.MULTIPOINTZ,\n GEOMETRY_TYPES.MULTIPOINTZM,\n GEOMETRY_TYPES.MULTIPOINTM,\n GEOMETRY_TYPES.MULTIPOINT25D,\n GEOMETRY_TYPES.MULTILINESTRING,\n GEOMETRY_TYPES.MULTILINESTRINGZ,\n GEOMETRY_TYPES.MULTILINESTRINGM,\n GEOMETRY_TYPES.MULTILINESTRINGZM,\n GEOMETRY_TYPES.MULTILINESTRING25D,\n GEOMETRY_TYPES.MULTILINE,\n GEOMETRY_TYPES.MULTILINEZ,\n GEOMETRY_TYPES.MULTILINEM,\n GEOMETRY_TYPES.MULTILINEZM,\n GEOMETRY_TYPES.MULTILINE25D,\n GEOMETRY_TYPES.MULTIPOLYGON,\n GEOMETRY_TYPES.MULTIPOLYGONZ,\n GEOMETRY_TYPES.MULTIPOLYGONM,\n GEOMETRY_TYPES.MULTIPOLYGONZM,\n GEOMETRY_TYPES.MULTIPOLYGON25D,\n ].includes(geometryType);\n}", "import { GEOMETRY_TYPES } from 'g3w-constants';\n\n/**\n * core/geometry/geometry::isPointGeometryType@v3.4\n * core/geometry/geometry::getAllPointGeometryTypes@v3.4\n */\nexport function isPointGeometryType(geometryType) {\n return [\n GEOMETRY_TYPES.POINT,\n GEOMETRY_TYPES.POINTZ,\n GEOMETRY_TYPES.POINTM,\n GEOMETRY_TYPES.POINTZM,\n GEOMETRY_TYPES.POINT25D,\n GEOMETRY_TYPES.MULTIPOINT,\n GEOMETRY_TYPES.MULTIPOINTZ,\n GEOMETRY_TYPES.MULTIPOINTM,\n GEOMETRY_TYPES.MULTIPOINTZM,\n GEOMETRY_TYPES.MULTIPOINT25D,\n ].includes(geometryType);\n}", "import { GEOMETRY_TYPES } from 'g3w-constants';\n\n/**\n * core/geometry/geometry::isLineGeometryType@v3.4\n * core/geometry/geometry::getAllLineGeometryTypes@v3.4\n */\nexport function isLineGeometryType(geometryType) {\n return [\n GEOMETRY_TYPES.LINESTRING,\n GEOMETRY_TYPES.LINESTRINGZ,\n GEOMETRY_TYPES.LINESTRINGM,\n GEOMETRY_TYPES.LINESTRINGZM,\n GEOMETRY_TYPES.LINESTRING25D,\n GEOMETRY_TYPES.MULTILINESTRING,\n GEOMETRY_TYPES.MULTILINESTRINGZ,\n GEOMETRY_TYPES.MULTILINESTRINGM,\n GEOMETRY_TYPES.MULTILINESTRINGZM,\n GEOMETRY_TYPES.MULTILINESTRING25D,\n GEOMETRY_TYPES.LINE,\n GEOMETRY_TYPES.LINEZ,\n GEOMETRY_TYPES.LINEM,\n GEOMETRY_TYPES.LINEZM,\n GEOMETRY_TYPES.LINE25D,\n GEOMETRY_TYPES.MULTILINE,\n GEOMETRY_TYPES.MULTILINEZ,\n GEOMETRY_TYPES.MULTILINEM,\n GEOMETRY_TYPES.MULTILINEZM,\n GEOMETRY_TYPES.MULTILINE25D,\n ].includes(geometryType);\n}", "import { GEOMETRY_TYPES } from 'g3w-constants';\n\n/**\n * core/geometry/geometry::isPolygonGeometryType@v3.4\n * core/geometry/geometry::getAllPolygonGeometryTypes@v3.4\n */\nexport function isPolygonGeometryType(geometryType) {\n return [\n GEOMETRY_TYPES.POLYGON,\n GEOMETRY_TYPES.POLYGONZ,\n GEOMETRY_TYPES.POLYGONM,\n GEOMETRY_TYPES.POLYGONZM,\n GEOMETRY_TYPES.POLYGON25D,\n GEOMETRY_TYPES.MULTIPOLYGON,\n GEOMETRY_TYPES.MULTIPOLYGONZ,\n GEOMETRY_TYPES.MULTIPOLYGONM,\n GEOMETRY_TYPES.MULTIPOLYGONZM,\n GEOMETRY_TYPES.MULTIPOLYGON25D,\n ].includes(geometryType);\n}", "/*!\n\nJSZip v3.10.1 - A JavaScript class for generating and reading zip files\n\n\n(c) 2009-2016 Stuart Knightley \nDual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.\n\nJSZip uses the library pako released under the MIT license :\nhttps://github.com/nodeca/pako/blob/main/LICENSE\n*/\n\n!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).JSZip=e()}}(function(){return function s(a,o,h){function u(r,e){if(!o[r]){if(!a[r]){var t=\"function\"==typeof require&&require;if(!e&&t)return t(r,!0);if(l)return l(r,!0);var n=new Error(\"Cannot find module '\"+r+\"'\");throw n.code=\"MODULE_NOT_FOUND\",n}var i=o[r]={exports:{}};a[r][0].call(i.exports,function(e){var t=a[r][1][e];return u(t||e)},i,i.exports,s,a,o,h)}return o[r].exports}for(var l=\"function\"==typeof require&&require,e=0;e>2,s=(3&t)<<4|r>>4,a=1>6:64,o=2>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(o++)))>>2,n=(3&s)<<6|(a=p.indexOf(e.charAt(o++))),l[h++]=t,64!==s&&(l[h++]=r),64!==a&&(l[h++]=n);return l}},{\"./support\":30,\"./utils\":32}],2:[function(e,t,r){\"use strict\";var n=e(\"./external\"),i=e(\"./stream/DataWorker\"),s=e(\"./stream/Crc32Probe\"),a=e(\"./stream/DataLengthProbe\");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a(\"data_length\")),t=this;return e.on(\"end\",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error(\"Bug : uncompressed data size mismatch\")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo(\"compressedSize\",this.compressedSize).withStreamInfo(\"uncompressedSize\",this.uncompressedSize).withStreamInfo(\"crc32\",this.crc32).withStreamInfo(\"compression\",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new a(\"uncompressedSize\")).pipe(t.compressWorker(r)).pipe(new a(\"compressedSize\")).withStreamInfo(\"compression\",t)},t.exports=o},{\"./external\":6,\"./stream/Crc32Probe\":25,\"./stream/DataLengthProbe\":26,\"./stream/DataWorker\":27}],3:[function(e,t,r){\"use strict\";var n=e(\"./stream/GenericWorker\");r.STORE={magic:\"\\0\\0\",compressWorker:function(){return new n(\"STORE compression\")},uncompressWorker:function(){return new n(\"STORE decompression\")}},r.DEFLATE=e(\"./flate\")},{\"./flate\":7,\"./stream/GenericWorker\":28}],4:[function(e,t,r){\"use strict\";var n=e(\"./utils\");var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?\"string\"!==n.getTypeOf(e)?function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0}},{\"./utils\":32}],5:[function(e,t,r){\"use strict\";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){\"use strict\";var n=null;n=\"undefined\"!=typeof Promise?Promise:e(\"lie\"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){\"use strict\";var n=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Uint32Array,i=e(\"pako\"),s=e(\"./utils\"),a=e(\"./stream/GenericWorker\"),o=n?\"uint8array\":\"array\";function h(e,t){a.call(this,\"FlateWorker/\"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic=\"\\b\\0\",s.inherits(h,a),h.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,e.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(e){return new h(\"Deflate\",e)},r.uncompressWorker=function(){return new h(\"Inflate\",{})}},{\"./stream/GenericWorker\":28,\"./utils\":32,pako:38}],8:[function(e,t,r){\"use strict\";function A(e,t){var r,n=\"\";for(r=0;r>>=8;return n}function n(e,t,r,n,i,s){var a,o,h=e.file,u=e.compression,l=s!==O.utf8encode,f=I.transformTo(\"string\",s(h.name)),c=I.transformTo(\"string\",O.utf8encode(h.name)),d=h.comment,p=I.transformTo(\"string\",s(d)),m=I.transformTo(\"string\",O.utf8encode(d)),_=c.length!==h.name.length,g=m.length!==d.length,b=\"\",v=\"\",y=\"\",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),\"UNIX\"===i?(C=798,z|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(e){return 63&(e||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+c,b+=\"up\"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+=\"uc\"+A(y.length,2)+y);var E=\"\";return E+=\"\\n\\0\",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+\"\\0\\0\\0\\0\"+A(z,4)+A(n,4)+f+b+p}}var I=e(\"../utils\"),i=e(\"../stream/GenericWorker\"),O=e(\"../utf8\"),B=e(\"../crc32\"),R=e(\"../signature\");function s(e,t,r,n){i.call(this,\"ZipFileWorker\"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}I.inherits(s,i),s.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},s.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=n(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},s.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=n(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return R.DATA_DESCRIPTOR+A(e.crc32,4)+A(e.compressedSize,4)+A(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},s.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo(\"string\",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{\"../utils\":32}],19:[function(e,t,r){\"use strict\";var n=e(\"./Uint8ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./Uint8ArrayReader\":21}],20:[function(e,t,r){\"use strict\";var n=e(\"./DataReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./DataReader\":18}],21:[function(e,t,r){\"use strict\";var n=e(\"./ArrayReader\");function i(e){n.call(this,e)}e(\"../utils\").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{\"../utils\":32,\"./ArrayReader\":17}],22:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"../support\"),s=e(\"./ArrayReader\"),a=e(\"./StringReader\"),o=e(\"./NodeBufferReader\"),h=e(\"./Uint8ArrayReader\");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),\"string\"!==t||i.uint8array?\"nodebuffer\"===t?new o(e):i.uint8array?new h(n.transformTo(\"uint8array\",e)):new s(n.transformTo(\"array\",e)):new a(e)}},{\"../support\":30,\"../utils\":32,\"./ArrayReader\":17,\"./NodeBufferReader\":19,\"./StringReader\":20,\"./Uint8ArrayReader\":21}],23:[function(e,t,r){\"use strict\";r.LOCAL_FILE_HEADER=\"PK\u0003\u0004\",r.CENTRAL_FILE_HEADER=\"PK\u0001\u0002\",r.CENTRAL_DIRECTORY_END=\"PK\u0005\u0006\",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR=\"PK\u0006\u0007\",r.ZIP64_CENTRAL_DIRECTORY_END=\"PK\u0006\u0006\",r.DATA_DESCRIPTOR=\"PK\u0007\\b\"},{}],24:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../utils\");function s(e){n.call(this,\"ConvertWorker to \"+e),this.destType=e}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],25:[function(e,t,r){\"use strict\";var n=e(\"./GenericWorker\"),i=e(\"../crc32\");function s(){n.call(this,\"Crc32Probe\"),this.withStreamInfo(\"crc32\",0)}e(\"../utils\").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{\"../crc32\":4,\"../utils\":32,\"./GenericWorker\":28}],26:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataLengthProbe for \"+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],27:[function(e,t,r){\"use strict\";var n=e(\"../utils\"),i=e(\"./GenericWorker\");function s(e){i.call(this,\"DataWorker\");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=\"\",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case\"string\":e=this.data.substring(this.index,t);break;case\"uint8array\":e=this.data.subarray(this.index,t);break;case\"array\":case\"nodebuffer\":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{\"../utils\":32,\"./GenericWorker\":28}],28:[function(e,t,r){\"use strict\";function n(e){this.name=e||\"default\",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit(\"data\",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(\"end\"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(\"error\",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(\"error\",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r \"+e:e}},t.exports=n},{}],29:[function(e,t,r){\"use strict\";var h=e(\"../utils\"),i=e(\"./ConvertWorker\"),s=e(\"./GenericWorker\"),u=e(\"../base64\"),n=e(\"../support\"),a=e(\"../external\"),o=null;if(n.nodestream)try{o=e(\"../nodejs/NodejsStreamOutputAdapter\")}catch(e){}function l(e,o){return new a.Promise(function(t,r){var n=[],i=e._internalType,s=e._outputType,a=e._mimeType;e.on(\"data\",function(e,t){n.push(e),o&&o(t)}).on(\"error\",function(e){n=[],r(e)}).on(\"end\",function(){try{var e=function(e,t,r){switch(e){case\"blob\":return h.newBlob(h.transformTo(\"arraybuffer\",t),r);case\"base64\":return u.encode(t);default:return h.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return h.nodebuffer?o.transformTo(\"nodebuffer\",e).toString(\"utf-8\"):function(e){var t,r,n,i,s=e.length,a=new Array(2*s);for(t=r=0;t>10&1023,a[r++]=56320|1023&n)}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(e=o.transformTo(h.uint8array?\"uint8array\":\"array\",e))},o.inherits(a,n),a.prototype.processChunk=function(e){var t=o.transformTo(h.uint8array?\"uint8array\":\"array\",e.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(h.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta})},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=a,o.inherits(l,n),l.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=l},{\"./nodejsUtils\":14,\"./stream/GenericWorker\":28,\"./support\":30,\"./utils\":32}],32:[function(e,t,a){\"use strict\";var o=e(\"./support\"),h=e(\"./base64\"),r=e(\"./nodejsUtils\"),u=e(\"./external\");function n(e){return e}function l(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||\"/\"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new h.Buf8(e.length),r=0,n=t.length;r>10&1023,o[n++]=56320|1023&i)}return l(o,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}},{\"./common\":41}],43:[function(e,t,r){\"use strict\";t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,r){\"use strict\";var h,c=e(\"../utils/common\"),u=e(\"./trees\"),d=e(\"./adler32\"),p=e(\"./crc32\"),n=e(\"./messages\"),l=0,f=4,m=0,_=-2,g=-1,b=4,i=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(e,t){return e.msg=n[t],t}function T(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(c.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function N(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function P(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function L(e,t){var r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match,h=e.strstart>e.w_size-z?e.strstart-(e.w_size-z):0,u=e.window,l=e.w_mask,f=e.prev,c=e.strstart+S,d=u[s+a-1],p=u[s+a];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===d&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--i);return a<=e.lookahead?a:e.lookahead}function j(e){var t,r,n,i,s,a,o,h,u,l,f=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-z)){for(c.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=r=e.hash_size;n=e.head[--t],e.head[t]=f<=n?n-f:0,--r;);for(t=r=f;n=e.prev[--t],e.prev[t]=f<=n?n-f:0,--r;);i+=f}if(0===e.strm.avail_in)break;if(a=e.strm,o=e.window,h=e.strstart+e.lookahead,u=i,l=void 0,l=a.avail_in,u=x)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-x,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(j(e),0===e.lookahead&&t===l)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,N(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-z&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(e,t){return Y(e,t,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?_:(e.state.gzhead=t,m):_},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5>8&255),U(n,n.gzhead.time>>16&255),U(n,n.gzhead.time>>24&255),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(U(n,255&n.gzhead.extra.length),U(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(U(n,0),U(n,0),U(n,0),U(n,0),U(n,0),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,3),n.status=E);else{var a=v+(n.w_bits-8<<4)<<8;a|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=E,P(n,a),0!==n.strstart&&(P(n,e.adler>>>16),P(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending!==n.pending_buf_size));)U(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&F(e),n.pending+2<=n.pending_buf_size&&(U(n,255&e.adler),U(n,e.adler>>8&255),e.adler=0,n.status=E)):n.status=E),0!==n.pending){if(F(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&T(t)<=T(r)&&t!==f)return R(e,-5);if(666===n.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==l&&666!==n.status){var o=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(j(e),0===e.lookahead)){if(t===l)return A;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=S){if(j(e),e.lookahead<=S&&t===l)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):h[n.level].func(n,t);if(o!==O&&o!==B||(n.status=666),o===A||o===O)return 0===e.avail_out&&(n.last_flush=-1),m;if(o===I&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(D(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),F(e),0===e.avail_out))return n.last_flush=-1,m}return t!==f?m:n.wrap<=0?1:(2===n.wrap?(U(n,255&e.adler),U(n,e.adler>>8&255),U(n,e.adler>>16&255),U(n,e.adler>>24&255),U(n,255&e.total_in),U(n,e.total_in>>8&255),U(n,e.total_in>>16&255),U(n,e.total_in>>24&255)):(P(n,e.adler>>>16),P(n,65535&e.adler)),F(e),0=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new c.Buf8(r.w_size),c.arraySet(u,t,l-r.w_size,r.w_size,0),t=u,l=r.w_size),a=e.avail_in,o=e.next_in,h=e.input,e.avail_in=l,e.next_in=0,e.input=t,j(r);r.lookahead>=x;){for(n=r.strstart,i=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(d&(1<>>=y,p-=y),p<15&&(d+=z[n++]<>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(d&(1<>>=y,p-=y,(y=s-a)>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new I.Buf32(n),t.distcode=t.distdyn=new I.Buf32(i),t.sane=1,t.back=-1,N):U}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):U}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(I.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),I.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(I.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg=\"incorrect header check\",r.mode=30;break}if(8!=(15&u)){e.msg=\"unknown compression method\",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg=\"invalid window size\",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,u+=n[s++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[s++]<>>8&255,r.check=B(r.check,E,2,0)),l=u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(d=r.length)&&(d=o),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,n,s,d,k)),512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break e;o--,u+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg=\"invalid block type\",r.mode=30}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,u+=n[s++]<>>16^65535)){e.msg=\"invalid stored block lengths\",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid code lengths set\",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=_,l-=_,r.lens[r.have++]=b;else{if(16===b){for(z=_+2;l>>=_,l-=_,0===r.have){e.msg=\"invalid bit length repeat\",r.mode=30;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,l-=2}else if(17===b){for(z=_+3;l>>=_)),u>>>=3,l-=3}else{for(z=_+7;l>>=_)),u>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){e.msg=\"invalid bit length repeat\",r.mode=30;break}for(;d--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){e.msg=\"invalid code -- missing end-of-block\",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg=\"invalid literal/lengths set\",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg=\"invalid distances set\",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=h){e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,R(e,c),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){e.msg=\"invalid literal/length code\",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=v,l-=v,r.back+=v}if(u>>>=_,l-=_,r.back+=_,64&g){e.msg=\"invalid distance code\",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg=\"invalid distance too far back\",r.mode=30;break}r.mode=25;case 25:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg=\"invalid distance too far back\",r.mode=30;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=a-r.offset,d=r.length;for(hd?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=t[r+a[v]]}if(k>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function P(e,t,r){e.bi_valid>d-r?(e.bi_buf|=t<>d-e.bi_valid,e.bi_valid+=r-d):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function Z(e,t,r){var n,i,s=new Array(g+1),a=0;for(n=1;n<=g;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=j(s[o]++,o))}}function W(e){var t;for(t=0;t>1;1<=r;r--)G(e,s,r);for(i=h;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,G(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,h=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=g;s++)e.bl_count[s]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<_;r++)p<(s=h[2*h[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),h[2*n+1]=s,u>=7;n>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?J(e,t,r,n):4===e.strategy||s===i?(P(e,2+(n?1:0),3),K(e,z,C)):(P(e,4+(n?1:0),3),function(e,t,r,n){var i;for(P(e,t-257,5),P(e,r-1,5),P(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(A[r]+u+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){P(e,2,3),L(e,m,z),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{\"../utils/common\":41}],53:[function(e,t,r){\"use strict\";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){(function(e){!function(r,n){\"use strict\";if(!r.setImmediate){var i,s,t,a,o=1,h={},u=!1,l=r.document,e=Object.getPrototypeOf&&Object.getPrototypeOf(r);e=e&&e.setTimeout?e:r,i=\"[object process]\"==={}.toString.call(r.process)?function(e){process.nextTick(function(){c(e)})}:function(){if(r.postMessage&&!r.importScripts){var e=!0,t=r.onmessage;return r.onmessage=function(){e=!1},r.postMessage(\"\",\"*\"),r.onmessage=t,e}}()?(a=\"setImmediate$\"+Math.random()+\"$\",r.addEventListener?r.addEventListener(\"message\",d,!1):r.attachEvent(\"onmessage\",d),function(e){r.postMessage(a+e,\"*\")}):r.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){c(e.data)},function(e){t.port2.postMessage(e)}):l&&\"onreadystatechange\"in l.createElement(\"script\")?(s=l.documentElement,function(e){var t=l.createElement(\"script\");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,s.removeChild(t),t=null},s.appendChild(t)}):function(e){setTimeout(c,0,e)},e.setImmediate=function(e){\"function\"!=typeof e&&(e=new Function(\"\"+e));for(var t=new Array(arguments.length-1),r=0;r= this.text.length) {\n return;\n }\n char = this.text[this.place++];\n }\n }\n switch (this.state) {\n case NEUTRAL:\n return this.neutral(char);\n case KEYWORD:\n return this.keyword(char)\n case QUOTED:\n return this.quoted(char);\n case AFTERQUOTE:\n return this.afterquote(char);\n case NUMBER:\n return this.number(char);\n case ENDED:\n return;\n }\n };\n Parser.prototype.afterquote = function(char) {\n if (char === '\"') {\n this.word += '\"';\n this.state = QUOTED;\n return;\n }\n if (endThings.test(char)) {\n this.word = this.word.trim();\n this.afterItem(char);\n return;\n }\n throw new Error('havn\\'t handled \"' +char + '\" in afterquote yet, index ' + this.place);\n };\n Parser.prototype.afterItem = function(char) {\n if (char === ',') {\n if (this.word !== null) {\n this.currentObject.push(this.word);\n }\n this.word = null;\n this.state = NEUTRAL;\n return;\n }\n if (char === ']') {\n this.level--;\n if (this.word !== null) {\n this.currentObject.push(this.word);\n this.word = null;\n }\n this.state = NEUTRAL;\n this.currentObject = this.stack.pop();\n if (!this.currentObject) {\n this.state = ENDED;\n }\n\n return;\n }\n };\n Parser.prototype.number = function(char) {\n if (digets.test(char)) {\n this.word += char;\n return;\n }\n if (endThings.test(char)) {\n this.word = parseFloat(this.word);\n this.afterItem(char);\n return;\n }\n throw new Error('havn\\'t handled \"' +char + '\" in number yet, index ' + this.place);\n };\n Parser.prototype.quoted = function(char) {\n if (char === '\"') {\n this.state = AFTERQUOTE;\n return;\n }\n this.word += char;\n return;\n };\n Parser.prototype.keyword = function(char) {\n if (keyword.test(char)) {\n this.word += char;\n return;\n }\n if (char === '[') {\n var newObjects = [];\n newObjects.push(this.word);\n this.level++;\n if (this.root === null) {\n this.root = newObjects;\n } else {\n this.currentObject.push(newObjects);\n }\n this.stack.push(this.currentObject);\n this.currentObject = newObjects;\n this.state = NEUTRAL;\n return;\n }\n if (endThings.test(char)) {\n this.afterItem(char);\n return;\n }\n throw new Error('havn\\'t handled \"' +char + '\" in keyword yet, index ' + this.place);\n };\n Parser.prototype.neutral = function(char) {\n if (latin.test(char)) {\n this.word = char;\n this.state = KEYWORD;\n return;\n }\n if (char === '\"') {\n this.word = '';\n this.state = QUOTED;\n return;\n }\n if (digets.test(char)) {\n this.word = char;\n this.state = NUMBER;\n return;\n }\n if (endThings.test(char)) {\n this.afterItem(char);\n return;\n }\n throw new Error('havn\\'t handled \"' +char + '\" in neutral yet, index ' + this.place);\n };\n Parser.prototype.output = function() {\n while (this.place < this.text.length) {\n this.readCharicter();\n }\n if (this.state === ENDED) {\n return this.root;\n }\n throw new Error('unable to parse string \"' +this.text + '\". State is ' + this.state);\n };\n\n function parseString(txt) {\n var parser = new Parser(txt);\n return parser.output();\n }\n\n function mapit(obj, key, value) {\n if (Array.isArray(key)) {\n value.unshift(key);\n key = null;\n }\n var thing = key ? {} : obj;\n\n var out = value.reduce(function(newObj, item) {\n sExpr(item, newObj);\n return newObj\n }, thing);\n if (key) {\n obj[key] = out;\n }\n }\n\n function sExpr(v, obj) {\n if (!Array.isArray(v)) {\n obj[v] = true;\n return;\n }\n var key = v.shift();\n if (key === 'PARAMETER') {\n key = v.shift();\n }\n if (v.length === 1) {\n if (Array.isArray(v[0])) {\n obj[key] = {};\n sExpr(v[0], obj[key]);\n return;\n }\n obj[key] = v[0];\n return;\n }\n if (!v.length) {\n obj[key] = true;\n return;\n }\n if (key === 'TOWGS84') {\n obj[key] = v;\n return;\n }\n if (key === 'AXIS') {\n if (!(key in obj)) {\n obj[key] = [];\n }\n obj[key].push(v);\n return;\n }\n if (!Array.isArray(key)) {\n obj[key] = {};\n }\n\n var i;\n switch (key) {\n case 'UNIT':\n case 'PRIMEM':\n case 'VERT_DATUM':\n obj[key] = {\n name: v[0].toLowerCase(),\n convert: v[1]\n };\n if (v.length === 3) {\n sExpr(v[2], obj[key]);\n }\n return;\n case 'SPHEROID':\n case 'ELLIPSOID':\n obj[key] = {\n name: v[0],\n a: v[1],\n rf: v[2]\n };\n if (v.length === 4) {\n sExpr(v[3], obj[key]);\n }\n return;\n case 'EDATUM':\n case 'ENGINEERINGDATUM':\n case 'LOCAL_DATUM':\n case 'DATUM':\n case 'VERT_CS':\n case 'VERTCRS':\n case 'VERTICALCRS':\n v[0] = ['name', v[0]];\n mapit(obj, key, v);\n return;\n case 'COMPD_CS':\n case 'COMPOUNDCRS':\n case 'FITTED_CS':\n // the followings are the crs defined in\n // https://github.com/proj4js/proj4js/blob/1da4ed0b865d0fcb51c136090569210cdcc9019e/lib/parseCode.js#L11\n case 'PROJECTEDCRS':\n case 'PROJCRS':\n case 'GEOGCS':\n case 'GEOCCS':\n case 'PROJCS':\n case 'LOCAL_CS':\n case 'GEODCRS':\n case 'GEODETICCRS':\n case 'GEODETICDATUM':\n case 'ENGCRS':\n case 'ENGINEERINGCRS':\n v[0] = ['name', v[0]];\n mapit(obj, key, v);\n obj[key].type = key;\n return;\n default:\n i = -1;\n while (++i < v.length) {\n if (!Array.isArray(v[i])) {\n return sExpr(v, obj[key]);\n }\n }\n return mapit(obj, key, v);\n }\n }\n\n var D2R$1 = 0.01745329251994329577;\n var knownTypes = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS', 'GEOCCS', 'PROJCS', 'LOCAL_CS', 'GEODCRS',\n 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];\n\n function rename(obj, params) {\n var outName = params[0];\n var inName = params[1];\n if (!(outName in obj) && (inName in obj)) {\n obj[outName] = obj[inName];\n if (params.length === 3) {\n obj[outName] = params[2](obj[outName]);\n }\n }\n }\n\n function d2r(input) {\n return input * D2R$1;\n }\n\n function cleanWKT(wkt) {\n var keys = Object.keys(wkt);\n for (var i = 0, ii = keys.length; i 0 ? 90 : -90);\n wkt.lat_ts = wkt.lat1;\n } else if (!wkt.lat_ts && wkt.lat0 && wkt.projName === 'Polar_Stereographic') {\n wkt.lat_ts = wkt.lat0;\n wkt.lat0 = d2r(wkt.lat0 > 0 ? 90 : -90);\n }\n }\n var wkt = function(wkt) {\n var lisp = parseString(wkt);\n var type = lisp[0];\n var obj = {};\n sExpr(lisp, obj);\n cleanWKT(obj);\n return obj[type];\n };\n\n function defs(name) {\n /*global console*/\n var that = this;\n if (arguments.length === 2) {\n var def = arguments[1];\n if (typeof def === 'string') {\n if (def.charAt(0) === '+') {\n defs[name] = parseProj(arguments[1]);\n }\n else {\n defs[name] = wkt(arguments[1]);\n }\n } else {\n defs[name] = def;\n }\n }\n else if (arguments.length === 1) {\n if (Array.isArray(name)) {\n return name.map(function(v) {\n if (Array.isArray(v)) {\n defs.apply(that, v);\n }\n else {\n defs(v);\n }\n });\n }\n else if (typeof name === 'string') {\n if (name in defs) {\n return defs[name];\n }\n }\n else if ('EPSG' in name) {\n defs['EPSG:' + name.EPSG] = name;\n }\n else if ('ESRI' in name) {\n defs['ESRI:' + name.ESRI] = name;\n }\n else if ('IAU2000' in name) {\n defs['IAU2000:' + name.IAU2000] = name;\n }\n else {\n console.log(name);\n }\n return;\n }\n\n\n }\n globals(defs);\n\n function testObj(code){\n return typeof code === 'string';\n }\n function testDef(code){\n return code in defs;\n }\n var codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS','GEOCCS','PROJCS','LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];\n function testWKT(code){\n return codeWords.some(function (word) {\n return code.indexOf(word) > -1;\n });\n }\n var codes = ['3857', '900913', '3785', '102113'];\n function checkMercator(item) {\n var auth = match(item, 'authority');\n if (!auth) {\n return;\n }\n var code = match(auth, 'epsg');\n return code && codes.indexOf(code) > -1;\n }\n function checkProjStr(item) {\n var ext = match(item, 'extension');\n if (!ext) {\n return;\n }\n return match(ext, 'proj4');\n }\n function testProj(code){\n return code[0] === '+';\n }\n function parse(code){\n if (testObj(code)) {\n //check to see if this is a WKT string\n if (testDef(code)) {\n return defs[code];\n }\n if (testWKT(code)) {\n var out = wkt(code);\n // test of spetial case, due to this being a very common and often malformed\n if (checkMercator(out)) {\n return defs['EPSG:3857'];\n }\n var maybeProjStr = checkProjStr(out);\n if (maybeProjStr) {\n return parseProj(maybeProjStr);\n }\n return out;\n }\n if (testProj(code)) {\n return parseProj(code);\n }\n }else{\n return code;\n }\n }\n\n var extend = function(destination, source) {\n destination = destination || {};\n var value, property;\n if (!source) {\n return destination;\n }\n for (property in source) {\n value = source[property];\n if (value !== undefined) {\n destination[property] = value;\n }\n }\n return destination;\n };\n\n var msfnz = function(eccent, sinphi, cosphi) {\n var con = eccent * sinphi;\n return cosphi / (Math.sqrt(1 - con * con));\n };\n\n var sign = function(x) {\n return x<0 ? -1 : 1;\n };\n\n var adjust_lon = function(x) {\n return (Math.abs(x) <= SPI) ? x : (x - (sign(x) * TWO_PI));\n };\n\n var tsfnz = function(eccent, phi, sinphi) {\n var con = eccent * sinphi;\n var com = 0.5 * eccent;\n con = Math.pow(((1 - con) / (1 + con)), com);\n return (Math.tan(0.5 * (HALF_PI - phi)) / con);\n };\n\n var phi2z = function(eccent, ts) {\n var eccnth = 0.5 * eccent;\n var con, dphi;\n var phi = HALF_PI - 2 * Math.atan(ts);\n for (var i = 0; i <= 15; i++) {\n con = eccent * Math.sin(phi);\n dphi = HALF_PI - 2 * Math.atan(ts * (Math.pow(((1 - con) / (1 + con)), eccnth))) - phi;\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n //console.log(\"phi2z has NoConvergence\");\n return -9999;\n };\n\n function init() {\n var con = this.b / this.a;\n this.es = 1 - con * con;\n if(!('x0' in this)){\n this.x0 = 0;\n }\n if(!('y0' in this)){\n this.y0 = 0;\n }\n this.e = Math.sqrt(this.es);\n if (this.lat_ts) {\n if (this.sphere) {\n this.k0 = Math.cos(this.lat_ts);\n }\n else {\n this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n else {\n if (!this.k0) {\n if (this.k) {\n this.k0 = this.k;\n }\n else {\n this.k0 = 1;\n }\n }\n }\n }\n\n /* Mercator forward equations--mapping lat,long to x,y\n --------------------------------------------------*/\n\n function forward(p) {\n var lon = p.x;\n var lat = p.y;\n // convert to radians\n if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) {\n return null;\n }\n\n var x, y;\n if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {\n return null;\n }\n else {\n if (this.sphere) {\n x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);\n y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));\n }\n else {\n var sinphi = Math.sin(lat);\n var ts = tsfnz(this.e, lat, sinphi);\n x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);\n y = this.y0 - this.a * this.k0 * Math.log(ts);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n }\n\n /* Mercator inverse equations--mapping x,y to lat/long\n --------------------------------------------------*/\n function inverse(p) {\n\n var x = p.x - this.x0;\n var y = p.y - this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));\n }\n else {\n var ts = Math.exp(-y / (this.a * this.k0));\n lat = phi2z(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n lon = adjust_lon(this.long0 + x / (this.a * this.k0));\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$1 = [\"Mercator\", \"Popular Visualisation Pseudo Mercator\", \"Mercator_1SP\", \"Mercator_Auxiliary_Sphere\", \"merc\"];\n var merc = {\n init: init,\n forward: forward,\n inverse: inverse,\n names: names$1\n };\n\n function init$1() {\n //no-op for longlat\n }\n\n function identity(pt) {\n return pt;\n }\n var names$2 = [\"longlat\", \"identity\"];\n var longlat = {\n init: init$1,\n forward: identity,\n inverse: identity,\n names: names$2\n };\n\n var projs = [merc, longlat];\n var names = {};\n var projStore = [];\n\n function add(proj, i) {\n var len = projStore.length;\n if (!proj.names) {\n console.log(i);\n return true;\n }\n projStore[len] = proj;\n proj.names.forEach(function(n) {\n names[n.toLowerCase()] = len;\n });\n return this;\n }\n\n function get(name) {\n if (!name) {\n return false;\n }\n var n = name.toLowerCase();\n if (typeof names[n] !== 'undefined' && projStore[names[n]]) {\n return projStore[names[n]];\n }\n }\n\n function start() {\n projs.forEach(add);\n }\n var projections = {\n start: start,\n add: add,\n get: get\n };\n\n var exports$2 = {};\n exports$2.MERIT = {\n a: 6378137.0,\n rf: 298.257,\n ellipseName: \"MERIT 1983\"\n };\n\n exports$2.SGS85 = {\n a: 6378136.0,\n rf: 298.257,\n ellipseName: \"Soviet Geodetic System 85\"\n };\n\n exports$2.GRS80 = {\n a: 6378137.0,\n rf: 298.257222101,\n ellipseName: \"GRS 1980(IUGG, 1980)\"\n };\n\n exports$2.IAU76 = {\n a: 6378140.0,\n rf: 298.257,\n ellipseName: \"IAU 1976\"\n };\n\n exports$2.airy = {\n a: 6377563.396,\n b: 6356256.910,\n ellipseName: \"Airy 1830\"\n };\n\n exports$2.APL4 = {\n a: 6378137,\n rf: 298.25,\n ellipseName: \"Appl. Physics. 1965\"\n };\n\n exports$2.NWL9D = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"Naval Weapons Lab., 1965\"\n };\n\n exports$2.mod_airy = {\n a: 6377340.189,\n b: 6356034.446,\n ellipseName: \"Modified Airy\"\n };\n\n exports$2.andrae = {\n a: 6377104.43,\n rf: 300.0,\n ellipseName: \"Andrae 1876 (Den., Iclnd.)\"\n };\n\n exports$2.aust_SA = {\n a: 6378160.0,\n rf: 298.25,\n ellipseName: \"Australian Natl & S. Amer. 1969\"\n };\n\n exports$2.GRS67 = {\n a: 6378160.0,\n rf: 298.2471674270,\n ellipseName: \"GRS 67(IUGG 1967)\"\n };\n\n exports$2.bessel = {\n a: 6377397.155,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841\"\n };\n\n exports$2.bess_nam = {\n a: 6377483.865,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841 (Namibia)\"\n };\n\n exports$2.clrk66 = {\n a: 6378206.4,\n b: 6356583.8,\n ellipseName: \"Clarke 1866\"\n };\n\n exports$2.clrk80 = {\n a: 6378249.145,\n rf: 293.4663,\n ellipseName: \"Clarke 1880 mod.\"\n };\n\n exports$2.clrk80ign = {\n a: 6378249.2,\n b: 6356515,\n rf: 293.4660213,\n ellipseName: \"Clarke 1880 (IGN)\"\n };\n\n exports$2.clrk58 = {\n a: 6378293.645208759,\n rf: 294.2606763692654,\n ellipseName: \"Clarke 1858\"\n };\n\n exports$2.CPM = {\n a: 6375738.7,\n rf: 334.29,\n ellipseName: \"Comm. des Poids et Mesures 1799\"\n };\n\n exports$2.delmbr = {\n a: 6376428.0,\n rf: 311.5,\n ellipseName: \"Delambre 1810 (Belgium)\"\n };\n\n exports$2.engelis = {\n a: 6378136.05,\n rf: 298.2566,\n ellipseName: \"Engelis 1985\"\n };\n\n exports$2.evrst30 = {\n a: 6377276.345,\n rf: 300.8017,\n ellipseName: \"Everest 1830\"\n };\n\n exports$2.evrst48 = {\n a: 6377304.063,\n rf: 300.8017,\n ellipseName: \"Everest 1948\"\n };\n\n exports$2.evrst56 = {\n a: 6377301.243,\n rf: 300.8017,\n ellipseName: \"Everest 1956\"\n };\n\n exports$2.evrst69 = {\n a: 6377295.664,\n rf: 300.8017,\n ellipseName: \"Everest 1969\"\n };\n\n exports$2.evrstSS = {\n a: 6377298.556,\n rf: 300.8017,\n ellipseName: \"Everest (Sabah & Sarawak)\"\n };\n\n exports$2.fschr60 = {\n a: 6378166.0,\n rf: 298.3,\n ellipseName: \"Fischer (Mercury Datum) 1960\"\n };\n\n exports$2.fschr60m = {\n a: 6378155.0,\n rf: 298.3,\n ellipseName: \"Fischer 1960\"\n };\n\n exports$2.fschr68 = {\n a: 6378150.0,\n rf: 298.3,\n ellipseName: \"Fischer 1968\"\n };\n\n exports$2.helmert = {\n a: 6378200.0,\n rf: 298.3,\n ellipseName: \"Helmert 1906\"\n };\n\n exports$2.hough = {\n a: 6378270.0,\n rf: 297.0,\n ellipseName: \"Hough\"\n };\n\n exports$2.intl = {\n a: 6378388.0,\n rf: 297.0,\n ellipseName: \"International 1909 (Hayford)\"\n };\n\n exports$2.kaula = {\n a: 6378163.0,\n rf: 298.24,\n ellipseName: \"Kaula 1961\"\n };\n\n exports$2.lerch = {\n a: 6378139.0,\n rf: 298.257,\n ellipseName: \"Lerch 1979\"\n };\n\n exports$2.mprts = {\n a: 6397300.0,\n rf: 191.0,\n ellipseName: \"Maupertius 1738\"\n };\n\n exports$2.new_intl = {\n a: 6378157.5,\n b: 6356772.2,\n ellipseName: \"New International 1967\"\n };\n\n exports$2.plessis = {\n a: 6376523.0,\n rf: 6355863.0,\n ellipseName: \"Plessis 1817 (France)\"\n };\n\n exports$2.krass = {\n a: 6378245.0,\n rf: 298.3,\n ellipseName: \"Krassovsky, 1942\"\n };\n\n exports$2.SEasia = {\n a: 6378155.0,\n b: 6356773.3205,\n ellipseName: \"Southeast Asia\"\n };\n\n exports$2.walbeck = {\n a: 6376896.0,\n b: 6355834.8467,\n ellipseName: \"Walbeck\"\n };\n\n exports$2.WGS60 = {\n a: 6378165.0,\n rf: 298.3,\n ellipseName: \"WGS 60\"\n };\n\n exports$2.WGS66 = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"WGS 66\"\n };\n\n exports$2.WGS7 = {\n a: 6378135.0,\n rf: 298.26,\n ellipseName: \"WGS 72\"\n };\n\n var WGS84 = exports$2.WGS84 = {\n a: 6378137.0,\n rf: 298.257223563,\n ellipseName: \"WGS 84\"\n };\n\n exports$2.sphere = {\n a: 6370997.0,\n b: 6370997.0,\n ellipseName: \"Normal Sphere (r=6370997)\"\n };\n\n function eccentricity(a, b, rf, R_A) {\n var a2 = a * a; // used in geocentric\n var b2 = b * b; // used in geocentric\n var es = (a2 - b2) / a2; // e ^ 2\n var e = 0;\n if (R_A) {\n a *= 1 - es * (SIXTH + es * (RA4 + es * RA6));\n a2 = a * a;\n es = 0;\n } else {\n e = Math.sqrt(es); // eccentricity\n }\n var ep2 = (a2 - b2) / b2; // used in geocentric\n return {\n es: es,\n e: e,\n ep2: ep2\n };\n }\n function sphere(a, b, rf, ellps, sphere) {\n if (!a) { // do we have an ellipsoid?\n var ellipse = match(exports$2, ellps);\n if (!ellipse) {\n ellipse = WGS84;\n }\n a = ellipse.a;\n b = ellipse.b;\n rf = ellipse.rf;\n }\n\n if (rf && !b) {\n b = (1.0 - 1.0 / rf) * a;\n }\n if (rf === 0 || Math.abs(a - b) < EPSLN) {\n sphere = true;\n b = a;\n }\n return {\n a: a,\n b: b,\n rf: rf,\n sphere: sphere\n };\n }\n\n var datums = {\n wgs84: {\n towgs84: \"0,0,0\",\n ellipse: \"WGS84\",\n datumName: \"WGS84\"\n },\n ch1903: {\n towgs84: \"674.374,15.056,405.346\",\n ellipse: \"bessel\",\n datumName: \"swiss\"\n },\n ggrs87: {\n towgs84: \"-199.87,74.79,246.62\",\n ellipse: \"GRS80\",\n datumName: \"Greek_Geodetic_Reference_System_1987\"\n },\n nad83: {\n towgs84: \"0,0,0\",\n ellipse: \"GRS80\",\n datumName: \"North_American_Datum_1983\"\n },\n nad27: {\n nadgrids: \"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",\n ellipse: \"clrk66\",\n datumName: \"North_American_Datum_1927\"\n },\n potsdam: {\n towgs84: \"598.1,73.7,418.2,0.202,0.045,-2.455,6.7\",\n ellipse: \"bessel\",\n datumName: \"Potsdam Rauenberg 1950 DHDN\"\n },\n carthage: {\n towgs84: \"-263.0,6.0,431.0\",\n ellipse: \"clark80\",\n datumName: \"Carthage 1934 Tunisia\"\n },\n hermannskogel: {\n towgs84: \"577.326,90.129,463.919,5.137,1.474,5.297,2.4232\",\n ellipse: \"bessel\",\n datumName: \"Hermannskogel\"\n },\n mgi: {\n towgs84: \"577.326,90.129,463.919,5.137,1.474,5.297,2.4232\",\n ellipse: \"bessel\",\n datumName: \"Militar-Geographische Institut\",\n },\n osni52: {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"airy\",\n datumName: \"Irish National\"\n },\n ire65: {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"mod_airy\",\n datumName: \"Ireland 1965\"\n },\n rassadiran: {\n towgs84: \"-133.63,-157.5,-158.62\",\n ellipse: \"intl\",\n datumName: \"Rassadiran\"\n },\n nzgd49: {\n towgs84: \"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",\n ellipse: \"intl\",\n datumName: \"New Zealand Geodetic Datum 1949\"\n },\n osgb36: {\n towgs84: \"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",\n ellipse: \"airy\",\n datumName: \"Ordnance Survey of Great Britain 1936\"\n },\n s_jtsk: {\n towgs84: \"589,76,480\",\n ellipse: 'bessel',\n datumName: 'S-JTSK (Ferro)'\n },\n beduaram: {\n towgs84: '-106,-87,188',\n ellipse: 'clrk80',\n datumName: 'Beduaram'\n },\n gunung_segara: {\n towgs84: '-403,684,41',\n ellipse: 'bessel',\n datumName: 'Gunung Segara Jakarta'\n },\n rnb72: {\n towgs84: \"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",\n ellipse: \"intl\",\n datumName: \"Reseau National Belge 1972\"\n }\n };\n\n for (var key in datums) {\n var datum = datums[key];\n datums[datum.datumName] = datum;\n }\n\n function datum$1(datumCode, datum_params, a, b, es, ep2, nadgrids) {\n var out = {};\n\n if (datumCode === undefined || datumCode === 'none') {\n out.datum_type = PJD_NODATUM;\n } else {\n out.datum_type = PJD_WGS84;\n }\n\n if (datum_params) {\n out.datum_params = datum_params.map(parseFloat);\n if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {\n out.datum_type = PJD_3PARAM;\n }\n if (out.datum_params.length > 3) {\n if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {\n out.datum_type = PJD_7PARAM;\n out.datum_params[3] *= SEC_TO_RAD;\n out.datum_params[4] *= SEC_TO_RAD;\n out.datum_params[5] *= SEC_TO_RAD;\n out.datum_params[6] = (out.datum_params[6] / 1000000.0) + 1.0;\n }\n }\n }\n\n if (nadgrids) {\n out.datum_type = PJD_GRIDSHIFT;\n out.grids = nadgrids;\n }\n out.a = a; //datum object also uses these values\n out.b = b;\n out.es = es;\n out.ep2 = ep2;\n return out;\n }\n\n /**\n * Resources for details of NTv2 file formats:\n * - https://web.archive.org/web/20140127204822if_/http://www.mgs.gov.on.ca:80/stdprodconsume/groups/content/@mgs/@iandit/documents/resourcelist/stel02_047447.pdf\n * - http://mimaka.com/help/gs/html/004_NTV2%20Data%20Format.htm\n */\n\n var loadedNadgrids = {};\n\n /**\n * Load a binary NTv2 file (.gsb) to a key that can be used in a proj string like +nadgrids=. Pass the NTv2 file\n * as an ArrayBuffer.\n */\n function nadgrid(key, data) {\n var view = new DataView(data);\n var isLittleEndian = detectLittleEndian(view);\n var header = readHeader(view, isLittleEndian);\n var subgrids = readSubgrids(view, header, isLittleEndian);\n var nadgrid = {header: header, subgrids: subgrids};\n loadedNadgrids[key] = nadgrid;\n return nadgrid;\n }\n\n /**\n * Given a proj4 value for nadgrids, return an array of loaded grids\n */\n function getNadgrids(nadgrids) {\n // Format details: http://proj.maptools.org/gen_parms.html\n if (nadgrids === undefined) { return null; }\n var grids = nadgrids.split(',');\n return grids.map(parseNadgridString);\n }\n\n function parseNadgridString(value) {\n if (value.length === 0) {\n return null;\n }\n var optional = value[0] === '@';\n if (optional) {\n value = value.slice(1);\n }\n if (value === 'null') {\n return {name: 'null', mandatory: !optional, grid: null, isNull: true};\n }\n return {\n name: value,\n mandatory: !optional,\n grid: loadedNadgrids[value] || null,\n isNull: false\n };\n }\n\n function secondsToRadians(seconds) {\n return (seconds / 3600) * Math.PI / 180;\n }\n\n function detectLittleEndian(view) {\n var nFields = view.getInt32(8, false);\n if (nFields === 11) {\n return false;\n }\n nFields = view.getInt32(8, true);\n if (nFields !== 11) {\n console.warn('Failed to detect nadgrid endian-ness, defaulting to little-endian');\n }\n return true;\n }\n\n function readHeader(view, isLittleEndian) {\n return {\n nFields: view.getInt32(8, isLittleEndian),\n nSubgridFields: view.getInt32(24, isLittleEndian),\n nSubgrids: view.getInt32(40, isLittleEndian),\n shiftType: decodeString(view, 56, 56 + 8).trim(),\n fromSemiMajorAxis: view.getFloat64(120, isLittleEndian),\n fromSemiMinorAxis: view.getFloat64(136, isLittleEndian),\n toSemiMajorAxis: view.getFloat64(152, isLittleEndian),\n toSemiMinorAxis: view.getFloat64(168, isLittleEndian),\n };\n }\n\n function decodeString(view, start, end) {\n return String.fromCharCode.apply(null, new Uint8Array(view.buffer.slice(start, end)));\n }\n\n function readSubgrids(view, header, isLittleEndian) {\n var gridOffset = 176;\n var grids = [];\n for (var i = 0; i < header.nSubgrids; i++) {\n var subHeader = readGridHeader(view, gridOffset, isLittleEndian);\n var nodes = readGridNodes(view, gridOffset, subHeader, isLittleEndian);\n var lngColumnCount = Math.round(\n 1 + (subHeader.upperLongitude - subHeader.lowerLongitude) / subHeader.longitudeInterval);\n var latColumnCount = Math.round(\n 1 + (subHeader.upperLatitude - subHeader.lowerLatitude) / subHeader.latitudeInterval);\n // Proj4 operates on radians whereas the coordinates are in seconds in the grid\n grids.push({\n ll: [secondsToRadians(subHeader.lowerLongitude), secondsToRadians(subHeader.lowerLatitude)],\n del: [secondsToRadians(subHeader.longitudeInterval), secondsToRadians(subHeader.latitudeInterval)],\n lim: [lngColumnCount, latColumnCount],\n count: subHeader.gridNodeCount,\n cvs: mapNodes(nodes)\n });\n gridOffset += 176 + subHeader.gridNodeCount * 16;\n }\n return grids;\n }\n\n function mapNodes(nodes) {\n return nodes.map(function (r) {return [secondsToRadians(r.longitudeShift), secondsToRadians(r.latitudeShift)];});\n }\n\n function readGridHeader(view, offset, isLittleEndian) {\n return {\n name: decodeString(view, offset + 8, offset + 16).trim(),\n parent: decodeString(view, offset + 24, offset + 24 + 8).trim(),\n lowerLatitude: view.getFloat64(offset + 72, isLittleEndian),\n upperLatitude: view.getFloat64(offset + 88, isLittleEndian),\n lowerLongitude: view.getFloat64(offset + 104, isLittleEndian),\n upperLongitude: view.getFloat64(offset + 120, isLittleEndian),\n latitudeInterval: view.getFloat64(offset + 136, isLittleEndian),\n longitudeInterval: view.getFloat64(offset + 152, isLittleEndian),\n gridNodeCount: view.getInt32(offset + 168, isLittleEndian)\n };\n }\n\n function readGridNodes(view, offset, gridHeader, isLittleEndian) {\n var nodesOffset = offset + 176;\n var gridRecordLength = 16;\n var gridShiftRecords = [];\n for (var i = 0; i < gridHeader.gridNodeCount; i++) {\n var record = {\n latitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength, isLittleEndian),\n longitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength + 4, isLittleEndian),\n latitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 8, isLittleEndian),\n longitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 12, isLittleEndian),\n };\n gridShiftRecords.push(record);\n }\n return gridShiftRecords;\n }\n\n function Projection(srsCode,callback) {\n if (!(this instanceof Projection)) {\n return new Projection(srsCode);\n }\n callback = callback || function(error){\n if(error){\n throw error;\n }\n };\n var json = parse(srsCode);\n if(typeof json !== 'object'){\n callback('Could not parse to valid json: ' + srsCode);\n return;\n }\n var ourProj = Projection.projections.get(json.projName);\n if(!ourProj){\n callback('Could not get projection name from: ' + srsCode);\n return;\n }\n if (json.datumCode && json.datumCode !== 'none') {\n var datumDef = match(datums, json.datumCode);\n if (datumDef) {\n json.datum_params = json.datum_params || (datumDef.towgs84 ? datumDef.towgs84.split(',') : null);\n json.ellps = datumDef.ellipse;\n json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;\n }\n }\n json.k0 = json.k0 || 1.0;\n json.axis = json.axis || 'enu';\n json.ellps = json.ellps || 'wgs84';\n json.lat1 = json.lat1 || json.lat0; // Lambert_Conformal_Conic_1SP, for example, needs this\n\n var sphere_ = sphere(json.a, json.b, json.rf, json.ellps, json.sphere);\n var ecc = eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A);\n var nadgrids = getNadgrids(json.nadgrids);\n var datumObj = json.datum || datum$1(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2,\n nadgrids);\n\n extend(this, json); // transfer everything over from the projection because we don't know what we'll need\n extend(this, ourProj); // transfer all the methods from the projection\n\n // copy the 4 things over we calculated in deriveConstants.sphere\n this.a = sphere_.a;\n this.b = sphere_.b;\n this.rf = sphere_.rf;\n this.sphere = sphere_.sphere;\n\n // copy the 3 things we calculated in deriveConstants.eccentricity\n this.es = ecc.es;\n this.e = ecc.e;\n this.ep2 = ecc.ep2;\n\n // add in the datum object\n this.datum = datumObj;\n\n // init the projection\n this.init();\n\n // legecy callback from back in the day when it went to spatialreference.org\n callback(null, this);\n\n }\n Projection.projections = projections;\n Projection.projections.start();\n\n 'use strict';\n function compareDatums(source, dest) {\n if (source.datum_type !== dest.datum_type) {\n return false; // false, datums are not equal\n } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {\n // the tolerance for es is to ensure that GRS80 and WGS84\n // are considered identical\n return false;\n } else if (source.datum_type === PJD_3PARAM) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2]);\n } else if (source.datum_type === PJD_7PARAM) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6]);\n } else {\n return true; // datums are equal\n }\n } // cs_compare_datums()\n\n /*\n * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates\n * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),\n * according to the current ellipsoid parameters.\n *\n * Latitude : Geodetic latitude in radians (input)\n * Longitude : Geodetic longitude in radians (input)\n * Height : Geodetic height, in meters (input)\n * X : Calculated Geocentric X coordinate, in meters (output)\n * Y : Calculated Geocentric Y coordinate, in meters (output)\n * Z : Calculated Geocentric Z coordinate, in meters (output)\n *\n */\n function geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n var Latitude = p.y;\n var Height = p.z ? p.z : 0; //Z value not always supplied\n\n var Rn; /* Earth radius at location */\n var Sin_Lat; /* Math.sin(Latitude) */\n var Sin2_Lat; /* Square of Math.sin(Latitude) */\n var Cos_Lat; /* Math.cos(Latitude) */\n\n /*\n ** Don't blow up if Latitude is just a little out of the value\n ** range as it may just be a rounding issue. Also removed longitude\n ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.\n */\n if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) {\n Latitude = -HALF_PI;\n } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) {\n Latitude = HALF_PI;\n } else if (Latitude < -HALF_PI) {\n /* Latitude out of range */\n //..reportError('geocent:lat out of range:' + Latitude);\n return { x: -Infinity, y: -Infinity, z: p.z };\n } else if (Latitude > HALF_PI) {\n /* Latitude out of range */\n return { x: Infinity, y: Infinity, z: p.z };\n }\n\n if (Longitude > Math.PI) {\n Longitude -= (2 * Math.PI);\n }\n Sin_Lat = Math.sin(Latitude);\n Cos_Lat = Math.cos(Latitude);\n Sin2_Lat = Sin_Lat * Sin_Lat;\n Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat));\n return {\n x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),\n y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),\n z: ((Rn * (1 - es)) + Height) * Sin_Lat\n };\n } // cs_geodetic_to_geocentric()\n\n function geocentricToGeodetic(p, es, a, b) {\n /* local defintions and variables */\n /* end-criterium of loop, accuracy of sin(Latitude) */\n var genau = 1e-12;\n var genau2 = (genau * genau);\n var maxiter = 30;\n\n var P; /* distance between semi-minor axis and location */\n var RR; /* distance between center and location */\n var CT; /* sin of geocentric latitude */\n var ST; /* cos of geocentric latitude */\n var RX;\n var RK;\n var RN; /* Earth radius at location */\n var CPHI0; /* cos of start or old geodetic latitude in iterations */\n var SPHI0; /* sin of start or old geodetic latitude in iterations */\n var CPHI; /* cos of searched geodetic latitude */\n var SPHI; /* sin of searched geodetic latitude */\n var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */\n var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */\n\n var X = p.x;\n var Y = p.y;\n var Z = p.z ? p.z : 0.0; //Z value not always supplied\n var Longitude;\n var Latitude;\n var Height;\n\n P = Math.sqrt(X * X + Y * Y);\n RR = Math.sqrt(X * X + Y * Y + Z * Z);\n\n /* special cases for latitude and longitude */\n if (P / a < genau) {\n\n /* special case, if P=0. (X=0., Y=0.) */\n Longitude = 0.0;\n\n /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis\n * of ellipsoid (=center of mass), Latitude becomes PI/2 */\n if (RR / a < genau) {\n Latitude = HALF_PI;\n Height = -b;\n return {\n x: p.x,\n y: p.y,\n z: p.z\n };\n }\n } else {\n /* ellipsoidal (geodetic) longitude\n * interval: -PI < Longitude <= +PI */\n Longitude = Math.atan2(Y, X);\n }\n\n /* --------------------------------------------------------------\n * Following iterative algorithm was developped by\n * \"Institut for Erdmessung\", University of Hannover, July 1988.\n * Internet: www.ife.uni-hannover.de\n * Iterative computation of CPHI,SPHI and Height.\n * Iteration of CPHI and SPHI to 10**-12 radian resp.\n * 2*10**-7 arcsec.\n * --------------------------------------------------------------\n */\n CT = Z / RR;\n ST = P / RR;\n RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);\n CPHI0 = ST * (1.0 - es) * RX;\n SPHI0 = CT * RX;\n iter = 0;\n\n /* loop to find sin(Latitude) resp. Latitude\n * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */\n do {\n iter++;\n RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);\n\n /* ellipsoidal (geodetic) height */\n Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);\n\n RK = es * RN / (RN + Height);\n RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);\n CPHI = ST * (1.0 - RK) * RX;\n SPHI = CT * RX;\n SDPHI = SPHI * CPHI0 - CPHI * SPHI0;\n CPHI0 = CPHI;\n SPHI0 = SPHI;\n }\n while (SDPHI * SDPHI > genau2 && iter < maxiter);\n\n /* ellipsoidal (geodetic) latitude */\n Latitude = Math.atan(SPHI / Math.abs(CPHI));\n return {\n x: Longitude,\n y: Latitude,\n z: Height\n };\n } // cs_geocentric_to_geodetic()\n\n /****************************************************************/\n // pj_geocentic_to_wgs84( p )\n // p = point to transform in geocentric coordinates (x,y,z)\n\n\n /** point object, nothing fancy, just allows values to be\n passed back and forth by reference rather than by value.\n Other point classes may be used as long as they have\n x and y properties, which will get modified in the transform method.\n */\n function geocentricToWgs84(p, datum_type, datum_params) {\n\n if (datum_type === PJD_3PARAM) {\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x + datum_params[0],\n y: p.y + datum_params[1],\n z: p.z + datum_params[2],\n };\n } else if (datum_type === PJD_7PARAM) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,\n y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,\n z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF\n };\n }\n } // cs_geocentric_to_wgs84\n\n /****************************************************************/\n // pj_geocentic_from_wgs84()\n // coordinate system definition,\n // point to transform in geocentric coordinates (x,y,z)\n function geocentricFromWgs84(p, datum_type, datum_params) {\n\n if (datum_type === PJD_3PARAM) {\n //if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x - datum_params[0],\n y: p.y - datum_params[1],\n z: p.z - datum_params[2],\n };\n\n } else if (datum_type === PJD_7PARAM) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n var x_tmp = (p.x - Dx_BF) / M_BF;\n var y_tmp = (p.y - Dy_BF) / M_BF;\n var z_tmp = (p.z - Dz_BF) / M_BF;\n //if( x[io] === HUGE_VAL )\n // continue;\n\n return {\n x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,\n y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,\n z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp\n };\n } //cs_geocentric_from_wgs84()\n }\n\n function checkParams(type) {\n return (type === PJD_3PARAM || type === PJD_7PARAM);\n }\n\n var datum_transform = function(source, dest, point) {\n // Short cut if the datums are identical.\n if (compareDatums(source, dest)) {\n return point; // in this case, zero is sucess,\n // whereas cs_compare_datums returns 1 to indicate TRUE\n // confusing, should fix this\n }\n\n // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest\n if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) {\n return point;\n }\n\n // If this datum requires grid shifts, then apply it to geodetic coordinates.\n var source_a = source.a;\n var source_es = source.es;\n if (source.datum_type === PJD_GRIDSHIFT) {\n var gridShiftCode = applyGridShift(source, false, point);\n if (gridShiftCode !== 0) {\n return undefined;\n }\n source_a = SRS_WGS84_SEMIMAJOR;\n source_es = SRS_WGS84_ESQUARED;\n }\n\n var dest_a = dest.a;\n var dest_b = dest.b;\n var dest_es = dest.es;\n if (dest.datum_type === PJD_GRIDSHIFT) {\n dest_a = SRS_WGS84_SEMIMAJOR;\n dest_b = SRS_WGS84_SEMIMINOR;\n dest_es = SRS_WGS84_ESQUARED;\n }\n\n // Do we need to go through geocentric coordinates?\n if (source_es === dest_es && source_a === dest_a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {\n return point;\n }\n\n // Convert to geocentric coordinates.\n point = geodeticToGeocentric(point, source_es, source_a);\n // Convert between datums\n if (checkParams(source.datum_type)) {\n point = geocentricToWgs84(point, source.datum_type, source.datum_params);\n }\n if (checkParams(dest.datum_type)) {\n point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params);\n }\n point = geocentricToGeodetic(point, dest_es, dest_a, dest_b);\n\n if (dest.datum_type === PJD_GRIDSHIFT) {\n var destGridShiftResult = applyGridShift(dest, true, point);\n if (destGridShiftResult !== 0) {\n return undefined;\n }\n }\n\n return point;\n };\n\n function applyGridShift(source, inverse, point) {\n if (source.grids === null || source.grids.length === 0) {\n console.log('Grid shift grids not found');\n return -1;\n }\n var input = {x: -point.x, y: point.y};\n var output = {x: Number.NaN, y: Number.NaN};\n var attemptedGrids = [];\n outer:\n for (var i = 0; i < source.grids.length; i++) {\n var grid = source.grids[i];\n attemptedGrids.push(grid.name);\n if (grid.isNull) {\n output = input;\n break;\n }\n if (grid.grid === null) {\n if (grid.mandatory) {\n console.log(\"Unable to find mandatory grid '\" + grid.name + \"'\");\n return -1;\n }\n continue;\n }\n var subgrids = grid.grid.subgrids;\n for (var j = 0, jj = subgrids.length; j < jj; j++) {\n var subgrid = subgrids[j];\n // skip tables that don't match our point at all\n var epsilon = (Math.abs(subgrid.del[1]) + Math.abs(subgrid.del[0])) / 10000.0;\n var minX = subgrid.ll[0] - epsilon;\n var minY = subgrid.ll[1] - epsilon;\n var maxX = subgrid.ll[0] + (subgrid.lim[0] - 1) * subgrid.del[0] + epsilon;\n var maxY = subgrid.ll[1] + (subgrid.lim[1] - 1) * subgrid.del[1] + epsilon;\n if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x ) {\n continue;\n }\n output = applySubgridShift(input, inverse, subgrid);\n if (!isNaN(output.x)) {\n break outer;\n }\n }\n }\n if (isNaN(output.x)) {\n console.log(\"Failed to find a grid shift table for location '\"+\n -input.x * R2D + \" \" + input.y * R2D + \" tried: '\" + attemptedGrids + \"'\");\n return -1;\n }\n point.x = -output.x;\n point.y = output.y;\n return 0;\n }\n\n function applySubgridShift(pin, inverse, ct) {\n var val = {x: Number.NaN, y: Number.NaN};\n if (isNaN(pin.x)) { return val; }\n var tb = {x: pin.x, y: pin.y};\n tb.x -= ct.ll[0];\n tb.y -= ct.ll[1];\n tb.x = adjust_lon(tb.x - Math.PI) + Math.PI;\n var t = nadInterpolate(tb, ct);\n if (inverse) {\n if (isNaN(t.x)) {\n return val;\n }\n t.x = tb.x - t.x;\n t.y = tb.y - t.y;\n var i = 9, tol = 1e-12;\n var dif, del;\n do {\n del = nadInterpolate(t, ct);\n if (isNaN(del.x)) {\n console.log(\"Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.\");\n break;\n }\n dif = {x: tb.x - (del.x + t.x), y: tb.y - (del.y + t.y)};\n t.x += dif.x;\n t.y += dif.y;\n } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol);\n if (i < 0) {\n console.log(\"Inverse grid shift iterator failed to converge.\");\n return val;\n }\n val.x = adjust_lon(t.x + ct.ll[0]);\n val.y = t.y + ct.ll[1];\n } else {\n if (!isNaN(t.x)) {\n val.x = pin.x + t.x;\n val.y = pin.y + t.y;\n }\n }\n return val;\n }\n\n function nadInterpolate(pin, ct) {\n var t = {x: pin.x / ct.del[0], y: pin.y / ct.del[1]};\n var indx = {x: Math.floor(t.x), y: Math.floor(t.y)};\n var frct = {x: t.x - 1.0 * indx.x, y: t.y - 1.0 * indx.y};\n var val= {x: Number.NaN, y: Number.NaN};\n var inx;\n if (indx.x < 0 || indx.x >= ct.lim[0]) {\n return val;\n }\n if (indx.y < 0 || indx.y >= ct.lim[1]) {\n return val;\n }\n inx = (indx.y * ct.lim[0]) + indx.x;\n var f00 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx++;\n var f10= {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx += ct.lim[0];\n var f11 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx--;\n var f01 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n var m11 = frct.x * frct.y, m10 = frct.x * (1.0 - frct.y),\n m00 = (1.0 - frct.x) * (1.0 - frct.y), m01 = (1.0 - frct.x) * frct.y;\n val.x = (m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x);\n val.y = (m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y);\n return val;\n }\n\n var adjust_axis = function(crs, denorm, point) {\n var xin = point.x,\n yin = point.y,\n zin = point.z || 0.0;\n var v, t, i;\n var out = {};\n for (i = 0; i < 3; i++) {\n if (denorm && i === 2 && point.z === undefined) {\n continue;\n }\n if (i === 0) {\n v = xin;\n if (\"ew\".indexOf(crs.axis[i]) !== -1) {\n t = 'x';\n } else {\n t = 'y';\n }\n\n }\n else if (i === 1) {\n v = yin;\n if (\"ns\".indexOf(crs.axis[i]) !== -1) {\n t = 'y';\n } else {\n t = 'x';\n }\n }\n else {\n v = zin;\n t = 'z';\n }\n switch (crs.axis[i]) {\n case 'e':\n out[t] = v;\n break;\n case 'w':\n out[t] = -v;\n break;\n case 'n':\n out[t] = v;\n break;\n case 's':\n out[t] = -v;\n break;\n case 'u':\n if (point[t] !== undefined) {\n out.z = v;\n }\n break;\n case 'd':\n if (point[t] !== undefined) {\n out.z = -v;\n }\n break;\n default:\n //console.log(\"ERROR: unknow axis (\"+crs.axis[i]+\") - check definition of \"+crs.projName);\n return null;\n }\n }\n return out;\n };\n\n var toPoint = function (array){\n var out = {\n x: array[0],\n y: array[1]\n };\n if (array.length>2) {\n out.z = array[2];\n }\n if (array.length>3) {\n out.m = array[3];\n }\n return out;\n };\n\n var checkSanity = function (point) {\n checkCoord(point.x);\n checkCoord(point.y);\n };\n function checkCoord(num) {\n if (typeof Number.isFinite === 'function') {\n if (Number.isFinite(num)) {\n return;\n }\n throw new TypeError('coordinates must be finite numbers');\n }\n if (typeof num !== 'number' || num !== num || !isFinite(num)) {\n throw new TypeError('coordinates must be finite numbers');\n }\n }\n\n function checkNotWGS(source, dest) {\n return (\n (source.datum.datum_type === PJD_3PARAM || source.datum.datum_type === PJD_7PARAM || source.datum.datum_type === PJD_GRIDSHIFT) && dest.datumCode !== 'WGS84') ||\n ((dest.datum.datum_type === PJD_3PARAM || dest.datum.datum_type === PJD_7PARAM || dest.datum.datum_type === PJD_GRIDSHIFT) && source.datumCode !== 'WGS84');\n }\n\n function transform(source, dest, point, enforceAxis) {\n var wgs84;\n if (Array.isArray(point)) {\n point = toPoint(point);\n } else {\n // Clone the point object so inputs don't get modified\n point = {\n x: point.x,\n y: point.y,\n z: point.z,\n m: point.m\n };\n }\n var hasZ = point.z !== undefined;\n checkSanity(point);\n // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84\n if (source.datum && dest.datum && checkNotWGS(source, dest)) {\n wgs84 = new Projection('WGS84');\n point = transform(source, wgs84, point, enforceAxis);\n source = wgs84;\n }\n // DGR, 2010/11/12\n if (enforceAxis && source.axis !== 'enu') {\n point = adjust_axis(source, false, point);\n }\n // Transform source points to long/lat, if they aren't already.\n if (source.projName === 'longlat') {\n point = {\n x: point.x * D2R,\n y: point.y * D2R,\n z: point.z || 0\n };\n } else {\n if (source.to_meter) {\n point = {\n x: point.x * source.to_meter,\n y: point.y * source.to_meter,\n z: point.z || 0\n };\n }\n point = source.inverse(point); // Convert Cartesian to longlat\n if (!point) {\n return;\n }\n }\n // Adjust for the prime meridian if necessary\n if (source.from_greenwich) {\n point.x += source.from_greenwich;\n }\n\n // Convert datums if needed, and if possible.\n point = datum_transform(source.datum, dest.datum, point);\n if (!point) {\n return;\n }\n\n // Adjust for the prime meridian if necessary\n if (dest.from_greenwich) {\n point = {\n x: point.x - dest.from_greenwich,\n y: point.y,\n z: point.z || 0\n };\n }\n\n if (dest.projName === 'longlat') {\n // convert radians to decimal degrees\n point = {\n x: point.x * R2D,\n y: point.y * R2D,\n z: point.z || 0\n };\n } else { // else project\n point = dest.forward(point);\n if (dest.to_meter) {\n point = {\n x: point.x / dest.to_meter,\n y: point.y / dest.to_meter,\n z: point.z || 0\n };\n }\n }\n\n // DGR, 2010/11/12\n if (enforceAxis && dest.axis !== 'enu') {\n return adjust_axis(dest, true, point);\n }\n\n if (point && !hasZ) {\n delete point.z;\n }\n return point;\n }\n\n var wgs84 = Projection('WGS84');\n\n function transformer(from, to, coords, enforceAxis) {\n var transformedArray, out, keys;\n if (Array.isArray(coords)) {\n transformedArray = transform(from, to, coords, enforceAxis) || {x: NaN, y: NaN};\n if (coords.length > 2) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (typeof transformedArray.z === 'number') {\n return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.slice(3));\n } else {\n return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.slice(3));\n }\n } else {\n return [transformedArray.x, transformedArray.y].concat(coords.slice(2));\n }\n } else {\n return [transformedArray.x, transformedArray.y];\n }\n } else {\n out = transform(from, to, coords, enforceAxis);\n keys = Object.keys(coords);\n if (keys.length === 2) {\n return out;\n }\n keys.forEach(function (key) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (key === 'x' || key === 'y' || key === 'z') {\n return;\n }\n } else {\n if (key === 'x' || key === 'y') {\n return;\n }\n }\n out[key] = coords[key];\n });\n return out;\n }\n }\n\n function checkProj(item) {\n if (item instanceof Projection) {\n return item;\n }\n if (item.oProj) {\n return item.oProj;\n }\n return Projection(item);\n }\n\n function proj4$1(fromProj, toProj, coord) {\n fromProj = checkProj(fromProj);\n var single = false;\n var obj;\n if (typeof toProj === 'undefined') {\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {\n coord = toProj;\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n }\n toProj = checkProj(toProj);\n if (coord) {\n return transformer(fromProj, toProj, coord);\n } else {\n obj = {\n forward: function (coords, enforceAxis) {\n return transformer(fromProj, toProj, coords, enforceAxis);\n },\n inverse: function (coords, enforceAxis) {\n return transformer(toProj, fromProj, coords, enforceAxis);\n }\n };\n if (single) {\n obj.oProj = toProj;\n }\n return obj;\n }\n }\n\n /**\n * UTM zones are grouped, and assigned to one of a group of 6\n * sets.\n *\n * {int} @private\n */\n var NUM_100K_SETS = 6;\n\n /**\n * The column letters (for easting) of the lower left value, per\n * set.\n *\n * {string} @private\n */\n var SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';\n\n /**\n * The row letters (for northing) of the lower left value, per\n * set.\n *\n * {string} @private\n */\n var SET_ORIGIN_ROW_LETTERS = 'AFAFAF';\n\n var A = 65; // A\n var I = 73; // I\n var O = 79; // O\n var V = 86; // V\n var Z = 90; // Z\n var mgrs = {\n forward: forward$1,\n inverse: inverse$1,\n toPoint: toPoint$1\n };\n /**\n * Conversion of lat/lon to MGRS.\n *\n * @param {object} ll Object literal with lat and lon properties on a\n * WGS84 ellipsoid.\n * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for\n * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.\n * @return {string} the MGRS string for the given location and accuracy.\n */\n function forward$1(ll, accuracy) {\n accuracy = accuracy || 5; // default accuracy 1m\n return encode(LLtoUTM({\n lat: ll[1],\n lon: ll[0]\n }), accuracy);\n }\n\n /**\n * Conversion of MGRS to lat/lon.\n *\n * @param {string} mgrs MGRS string.\n * @return {array} An array with left (longitude), bottom (latitude), right\n * (longitude) and top (latitude) values in WGS84, representing the\n * bounding box for the provided MGRS reference.\n */\n function inverse$1(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];\n }\n return [bbox.left, bbox.bottom, bbox.right, bbox.top];\n }\n\n function toPoint$1(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat];\n }\n return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];\n }\n /**\n * Conversion from degrees to radians.\n *\n * @private\n * @param {number} deg the angle in degrees.\n * @return {number} the angle in radians.\n */\n function degToRad(deg) {\n return (deg * (Math.PI / 180.0));\n }\n\n /**\n * Conversion from radians to degrees.\n *\n * @private\n * @param {number} rad the angle in radians.\n * @return {number} the angle in degrees.\n */\n function radToDeg(rad) {\n return (180.0 * (rad / Math.PI));\n }\n\n /**\n * Converts a set of Longitude and Latitude co-ordinates to UTM\n * using the WGS84 ellipsoid.\n *\n * @private\n * @param {object} ll Object literal with lat and lon properties\n * representing the WGS84 coordinate to be converted.\n * @return {object} Object literal containing the UTM value with easting,\n * northing, zoneNumber and zoneLetter properties, and an optional\n * accuracy property in digits. Returns null if the conversion failed.\n */\n function LLtoUTM(ll) {\n var Lat = ll.lat;\n var Long = ll.lon;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var k0 = 0.9996;\n var LongOrigin;\n var eccPrimeSquared;\n var N, T, C, A, M;\n var LatRad = degToRad(Lat);\n var LongRad = degToRad(Long);\n var LongOriginRad;\n var ZoneNumber;\n // (int)\n ZoneNumber = Math.floor((Long + 180) / 6) + 1;\n\n //Make sure the longitude 180.00 is in Zone 60\n if (Long === 180) {\n ZoneNumber = 60;\n }\n\n // Special zone for Norway\n if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {\n ZoneNumber = 32;\n }\n\n // Special zones for Svalbard\n if (Lat >= 72.0 && Lat < 84.0) {\n if (Long >= 0.0 && Long < 9.0) {\n ZoneNumber = 31;\n }\n else if (Long >= 9.0 && Long < 21.0) {\n ZoneNumber = 33;\n }\n else if (Long >= 21.0 && Long < 33.0) {\n ZoneNumber = 35;\n }\n else if (Long >= 33.0 && Long < 42.0) {\n ZoneNumber = 37;\n }\n }\n\n LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin\n // in middle of\n // zone\n LongOriginRad = degToRad(LongOrigin);\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));\n T = Math.tan(LatRad) * Math.tan(LatRad);\n C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);\n A = Math.cos(LatRad) * (LongRad - LongOriginRad);\n\n M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - (35 * eccSquared * eccSquared * eccSquared / 3072) * Math.sin(6 * LatRad));\n\n var UTMEasting = (k0 * N * (A + (1 - T + C) * A * A * A / 6.0 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A * A * A * A * A / 120.0) + 500000.0);\n\n var UTMNorthing = (k0 * (M + N * Math.tan(LatRad) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24.0 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * A * A * A * A * A / 720.0)));\n if (Lat < 0.0) {\n UTMNorthing += 10000000.0; //10000000 meter offset for\n // southern hemisphere\n }\n\n return {\n northing: Math.round(UTMNorthing),\n easting: Math.round(UTMEasting),\n zoneNumber: ZoneNumber,\n zoneLetter: getLetterDesignator(Lat)\n };\n }\n\n /**\n * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience\n * class where the Zone can be specified as a single string eg.\"60N\" which\n * is then broken down into the ZoneNumber and ZoneLetter.\n *\n * @private\n * @param {object} utm An object literal with northing, easting, zoneNumber\n * and zoneLetter properties. If an optional accuracy property is\n * provided (in meters), a bounding box will be returned instead of\n * latitude and longitude.\n * @return {object} An object literal containing either lat and lon values\n * (if no accuracy was provided), or top, right, bottom and left values\n * for the bounding box calculated according to the provided accuracy.\n * Returns null if the conversion failed.\n */\n function UTMtoLL(utm) {\n\n var UTMNorthing = utm.northing;\n var UTMEasting = utm.easting;\n var zoneLetter = utm.zoneLetter;\n var zoneNumber = utm.zoneNumber;\n // check the ZoneNummber is valid\n if (zoneNumber < 0 || zoneNumber > 60) {\n return null;\n }\n\n var k0 = 0.9996;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var eccPrimeSquared;\n var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));\n var N1, T1, C1, R1, D, M;\n var LongOrigin;\n var mu, phi1Rad;\n\n // remove 500,000 meter offset for longitude\n var x = UTMEasting - 500000.0;\n var y = UTMNorthing;\n\n // We must know somehow if we are in the Northern or Southern\n // hemisphere, this is the only time we use the letter So even\n // if the Zone letter isn't exactly correct it should indicate\n // the hemisphere correctly\n if (zoneLetter < 'N') {\n y -= 10000000.0; // remove 10,000,000 meter offset used\n // for southern hemisphere\n }\n\n // There are 60 zones with zone 1 being at West -180 to -174\n LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin\n // in middle of\n // zone\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n M = y / k0;\n mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));\n\n phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + (151 * e1 * e1 * e1 / 96) * Math.sin(6 * mu);\n // double phi1 = ProjMath.radToDeg(phi1Rad);\n\n N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));\n T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);\n C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);\n R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);\n D = x / (N1 * k0);\n\n var lat = phi1Rad - (N1 * Math.tan(phi1Rad) / R1) * (D * D / 2 - (5 + 3 * T1 + 10 * C1 - 4 * C1 * C1 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C1 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C1 * C1) * D * D * D * D * D * D / 720);\n lat = radToDeg(lat);\n\n var lon = (D - (1 + 2 * T1 + C1) * D * D * D / 6 + (5 - 2 * C1 + 28 * T1 - 3 * C1 * C1 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad);\n lon = LongOrigin + radToDeg(lon);\n\n var result;\n if (utm.accuracy) {\n var topRight = UTMtoLL({\n northing: utm.northing + utm.accuracy,\n easting: utm.easting + utm.accuracy,\n zoneLetter: utm.zoneLetter,\n zoneNumber: utm.zoneNumber\n });\n result = {\n top: topRight.lat,\n right: topRight.lon,\n bottom: lat,\n left: lon\n };\n }\n else {\n result = {\n lat: lat,\n lon: lon\n };\n }\n return result;\n }\n\n /**\n * Calculates the MGRS letter designator for the given latitude.\n *\n * @private\n * @param {number} lat The latitude in WGS84 to get the letter designator\n * for.\n * @return {char} The letter designator.\n */\n function getLetterDesignator(lat) {\n //This is here as an error flag to show that the Latitude is\n //outside MGRS limits\n var LetterDesignator = 'Z';\n\n if ((84 >= lat) && (lat >= 72)) {\n LetterDesignator = 'X';\n }\n else if ((72 > lat) && (lat >= 64)) {\n LetterDesignator = 'W';\n }\n else if ((64 > lat) && (lat >= 56)) {\n LetterDesignator = 'V';\n }\n else if ((56 > lat) && (lat >= 48)) {\n LetterDesignator = 'U';\n }\n else if ((48 > lat) && (lat >= 40)) {\n LetterDesignator = 'T';\n }\n else if ((40 > lat) && (lat >= 32)) {\n LetterDesignator = 'S';\n }\n else if ((32 > lat) && (lat >= 24)) {\n LetterDesignator = 'R';\n }\n else if ((24 > lat) && (lat >= 16)) {\n LetterDesignator = 'Q';\n }\n else if ((16 > lat) && (lat >= 8)) {\n LetterDesignator = 'P';\n }\n else if ((8 > lat) && (lat >= 0)) {\n LetterDesignator = 'N';\n }\n else if ((0 > lat) && (lat >= -8)) {\n LetterDesignator = 'M';\n }\n else if ((-8 > lat) && (lat >= -16)) {\n LetterDesignator = 'L';\n }\n else if ((-16 > lat) && (lat >= -24)) {\n LetterDesignator = 'K';\n }\n else if ((-24 > lat) && (lat >= -32)) {\n LetterDesignator = 'J';\n }\n else if ((-32 > lat) && (lat >= -40)) {\n LetterDesignator = 'H';\n }\n else if ((-40 > lat) && (lat >= -48)) {\n LetterDesignator = 'G';\n }\n else if ((-48 > lat) && (lat >= -56)) {\n LetterDesignator = 'F';\n }\n else if ((-56 > lat) && (lat >= -64)) {\n LetterDesignator = 'E';\n }\n else if ((-64 > lat) && (lat >= -72)) {\n LetterDesignator = 'D';\n }\n else if ((-72 > lat) && (lat >= -80)) {\n LetterDesignator = 'C';\n }\n return LetterDesignator;\n }\n\n /**\n * Encodes a UTM location as MGRS string.\n *\n * @private\n * @param {object} utm An object literal with easting, northing,\n * zoneLetter, zoneNumber\n * @param {number} accuracy Accuracy in digits (1-5).\n * @return {string} MGRS string for the given UTM location.\n */\n function encode(utm, accuracy) {\n // prepend with leading zeroes\n var seasting = \"00000\" + utm.easting,\n snorthing = \"00000\" + utm.northing;\n\n return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);\n }\n\n /**\n * Get the two letter 100k designator for a given UTM easting,\n * northing and zone number value.\n *\n * @private\n * @param {number} easting\n * @param {number} northing\n * @param {number} zoneNumber\n * @return the two letter 100k designator for the given UTM location.\n */\n function get100kID(easting, northing, zoneNumber) {\n var setParm = get100kSetForZone(zoneNumber);\n var setColumn = Math.floor(easting / 100000);\n var setRow = Math.floor(northing / 100000) % 20;\n return getLetter100kID(setColumn, setRow, setParm);\n }\n\n /**\n * Given a UTM zone number, figure out the MGRS 100K set it is in.\n *\n * @private\n * @param {number} i An UTM zone number.\n * @return {number} the 100k set the UTM zone is in.\n */\n function get100kSetForZone(i) {\n var setParm = i % NUM_100K_SETS;\n if (setParm === 0) {\n setParm = NUM_100K_SETS;\n }\n\n return setParm;\n }\n\n /**\n * Get the two-letter MGRS 100k designator given information\n * translated from the UTM northing, easting and zone number.\n *\n * @private\n * @param {number} column the column index as it relates to the MGRS\n * 100k set spreadsheet, created from the UTM easting.\n * Values are 1-8.\n * @param {number} row the row index as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM northing value. Values\n * are from 0-19.\n * @param {number} parm the set block, as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM zone. Values are from\n * 1-60.\n * @return two letter MGRS 100k code.\n */\n function getLetter100kID(column, row, parm) {\n // colOrigin and rowOrigin are the letters at the origin of the set\n var index = parm - 1;\n var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);\n var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index);\n\n // colInt and rowInt are the letters to build to return\n var colInt = colOrigin + column - 1;\n var rowInt = rowOrigin + row;\n var rollover = false;\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n rollover = true;\n }\n\n if (colInt === I || (colOrigin < I && colInt > I) || ((colInt > I || colOrigin < I) && rollover)) {\n colInt++;\n }\n\n if (colInt === O || (colOrigin < O && colInt > O) || ((colInt > O || colOrigin < O) && rollover)) {\n colInt++;\n\n if (colInt === I) {\n colInt++;\n }\n }\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n rollover = true;\n }\n else {\n rollover = false;\n }\n\n if (((rowInt === I) || ((rowOrigin < I) && (rowInt > I))) || (((rowInt > I) || (rowOrigin < I)) && rollover)) {\n rowInt++;\n }\n\n if (((rowInt === O) || ((rowOrigin < O) && (rowInt > O))) || (((rowInt > O) || (rowOrigin < O)) && rollover)) {\n rowInt++;\n\n if (rowInt === I) {\n rowInt++;\n }\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n }\n\n var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);\n return twoLetter;\n }\n\n /**\n * Decode the UTM parameters from a MGRS string.\n *\n * @private\n * @param {string} mgrsString an UPPERCASE coordinate string is expected.\n * @return {object} An object literal with easting, northing, zoneLetter,\n * zoneNumber and accuracy (in meters) properties.\n */\n function decode(mgrsString) {\n\n if (mgrsString && mgrsString.length === 0) {\n throw (\"MGRSPoint coverting from nothing\");\n }\n\n var length = mgrsString.length;\n\n var hunK = null;\n var sb = \"\";\n var testChar;\n var i = 0;\n\n // get Zone number\n while (!(/[A-Z]/).test(testChar = mgrsString.charAt(i))) {\n if (i >= 2) {\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n sb += testChar;\n i++;\n }\n\n var zoneNumber = parseInt(sb, 10);\n\n if (i === 0 || i + 3 > length) {\n // A good MGRS string has to be 4-5 digits long,\n // ##AAA/#AAA at least.\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n\n var zoneLetter = mgrsString.charAt(i++);\n\n // Should we check the zone letter here? Why not.\n if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {\n throw (\"MGRSPoint zone letter \" + zoneLetter + \" not handled: \" + mgrsString);\n }\n\n hunK = mgrsString.substring(i, i += 2);\n\n var set = get100kSetForZone(zoneNumber);\n\n var east100k = getEastingFromChar(hunK.charAt(0), set);\n var north100k = getNorthingFromChar(hunK.charAt(1), set);\n\n // We have a bug where the northing may be 2000000 too low.\n // How\n // do we know when to roll over?\n\n while (north100k < getMinNorthing(zoneLetter)) {\n north100k += 2000000;\n }\n\n // calculate the char index for easting/northing separator\n var remainder = length - i;\n\n if (remainder % 2 !== 0) {\n throw (\"MGRSPoint has to have an even number \\nof digits after the zone letter and two 100km letters - front \\nhalf for easting meters, second half for \\nnorthing meters\" + mgrsString);\n }\n\n var sep = remainder / 2;\n\n var sepEasting = 0.0;\n var sepNorthing = 0.0;\n var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;\n if (sep > 0) {\n accuracyBonus = 100000.0 / Math.pow(10, sep);\n sepEastingString = mgrsString.substring(i, i + sep);\n sepEasting = parseFloat(sepEastingString) * accuracyBonus;\n sepNorthingString = mgrsString.substring(i + sep);\n sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;\n }\n\n easting = sepEasting + east100k;\n northing = sepNorthing + north100k;\n\n return {\n easting: easting,\n northing: northing,\n zoneLetter: zoneLetter,\n zoneNumber: zoneNumber,\n accuracy: accuracyBonus\n };\n }\n\n /**\n * Given the first letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the easting value that\n * should be added to the other, secondary easting value.\n *\n * @private\n * @param {char} e The first letter from a two-letter MGRS 100\u00B4k zone.\n * @param {number} set The MGRS table set for the zone number.\n * @return {number} The easting value for the given letter and set.\n */\n function getEastingFromChar(e, set) {\n // colOrigin is the letter at the origin of the set for the\n // column\n var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);\n var eastingValue = 100000.0;\n var rewindMarker = false;\n\n while (curCol !== e.charCodeAt(0)) {\n curCol++;\n if (curCol === I) {\n curCol++;\n }\n if (curCol === O) {\n curCol++;\n }\n if (curCol > Z) {\n if (rewindMarker) {\n throw (\"Bad character: \" + e);\n }\n curCol = A;\n rewindMarker = true;\n }\n eastingValue += 100000.0;\n }\n\n return eastingValue;\n }\n\n /**\n * Given the second letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the northing value that\n * should be added to the other, secondary northing value. You have to\n * remember that Northings are determined from the equator, and the vertical\n * cycle of letters mean a 2000000 additional northing meters. This happens\n * approx. every 18 degrees of latitude. This method does *NOT* count any\n * additional northings. You have to figure out how many 2000000 meters need\n * to be added for the zone letter of the MGRS coordinate.\n *\n * @private\n * @param {char} n Second letter of the MGRS 100k zone\n * @param {number} set The MGRS table set number, which is dependent on the\n * UTM zone number.\n * @return {number} The northing value for the given letter and set.\n */\n function getNorthingFromChar(n, set) {\n\n if (n > 'V') {\n throw (\"MGRSPoint given invalid Northing \" + n);\n }\n\n // rowOrigin is the letter at the origin of the set for the\n // column\n var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);\n var northingValue = 0.0;\n var rewindMarker = false;\n\n while (curRow !== n.charCodeAt(0)) {\n curRow++;\n if (curRow === I) {\n curRow++;\n }\n if (curRow === O) {\n curRow++;\n }\n // fixing a bug making whole application hang in this loop\n // when 'n' is a wrong character\n if (curRow > V) {\n if (rewindMarker) { // making sure that this loop ends\n throw (\"Bad character: \" + n);\n }\n curRow = A;\n rewindMarker = true;\n }\n northingValue += 100000.0;\n }\n\n return northingValue;\n }\n\n /**\n * The function getMinNorthing returns the minimum northing value of a MGRS\n * zone.\n *\n * Ported from Geotrans' c Lattitude_Band_Value structure table.\n *\n * @private\n * @param {char} zoneLetter The MGRS zone to get the min northing for.\n * @return {number}\n */\n function getMinNorthing(zoneLetter) {\n var northing;\n switch (zoneLetter) {\n case 'C':\n northing = 1100000.0;\n break;\n case 'D':\n northing = 2000000.0;\n break;\n case 'E':\n northing = 2800000.0;\n break;\n case 'F':\n northing = 3700000.0;\n break;\n case 'G':\n northing = 4600000.0;\n break;\n case 'H':\n northing = 5500000.0;\n break;\n case 'J':\n northing = 6400000.0;\n break;\n case 'K':\n northing = 7300000.0;\n break;\n case 'L':\n northing = 8200000.0;\n break;\n case 'M':\n northing = 9100000.0;\n break;\n case 'N':\n northing = 0.0;\n break;\n case 'P':\n northing = 800000.0;\n break;\n case 'Q':\n northing = 1700000.0;\n break;\n case 'R':\n northing = 2600000.0;\n break;\n case 'S':\n northing = 3500000.0;\n break;\n case 'T':\n northing = 4400000.0;\n break;\n case 'U':\n northing = 5300000.0;\n break;\n case 'V':\n northing = 6200000.0;\n break;\n case 'W':\n northing = 7000000.0;\n break;\n case 'X':\n northing = 7900000.0;\n break;\n default:\n northing = -1.0;\n }\n if (northing >= 0.0) {\n return northing;\n }\n else {\n throw (\"Invalid zone letter: \" + zoneLetter);\n }\n\n }\n\n function Point(x, y, z) {\n if (!(this instanceof Point)) {\n return new Point(x, y, z);\n }\n if (Array.isArray(x)) {\n this.x = x[0];\n this.y = x[1];\n this.z = x[2] || 0.0;\n } else if(typeof x === 'object') {\n this.x = x.x;\n this.y = x.y;\n this.z = x.z || 0.0;\n } else if (typeof x === 'string' && typeof y === 'undefined') {\n var coords = x.split(',');\n this.x = parseFloat(coords[0], 10);\n this.y = parseFloat(coords[1], 10);\n this.z = parseFloat(coords[2], 10) || 0.0;\n } else {\n this.x = x;\n this.y = y;\n this.z = z || 0.0;\n }\n console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');\n }\n\n Point.fromMGRS = function(mgrsStr) {\n return new Point(toPoint$1(mgrsStr));\n };\n Point.prototype.toMGRS = function(accuracy) {\n return forward$1([this.x, this.y], accuracy);\n };\n\n var C00 = 1;\n var C02 = 0.25;\n var C04 = 0.046875;\n var C06 = 0.01953125;\n var C08 = 0.01068115234375;\n var C22 = 0.75;\n var C44 = 0.46875;\n var C46 = 0.01302083333333333333;\n var C48 = 0.00712076822916666666;\n var C66 = 0.36458333333333333333;\n var C68 = 0.00569661458333333333;\n var C88 = 0.3076171875;\n\n var pj_enfn = function(es) {\n var en = [];\n en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));\n en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));\n var t = es * es;\n en[2] = t * (C44 - es * (C46 + es * C48));\n t *= es;\n en[3] = t * (C66 - es * C68);\n en[4] = t * es * C88;\n return en;\n };\n\n var pj_mlfn = function(phi, sphi, cphi, en) {\n cphi *= sphi;\n sphi *= sphi;\n return (en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4]))));\n };\n\n var MAX_ITER = 20;\n\n var pj_inv_mlfn = function(arg, es, en) {\n var k = 1 / (1 - es);\n var phi = arg;\n for (var i = MAX_ITER; i; --i) { /* rarely goes over 2 iterations */\n var s = Math.sin(phi);\n var t = 1 - es * s * s;\n //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;\n //phi -= t * (t * Math.sqrt(t)) * k;\n t = (pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;\n phi -= t;\n if (Math.abs(t) < EPSLN) {\n return phi;\n }\n }\n //..reportError(\"cass:pj_inv_mlfn: Convergence error\");\n return phi;\n };\n\n // Heavily based on this tmerc projection implementation\n // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js\n\n function init$2() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = pj_enfn(this.es);\n this.ml0 = pj_mlfn(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n }\n\n /**\n Transverse Mercator Forward - long/lat to x/y\n long/lat in radians\n */\n function forward$2(p) {\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = adjust_lon(lon - this.long0);\n var con;\n var x, y;\n var sin_phi = Math.sin(lat);\n var cos_phi = Math.cos(lat);\n\n if (!this.es) {\n var b = cos_phi * Math.sin(delta_lon);\n\n if ((Math.abs(Math.abs(b) - 1)) < EPSLN) {\n return (93);\n }\n else {\n x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;\n y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));\n b = Math.abs(y);\n\n if (b >= 1) {\n if ((b - 1) > EPSLN) {\n return (93);\n }\n else {\n y = 0;\n }\n }\n else {\n y = Math.acos(y);\n }\n\n if (lat < 0) {\n y = -y;\n }\n\n y = this.a * this.k0 * (y - this.lat0) + this.y0;\n }\n }\n else {\n var al = cos_phi * delta_lon;\n var als = Math.pow(al, 2);\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var tq = Math.abs(cos_phi) > EPSLN ? Math.tan(lat) : 0;\n var t = Math.pow(tq, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n al = al / Math.sqrt(con);\n var ml = pj_mlfn(lat, sin_phi, cos_phi, this.en);\n\n x = this.a * (this.k0 * al * (1 +\n als / 6 * (1 - t + c +\n als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c +\n als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) +\n this.x0;\n\n y = this.a * (this.k0 * (ml - this.ml0 +\n sin_phi * delta_lon * al / 2 * (1 +\n als / 12 * (5 - t + 9 * c + 4 * cs +\n als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c +\n als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) +\n this.y0;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n }\n\n /**\n Transverse Mercator Inverse - x/y to long/lat\n */\n function inverse$2(p) {\n var con, phi;\n var lat, lon;\n var x = (p.x - this.x0) * (1 / this.a);\n var y = (p.y - this.y0) * (1 / this.a);\n\n if (!this.es) {\n var f = Math.exp(x / this.k0);\n var g = 0.5 * (f - 1 / f);\n var temp = this.lat0 + y / this.k0;\n var h = Math.cos(temp);\n con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));\n lat = Math.asin(con);\n\n if (y < 0) {\n lat = -lat;\n }\n\n if ((g === 0) && (h === 0)) {\n lon = 0;\n }\n else {\n lon = adjust_lon(Math.atan2(g, h) + this.long0);\n }\n }\n else { // ellipsoidal form\n con = this.ml0 + y / this.k0;\n phi = pj_inv_mlfn(con, this.es, this.en);\n\n if (Math.abs(phi) < HALF_PI) {\n var sin_phi = Math.sin(phi);\n var cos_phi = Math.cos(phi);\n var tan_phi = Math.abs(cos_phi) > EPSLN ? Math.tan(phi) : 0;\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var t = Math.pow(tan_phi, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n var d = x * Math.sqrt(con) / this.k0;\n var ds = Math.pow(d, 2);\n con = con * tan_phi;\n\n lat = phi - (con * ds / (1 - this.es)) * 0.5 * (1 -\n ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs -\n ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c -\n ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t))));\n\n lon = adjust_lon(this.long0 + (d * (1 -\n ds / 6 * (1 + 2 * t + c -\n ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c -\n ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi));\n }\n else {\n lat = HALF_PI * sign(y);\n lon = 0;\n }\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n }\n\n var names$3 = [\"Fast_Transverse_Mercator\", \"Fast Transverse Mercator\"];\n var tmerc = {\n init: init$2,\n forward: forward$2,\n inverse: inverse$2,\n names: names$3\n };\n\n var sinh = function(x) {\n var r = Math.exp(x);\n r = (r - 1 / r) / 2;\n return r;\n };\n\n var hypot = function(x, y) {\n x = Math.abs(x);\n y = Math.abs(y);\n var a = Math.max(x, y);\n var b = Math.min(x, y) / (a ? a : 1);\n\n return a * Math.sqrt(1 + Math.pow(b, 2));\n };\n\n var log1py = function(x) {\n var y = 1 + x;\n var z = y - 1;\n\n return z === 0 ? x : x * Math.log(y) / z;\n };\n\n var asinhy = function(x) {\n var y = Math.abs(x);\n y = log1py(y * (1 + y / (hypot(1, y) + 1)));\n\n return x < 0 ? -y : y;\n };\n\n var gatg = function(pp, B) {\n var cos_2B = 2 * Math.cos(2 * B);\n var i = pp.length - 1;\n var h1 = pp[i];\n var h2 = 0;\n var h;\n\n while (--i >= 0) {\n h = -h2 + cos_2B * h1 + pp[i];\n h2 = h1;\n h1 = h;\n }\n\n return (B + h * Math.sin(2 * B));\n };\n\n var clens = function(pp, arg_r) {\n var r = 2 * Math.cos(arg_r);\n var i = pp.length - 1;\n var hr1 = pp[i];\n var hr2 = 0;\n var hr;\n\n while (--i >= 0) {\n hr = -hr2 + r * hr1 + pp[i];\n hr2 = hr1;\n hr1 = hr;\n }\n\n return Math.sin(arg_r) * hr;\n };\n\n var cosh = function(x) {\n var r = Math.exp(x);\n r = (r + 1 / r) / 2;\n return r;\n };\n\n var clens_cmplx = function(pp, arg_r, arg_i) {\n var sin_arg_r = Math.sin(arg_r);\n var cos_arg_r = Math.cos(arg_r);\n var sinh_arg_i = sinh(arg_i);\n var cosh_arg_i = cosh(arg_i);\n var r = 2 * cos_arg_r * cosh_arg_i;\n var i = -2 * sin_arg_r * sinh_arg_i;\n var j = pp.length - 1;\n var hr = pp[j];\n var hi1 = 0;\n var hr1 = 0;\n var hi = 0;\n var hr2;\n var hi2;\n\n while (--j >= 0) {\n hr2 = hr1;\n hi2 = hi1;\n hr1 = hr;\n hi1 = hi;\n hr = -hr2 + r * hr1 - i * hi1 + pp[j];\n hi = -hi2 + i * hr1 + r * hi1;\n }\n\n r = sin_arg_r * cosh_arg_i;\n i = cos_arg_r * sinh_arg_i;\n\n return [r * hr - i * hi, r * hi + i * hr];\n };\n\n // Heavily based on this etmerc projection implementation\n // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js\n\n function init$3() {\n if (!this.approx && (isNaN(this.es) || this.es <= 0)) {\n throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION[\"Fast_Transverse_Mercator\"] in the WKT.');\n }\n if (this.approx) {\n // When '+approx' is set, use tmerc instead\n tmerc.init.apply(this);\n this.forward = tmerc.forward;\n this.inverse = tmerc.inverse;\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = gatg(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z));\n }\n\n function forward$3(p) {\n var Ce = adjust_lon(p.x - this.long0);\n var Cn = p.y;\n\n Cn = gatg(this.cbg, Cn);\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);\n Ce = Math.atan2(sin_Ce * cos_Cn, hypot(sin_Cn, cos_Cn * cos_Ce));\n Ce = asinhy(Math.tan(Ce));\n\n var tmp = clens_cmplx(this.gtu, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n\n var x;\n var y;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n x = this.a * (this.Qn * Ce) + this.x0;\n y = this.a * (this.Qn * Cn + this.Zb) + this.y0;\n }\n else {\n x = Infinity;\n y = Infinity;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n }\n\n function inverse$3(p) {\n var Ce = (p.x - this.x0) * (1 / this.a);\n var Cn = (p.y - this.y0) * (1 / this.a);\n\n Cn = (Cn - this.Zb) / this.Qn;\n Ce = Ce / this.Qn;\n\n var lon;\n var lat;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n var tmp = clens_cmplx(this.utg, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n Ce = Math.atan(sinh(Ce));\n\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn));\n Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);\n\n lon = adjust_lon(Ce + this.long0);\n lat = gatg(this.cgb, Cn);\n }\n else {\n lon = Infinity;\n lat = Infinity;\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n }\n\n var names$4 = [\"Extended_Transverse_Mercator\", \"Extended Transverse Mercator\", \"etmerc\", \"Transverse_Mercator\", \"Transverse Mercator\", \"Gauss Kruger\", \"Gauss_Kruger\", \"tmerc\"];\n var etmerc = {\n init: init$3,\n forward: forward$3,\n inverse: inverse$3,\n names: names$4\n };\n\n var adjust_zone = function(zone, lon) {\n if (zone === undefined) {\n zone = Math.floor((adjust_lon(lon) + Math.PI) * 30 / Math.PI) + 1;\n\n if (zone < 0) {\n return 0;\n } else if (zone > 60) {\n return 60;\n }\n }\n return zone;\n };\n\n var dependsOn = 'etmerc';\n function init$4() {\n var zone = adjust_zone(this.zone, this.long0);\n if (zone === undefined) {\n throw new Error('unknown utm zone');\n }\n this.lat0 = 0;\n this.long0 = ((6 * Math.abs(zone)) - 183) * D2R;\n this.x0 = 500000;\n this.y0 = this.utmSouth ? 10000000 : 0;\n this.k0 = 0.9996;\n\n etmerc.init.apply(this);\n this.forward = etmerc.forward;\n this.inverse = etmerc.inverse;\n }\n\n var names$5 = [\"Universal Transverse Mercator System\", \"utm\"];\n var utm = {\n init: init$4,\n names: names$5,\n dependsOn: dependsOn\n };\n\n var srat = function(esinp, exp) {\n return (Math.pow((1 - esinp) / (1 + esinp), exp));\n };\n\n var MAX_ITER$1 = 20;\n function init$6() {\n var sphi = Math.sin(this.lat0);\n var cphi = Math.cos(this.lat0);\n cphi *= cphi;\n this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);\n this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));\n this.phic0 = Math.asin(sphi / this.C);\n this.ratexp = 0.5 * this.C * this.e;\n this.K = Math.tan(0.5 * this.phic0 + FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + FORTPI), this.C) * srat(this.e * sphi, this.ratexp));\n }\n\n function forward$5(p) {\n var lon = p.x;\n var lat = p.y;\n\n p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + FORTPI), this.C) * srat(this.e * Math.sin(lat), this.ratexp)) - HALF_PI;\n p.x = this.C * lon;\n return p;\n }\n\n function inverse$5(p) {\n var DEL_TOL = 1e-14;\n var lon = p.x / this.C;\n var lat = p.y;\n var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C);\n for (var i = MAX_ITER$1; i > 0; --i) {\n lat = 2 * Math.atan(num * srat(this.e * Math.sin(p.y), - 0.5 * this.e)) - HALF_PI;\n if (Math.abs(lat - p.y) < DEL_TOL) {\n break;\n }\n p.y = lat;\n }\n /* convergence failed */\n if (!i) {\n return null;\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$7 = [\"gauss\"];\n var gauss = {\n init: init$6,\n forward: forward$5,\n inverse: inverse$5,\n names: names$7\n };\n\n function init$5() {\n gauss.init.apply(this);\n if (!this.rc) {\n return;\n }\n this.sinc0 = Math.sin(this.phic0);\n this.cosc0 = Math.cos(this.phic0);\n this.R2 = 2 * this.rc;\n if (!this.title) {\n this.title = \"Oblique Stereographic Alternative\";\n }\n }\n\n function forward$4(p) {\n var sinc, cosc, cosl, k;\n p.x = adjust_lon(p.x - this.long0);\n gauss.forward.apply(this, [p]);\n sinc = Math.sin(p.y);\n cosc = Math.cos(p.y);\n cosl = Math.cos(p.x);\n k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);\n p.x = k * cosc * Math.sin(p.x);\n p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);\n p.x = this.a * p.x + this.x0;\n p.y = this.a * p.y + this.y0;\n return p;\n }\n\n function inverse$4(p) {\n var sinc, cosc, lon, lat, rho;\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n if ((rho = hypot(p.x, p.y))) {\n var c = 2 * Math.atan2(rho, this.R2);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);\n lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n gauss.inverse.apply(this, [p]);\n p.x = adjust_lon(p.x + this.long0);\n return p;\n }\n\n var names$6 = [\"Stereographic_North_Pole\", \"Oblique_Stereographic\", \"sterea\",\"Oblique Stereographic Alternative\",\"Double_Stereographic\"];\n var sterea = {\n init: init$5,\n forward: forward$4,\n inverse: inverse$4,\n names: names$6\n };\n\n function ssfn_(phit, sinphi, eccen) {\n sinphi *= eccen;\n return (Math.tan(0.5 * (HALF_PI + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen));\n }\n\n function init$7() {\n\n // setting default parameters\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n\n this.coslat0 = Math.cos(this.lat0);\n this.sinlat0 = Math.sin(this.lat0);\n if (this.sphere) {\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {\n this.k0 = 0.5 * (1 + sign(this.lat0) * Math.sin(this.lat_ts));\n }\n }\n else {\n if (Math.abs(this.coslat0) <= EPSLN) {\n if (this.lat0 > 0) {\n //North pole\n //trace('stere:north pole');\n this.con = 1;\n }\n else {\n //South pole\n //trace('stere:south pole');\n this.con = -1;\n }\n }\n this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN && Math.abs(Math.cos(this.lat_ts)) > EPSLN) {\n // When k0 is 1 (default value) and lat_ts is a vaild number and lat0 is at a pole and lat_ts is not at a pole\n // Recalculate k0 using formula 21-35 from p161 of Snyder, 1987\n this.k0 = 0.5 * this.cons * msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / tsfnz(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));\n }\n this.ms1 = msfnz(this.e, this.sinlat0, this.coslat0);\n this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - HALF_PI;\n this.cosX0 = Math.cos(this.X0);\n this.sinX0 = Math.sin(this.X0);\n }\n }\n\n // Stereographic forward equations--mapping lat,long to x,y\n function forward$6(p) {\n var lon = p.x;\n var lat = p.y;\n var sinlat = Math.sin(lat);\n var coslat = Math.cos(lat);\n var A, X, sinX, cosX, ts, rh;\n var dlon = adjust_lon(lon - this.long0);\n\n if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {\n //case of the origine point\n //trace('stere:this is the origin point');\n p.x = NaN;\n p.y = NaN;\n return p;\n }\n if (this.sphere) {\n //trace('stere:sphere case');\n A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));\n p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;\n p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;\n return p;\n }\n else {\n X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - HALF_PI;\n cosX = Math.cos(X);\n sinX = Math.sin(X);\n if (Math.abs(this.coslat0) <= EPSLN) {\n ts = tsfnz(this.e, lat * this.con, this.con * sinlat);\n rh = 2 * this.a * this.k0 * ts / this.cons;\n p.x = this.x0 + rh * Math.sin(lon - this.long0);\n p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0);\n //trace(p.toString());\n return p;\n }\n else if (Math.abs(this.sinlat0) < EPSLN) {\n //Eq\n //trace('stere:equateur');\n A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));\n p.y = A * sinX;\n }\n else {\n //other case\n //trace('stere:normal case');\n A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));\n p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;\n }\n p.x = A * cosX * Math.sin(dlon) + this.x0;\n }\n //trace(p.toString());\n return p;\n }\n\n //* Stereographic inverse equations--mapping x,y to lat/long\n function inverse$6(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat, ts, ce, Chi;\n var rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (this.sphere) {\n var c = 2 * Math.atan(rh / (2 * this.a * this.k0));\n lon = this.long0;\n lat = this.lat0;\n if (rh <= EPSLN) {\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);\n if (Math.abs(this.coslat0) < EPSLN) {\n if (this.lat0 > 0) {\n lon = adjust_lon(this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));\n }\n }\n else {\n lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n if (Math.abs(this.coslat0) <= EPSLN) {\n if (rh <= EPSLN) {\n lat = this.lat0;\n lon = this.long0;\n p.x = lon;\n p.y = lat;\n //trace(p.toString());\n return p;\n }\n p.x *= this.con;\n p.y *= this.con;\n ts = rh * this.cons / (2 * this.a * this.k0);\n lat = this.con * phi2z(this.e, ts);\n lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));\n lon = this.long0;\n if (rh <= EPSLN) {\n Chi = this.X0;\n }\n else {\n Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);\n lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));\n }\n lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi)));\n }\n }\n p.x = lon;\n p.y = lat;\n\n //trace(p.toString());\n return p;\n\n }\n\n var names$8 = [\"stere\", \"Stereographic_South_Pole\", \"Polar Stereographic (variant B)\", \"Polar_Stereographic\"];\n var stere = {\n init: init$7,\n forward: forward$6,\n inverse: inverse$6,\n names: names$8,\n ssfn_: ssfn_\n };\n\n /*\n references:\n Formules et constantes pour le Calcul pour la\n projection cylindrique conforme \u00E0 axe oblique et pour la transformation entre\n des syst\u00E8mes de r\u00E9f\u00E9rence.\n http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf\n */\n\n function init$8() {\n var phy0 = this.lat0;\n this.lambda0 = this.long0;\n var sinPhy0 = Math.sin(phy0);\n var semiMajorAxis = this.a;\n var invF = this.rf;\n var flattening = 1 / invF;\n var e2 = 2 * flattening - Math.pow(flattening, 2);\n var e = this.e = Math.sqrt(e2);\n this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));\n this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));\n this.b0 = Math.asin(sinPhy0 / this.alpha);\n var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));\n var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));\n var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));\n this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;\n }\n\n function forward$7(p) {\n var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));\n var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));\n var S = -this.alpha * (Sa1 + Sa2) + this.K;\n\n // spheric latitude\n var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4);\n\n // spheric longitude\n var I = this.alpha * (p.x - this.lambda0);\n\n // psoeudo equatorial rotation\n var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));\n\n var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));\n\n p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;\n p.x = this.R * rotI + this.x0;\n return p;\n }\n\n function inverse$7(p) {\n var Y = p.x - this.x0;\n var X = p.y - this.y0;\n\n var rotI = Y / this.R;\n var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);\n\n var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));\n var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));\n\n var lambda = this.lambda0 + I / this.alpha;\n\n var S = 0;\n var phy = b;\n var prevPhy = -1000;\n var iteration = 0;\n while (Math.abs(phy - prevPhy) > 0.0000001) {\n if (++iteration > 20) {\n //...reportError(\"omercFwdInfinity\");\n return;\n }\n //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));\n S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2));\n prevPhy = phy;\n phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;\n }\n\n p.x = lambda;\n p.y = phy;\n return p;\n }\n\n var names$9 = [\"somerc\"];\n var somerc = {\n init: init$8,\n forward: forward$7,\n inverse: inverse$7,\n names: names$9\n };\n\n var TOL = 1e-7;\n\n function isTypeA(P) {\n var typeAProjections = ['Hotine_Oblique_Mercator','Hotine_Oblique_Mercator_Azimuth_Natural_Origin'];\n var projectionName = typeof P.PROJECTION === \"object\" ? Object.keys(P.PROJECTION)[0] : P.PROJECTION;\n \n return 'no_uoff' in P || 'no_off' in P || typeAProjections.indexOf(projectionName) !== -1;\n }\n\n\n /* Initialize the Oblique Mercator projection\n ------------------------------------------*/\n function init$9() { \n var con, com, cosph0, D, F, H, L, sinph0, p, J, gamma = 0,\n gamma0, lamc = 0, lam1 = 0, lam2 = 0, phi1 = 0, phi2 = 0, alpha_c = 0;\n \n // only Type A uses the no_off or no_uoff property\n // https://github.com/OSGeo/proj.4/issues/104\n this.no_off = isTypeA(this);\n this.no_rot = 'no_rot' in this;\n \n var alp = false;\n if (\"alpha\" in this) {\n alp = true;\n }\n\n var gam = false;\n if (\"rectified_grid_angle\" in this) {\n gam = true;\n }\n\n if (alp) {\n alpha_c = this.alpha;\n }\n \n if (gam) {\n gamma = (this.rectified_grid_angle * D2R);\n }\n \n if (alp || gam) {\n lamc = this.longc;\n } else {\n lam1 = this.long1;\n phi1 = this.lat1;\n lam2 = this.long2;\n phi2 = this.lat2;\n \n if (Math.abs(phi1 - phi2) <= TOL || (con = Math.abs(phi1)) <= TOL ||\n Math.abs(con - HALF_PI) <= TOL || Math.abs(Math.abs(this.lat0) - HALF_PI) <= TOL ||\n Math.abs(Math.abs(phi2) - HALF_PI) <= TOL) {\n throw new Error();\n }\n }\n \n var one_es = 1.0 - this.es;\n com = Math.sqrt(one_es);\n \n if (Math.abs(this.lat0) > EPSLN) {\n sinph0 = Math.sin(this.lat0);\n cosph0 = Math.cos(this.lat0);\n con = 1 - this.es * sinph0 * sinph0;\n this.B = cosph0 * cosph0;\n this.B = Math.sqrt(1 + this.es * this.B * this.B / one_es);\n this.A = this.B * this.k0 * com / con;\n D = this.B * com / (cosph0 * Math.sqrt(con));\n F = D * D -1;\n \n if (F <= 0) {\n F = 0;\n } else {\n F = Math.sqrt(F);\n if (this.lat0 < 0) {\n F = -F;\n }\n }\n \n this.E = F += D;\n this.E *= Math.pow(tsfnz(this.e, this.lat0, sinph0), this.B);\n } else {\n this.B = 1 / com;\n this.A = this.k0;\n this.E = D = F = 1;\n }\n \n if (alp || gam) {\n if (alp) {\n gamma0 = Math.asin(Math.sin(alpha_c) / D);\n if (!gam) {\n gamma = alpha_c;\n }\n } else {\n gamma0 = gamma;\n alpha_c = Math.asin(D * Math.sin(gamma0));\n }\n this.lam0 = lamc - Math.asin(0.5 * (F - 1 / F) * Math.tan(gamma0)) / this.B;\n } else {\n H = Math.pow(tsfnz(this.e, phi1, Math.sin(phi1)), this.B);\n L = Math.pow(tsfnz(this.e, phi2, Math.sin(phi2)), this.B);\n F = this.E / H;\n p = (L - H) / (L + H);\n J = this.E * this.E;\n J = (J - L * H) / (J + L * H);\n con = lam1 - lam2;\n \n if (con < -Math.pi) {\n lam2 -=TWO_PI;\n } else if (con > Math.pi) {\n lam2 += TWO_PI;\n }\n \n this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B);\n gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0)) / (F - 1 / F));\n gamma = alpha_c = Math.asin(D * Math.sin(gamma0));\n }\n \n this.singam = Math.sin(gamma0);\n this.cosgam = Math.cos(gamma0);\n this.sinrot = Math.sin(gamma);\n this.cosrot = Math.cos(gamma);\n \n this.rB = 1 / this.B;\n this.ArB = this.A * this.rB;\n this.BrA = 1 / this.ArB;\n if (this.no_off) {\n this.u_0 = 0;\n } else {\n this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(D * D - 1) / Math.cos(alpha_c)));\n \n if (this.lat0 < 0) {\n this.u_0 = - this.u_0;\n } \n }\n \n F = 0.5 * gamma0;\n this.v_pole_n = this.ArB * Math.log(Math.tan(FORTPI - F));\n this.v_pole_s = this.ArB * Math.log(Math.tan(FORTPI + F));\n }\n\n\n /* Oblique Mercator forward equations--mapping lat,long to x,y\n ----------------------------------------------------------*/\n function forward$8(p) {\n var coords = {};\n var S, T, U, V, W, temp, u, v;\n p.x = p.x - this.lam0;\n \n if (Math.abs(Math.abs(p.y) - HALF_PI) > EPSLN) {\n W = this.E / Math.pow(tsfnz(this.e, p.y, Math.sin(p.y)), this.B);\n \n temp = 1 / W;\n S = 0.5 * (W - temp);\n T = 0.5 * (W + temp);\n V = Math.sin(this.B * p.x);\n U = (S * this.singam - V * this.cosgam) / T;\n \n if (Math.abs(Math.abs(U) - 1.0) < EPSLN) {\n throw new Error();\n }\n \n v = 0.5 * this.ArB * Math.log((1 - U)/(1 + U));\n temp = Math.cos(this.B * p.x);\n \n if (Math.abs(temp) < TOL) {\n u = this.A * p.x;\n } else {\n u = this.ArB * Math.atan2((S * this.cosgam + V * this.singam), temp);\n } \n } else {\n v = p.y > 0 ? this.v_pole_n : this.v_pole_s;\n u = this.ArB * p.y;\n }\n \n if (this.no_rot) {\n coords.x = u;\n coords.y = v;\n } else {\n u -= this.u_0;\n coords.x = v * this.cosrot + u * this.sinrot;\n coords.y = u * this.cosrot - v * this.sinrot;\n }\n \n coords.x = (this.a * coords.x + this.x0);\n coords.y = (this.a * coords.y + this.y0);\n \n return coords;\n }\n\n function inverse$8(p) {\n var u, v, Qp, Sp, Tp, Vp, Up;\n var coords = {};\n \n p.x = (p.x - this.x0) * (1.0 / this.a);\n p.y = (p.y - this.y0) * (1.0 / this.a);\n\n if (this.no_rot) {\n v = p.y;\n u = p.x;\n } else {\n v = p.x * this.cosrot - p.y * this.sinrot;\n u = p.y * this.cosrot + p.x * this.sinrot + this.u_0;\n }\n \n Qp = Math.exp(-this.BrA * v);\n Sp = 0.5 * (Qp - 1 / Qp);\n Tp = 0.5 * (Qp + 1 / Qp);\n Vp = Math.sin(this.BrA * u);\n Up = (Vp * this.cosgam + Sp * this.singam) / Tp;\n \n if (Math.abs(Math.abs(Up) - 1) < EPSLN) {\n coords.x = 0;\n coords.y = Up < 0 ? -HALF_PI : HALF_PI;\n } else {\n coords.y = this.E / Math.sqrt((1 + Up) / (1 - Up));\n coords.y = phi2z(this.e, Math.pow(coords.y, 1 / this.B));\n \n if (coords.y === Infinity) {\n throw new Error();\n }\n \n coords.x = -this.rB * Math.atan2((Sp * this.cosgam - Vp * this.singam), Math.cos(this.BrA * u));\n }\n \n coords.x += this.lam0;\n \n return coords;\n }\n\n var names$10 = [\"Hotine_Oblique_Mercator\", \"Hotine Oblique Mercator\", \"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\", \"Hotine_Oblique_Mercator_Two_Point_Natural_Origin\", \"Hotine_Oblique_Mercator_Azimuth_Center\", \"Oblique_Mercator\", \"omerc\"];\n var omerc = {\n init: init$9,\n forward: forward$8,\n inverse: inverse$8,\n names: names$10\n };\n\n function init$10() {\n \n //double lat0; /* the reference latitude */\n //double long0; /* the reference longitude */\n //double lat1; /* first standard parallel */\n //double lat2; /* second standard parallel */\n //double r_maj; /* major axis */\n //double r_min; /* minor axis */\n //double false_east; /* x offset in meters */\n //double false_north; /* y offset in meters */\n \n //the above value can be set with proj4.defs\n //example: proj4.defs(\"EPSG:2154\",\"+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\");\n\n if (!this.lat2) {\n this.lat2 = this.lat1;\n } //if lat2 is not defined\n if (!this.k0) {\n this.k0 = 1;\n }\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < EPSLN) {\n return;\n }\n\n var temp = this.b / this.a;\n this.e = Math.sqrt(1 - temp * temp);\n\n var sin1 = Math.sin(this.lat1);\n var cos1 = Math.cos(this.lat1);\n var ms1 = msfnz(this.e, sin1, cos1);\n var ts1 = tsfnz(this.e, this.lat1, sin1);\n\n var sin2 = Math.sin(this.lat2);\n var cos2 = Math.cos(this.lat2);\n var ms2 = msfnz(this.e, sin2, cos2);\n var ts2 = tsfnz(this.e, this.lat2, sin2);\n\n var ts0 = tsfnz(this.e, this.lat0, Math.sin(this.lat0));\n\n if (Math.abs(this.lat1 - this.lat2) > EPSLN) {\n this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);\n }\n else {\n this.ns = sin1;\n }\n if (isNaN(this.ns)) {\n this.ns = sin1;\n }\n this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));\n this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);\n if (!this.title) {\n this.title = \"Lambert Conformal Conic\";\n }\n }\n\n // Lambert Conformal conic forward equations--mapping lat,long to x,y\n // -----------------------------------------------------------------\n function forward$9(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n // singular cases :\n if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) {\n lat = sign(lat) * (HALF_PI - 2 * EPSLN);\n }\n\n var con = Math.abs(Math.abs(lat) - HALF_PI);\n var ts, rh1;\n if (con > EPSLN) {\n ts = tsfnz(this.e, lat, Math.sin(lat));\n rh1 = this.a * this.f0 * Math.pow(ts, this.ns);\n }\n else {\n con = lat * this.ns;\n if (con <= 0) {\n return null;\n }\n rh1 = 0;\n }\n var theta = this.ns * adjust_lon(lon - this.long0);\n p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;\n p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;\n\n return p;\n }\n\n // Lambert Conformal Conic inverse equations--mapping x,y to lat/long\n // -----------------------------------------------------------------\n function inverse$9(p) {\n\n var rh1, con, ts;\n var lat, lon;\n var x = (p.x - this.x0) / this.k0;\n var y = (this.rh - (p.y - this.y0) / this.k0);\n if (this.ns > 0) {\n rh1 = Math.sqrt(x * x + y * y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(x * x + y * y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2((con * x), (con * y));\n }\n if ((rh1 !== 0) || (this.ns > 0)) {\n con = 1 / this.ns;\n ts = Math.pow((rh1 / (this.a * this.f0)), con);\n lat = phi2z(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n else {\n lat = -HALF_PI;\n }\n lon = adjust_lon(theta / this.ns + this.long0);\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$11 = [\n \"Lambert Tangential Conformal Conic Projection\",\n \"Lambert_Conformal_Conic\",\n \"Lambert_Conformal_Conic_1SP\",\n \"Lambert_Conformal_Conic_2SP\",\n \"lcc\",\n \"Lambert Conic Conformal (1SP)\",\n \"Lambert Conic Conformal (2SP)\"\n ];\n\n var lcc = {\n init: init$10,\n forward: forward$9,\n inverse: inverse$9,\n names: names$11\n };\n\n function init$11() {\n this.a = 6377397.155;\n this.es = 0.006674372230614;\n this.e = Math.sqrt(this.es);\n if (!this.lat0) {\n this.lat0 = 0.863937979737193;\n }\n if (!this.long0) {\n this.long0 = 0.7417649320975901 - 0.308341501185665;\n }\n /* if scale not set default to 0.9999 */\n if (!this.k0) {\n this.k0 = 0.9999;\n }\n this.s45 = 0.785398163397448; /* 45 */\n this.s90 = 2 * this.s45;\n this.fi0 = this.lat0;\n this.e2 = this.es;\n this.e = Math.sqrt(this.e2);\n this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2));\n this.uq = 1.04216856380474;\n this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);\n this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);\n this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;\n this.k1 = this.k0;\n this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));\n this.s0 = 1.37008346281555;\n this.n = Math.sin(this.s0);\n this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);\n this.ad = this.s90 - this.uq;\n }\n\n /* ellipsoid */\n /* calculate xy from lat/lon */\n /* Constants, identical to inverse transform function */\n function forward$10(p) {\n var gfi, u, deltav, s, d, eps, ro;\n var lon = p.x;\n var lat = p.y;\n var delta_lon = adjust_lon(lon - this.long0);\n /* Transformation */\n gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2));\n u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);\n deltav = -delta_lon * this.alfa;\n s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));\n d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));\n eps = this.n * d;\n ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);\n p.y = ro * Math.cos(eps) / 1;\n p.x = ro * Math.sin(eps) / 1;\n\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n return (p);\n }\n\n /* calculate lat/lon from xy */\n function inverse$10(p) {\n var u, deltav, s, d, eps, ro, fi1;\n var ok;\n\n /* Transformation */\n /* revert y, x*/\n var tmp = p.x;\n p.x = p.y;\n p.y = tmp;\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n ro = Math.sqrt(p.x * p.x + p.y * p.y);\n eps = Math.atan2(p.y, p.x);\n d = eps / Math.sin(this.s0);\n s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);\n u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));\n deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));\n p.x = this.long0 - deltav / this.alfa;\n fi1 = u;\n ok = 0;\n var iter = 0;\n do {\n p.y = 2 * (Math.atan(Math.pow(this.k, - 1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45);\n if (Math.abs(fi1 - p.y) < 0.0000000001) {\n ok = 1;\n }\n fi1 = p.y;\n iter += 1;\n } while (ok === 0 && iter < 15);\n if (iter >= 15) {\n return null;\n }\n\n return (p);\n }\n\n var names$12 = [\"Krovak\", \"krovak\"];\n var krovak = {\n init: init$11,\n forward: forward$10,\n inverse: inverse$10,\n names: names$12\n };\n\n var mlfn = function(e0, e1, e2, e3, phi) {\n return (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi));\n };\n\n var e0fn = function(x) {\n return (1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x)));\n };\n\n var e1fn = function(x) {\n return (0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x)));\n };\n\n var e2fn = function(x) {\n return (0.05859375 * x * x * (1 + 0.75 * x));\n };\n\n var e3fn = function(x) {\n return (x * x * x * (35 / 3072));\n };\n\n var gN = function(a, e, sinphi) {\n var temp = e * sinphi;\n return a / Math.sqrt(1 - temp * temp);\n };\n\n var adjust_lat = function(x) {\n return (Math.abs(x) < HALF_PI) ? x : (x - (sign(x) * Math.PI));\n };\n\n var imlfn = function(ml, e0, e1, e2, e3) {\n var phi;\n var dphi;\n\n phi = ml / e0;\n for (var i = 0; i < 15; i++) {\n dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //..reportError(\"IMLFN-CONV:Latitude failed to converge after 15 iterations\");\n return NaN;\n };\n\n function init$12() {\n if (!this.sphere) {\n this.e0 = e0fn(this.es);\n this.e1 = e1fn(this.es);\n this.e2 = e2fn(this.es);\n this.e3 = e3fn(this.es);\n this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);\n }\n }\n\n /* Cassini forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\n function forward$11(p) {\n\n /* Forward equations\n -----------------*/\n var x, y;\n var lam = p.x;\n var phi = p.y;\n lam = adjust_lon(lam - this.long0);\n\n if (this.sphere) {\n x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));\n y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);\n }\n else {\n //ellipsoid\n var sinphi = Math.sin(phi);\n var cosphi = Math.cos(phi);\n var nl = gN(this.a, this.e, sinphi);\n var tl = Math.tan(phi) * Math.tan(phi);\n var al = lam * Math.cos(phi);\n var asq = al * al;\n var cl = this.es * cosphi * cosphi / (1 - this.es);\n var ml = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);\n\n x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));\n y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);\n\n\n }\n\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n }\n\n /* Inverse equations\n -----------------*/\n function inverse$11(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var phi, lam;\n\n if (this.sphere) {\n var dd = y + this.lat0;\n phi = Math.asin(Math.sin(dd) * Math.cos(x));\n lam = Math.atan2(Math.tan(x), Math.cos(dd));\n }\n else {\n /* ellipsoid */\n var ml1 = this.ml0 / this.a + y;\n var phi1 = imlfn(ml1, this.e0, this.e1, this.e2, this.e3);\n if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) {\n p.x = this.long0;\n p.y = HALF_PI;\n if (y < 0) {\n p.y *= -1;\n }\n return p;\n }\n var nl1 = gN(this.a, this.e, Math.sin(phi1));\n\n var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);\n var tl1 = Math.pow(Math.tan(phi1), 2);\n var dl = x * this.a / nl1;\n var dsq = dl * dl;\n phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);\n lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);\n\n }\n\n p.x = adjust_lon(lam + this.long0);\n p.y = adjust_lat(phi);\n return p;\n\n }\n\n var names$13 = [\"Cassini\", \"Cassini_Soldner\", \"cass\"];\n var cass = {\n init: init$12,\n forward: forward$11,\n inverse: inverse$11,\n names: names$13\n };\n\n var qsfnz = function(eccent, sinphi) {\n var con;\n if (eccent > 1.0e-7) {\n con = eccent * sinphi;\n return ((1 - eccent * eccent) * (sinphi / (1 - con * con) - (0.5 / eccent) * Math.log((1 - con) / (1 + con))));\n }\n else {\n return (2 * sinphi);\n }\n };\n\n /*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\n var S_POLE = 1;\n\n var N_POLE = 2;\n var EQUIT = 3;\n var OBLIQ = 4;\n\n /* Initialize the Lambert Azimuthal Equal Area projection\n ------------------------------------------------------*/\n function init$13() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - HALF_PI) < EPSLN) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < EPSLN) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = qsfnz(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = qsfnz(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n }\n\n /* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\n function forward$12(p) {\n\n /* Forward equations\n -----------------*/\n var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;\n var lam = p.x;\n var phi = p.y;\n\n lam = adjust_lon(lam - this.long0);\n if (this.sphere) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n coslam = Math.cos(lam);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n y = (this.mode === this.EQUIT) ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n if (y <= EPSLN) {\n return null;\n }\n y = Math.sqrt(2 / y);\n x = y * cosphi * Math.sin(lam);\n y *= (this.mode === this.EQUIT) ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n coslam = -coslam;\n }\n if (Math.abs(phi + this.lat0) < EPSLN) {\n return null;\n }\n y = FORTPI - phi * 0.5;\n y = 2 * ((this.mode === this.S_POLE) ? Math.cos(y) : Math.sin(y));\n x = y * Math.sin(lam);\n y *= coslam;\n }\n }\n else {\n sinb = 0;\n cosb = 0;\n b = 0;\n coslam = Math.cos(lam);\n sinlam = Math.sin(lam);\n sinphi = Math.sin(phi);\n q = qsfnz(this.e, sinphi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinb = q / this.qp;\n cosb = Math.sqrt(1 - sinb * sinb);\n }\n switch (this.mode) {\n case this.OBLIQ:\n b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;\n break;\n case this.EQUIT:\n b = 1 + cosb * coslam;\n break;\n case this.N_POLE:\n b = HALF_PI + phi;\n q = this.qp - q;\n break;\n case this.S_POLE:\n b = phi - HALF_PI;\n q = this.qp + q;\n break;\n }\n if (Math.abs(b) < EPSLN) {\n return null;\n }\n switch (this.mode) {\n case this.OBLIQ:\n case this.EQUIT:\n b = Math.sqrt(2 / b);\n if (this.mode === this.OBLIQ) {\n y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);\n }\n else {\n y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;\n }\n x = this.xmf * b * cosb * sinlam;\n break;\n case this.N_POLE:\n case this.S_POLE:\n if (q >= 0) {\n x = (b = Math.sqrt(q)) * sinlam;\n y = coslam * ((this.mode === this.S_POLE) ? b : -b);\n }\n else {\n x = y = 0;\n }\n break;\n }\n }\n\n p.x = this.a * x + this.x0;\n p.y = this.a * y + this.y0;\n return p;\n }\n\n /* Inverse equations\n -----------------*/\n function inverse$12(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var lam, phi, cCe, sCe, q, rho, ab;\n if (this.sphere) {\n var cosz = 0,\n rh, sinz = 0;\n\n rh = Math.sqrt(x * x + y * y);\n phi = rh * 0.5;\n if (phi > 1) {\n return null;\n }\n phi = 2 * Math.asin(phi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinz = Math.sin(phi);\n cosz = Math.cos(phi);\n }\n switch (this.mode) {\n case this.EQUIT:\n phi = (Math.abs(rh) <= EPSLN) ? 0 : Math.asin(y * sinz / rh);\n x *= sinz;\n y = cosz * rh;\n break;\n case this.OBLIQ:\n phi = (Math.abs(rh) <= EPSLN) ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);\n x *= sinz * this.cosph0;\n y = (cosz - Math.sin(phi) * this.sinph0) * rh;\n break;\n case this.N_POLE:\n y = -y;\n phi = HALF_PI - phi;\n break;\n case this.S_POLE:\n phi -= HALF_PI;\n break;\n }\n lam = (y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ)) ? 0 : Math.atan2(x, y);\n }\n else {\n ab = 0;\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n x /= this.dd;\n y *= this.dd;\n rho = Math.sqrt(x * x + y * y);\n if (rho < EPSLN) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n sCe = 2 * Math.asin(0.5 * rho / this.rq);\n cCe = Math.cos(sCe);\n x *= (sCe = Math.sin(sCe));\n if (this.mode === this.OBLIQ) {\n ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;\n q = this.qp * ab;\n y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;\n }\n else {\n ab = y * sCe / rho;\n q = this.qp * ab;\n y = rho * cCe;\n }\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n y = -y;\n }\n q = (x * x + y * y);\n if (!q) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n ab = 1 - q / this.qp;\n if (this.mode === this.S_POLE) {\n ab = -ab;\n }\n }\n lam = Math.atan2(x, y);\n phi = authlat(Math.asin(ab), this.apa);\n }\n\n p.x = adjust_lon(this.long0 + lam);\n p.y = phi;\n return p;\n }\n\n /* determine latitude from authalic latitude */\n var P00 = 0.33333333333333333333;\n\n var P01 = 0.17222222222222222222;\n var P02 = 0.10257936507936507936;\n var P10 = 0.06388888888888888888;\n var P11 = 0.06640211640211640211;\n var P20 = 0.01641501294219154443;\n\n function authset(es) {\n var t;\n var APA = [];\n APA[0] = es * P00;\n t = es * es;\n APA[0] += t * P01;\n APA[1] = t * P10;\n t *= es;\n APA[0] += t * P02;\n APA[1] += t * P11;\n APA[2] = t * P20;\n return APA;\n }\n\n function authlat(beta, APA) {\n var t = beta + beta;\n return (beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t));\n }\n\n var names$14 = [\"Lambert Azimuthal Equal Area\", \"Lambert_Azimuthal_Equal_Area\", \"laea\"];\n var laea = {\n init: init$13,\n forward: forward$12,\n inverse: inverse$12,\n names: names$14,\n S_POLE: S_POLE,\n N_POLE: N_POLE,\n EQUIT: EQUIT,\n OBLIQ: OBLIQ\n };\n\n var asinz = function(x) {\n if (Math.abs(x) > 1) {\n x = (x > 1) ? 1 : -1;\n }\n return Math.asin(x);\n };\n\n function init$14() {\n\n if (Math.abs(this.lat1 + this.lat2) < EPSLN) {\n return;\n }\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e3 = Math.sqrt(this.es);\n\n this.sin_po = Math.sin(this.lat1);\n this.cos_po = Math.cos(this.lat1);\n this.t1 = this.sin_po;\n this.con = this.sin_po;\n this.ms1 = msfnz(this.e3, this.sin_po, this.cos_po);\n this.qs1 = qsfnz(this.e3, this.sin_po);\n\n this.sin_po = Math.sin(this.lat2);\n this.cos_po = Math.cos(this.lat2);\n this.t2 = this.sin_po;\n this.ms2 = msfnz(this.e3, this.sin_po, this.cos_po);\n this.qs2 = qsfnz(this.e3, this.sin_po);\n\n this.sin_po = Math.sin(this.lat0);\n this.cos_po = Math.cos(this.lat0);\n this.t3 = this.sin_po;\n this.qs0 = qsfnz(this.e3, this.sin_po);\n\n if (Math.abs(this.lat1 - this.lat2) > EPSLN) {\n this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);\n }\n else {\n this.ns0 = this.con;\n }\n this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;\n this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;\n }\n\n /* Albers Conical Equal Area forward equations--mapping lat,long to x,y\n -------------------------------------------------------------------*/\n function forward$13(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n this.sin_phi = Math.sin(lat);\n this.cos_phi = Math.cos(lat);\n\n var qs = qsfnz(this.e3, this.sin_phi);\n var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;\n var theta = this.ns0 * adjust_lon(lon - this.long0);\n var x = rh1 * Math.sin(theta) + this.x0;\n var y = this.rh - rh1 * Math.cos(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$13(p) {\n var rh1, qs, con, theta, lon, lat;\n\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n if (this.ns0 >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n con = rh1 * this.ns0 / this.a;\n if (this.sphere) {\n lat = Math.asin((this.c - con * con) / (2 * this.ns0));\n }\n else {\n qs = (this.c - con * con) / this.ns0;\n lat = this.phi1z(this.e3, qs);\n }\n\n lon = adjust_lon(theta / this.ns0 + this.long0);\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n /* Function to compute phi1, the latitude for the inverse of the\n Albers Conical Equal-Area projection.\n -------------------------------------------*/\n function phi1z(eccent, qs) {\n var sinphi, cosphi, con, com, dphi;\n var phi = asinz(0.5 * qs);\n if (eccent < EPSLN) {\n return phi;\n }\n\n var eccnts = eccent * eccent;\n for (var i = 1; i <= 25; i++) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n con = eccent * sinphi;\n com = 1 - con * con;\n dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi = phi + dphi;\n if (Math.abs(dphi) <= 1e-7) {\n return phi;\n }\n }\n return null;\n }\n\n var names$15 = [\"Albers_Conic_Equal_Area\", \"Albers\", \"aea\"];\n var aea = {\n init: init$14,\n forward: forward$13,\n inverse: inverse$13,\n names: names$15,\n phi1z: phi1z\n };\n\n /*\n reference:\n Wolfram Mathworld \"Gnomonic Projection\"\n http://mathworld.wolfram.com/GnomonicProjection.html\n Accessed: 12th November 2009\n */\n function init$15() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n // Approximation for projecting points to the horizon (infinity)\n this.infinity_dist = 1000 * this.a;\n this.rc = 1;\n }\n\n /* Gnomonic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\n function forward$14(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g;\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = adjust_lon(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= EPSLN)) {\n x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;\n }\n else {\n\n // Point is in the opposing hemisphere and is unprojectable\n // We still need to return a reasonable point, so we project\n // to infinity, on a bearing\n // equivalent to the northern hemisphere equivalent\n // This is a reasonable approximation for short shapes and lines that\n // straddle the horizon.\n\n x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);\n y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n\n }\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$14(p) {\n var rh; /* Rho */\n var sinc, cosc;\n var c;\n var lon, lat;\n\n /* Inverse equations\n -----------------*/\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n\n if ((rh = Math.sqrt(p.x * p.x + p.y * p.y))) {\n c = Math.atan2(rh, this.rc);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n\n lat = asinz(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh);\n lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);\n lon = adjust_lon(this.long0 + lon);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$16 = [\"gnom\"];\n var gnom = {\n init: init$15,\n forward: forward$14,\n inverse: inverse$14,\n names: names$16\n };\n\n var iqsfnz = function(eccent, q) {\n var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));\n if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {\n if (q < 0) {\n return (-1 * HALF_PI);\n }\n else {\n return HALF_PI;\n }\n }\n //var phi = 0.5* q/(1-eccent*eccent);\n var phi = Math.asin(0.5 * q);\n var dphi;\n var sin_phi;\n var cos_phi;\n var con;\n for (var i = 0; i < 30; i++) {\n sin_phi = Math.sin(phi);\n cos_phi = Math.cos(phi);\n con = eccent * sin_phi;\n dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //console.log(\"IQSFN-CONV:Latitude failed to converge after 30 iterations\");\n return NaN;\n };\n\n /*\n reference:\n \"Cartographic Projection Procedures for the UNIX Environment-\n A User's Manual\" by Gerald I. Evenden,\n USGS Open File Report 90-284and Release 4 Interim Reports (2003)\n */\n function init$16() {\n //no-op\n if (!this.sphere) {\n this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n\n /* Cylindrical Equal Area forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\n function forward$15(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y;\n /* Forward equations\n -----------------*/\n var dlon = adjust_lon(lon - this.long0);\n if (this.sphere) {\n x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);\n y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);\n }\n else {\n var qs = qsfnz(this.e, Math.sin(lat));\n x = this.x0 + this.a * this.k0 * dlon;\n y = this.y0 + this.a * qs * 0.5 / this.k0;\n }\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\n function inverse$15(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);\n lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$17 = [\"cea\"];\n var cea = {\n init: init$16,\n forward: forward$15,\n inverse: inverse$15,\n names: names$17\n };\n\n function init$17() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Equidistant Cylindrical (Plate Carre)\";\n\n this.rc = Math.cos(this.lat_ts);\n }\n\n // forward equations--mapping lat,long to x,y\n // -----------------------------------------------------------------\n function forward$16(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n var dlon = adjust_lon(lon - this.long0);\n var dlat = adjust_lat(lat - this.lat0);\n p.x = this.x0 + (this.a * dlon * this.rc);\n p.y = this.y0 + (this.a * dlat);\n return p;\n }\n\n // inverse equations--mapping x,y to lat/long\n // -----------------------------------------------------------------\n function inverse$16(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = adjust_lat(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n }\n\n var names$18 = [\"Equirectangular\", \"Equidistant_Cylindrical\", \"eqc\"];\n var eqc = {\n init: init$17,\n forward: forward$16,\n inverse: inverse$16,\n names: names$18\n };\n\n var MAX_ITER$2 = 20;\n\n function init$18() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles\n this.e = Math.sqrt(this.es);\n this.e0 = e0fn(this.es);\n this.e1 = e1fn(this.es);\n this.e2 = e2fn(this.es);\n this.e3 = e3fn(this.es);\n this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas\n }\n\n /* Polyconic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\n function forward$17(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y, el;\n var dlon = adjust_lon(lon - this.long0);\n el = dlon * Math.sin(lat);\n if (this.sphere) {\n if (Math.abs(lat) <= EPSLN) {\n x = this.a * dlon;\n y = -1 * this.a * this.lat0;\n }\n else {\n x = this.a * Math.sin(el) / Math.tan(lat);\n y = this.a * (adjust_lat(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));\n }\n }\n else {\n if (Math.abs(lat) <= EPSLN) {\n x = this.a * dlon;\n y = -1 * this.ml0;\n }\n else {\n var nl = gN(this.a, this.e, Math.sin(lat)) / Math.tan(lat);\n x = nl * Math.sin(el);\n y = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));\n }\n\n }\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n }\n\n /* Inverse equations\n -----------------*/\n function inverse$17(p) {\n var lon, lat, x, y, i;\n var al, bl;\n var phi, dphi;\n x = p.x - this.x0;\n y = p.y - this.y0;\n\n if (this.sphere) {\n if (Math.abs(y + this.a * this.lat0) <= EPSLN) {\n lon = adjust_lon(x / this.a + this.long0);\n lat = 0;\n }\n else {\n al = this.lat0 + y / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var tanphi;\n for (i = MAX_ITER$2; i; --i) {\n tanphi = Math.tan(phi);\n dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);\n phi += dphi;\n if (Math.abs(dphi) <= EPSLN) {\n lat = phi;\n break;\n }\n }\n lon = adjust_lon(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat));\n }\n }\n else {\n if (Math.abs(y + this.ml0) <= EPSLN) {\n lat = 0;\n lon = adjust_lon(this.long0 + x / this.a);\n }\n else {\n\n al = (this.ml0 + y) / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var cl, mln, mlnp, ma;\n var con;\n for (i = MAX_ITER$2; i; --i) {\n con = this.e * Math.sin(phi);\n cl = Math.sqrt(1 - con * con) * Math.tan(phi);\n mln = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);\n mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);\n ma = mln / this.a;\n dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp);\n phi -= dphi;\n if (Math.abs(dphi) <= EPSLN) {\n lat = phi;\n break;\n }\n }\n\n //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);\n cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);\n lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$19 = [\"Polyconic\", \"poly\"];\n var poly = {\n init: init$18,\n forward: forward$17,\n inverse: inverse$17,\n names: names$19\n };\n\n /*\n reference\n Department of Land and Survey Technical Circular 1973/32\n http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf\n OSG Technical Report 4.1\n http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf\n */\n\n /**\n * iterations: Number of iterations to refine inverse transform.\n * 0 -> km accuracy\n * 1 -> m accuracy -- suitable for most mapping applications\n * 2 -> mm accuracy\n */\n\n\n function init$19() {\n this.A = [];\n this.A[1] = 0.6399175073;\n this.A[2] = -0.1358797613;\n this.A[3] = 0.063294409;\n this.A[4] = -0.02526853;\n this.A[5] = 0.0117879;\n this.A[6] = -0.0055161;\n this.A[7] = 0.0026906;\n this.A[8] = -0.001333;\n this.A[9] = 0.00067;\n this.A[10] = -0.00034;\n\n this.B_re = [];\n this.B_im = [];\n this.B_re[1] = 0.7557853228;\n this.B_im[1] = 0;\n this.B_re[2] = 0.249204646;\n this.B_im[2] = 0.003371507;\n this.B_re[3] = -0.001541739;\n this.B_im[3] = 0.041058560;\n this.B_re[4] = -0.10162907;\n this.B_im[4] = 0.01727609;\n this.B_re[5] = -0.26623489;\n this.B_im[5] = -0.36249218;\n this.B_re[6] = -0.6870983;\n this.B_im[6] = -1.1651967;\n\n this.C_re = [];\n this.C_im = [];\n this.C_re[1] = 1.3231270439;\n this.C_im[1] = 0;\n this.C_re[2] = -0.577245789;\n this.C_im[2] = -0.007809598;\n this.C_re[3] = 0.508307513;\n this.C_im[3] = -0.112208952;\n this.C_re[4] = -0.15094762;\n this.C_im[4] = 0.18200602;\n this.C_re[5] = 1.01418179;\n this.C_im[5] = 1.64497696;\n this.C_re[6] = 1.9660549;\n this.C_im[6] = 2.5127645;\n\n this.D = [];\n this.D[1] = 1.5627014243;\n this.D[2] = 0.5185406398;\n this.D[3] = -0.03333098;\n this.D[4] = -0.1052906;\n this.D[5] = -0.0368594;\n this.D[6] = 0.007317;\n this.D[7] = 0.01220;\n this.D[8] = 0.00394;\n this.D[9] = -0.0013;\n }\n\n /**\n New Zealand Map Grid Forward - long/lat to x/y\n long/lat in radians\n */\n function forward$18(p) {\n var n;\n var lon = p.x;\n var lat = p.y;\n\n var delta_lat = lat - this.lat0;\n var delta_lon = lon - this.long0;\n\n // 1. Calculate d_phi and d_psi ... // and d_lambda\n // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.\n var d_phi = delta_lat / SEC_TO_RAD * 1E-5;\n var d_lambda = delta_lon;\n var d_phi_n = 1; // d_phi^0\n\n var d_psi = 0;\n for (n = 1; n <= 10; n++) {\n d_phi_n = d_phi_n * d_phi;\n d_psi = d_psi + this.A[n] * d_phi_n;\n }\n\n // 2. Calculate theta\n var th_re = d_psi;\n var th_im = d_lambda;\n\n // 3. Calculate z\n var th_n_re = 1;\n var th_n_im = 0; // theta^0\n var th_n_re1;\n var th_n_im1;\n\n var z_re = 0;\n var z_im = 0;\n for (n = 1; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;\n z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;\n }\n\n // 4. Calculate easting and northing\n p.x = (z_im * this.a) + this.x0;\n p.y = (z_re * this.a) + this.y0;\n\n return p;\n }\n\n /**\n New Zealand Map Grid Inverse - x/y to long/lat\n */\n function inverse$18(p) {\n var n;\n var x = p.x;\n var y = p.y;\n\n var delta_x = x - this.x0;\n var delta_y = y - this.y0;\n\n // 1. Calculate z\n var z_re = delta_y / this.a;\n var z_im = delta_x / this.a;\n\n // 2a. Calculate theta - first approximation gives km accuracy\n var z_n_re = 1;\n var z_n_im = 0; // z^0\n var z_n_re1;\n var z_n_im1;\n\n var th_re = 0;\n var th_im = 0;\n for (n = 1; n <= 6; n++) {\n z_n_re1 = z_n_re * z_re - z_n_im * z_im;\n z_n_im1 = z_n_im * z_re + z_n_re * z_im;\n z_n_re = z_n_re1;\n z_n_im = z_n_im1;\n th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;\n th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;\n }\n\n // 2b. Iterate to refine the accuracy of the calculation\n // 0 iterations gives km accuracy\n // 1 iteration gives m accuracy -- good enough for most mapping applications\n // 2 iterations bives mm accuracy\n for (var i = 0; i < this.iterations; i++) {\n var th_n_re = th_re;\n var th_n_im = th_im;\n var th_n_re1;\n var th_n_im1;\n\n var num_re = z_re;\n var num_im = z_im;\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n th_n_re = 1;\n th_n_im = 0;\n var den_re = this.B_re[1];\n var den_im = this.B_im[1];\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n // Complex division\n var den2 = den_re * den_re + den_im * den_im;\n th_re = (num_re * den_re + num_im * den_im) / den2;\n th_im = (num_im * den_re - num_re * den_im) / den2;\n }\n\n // 3. Calculate d_phi ... // and d_lambda\n var d_psi = th_re;\n var d_lambda = th_im;\n var d_psi_n = 1; // d_psi^0\n\n var d_phi = 0;\n for (n = 1; n <= 9; n++) {\n d_psi_n = d_psi_n * d_psi;\n d_phi = d_phi + this.D[n] * d_psi_n;\n }\n\n // 4. Calculate latitude and longitude\n // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.\n var lat = this.lat0 + (d_phi * SEC_TO_RAD * 1E5);\n var lon = this.long0 + d_lambda;\n\n p.x = lon;\n p.y = lat;\n\n return p;\n }\n\n var names$20 = [\"New_Zealand_Map_Grid\", \"nzmg\"];\n var nzmg = {\n init: init$19,\n forward: forward$18,\n inverse: inverse$18,\n names: names$20\n };\n\n /*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\n\n /* Initialize the Miller Cylindrical projection\n -------------------------------------------*/\n function init$20() {\n //no-op\n }\n\n /* Miller Cylindrical forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\n function forward$19(p) {\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n var dlon = adjust_lon(lon - this.long0);\n var x = this.x0 + this.a * dlon;\n var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25;\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n /* Miller Cylindrical inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\n function inverse$19(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = adjust_lon(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$21 = [\"Miller_Cylindrical\", \"mill\"];\n var mill = {\n init: init$20,\n forward: forward$19,\n inverse: inverse$19,\n names: names$21\n };\n\n var MAX_ITER$3 = 20;\n function init$21() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n\n\n if (!this.sphere) {\n this.en = pj_enfn(this.es);\n }\n else {\n this.n = 1;\n this.m = 0;\n this.es = 0;\n this.C_y = Math.sqrt((this.m + 1) / this.n);\n this.C_x = this.C_y / (this.m + 1);\n }\n\n }\n\n /* Sinusoidal forward equations--mapping lat,long to x,y\n -----------------------------------------------------*/\n function forward$20(p) {\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n lon = adjust_lon(lon - this.long0);\n\n if (this.sphere) {\n if (!this.m) {\n lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;\n }\n else {\n var k = this.n * Math.sin(lat);\n for (var i = MAX_ITER$3; i; --i) {\n var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));\n lat -= V;\n if (Math.abs(V) < EPSLN) {\n break;\n }\n }\n }\n x = this.a * this.C_x * lon * (this.m + Math.cos(lat));\n y = this.a * this.C_y * lat;\n\n }\n else {\n\n var s = Math.sin(lat);\n var c = Math.cos(lat);\n y = this.a * pj_mlfn(lat, s, c, this.en);\n x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);\n }\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$20(p) {\n var lat, temp, lon, s;\n\n p.x -= this.x0;\n lon = p.x / this.a;\n p.y -= this.y0;\n lat = p.y / this.a;\n\n if (this.sphere) {\n lat /= this.C_y;\n lon = lon / (this.C_x * (this.m + Math.cos(lat)));\n if (this.m) {\n lat = asinz((this.m * lat + Math.sin(lat)) / this.n);\n }\n else if (this.n !== 1) {\n lat = asinz(Math.sin(lat) / this.n);\n }\n lon = adjust_lon(lon + this.long0);\n lat = adjust_lat(lat);\n }\n else {\n lat = pj_inv_mlfn(p.y / this.a, this.es, this.en);\n s = Math.abs(lat);\n if (s < HALF_PI) {\n s = Math.sin(lat);\n temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));\n //temp = this.long0 + p.x / (this.a * Math.cos(lat));\n lon = adjust_lon(temp);\n }\n else if ((s - EPSLN) < HALF_PI) {\n lon = this.long0;\n }\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$22 = [\"Sinusoidal\", \"sinu\"];\n var sinu = {\n init: init$21,\n forward: forward$20,\n inverse: inverse$20,\n names: names$22\n };\n\n function init$22() {}\n /* Mollweide forward equations--mapping lat,long to x,y\n ----------------------------------------------------*/\n function forward$21(p) {\n\n /* Forward equations\n -----------------*/\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = adjust_lon(lon - this.long0);\n var theta = lat;\n var con = Math.PI * Math.sin(lat);\n\n /* Iterate using the Newton-Raphson method to find theta\n -----------------------------------------------------*/\n while (true) {\n var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));\n theta += delta_theta;\n if (Math.abs(delta_theta) < EPSLN) {\n break;\n }\n }\n theta /= 2;\n\n /* If the latitude is 90 deg, force the x coordinate to be \"0 + false easting\"\n this is done here because of precision problems with \"cos(theta)\"\n --------------------------------------------------------------------------*/\n if (Math.PI / 2 - Math.abs(lat) < EPSLN) {\n delta_lon = 0;\n }\n var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;\n var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$21(p) {\n var theta;\n var arg;\n\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n arg = p.y / (1.4142135623731 * this.a);\n\n /* Because of division by zero problems, 'arg' can not be 1. Therefore\n a number very close to one is used instead.\n -------------------------------------------------------------------*/\n if (Math.abs(arg) > 0.999999999999) {\n arg = 0.999999999999;\n }\n theta = Math.asin(arg);\n var lon = adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))));\n if (lon < (-Math.PI)) {\n lon = -Math.PI;\n }\n if (lon > Math.PI) {\n lon = Math.PI;\n }\n arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;\n if (Math.abs(arg) > 1) {\n arg = 1;\n }\n var lat = Math.asin(arg);\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$23 = [\"Mollweide\", \"moll\"];\n var moll = {\n init: init$22,\n forward: forward$21,\n inverse: inverse$21,\n names: names$23\n };\n\n function init$23() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < EPSLN) {\n return;\n }\n this.lat2 = this.lat2 || this.lat1;\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e = Math.sqrt(this.es);\n this.e0 = e0fn(this.es);\n this.e1 = e1fn(this.es);\n this.e2 = e2fn(this.es);\n this.e3 = e3fn(this.es);\n\n this.sinphi = Math.sin(this.lat1);\n this.cosphi = Math.cos(this.lat1);\n\n this.ms1 = msfnz(this.e, this.sinphi, this.cosphi);\n this.ml1 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat1);\n\n if (Math.abs(this.lat1 - this.lat2) < EPSLN) {\n this.ns = this.sinphi;\n }\n else {\n this.sinphi = Math.sin(this.lat2);\n this.cosphi = Math.cos(this.lat2);\n this.ms2 = msfnz(this.e, this.sinphi, this.cosphi);\n this.ml2 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat2);\n this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);\n }\n this.g = this.ml1 + this.ms1 / this.ns;\n this.ml0 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);\n this.rh = this.a * (this.g - this.ml0);\n }\n\n /* Equidistant Conic forward equations--mapping lat,long to x,y\n -----------------------------------------------------------*/\n function forward$22(p) {\n var lon = p.x;\n var lat = p.y;\n var rh1;\n\n /* Forward equations\n -----------------*/\n if (this.sphere) {\n rh1 = this.a * (this.g - lat);\n }\n else {\n var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat);\n rh1 = this.a * (this.g - ml);\n }\n var theta = this.ns * adjust_lon(lon - this.long0);\n var x = this.x0 + rh1 * Math.sin(theta);\n var y = this.y0 + this.rh - rh1 * Math.cos(theta);\n p.x = x;\n p.y = y;\n return p;\n }\n\n /* Inverse equations\n -----------------*/\n function inverse$22(p) {\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n var con, rh1, lat, lon;\n if (this.ns >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n\n if (this.sphere) {\n lon = adjust_lon(this.long0 + theta / this.ns);\n lat = adjust_lat(this.g - rh1 / this.a);\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n var ml = this.g - rh1 / this.a;\n lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3);\n lon = adjust_lon(this.long0 + theta / this.ns);\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n }\n\n var names$24 = [\"Equidistant_Conic\", \"eqdc\"];\n var eqdc = {\n init: init$23,\n forward: forward$22,\n inverse: inverse$22,\n names: names$24\n };\n\n /* Initialize the Van Der Grinten projection\n ----------------------------------------*/\n function init$24() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n }\n\n function forward$23(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n /* Forward equations\n -----------------*/\n var dlon = adjust_lon(lon - this.long0);\n var x, y;\n\n if (Math.abs(lat) <= EPSLN) {\n x = this.x0 + this.R * dlon;\n y = this.y0;\n }\n var theta = asinz(2 * Math.abs(lat / Math.PI));\n if ((Math.abs(dlon) <= EPSLN) || (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN)) {\n x = this.x0;\n if (lat >= 0) {\n y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);\n }\n else {\n y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);\n }\n // return(OK);\n }\n var al = 0.5 * Math.abs((Math.PI / dlon) - (dlon / Math.PI));\n var asq = al * al;\n var sinth = Math.sin(theta);\n var costh = Math.cos(theta);\n\n var g = costh / (sinth + costh - 1);\n var gsq = g * g;\n var m = g * (2 / sinth - 1);\n var msq = m * m;\n var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);\n if (dlon < 0) {\n con = -con;\n }\n x = this.x0 + con;\n //con = Math.abs(con / (Math.PI * this.R));\n var q = asq + g;\n con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);\n if (lat >= 0) {\n //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 + con;\n }\n else {\n //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 - con;\n }\n p.x = x;\n p.y = y;\n return p;\n }\n\n /* Van Der Grinten inverse equations--mapping x,y to lat/long\n ---------------------------------------------------------*/\n function inverse$23(p) {\n var lon, lat;\n var xx, yy, xys, c1, c2, c3;\n var a1;\n var m1;\n var con;\n var th1;\n var d;\n\n /* inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n con = Math.PI * this.R;\n xx = p.x / con;\n yy = p.y / con;\n xys = xx * xx + yy * yy;\n c1 = -Math.abs(yy) * (1 + xys);\n c2 = c1 - 2 * yy * yy + xx * xx;\n c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;\n d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;\n a1 = (c1 - c2 * c2 / 3 / c3) / c3;\n m1 = 2 * Math.sqrt(-a1 / 3);\n con = ((3 * d) / a1) / m1;\n if (Math.abs(con) > 1) {\n if (con >= 0) {\n con = 1;\n }\n else {\n con = -1;\n }\n }\n th1 = Math.acos(con) / 3;\n if (p.y >= 0) {\n lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n else {\n lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n\n if (Math.abs(xx) < EPSLN) {\n lon = this.long0;\n }\n else {\n lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$25 = [\"Van_der_Grinten_I\", \"VanDerGrinten\", \"vandg\"];\n var vandg = {\n init: init$24,\n forward: forward$23,\n inverse: inverse$23,\n names: names$25\n };\n\n function init$25() {\n this.sin_p12 = Math.sin(this.lat0);\n this.cos_p12 = Math.cos(this.lat0);\n }\n\n function forward$24(p) {\n var lon = p.x;\n var lat = p.y;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var dlon = adjust_lon(lon - this.long0);\n var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5;\n if (this.sphere) {\n if (Math.abs(this.sin_p12 - 1) <= EPSLN) {\n //North Pole case\n p.x = this.x0 + this.a * (HALF_PI - lat) * Math.sin(dlon);\n p.y = this.y0 - this.a * (HALF_PI - lat) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {\n //South Pole case\n p.x = this.x0 + this.a * (HALF_PI + lat) * Math.sin(dlon);\n p.y = this.y0 + this.a * (HALF_PI + lat) * Math.cos(dlon);\n return p;\n }\n else {\n //default case\n cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);\n c = Math.acos(cos_c);\n kp = c ? c / Math.sin(c) : 1;\n p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);\n p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));\n return p;\n }\n }\n else {\n e0 = e0fn(this.es);\n e1 = e1fn(this.es);\n e2 = e2fn(this.es);\n e3 = e3fn(this.es);\n if (Math.abs(this.sin_p12 - 1) <= EPSLN) {\n //North Pole case\n Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);\n Ml = this.a * mlfn(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);\n p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {\n //South Pole case\n Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);\n Ml = this.a * mlfn(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);\n p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);\n return p;\n }\n else {\n //Default case\n tanphi = sinphi / cosphi;\n Nl1 = gN(this.a, this.e, this.sin_p12);\n Nl = gN(this.a, this.e, sinphi);\n psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));\n Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));\n if (Az === 0) {\n s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else if (Math.abs(Math.abs(Az) - Math.PI) <= EPSLN) {\n s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else {\n s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));\n }\n G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);\n H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);\n GH = G * H;\n Hs = H * H;\n s2 = s * s;\n s3 = s2 * s;\n s4 = s3 * s;\n s5 = s4 * s;\n c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH);\n p.x = this.x0 + c * Math.sin(Az);\n p.y = this.y0 + c * Math.cos(Az);\n return p;\n }\n }\n\n\n }\n\n function inverse$24(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A, B, D, Ee, F, sinpsi;\n if (this.sphere) {\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (rh > (2 * HALF_PI * this.a)) {\n return;\n }\n z = rh / this.a;\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= EPSLN) {\n lat = this.lat0;\n }\n else {\n lat = asinz(cosz * this.sin_p12 + (p.y * sinz * this.cos_p12) / rh);\n con = Math.abs(this.lat0) - HALF_PI;\n if (Math.abs(con) <= EPSLN) {\n if (this.lat0 >= 0) {\n lon = adjust_lon(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));\n }\n }\n else {\n /*con = cosz - this.sin_p12 * Math.sin(lat);\n if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {\n //no-op, just keep the lon value as is\n } else {\n var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));\n lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));\n }*/\n lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n e0 = e0fn(this.es);\n e1 = e1fn(this.es);\n e2 = e2fn(this.es);\n e3 = e3fn(this.es);\n if (Math.abs(this.sin_p12 - 1) <= EPSLN) {\n //North pole case\n Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = Mlp - rh;\n lat = imlfn(M / this.a, e0, e1, e2, e3);\n lon = adjust_lon(this.long0 + Math.atan2(p.x, - 1 * p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {\n //South pole case\n Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = rh - Mlp;\n\n lat = imlfn(M / this.a, e0, e1, e2, e3);\n lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n //default case\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n Az = Math.atan2(p.x, p.y);\n N1 = gN(this.a, this.e, this.sin_p12);\n cosAz = Math.cos(Az);\n tmp = this.e * this.cos_p12 * cosAz;\n A = -tmp * tmp / (1 - this.es);\n B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);\n D = rh / N1;\n Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;\n F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;\n psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);\n lon = adjust_lon(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));\n sinpsi = Math.sin(psi);\n lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));\n p.x = lon;\n p.y = lat;\n return p;\n }\n }\n\n }\n\n var names$26 = [\"Azimuthal_Equidistant\", \"aeqd\"];\n var aeqd = {\n init: init$25,\n forward: forward$24,\n inverse: inverse$24,\n names: names$26\n };\n\n function init$26() {\n //double temp; /* temporary variable */\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n }\n\n /* Orthographic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\n function forward$25(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g, x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = adjust_lon(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= EPSLN)) {\n x = this.a * ksp * cosphi * Math.sin(dlon);\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n\n function inverse$25(p) {\n var rh; /* height above ellipsoid */\n var z; /* angle */\n var sinz, cosz; /* sin of z and cos of z */\n var con;\n var lon, lat;\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n z = asinz(rh / this.a);\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= EPSLN) {\n lat = this.lat0;\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = asinz(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh);\n con = Math.abs(this.lat0) - HALF_PI;\n if (Math.abs(con) <= EPSLN) {\n if (this.lat0 >= 0) {\n lon = adjust_lon(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n var names$27 = [\"ortho\"];\n var ortho = {\n init: init$26,\n forward: forward$25,\n inverse: inverse$25,\n names: names$27\n };\n\n // QSC projection rewritten from the original PROJ4\n // https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c\n\n /* constants */\n var FACE_ENUM = {\n FRONT: 1,\n RIGHT: 2,\n BACK: 3,\n LEFT: 4,\n TOP: 5,\n BOTTOM: 6\n };\n\n var AREA_ENUM = {\n AREA_0: 1,\n AREA_1: 2,\n AREA_2: 3,\n AREA_3: 4\n };\n\n function init$27() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Quadrilateralized Spherical Cube\";\n\n /* Determine the cube face from the center of projection. */\n if (this.lat0 >= HALF_PI - FORTPI / 2.0) {\n this.face = FACE_ENUM.TOP;\n } else if (this.lat0 <= -(HALF_PI - FORTPI / 2.0)) {\n this.face = FACE_ENUM.BOTTOM;\n } else if (Math.abs(this.long0) <= FORTPI) {\n this.face = FACE_ENUM.FRONT;\n } else if (Math.abs(this.long0) <= HALF_PI + FORTPI) {\n this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;\n } else {\n this.face = FACE_ENUM.BACK;\n }\n\n /* Fill in useful values for the ellipsoid <-> sphere shift\n * described in [LK12]. */\n if (this.es !== 0) {\n this.one_minus_f = 1 - (this.a - this.b) / this.a;\n this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;\n }\n }\n\n // QSC forward equations--mapping lat,long to x,y\n // -----------------------------------------------------------------\n function forward$26(p) {\n var xy = {x: 0, y: 0};\n var lat, lon;\n var theta, phi;\n var t, mu;\n /* nu; */\n var area = {value: 0};\n\n // move lon according to projection's lon\n p.x -= this.long0;\n\n /* Convert the geodetic latitude to a geocentric latitude.\n * This corresponds to the shift from the ellipsoid to the sphere\n * described in [LK12]. */\n if (this.es !== 0) {//if (P->es != 0) {\n lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));\n } else {\n lat = p.y;\n }\n\n /* Convert the input lat, lon into theta, phi as used by QSC.\n * This depends on the cube face and the area on it.\n * For the top and bottom face, we can compute theta and phi\n * directly from phi, lam. For the other faces, we must use\n * unit sphere cartesian coordinates as an intermediate step. */\n lon = p.x; //lon = lp.lam;\n if (this.face === FACE_ENUM.TOP) {\n phi = HALF_PI - lat;\n if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {\n area.value = AREA_ENUM.AREA_0;\n theta = lon - HALF_PI;\n } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) {\n area.value = AREA_ENUM.AREA_1;\n theta = (lon > 0.0 ? lon - SPI : lon + SPI);\n } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) {\n area.value = AREA_ENUM.AREA_2;\n theta = lon + HALF_PI;\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = lon;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = HALF_PI + lat;\n if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {\n area.value = AREA_ENUM.AREA_0;\n theta = -lon + HALF_PI;\n } else if (lon < FORTPI && lon >= -FORTPI) {\n area.value = AREA_ENUM.AREA_1;\n theta = -lon;\n } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) {\n area.value = AREA_ENUM.AREA_2;\n theta = -lon - HALF_PI;\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = (lon > 0.0 ? -lon + SPI : -lon - SPI);\n }\n } else {\n var q, r, s;\n var sinlat, coslat;\n var sinlon, coslon;\n\n if (this.face === FACE_ENUM.RIGHT) {\n lon = qsc_shift_lon_origin(lon, +HALF_PI);\n } else if (this.face === FACE_ENUM.BACK) {\n lon = qsc_shift_lon_origin(lon, +SPI);\n } else if (this.face === FACE_ENUM.LEFT) {\n lon = qsc_shift_lon_origin(lon, -HALF_PI);\n }\n sinlat = Math.sin(lat);\n coslat = Math.cos(lat);\n sinlon = Math.sin(lon);\n coslon = Math.cos(lon);\n q = coslat * coslon;\n r = coslat * sinlon;\n s = sinlat;\n\n if (this.face === FACE_ENUM.FRONT) {\n phi = Math.acos(q);\n theta = qsc_fwd_equat_face_theta(phi, s, r, area);\n } else if (this.face === FACE_ENUM.RIGHT) {\n phi = Math.acos(r);\n theta = qsc_fwd_equat_face_theta(phi, s, -q, area);\n } else if (this.face === FACE_ENUM.BACK) {\n phi = Math.acos(-q);\n theta = qsc_fwd_equat_face_theta(phi, s, -r, area);\n } else if (this.face === FACE_ENUM.LEFT) {\n phi = Math.acos(-r);\n theta = qsc_fwd_equat_face_theta(phi, s, q, area);\n } else {\n /* Impossible */\n phi = theta = 0;\n area.value = AREA_ENUM.AREA_0;\n }\n }\n\n /* Compute mu and nu for the area of definition.\n * For mu, see Eq. (3-21) in [OL76], but note the typos:\n * compare with Eq. (3-14). For nu, see Eq. (3-38). */\n mu = Math.atan((12 / SPI) * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI));\n t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));\n\n /* Apply the result to the real area. */\n if (area.value === AREA_ENUM.AREA_1) {\n mu += HALF_PI;\n } else if (area.value === AREA_ENUM.AREA_2) {\n mu += SPI;\n } else if (area.value === AREA_ENUM.AREA_3) {\n mu += 1.5 * SPI;\n }\n\n /* Now compute x, y from mu and nu */\n xy.x = t * Math.cos(mu);\n xy.y = t * Math.sin(mu);\n xy.x = xy.x * this.a + this.x0;\n xy.y = xy.y * this.a + this.y0;\n\n p.x = xy.x;\n p.y = xy.y;\n return p;\n }\n\n // QSC inverse equations--mapping x,y to lat/long\n // -----------------------------------------------------------------\n function inverse$26(p) {\n var lp = {lam: 0, phi: 0};\n var mu, nu, cosmu, tannu;\n var tantheta, theta, cosphi, phi;\n var t;\n var area = {value: 0};\n\n /* de-offset */\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n /* Convert the input x, y to the mu and nu angles as used by QSC.\n * This depends on the area of the cube face. */\n nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));\n mu = Math.atan2(p.y, p.x);\n if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_0;\n } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {\n area.value = AREA_ENUM.AREA_1;\n mu -= HALF_PI;\n } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_2;\n mu = (mu < 0.0 ? mu + SPI : mu - SPI);\n } else {\n area.value = AREA_ENUM.AREA_3;\n mu += HALF_PI;\n }\n\n /* Compute phi and theta for the area of definition.\n * The inverse projection is not described in the original paper, but some\n * good hints can be found here (as of 2011-12-14):\n * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302\n * (search for \"Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>\") */\n t = (SPI / 12) * Math.tan(mu);\n tantheta = Math.sin(t) / (Math.cos(t) - (1 / Math.sqrt(2)));\n theta = Math.atan(tantheta);\n cosmu = Math.cos(mu);\n tannu = Math.tan(nu);\n cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));\n if (cosphi < -1) {\n cosphi = -1;\n } else if (cosphi > +1) {\n cosphi = +1;\n }\n\n /* Apply the result to the real area on the cube face.\n * For the top and bottom face, we can compute phi and lam directly.\n * For the other faces, we must use unit sphere cartesian coordinates\n * as an intermediate step. */\n if (this.face === FACE_ENUM.TOP) {\n phi = Math.acos(cosphi);\n lp.phi = HALF_PI - phi;\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = theta + HALF_PI;\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = (theta < 0.0 ? theta + SPI : theta - SPI);\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = theta - HALF_PI;\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = theta;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = Math.acos(cosphi);\n lp.phi = phi - HALF_PI;\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = -theta + HALF_PI;\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = -theta;\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = -theta - HALF_PI;\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = (theta < 0.0 ? -theta - SPI : -theta + SPI);\n }\n } else {\n /* Compute phi and lam via cartesian unit sphere coordinates. */\n var q, r, s;\n q = cosphi;\n t = q * q;\n if (t >= 1) {\n s = 0;\n } else {\n s = Math.sqrt(1 - t) * Math.sin(theta);\n }\n t += s * s;\n if (t >= 1) {\n r = 0;\n } else {\n r = Math.sqrt(1 - t);\n }\n /* Rotate q,r,s into the correct area. */\n if (area.value === AREA_ENUM.AREA_1) {\n t = r;\n r = -s;\n s = t;\n } else if (area.value === AREA_ENUM.AREA_2) {\n r = -r;\n s = -s;\n } else if (area.value === AREA_ENUM.AREA_3) {\n t = r;\n r = s;\n s = -t;\n }\n /* Rotate q,r,s into the correct cube face. */\n if (this.face === FACE_ENUM.RIGHT) {\n t = q;\n q = -r;\n r = t;\n } else if (this.face === FACE_ENUM.BACK) {\n q = -q;\n r = -r;\n } else if (this.face === FACE_ENUM.LEFT) {\n t = q;\n q = r;\n r = -t;\n }\n /* Now compute phi and lam from the unit sphere coordinates. */\n lp.phi = Math.acos(-s) - HALF_PI;\n lp.lam = Math.atan2(r, q);\n if (this.face === FACE_ENUM.RIGHT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -HALF_PI);\n } else if (this.face === FACE_ENUM.BACK) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -SPI);\n } else if (this.face === FACE_ENUM.LEFT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, +HALF_PI);\n }\n }\n\n /* Apply the shift from the sphere to the ellipsoid as described\n * in [LK12]. */\n if (this.es !== 0) {\n var invert_sign;\n var tanphi, xa;\n invert_sign = (lp.phi < 0 ? 1 : 0);\n tanphi = Math.tan(lp.phi);\n xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);\n lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));\n if (invert_sign) {\n lp.phi = -lp.phi;\n }\n }\n\n lp.lam += this.long0;\n p.x = lp.lam;\n p.y = lp.phi;\n return p;\n }\n\n /* Helper function for forward projection: compute the theta angle\n * and determine the area number. */\n function qsc_fwd_equat_face_theta(phi, y, x, area) {\n var theta;\n if (phi < EPSLN) {\n area.value = AREA_ENUM.AREA_0;\n theta = 0.0;\n } else {\n theta = Math.atan2(y, x);\n if (Math.abs(theta) <= FORTPI) {\n area.value = AREA_ENUM.AREA_0;\n } else if (theta > FORTPI && theta <= HALF_PI + FORTPI) {\n area.value = AREA_ENUM.AREA_1;\n theta -= HALF_PI;\n } else if (theta > HALF_PI + FORTPI || theta <= -(HALF_PI + FORTPI)) {\n area.value = AREA_ENUM.AREA_2;\n theta = (theta >= 0.0 ? theta - SPI : theta + SPI);\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta += HALF_PI;\n }\n }\n return theta;\n }\n\n /* Helper function: shift the longitude. */\n function qsc_shift_lon_origin(lon, offset) {\n var slon = lon + offset;\n if (slon < -SPI) {\n slon += TWO_PI;\n } else if (slon > +SPI) {\n slon -= TWO_PI;\n }\n return slon;\n }\n\n var names$28 = [\"Quadrilateralized Spherical Cube\", \"Quadrilateralized_Spherical_Cube\", \"qsc\"];\n var qsc = {\n init: init$27,\n forward: forward$26,\n inverse: inverse$26,\n names: names$28\n };\n\n // Robinson projection\n // Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c\n // Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039\n\n var COEFS_X = [\n [1.0000, 2.2199e-17, -7.15515e-05, 3.1103e-06],\n [0.9986, -0.000482243, -2.4897e-05, -1.3309e-06],\n [0.9954, -0.00083103, -4.48605e-05, -9.86701e-07],\n [0.9900, -0.00135364, -5.9661e-05, 3.6777e-06],\n [0.9822, -0.00167442, -4.49547e-06, -5.72411e-06],\n [0.9730, -0.00214868, -9.03571e-05, 1.8736e-08],\n [0.9600, -0.00305085, -9.00761e-05, 1.64917e-06],\n [0.9427, -0.00382792, -6.53386e-05, -2.6154e-06],\n [0.9216, -0.00467746, -0.00010457, 4.81243e-06],\n [0.8962, -0.00536223, -3.23831e-05, -5.43432e-06],\n [0.8679, -0.00609363, -0.000113898, 3.32484e-06],\n [0.8350, -0.00698325, -6.40253e-05, 9.34959e-07],\n [0.7986, -0.00755338, -5.00009e-05, 9.35324e-07],\n [0.7597, -0.00798324, -3.5971e-05, -2.27626e-06],\n [0.7186, -0.00851367, -7.01149e-05, -8.6303e-06],\n [0.6732, -0.00986209, -0.000199569, 1.91974e-05],\n [0.6213, -0.010418, 8.83923e-05, 6.24051e-06],\n [0.5722, -0.00906601, 0.000182, 6.24051e-06],\n [0.5322, -0.00677797, 0.000275608, 6.24051e-06]\n ];\n\n var COEFS_Y = [\n [-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11],\n [0.0620, 0.0124, -1.26793e-09, 4.22642e-10],\n [0.1240, 0.0124, 5.07171e-09, -1.60604e-09],\n [0.1860, 0.0123999, -1.90189e-08, 6.00152e-09],\n [0.2480, 0.0124002, 7.10039e-08, -2.24e-08],\n [0.3100, 0.0123992, -2.64997e-07, 8.35986e-08],\n [0.3720, 0.0124029, 9.88983e-07, -3.11994e-07],\n [0.4340, 0.0123893, -3.69093e-06, -4.35621e-07],\n [0.4958, 0.0123198, -1.02252e-05, -3.45523e-07],\n [0.5571, 0.0121916, -1.54081e-05, -5.82288e-07],\n [0.6176, 0.0119938, -2.41424e-05, -5.25327e-07],\n [0.6769, 0.011713, -3.20223e-05, -5.16405e-07],\n [0.7346, 0.0113541, -3.97684e-05, -6.09052e-07],\n [0.7903, 0.0109107, -4.89042e-05, -1.04739e-06],\n [0.8435, 0.0103431, -6.4615e-05, -1.40374e-09],\n [0.8936, 0.00969686, -6.4636e-05, -8.547e-06],\n [0.9394, 0.00840947, -0.000192841, -4.2106e-06],\n [0.9761, 0.00616527, -0.000256, -4.2106e-06],\n [1.0000, 0.00328947, -0.000319159, -4.2106e-06]\n ];\n\n var FXC = 0.8487;\n var FYC = 1.3523;\n var C1 = R2D/5; // rad to 5-degree interval\n var RC1 = 1/C1;\n var NODES = 18;\n\n var poly3_val = function(coefs, x) {\n return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));\n };\n\n var poly3_der = function(coefs, x) {\n return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);\n };\n\n function newton_rapshon(f_df, start, max_err, iters) {\n var x = start;\n for (; iters; --iters) {\n var upd = f_df(x);\n x -= upd;\n if (Math.abs(upd) < max_err) {\n break;\n }\n }\n return x;\n }\n\n function init$28() {\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.long0 = this.long0 || 0;\n this.es = 0;\n this.title = this.title || \"Robinson\";\n }\n\n function forward$27(ll) {\n var lon = adjust_lon(ll.x - this.long0);\n\n var dphi = Math.abs(ll.y);\n var i = Math.floor(dphi * C1);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n dphi = R2D * (dphi - RC1 * i);\n var xy = {\n x: poly3_val(COEFS_X[i], dphi) * lon,\n y: poly3_val(COEFS_Y[i], dphi)\n };\n if (ll.y < 0) {\n xy.y = -xy.y;\n }\n\n xy.x = xy.x * this.a * FXC + this.x0;\n xy.y = xy.y * this.a * FYC + this.y0;\n return xy;\n }\n\n function inverse$27(xy) {\n var ll = {\n x: (xy.x - this.x0) / (this.a * FXC),\n y: Math.abs(xy.y - this.y0) / (this.a * FYC)\n };\n\n if (ll.y >= 1) { // pathologic case\n ll.x /= COEFS_X[NODES][0];\n ll.y = xy.y < 0 ? -HALF_PI : HALF_PI;\n } else {\n // find table interval\n var i = Math.floor(ll.y * NODES);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n for (;;) {\n if (COEFS_Y[i][0] > ll.y) {\n --i;\n } else if (COEFS_Y[i+1][0] <= ll.y) {\n ++i;\n } else {\n break;\n }\n }\n // linear interpolation in 5 degree interval\n var coefs = COEFS_Y[i];\n var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i+1][0] - coefs[0]);\n // find t so that poly3_val(coefs, t) = ll.y\n t = newton_rapshon(function(x) {\n return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);\n }, t, EPSLN, 100);\n\n ll.x /= poly3_val(COEFS_X[i], t);\n ll.y = (5 * i + t) * D2R;\n if (xy.y < 0) {\n ll.y = -ll.y;\n }\n }\n\n ll.x = adjust_lon(ll.x + this.long0);\n return ll;\n }\n\n var names$29 = [\"Robinson\", \"robin\"];\n var robin = {\n init: init$28,\n forward: forward$27,\n inverse: inverse$27,\n names: names$29\n };\n\n function init$29() {\n this.name = 'geocent';\n\n }\n\n function forward$28(p) {\n var point = geodeticToGeocentric(p, this.es, this.a);\n return point;\n }\n\n function inverse$28(p) {\n var point = geocentricToGeodetic(p, this.es, this.a, this.b);\n return point;\n }\n\n var names$30 = [\"Geocentric\", 'geocentric', \"geocent\", \"Geocent\"];\n var geocent = {\n init: init$29,\n forward: forward$28,\n inverse: inverse$28,\n names: names$30\n };\n\n var mode = {\n N_POLE: 0,\n S_POLE: 1,\n EQUIT: 2,\n OBLIQ: 3\n };\n\n var params = {\n h: { def: 100000, num: true }, // default is Karman line, no default in PROJ.7\n azi: { def: 0, num: true, degrees: true }, // default is North\n tilt: { def: 0, num: true, degrees: true }, // default is Nadir\n long0: { def: 0, num: true }, // default is Greenwich, conversion to rad is automatic\n lat0: { def: 0, num: true } // default is Equator, conversion to rad is automatic\n };\n\n function init$30() {\n Object.keys(params).forEach(function (p) {\n if (typeof this[p] === \"undefined\") {\n this[p] = params[p].def;\n } else if (params[p].num && isNaN(this[p])) {\n throw new Error(\"Invalid parameter value, must be numeric \" + p + \" = \" + this[p]);\n } else if (params[p].num) {\n this[p] = parseFloat(this[p]);\n }\n if (params[p].degrees) {\n this[p] = this[p] * D2R;\n }\n }.bind(this));\n\n if (Math.abs((Math.abs(this.lat0) - HALF_PI)) < EPSLN) {\n this.mode = this.lat0 < 0 ? mode.S_POLE : mode.N_POLE;\n } else if (Math.abs(this.lat0) < EPSLN) {\n this.mode = mode.EQUIT;\n } else {\n this.mode = mode.OBLIQ;\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n\n this.pn1 = this.h / this.a; // Normalize relative to the Earth's radius\n\n if (this.pn1 <= 0 || this.pn1 > 1e10) {\n throw new Error(\"Invalid height\");\n }\n \n this.p = 1 + this.pn1;\n this.rp = 1 / this.p;\n this.h1 = 1 / this.pn1;\n this.pfact = (this.p + 1) * this.h1;\n this.es = 0;\n\n var omega = this.tilt;\n var gamma = this.azi;\n this.cg = Math.cos(gamma);\n this.sg = Math.sin(gamma);\n this.cw = Math.cos(omega);\n this.sw = Math.sin(omega);\n }\n\n function forward$29(p) {\n p.x -= this.long0;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var coslam = Math.cos(p.x);\n var x, y;\n switch (this.mode) {\n case mode.OBLIQ:\n y = this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y = cosphi * coslam;\n break;\n case mode.S_POLE:\n y = -sinphi;\n break;\n case mode.N_POLE:\n y = sinphi;\n break;\n }\n y = this.pn1 / (this.p - y);\n x = y * cosphi * Math.sin(p.x);\n\n switch (this.mode) {\n case mode.OBLIQ:\n y *= this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y *= sinphi;\n break;\n case mode.N_POLE:\n y *= -(cosphi * coslam);\n break;\n case mode.S_POLE:\n y *= cosphi * coslam;\n break;\n }\n\n // Tilt \n var yt, ba;\n yt = y * this.cg + x * this.sg;\n ba = 1 / (yt * this.sw * this.h1 + this.cw);\n x = (x * this.cg - y * this.sg) * this.cw * ba;\n y = yt * ba;\n\n p.x = x * this.a;\n p.y = y * this.a;\n return p;\n }\n\n function inverse$29(p) {\n p.x /= this.a;\n p.y /= this.a;\n var r = { x: p.x, y: p.y };\n\n // Un-Tilt\n var bm, bq, yt;\n yt = 1 / (this.pn1 - p.y * this.sw);\n bm = this.pn1 * p.x * yt;\n bq = this.pn1 * p.y * this.cw * yt;\n p.x = bm * this.cg + bq * this.sg;\n p.y = bq * this.cg - bm * this.sg;\n\n var rh = hypot(p.x, p.y);\n if (Math.abs(rh) < EPSLN) {\n r.x = 0;\n r.y = p.y;\n } else {\n var cosz, sinz;\n sinz = 1 - rh * rh * this.pfact;\n sinz = (this.p - Math.sqrt(sinz)) / (this.pn1 / rh + rh / this.pn1);\n cosz = Math.sqrt(1 - sinz * sinz);\n switch (this.mode) {\n case mode.OBLIQ:\n r.y = Math.asin(cosz * this.sinph0 + p.y * sinz * this.cosph0 / rh);\n p.y = (cosz - this.sinph0 * Math.sin(r.y)) * rh;\n p.x *= sinz * this.cosph0;\n break;\n case mode.EQUIT:\n r.y = Math.asin(p.y * sinz / rh);\n p.y = cosz * rh;\n p.x *= sinz;\n break;\n case mode.N_POLE:\n r.y = Math.asin(cosz);\n p.y = -p.y;\n break;\n case mode.S_POLE:\n r.y = -Math.asin(cosz);\n break;\n }\n r.x = Math.atan2(p.x, p.y);\n }\n\n p.x = r.x + this.long0;\n p.y = r.y;\n return p;\n }\n\n var names$31 = [\"Tilted_Perspective\", \"tpers\"];\n var tpers = {\n init: init$30,\n forward: forward$29,\n inverse: inverse$29,\n names: names$31\n };\n\n function init$31() {\n this.flip_axis = (this.sweep === 'x' ? 1 : 0);\n this.h = Number(this.h);\n this.radius_g_1 = this.h / this.a;\n\n if (this.radius_g_1 <= 0 || this.radius_g_1 > 1e10) {\n throw new Error();\n }\n\n this.radius_g = 1.0 + this.radius_g_1;\n this.C = this.radius_g * this.radius_g - 1.0;\n\n if (this.es !== 0.0) {\n var one_es = 1.0 - this.es;\n var rone_es = 1 / one_es;\n\n this.radius_p = Math.sqrt(one_es);\n this.radius_p2 = one_es;\n this.radius_p_inv2 = rone_es;\n\n this.shape = 'ellipse'; // Use as a condition in the forward and inverse functions.\n } else {\n this.radius_p = 1.0;\n this.radius_p2 = 1.0;\n this.radius_p_inv2 = 1.0;\n\n this.shape = 'sphere'; // Use as a condition in the forward and inverse functions.\n }\n\n if (!this.title) {\n this.title = \"Geostationary Satellite View\";\n }\n }\n\n function forward$30(p) {\n var lon = p.x;\n var lat = p.y;\n var tmp, v_x, v_y, v_z;\n lon = lon - this.long0;\n\n if (this.shape === 'ellipse') {\n lat = Math.atan(this.radius_p2 * Math.tan(lat));\n var r = this.radius_p / hypot(this.radius_p * Math.cos(lat), Math.sin(lat));\n\n v_x = r * Math.cos(lon) * Math.cos(lat);\n v_y = r * Math.sin(lon) * Math.cos(lat);\n v_z = r * Math.sin(lat);\n\n if (((this.radius_g - v_x) * v_x - v_y * v_y - v_z * v_z * this.radius_p_inv2) < 0.0) {\n p.x = Number.NaN;\n p.y = Number.NaN;\n return p;\n }\n\n tmp = this.radius_g - v_x;\n if (this.flip_axis) {\n p.x = this.radius_g_1 * Math.atan(v_y / hypot(v_z, tmp));\n p.y = this.radius_g_1 * Math.atan(v_z / tmp);\n } else {\n p.x = this.radius_g_1 * Math.atan(v_y / tmp);\n p.y = this.radius_g_1 * Math.atan(v_z / hypot(v_y, tmp));\n }\n } else if (this.shape === 'sphere') {\n tmp = Math.cos(lat);\n v_x = Math.cos(lon) * tmp;\n v_y = Math.sin(lon) * tmp;\n v_z = Math.sin(lat);\n tmp = this.radius_g - v_x;\n\n if (this.flip_axis) {\n p.x = this.radius_g_1 * Math.atan(v_y / hypot(v_z, tmp));\n p.y = this.radius_g_1 * Math.atan(v_z / tmp);\n } else {\n p.x = this.radius_g_1 * Math.atan(v_y / tmp);\n p.y = this.radius_g_1 * Math.atan(v_z / hypot(v_y, tmp));\n }\n }\n p.x = p.x * this.a;\n p.y = p.y * this.a;\n return p;\n }\n\n function inverse$30(p) {\n var v_x = -1.0;\n var v_y = 0.0;\n var v_z = 0.0;\n var a, b, det, k;\n\n p.x = p.x / this.a;\n p.y = p.y / this.a;\n\n if (this.shape === 'ellipse') {\n if (this.flip_axis) {\n v_z = Math.tan(p.y / this.radius_g_1);\n v_y = Math.tan(p.x / this.radius_g_1) * hypot(1.0, v_z);\n } else {\n v_y = Math.tan(p.x / this.radius_g_1);\n v_z = Math.tan(p.y / this.radius_g_1) * hypot(1.0, v_y);\n }\n\n var v_zp = v_z / this.radius_p;\n a = v_y * v_y + v_zp * v_zp + v_x * v_x;\n b = 2 * this.radius_g * v_x;\n det = (b * b) - 4 * a * this.C;\n\n if (det < 0.0) {\n p.x = Number.NaN;\n p.y = Number.NaN;\n return p;\n }\n\n k = (-b - Math.sqrt(det)) / (2.0 * a);\n v_x = this.radius_g + k * v_x;\n v_y *= k;\n v_z *= k;\n\n p.x = Math.atan2(v_y, v_x);\n p.y = Math.atan(v_z * Math.cos(p.x) / v_x);\n p.y = Math.atan(this.radius_p_inv2 * Math.tan(p.y));\n } else if (this.shape === 'sphere') {\n if (this.flip_axis) {\n v_z = Math.tan(p.y / this.radius_g_1);\n v_y = Math.tan(p.x / this.radius_g_1) * Math.sqrt(1.0 + v_z * v_z);\n } else {\n v_y = Math.tan(p.x / this.radius_g_1);\n v_z = Math.tan(p.y / this.radius_g_1) * Math.sqrt(1.0 + v_y * v_y);\n }\n\n a = v_y * v_y + v_z * v_z + v_x * v_x;\n b = 2 * this.radius_g * v_x;\n det = (b * b) - 4 * a * this.C;\n if (det < 0.0) {\n p.x = Number.NaN;\n p.y = Number.NaN;\n return p;\n }\n\n k = (-b - Math.sqrt(det)) / (2.0 * a);\n v_x = this.radius_g + k * v_x;\n v_y *= k;\n v_z *= k;\n\n p.x = Math.atan2(v_y, v_x);\n p.y = Math.atan(v_z * Math.cos(p.x) / v_x);\n }\n p.x = p.x + this.long0;\n return p;\n }\n\n var names$32 = [\"Geostationary Satellite View\", \"Geostationary_Satellite\", \"geos\"];\n var geos = {\n init: init$31,\n forward: forward$30,\n inverse: inverse$30,\n names: names$32,\n };\n\n /**\n * Copyright 2018 Bernie Jenny, Monash University, Melbourne, Australia.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Equal Earth is a projection inspired by the Robinson projection, but unlike\n * the Robinson projection retains the relative size of areas. The projection\n * was designed in 2018 by Bojan Savric, Tom Patterson and Bernhard Jenny.\n *\n * Publication:\n * Bojan Savric, Tom Patterson & Bernhard Jenny (2018). The Equal Earth map\n * projection, International Journal of Geographical Information Science,\n * DOI: 10.1080/13658816.2018.1504949\n *\n * Code released August 2018\n * Ported to JavaScript and adapted for mapshaper-proj by Matthew Bloch August 2018\n * Modified for proj4js by Andreas Hocevar by Andreas Hocevar March 2024\n */\n\n var A1 = 1.340264;\n var A2 = -0.081106;\n var A3 = 0.000893;\n var A4 = 0.003796;\n var M = Math.sqrt(3) / 2.0;\n\n function init$32() {\n this.es = 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n }\n\n function forward$31(p) {\n var lam = adjust_lon(p.x - this.long0);\n var phi = p.y;\n var paramLat = Math.asin(M * Math.sin(phi)),\n paramLatSq = paramLat * paramLat,\n paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;\n p.x = lam * Math.cos(paramLat) /\n (M * (A1 + 3 * A2 * paramLatSq + paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq)));\n p.y = paramLat * (A1 + A2 * paramLatSq + paramLatPow6 * (A3 + A4 * paramLatSq));\n\n p.x = this.a * p.x + this.x0;\n p.y = this.a * p.y + this.y0;\n return p;\n }\n\n function inverse$31(p) {\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n var EPS = 1e-9,\n NITER = 12,\n paramLat = p.y,\n paramLatSq, paramLatPow6, fy, fpy, dlat, i;\n\n for (i = 0; i < NITER; ++i) {\n paramLatSq = paramLat * paramLat;\n paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;\n fy = paramLat * (A1 + A2 * paramLatSq + paramLatPow6 * (A3 + A4 * paramLatSq)) - p.y;\n fpy = A1 + 3 * A2 * paramLatSq + paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq);\n paramLat -= dlat = fy / fpy;\n if (Math.abs(dlat) < EPS) {\n break;\n }\n }\n paramLatSq = paramLat * paramLat;\n paramLatPow6 = paramLatSq * paramLatSq * paramLatSq;\n p.x = M * p.x * (A1 + 3 * A2 * paramLatSq + paramLatPow6 * (7 * A3 + 9 * A4 * paramLatSq)) /\n Math.cos(paramLat);\n p.y = Math.asin(Math.sin(paramLat) / M);\n\n p.x = adjust_lon(p.x + this.long0);\n return p;\n }\n\n var names$33 = [\"eqearth\", \"Equal Earth\", \"Equal_Earth\"];\n var eqearth = {\n init: init$32,\n forward: forward$31,\n inverse: inverse$31,\n names: names$33\n };\n\n var EPS10 = 1e-10;\n\n function init$33() {\n var c;\n\n this.phi1 = this.lat1;\n if (Math.abs(this.phi1) < EPS10) {\n throw new Error();\n }\n if (this.es) {\n this.en = pj_enfn(this.es);\n this.m1 = pj_mlfn(this.phi1, this.am1 = Math.sin(this.phi1),\n c = Math.cos(this.phi1), this.en);\n this.am1 = c / (Math.sqrt(1 - this.es * this.am1 * this.am1) * this.am1);\n this.inverse = e_inv;\n this.forward = e_fwd;\n } else {\n if (Math.abs(this.phi1) + EPS10 >= HALF_PI) {\n this.cphi1 = 0;\n }\n else {\n this.cphi1 = 1 / Math.tan(this.phi1);\n }\n this.inverse = s_inv;\n this.forward = s_fwd;\n }\n }\n\n function e_fwd(p) {\n var lam = adjust_lon(p.x - (this.long0 || 0));\n var phi = p.y;\n var rh, E, c;\n rh = this.am1 + this.m1 - pj_mlfn(phi, E = Math.sin(phi), c = Math.cos(phi), this.en);\n E = c * lam / (rh * Math.sqrt(1 - this.es * E * E));\n p.x = rh * Math.sin(E);\n p.y = this.am1 - rh * Math.cos(E);\n\n p.x = this.a * p.x + (this.x0 || 0);\n p.y = this.a * p.y + (this.y0 || 0);\n return p;\n }\n\n function e_inv(p) {\n p.x = (p.x - (this.x0 || 0)) / this.a;\n p.y = (p.y - (this.y0 || 0)) / this.a;\n\n var s, rh, lam, phi;\n rh = hypot(p.x, p.y = this.am1 - p.y);\n phi = pj_inv_mlfn(this.am1 + this.m1 - rh, this.es, this.en);\n if ((s = Math.abs(phi)) < HALF_PI) {\n s = Math.sin(phi);\n lam = rh * Math.atan2(p.x, p.y) * Math.sqrt(1 - this.es * s * s) / Math.cos(phi);\n } else if (Math.abs(s - HALF_PI) <= EPS10) {\n lam = 0;\n }\n else {\n throw new Error();\n }\n p.x = adjust_lon(lam + (this.long0 || 0));\n p.y = adjust_lat(phi);\n return p;\n }\n\n function s_fwd(p) {\n var lam = adjust_lon(p.x - (this.long0 || 0));\n var phi = p.y;\n var E, rh;\n rh = this.cphi1 + this.phi1 - phi;\n if (Math.abs(rh) > EPS10) {\n p.x = rh * Math.sin(E = lam * Math.cos(phi) / rh);\n p.y = this.cphi1 - rh * Math.cos(E);\n } else {\n p.x = p.y = 0;\n }\n\n p.x = this.a * p.x + (this.x0 || 0);\n p.y = this.a * p.y + (this.y0 || 0);\n return p;\n }\n\n function s_inv(p) {\n p.x = (p.x - (this.x0 || 0)) / this.a;\n p.y = (p.y - (this.y0 || 0)) / this.a;\n\n var lam, phi;\n var rh = hypot(p.x, p.y = this.cphi1 - p.y);\n phi = this.cphi1 + this.phi1 - rh;\n if (Math.abs(phi) > HALF_PI) {\n throw new Error();\n }\n if (Math.abs(Math.abs(phi) - HALF_PI) <= EPS10) {\n lam = 0;\n } else {\n lam = rh * Math.atan2(p.x, p.y) / Math.cos(phi);\n }\n p.x = adjust_lon(lam + (this.long0 || 0));\n p.y = adjust_lat(phi);\n return p;\n }\n\n var names$34 = [\"bonne\", \"Bonne (Werner lat_1=90)\"];\n var bonne = {\n init: init$33,\n names: names$34\n };\n\n var includedProjections = function(proj4){\n proj4.Proj.projections.add(tmerc);\n proj4.Proj.projections.add(etmerc);\n proj4.Proj.projections.add(utm);\n proj4.Proj.projections.add(sterea);\n proj4.Proj.projections.add(stere);\n proj4.Proj.projections.add(somerc);\n proj4.Proj.projections.add(omerc);\n proj4.Proj.projections.add(lcc);\n proj4.Proj.projections.add(krovak);\n proj4.Proj.projections.add(cass);\n proj4.Proj.projections.add(laea);\n proj4.Proj.projections.add(aea);\n proj4.Proj.projections.add(gnom);\n proj4.Proj.projections.add(cea);\n proj4.Proj.projections.add(eqc);\n proj4.Proj.projections.add(poly);\n proj4.Proj.projections.add(nzmg);\n proj4.Proj.projections.add(mill);\n proj4.Proj.projections.add(sinu);\n proj4.Proj.projections.add(moll);\n proj4.Proj.projections.add(eqdc);\n proj4.Proj.projections.add(vandg);\n proj4.Proj.projections.add(aeqd);\n proj4.Proj.projections.add(ortho);\n proj4.Proj.projections.add(qsc);\n proj4.Proj.projections.add(robin);\n proj4.Proj.projections.add(geocent);\n proj4.Proj.projections.add(tpers);\n proj4.Proj.projections.add(geos);\n proj4.Proj.projections.add(eqearth);\n proj4.Proj.projections.add(bonne);\n };\n\n proj4$1.defaultDatum = 'WGS84'; //default datum\n proj4$1.Proj = Projection;\n proj4$1.WGS84 = new proj4$1.Proj('WGS84');\n proj4$1.Point = Point;\n proj4$1.toPoint = toPoint;\n proj4$1.defs = defs;\n proj4$1.nadgrid = nadgrid;\n proj4$1.transform = transform;\n proj4$1.mgrs = mgrs;\n proj4$1.version = '2.15.0';\n includedProjections(proj4$1);\n\n return proj4$1;\n\n})));\n", "let _uid = 0;\n\nexport function getUniqueDomId() {\n return `${++_uid}_${Date.now()}`;\n}", "/**\n * @param { Object } style \n * @param style.geometryType\n * @param style.color\n * @param style.fill\n * \n * @returns { ol.style.Style | null } style \n */\nexport function createSelectedStyle({\n geometryType,\n color = 'rgb(255,255,0)',\n fill = true,\n} = {}) {\n switch(geometryType) {\n\n case 'LineString':\n case 'MultiLineString':\n return new ol.style.Style({\n stroke: new ol.style.Stroke({ color, width: 4 })\n });\n\n case 'Point':\n case 'MultiPoint':\n return new ol.style.Style({\n image: new ol.style.Circle({\n radius: 6,\n fill: fill && new ol.style.Fill({ color }),\n stroke: !fill && new ol.style.Stroke({ color, width: 4 }),\n }),\n zIndex: Infinity,\n });\n\n case 'MultiPolygon':\n case 'Polygon':\n return new ol.style.Style({\n stroke: new ol.style.Stroke({ color, width: 4 }),\n fill: fill && new ol.style.Fill({ color: ol.color.asString([...ol.color.asArray(color)].splice(0, 3).concat(.25)) }) // force rgba color transparency (alpha = .25)\n });\n\n default:\n console.warn('invalid geometry type', geometryType);\n return null;\n\n }\n}", "import { GEOMETRY_FIELDS } from 'g3w-constants';\n\n/**\n * @param { Array } properties\n * \n * @returns { Array }\n */\nexport function getAlphanumericPropertiesFromFeature(properties = []) {\n return (Array.isArray(properties) ? properties : Object.keys(properties)).filter(p => !GEOMETRY_FIELDS.includes(p));\n}", "/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"1\":1}],3:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nif (typeof global.Promise !== 'function') {\n global.Promise = _dereq_(2);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"2\":2}],4:[function(_dereq_,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction getIDB() {\n /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */\n try {\n if (typeof indexedDB !== 'undefined') {\n return indexedDB;\n }\n if (typeof webkitIndexedDB !== 'undefined') {\n return webkitIndexedDB;\n }\n if (typeof mozIndexedDB !== 'undefined') {\n return mozIndexedDB;\n }\n if (typeof OIndexedDB !== 'undefined') {\n return OIndexedDB;\n }\n if (typeof msIndexedDB !== 'undefined') {\n return msIndexedDB;\n }\n } catch (e) {\n return;\n }\n}\n\nvar idb = getIDB();\n\nfunction isIndexedDBValid() {\n try {\n // Initialize IndexedDB; fall back to vendor-prefixed versions\n // if needed.\n if (!idb || !idb.open) {\n return false;\n }\n // We mimic PouchDB here;\n //\n // We test for openDatabase because IE Mobile identifies itself\n // as Safari. Oh the lulz...\n var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);\n\n var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;\n\n // Safari <10.1 does not meet our requirements for IDB support\n // (see: https://github.com/pouchdb/pouchdb/issues/5572).\n // Safari 10.1 shipped with fetch, we can use that to detect it.\n // Note: this creates issues with `window.fetch` polyfills and\n // overrides; see:\n // https://github.com/localForage/localForage/issues/856\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n // See: https://github.com/mozilla/localForage/issues/128\n // See: https://github.com/mozilla/localForage/issues/272\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n}\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== 'TypeError') {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// This is CommonJS because lie is an external dependency, so Rollup\n// can just ignore it.\nif (typeof Promise === 'undefined') {\n // In the \"nopromises\" build this will just throw if you don't have\n // a global promise object, but it would throw anyway later.\n _dereq_(3);\n}\nvar Promise$1 = Promise;\n\nfunction executeCallback(promise, callback) {\n if (callback) {\n promise.then(function (result) {\n callback(null, result);\n }, function (error) {\n callback(error);\n });\n }\n}\n\nfunction executeTwoCallbacks(promise, callback, errorCallback) {\n if (typeof callback === 'function') {\n promise.then(callback);\n }\n\n if (typeof errorCallback === 'function') {\n promise[\"catch\"](errorCallback);\n }\n}\n\nfunction normalizeKey(key) {\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n return key;\n}\n\nfunction getCallback() {\n if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {\n return arguments[arguments.length - 1];\n }\n}\n\n// Some code originally from async_storage.js in\n// [Gaia](https://github.com/mozilla-b2g/gaia).\n\nvar DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';\nvar supportsBlobs = void 0;\nvar dbContexts = {};\nvar toString = Object.prototype.toString;\n\n// Transaction Modes\nvar READ_ONLY = 'readonly';\nvar READ_WRITE = 'readwrite';\n\n// Transform a binary string to an array buffer, because otherwise\n// weird stuff happens when you try to work with the binary string directly.\n// It is known.\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction _binStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\n// Code borrowed from PouchDB. See:\n// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js\n//\nfunction _checkBlobSupportWithoutCaching(idb) {\n return new Promise$1(function (resolve) {\n var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);\n var blob = createBlob(['']);\n txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n\n txn.oncomplete = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction _checkBlobSupport(idb) {\n if (typeof supportsBlobs === 'boolean') {\n return Promise$1.resolve(supportsBlobs);\n }\n return _checkBlobSupportWithoutCaching(idb).then(function (value) {\n supportsBlobs = value;\n return supportsBlobs;\n });\n}\n\nfunction _deferReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Create a deferred object representing the current database operation.\n var deferredOperation = {};\n\n deferredOperation.promise = new Promise$1(function (resolve, reject) {\n deferredOperation.resolve = resolve;\n deferredOperation.reject = reject;\n });\n\n // Enqueue the deferred operation.\n dbContext.deferredOperations.push(deferredOperation);\n\n // Chain its promise to the database readiness.\n if (!dbContext.dbReady) {\n dbContext.dbReady = deferredOperation.promise;\n } else {\n dbContext.dbReady = dbContext.dbReady.then(function () {\n return deferredOperation.promise;\n });\n }\n}\n\nfunction _advanceReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Resolve its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.resolve();\n return deferredOperation.promise;\n }\n}\n\nfunction _rejectReadiness(dbInfo, err) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Reject its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.reject(err);\n return deferredOperation.promise;\n }\n}\n\nfunction _getConnection(dbInfo, upgradeNeeded) {\n return new Promise$1(function (resolve, reject) {\n dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();\n\n if (dbInfo.db) {\n if (upgradeNeeded) {\n _deferReadiness(dbInfo);\n dbInfo.db.close();\n } else {\n return resolve(dbInfo.db);\n }\n }\n\n var dbArgs = [dbInfo.name];\n\n if (upgradeNeeded) {\n dbArgs.push(dbInfo.version);\n }\n\n var openreq = idb.open.apply(idb, dbArgs);\n\n if (upgradeNeeded) {\n openreq.onupgradeneeded = function (e) {\n var db = openreq.result;\n try {\n db.createObjectStore(dbInfo.storeName);\n if (e.oldVersion <= 1) {\n // Added when support for blob shims was added\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n }\n } catch (ex) {\n if (ex.name === 'ConstraintError') {\n console.warn('The database \"' + dbInfo.name + '\"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage \"' + dbInfo.storeName + '\" already exists.');\n } else {\n throw ex;\n }\n }\n };\n }\n\n openreq.onerror = function (e) {\n e.preventDefault();\n reject(openreq.error);\n };\n\n openreq.onsuccess = function () {\n var db = openreq.result;\n db.onversionchange = function (e) {\n // Triggered when the database is modified (e.g. adding an objectStore) or\n // deleted (even when initiated by other sessions in different tabs).\n // Closing the connection here prevents those operations from being blocked.\n // If the database is accessed again later by this instance, the connection\n // will be reopened or the database recreated as needed.\n e.target.close();\n };\n resolve(db);\n _advanceReadiness(dbInfo);\n };\n });\n}\n\nfunction _getOriginalConnection(dbInfo) {\n return _getConnection(dbInfo, false);\n}\n\nfunction _getUpgradedConnection(dbInfo) {\n return _getConnection(dbInfo, true);\n}\n\nfunction _isUpgradeNeeded(dbInfo, defaultVersion) {\n if (!dbInfo.db) {\n return true;\n }\n\n var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);\n var isDowngrade = dbInfo.version < dbInfo.db.version;\n var isUpgrade = dbInfo.version > dbInfo.db.version;\n\n if (isDowngrade) {\n // If the version is not the default one\n // then warn for impossible downgrade.\n if (dbInfo.version !== defaultVersion) {\n console.warn('The database \"' + dbInfo.name + '\"' + \" can't be downgraded from version \" + dbInfo.db.version + ' to version ' + dbInfo.version + '.');\n }\n // Align the versions to prevent errors.\n dbInfo.version = dbInfo.db.version;\n }\n\n if (isUpgrade || isNewStore) {\n // If the store is new then increment the version (if needed).\n // This will trigger an \"upgradeneeded\" event which is required\n // for creating a store.\n if (isNewStore) {\n var incVersion = dbInfo.db.version + 1;\n if (incVersion > dbInfo.version) {\n dbInfo.version = incVersion;\n }\n }\n\n return true;\n }\n\n return false;\n}\n\n// encode a blob for indexeddb engines that don't support blobs\nfunction _encodeBlob(blob) {\n return new Promise$1(function (resolve, reject) {\n var reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = function (e) {\n var base64 = btoa(e.target.result || '');\n resolve({\n __local_forage_encoded_blob: true,\n data: base64,\n type: blob.type\n });\n };\n reader.readAsBinaryString(blob);\n });\n}\n\n// decode an encoded blob\nfunction _decodeBlob(encodedBlob) {\n var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n return createBlob([arrayBuff], { type: encodedBlob.type });\n}\n\n// is this one of our fancy encoded blobs?\nfunction _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}\n\n// Specialize the default `ready()` function by making it dependent\n// on the current database operations. Thus, the driver will be actually\n// ready when it's been initialized (default) *and* there are no pending\n// operations on the database (initiated by some other instances).\nfunction _fullyReady(callback) {\n var self = this;\n\n var promise = self._initReady().then(function () {\n var dbContext = dbContexts[self._dbInfo.name];\n\n if (dbContext && dbContext.dbReady) {\n return dbContext.dbReady;\n }\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n}\n\n// Try to establish a new db connection to replace the\n// current one which is broken (i.e. experiencing\n// InvalidStateError while creating a transaction).\nfunction _tryReconnect(dbInfo) {\n _deferReadiness(dbInfo);\n\n var dbContext = dbContexts[dbInfo.name];\n var forages = dbContext.forages;\n\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n if (forage._dbInfo.db) {\n forage._dbInfo.db.close();\n forage._dbInfo.db = null;\n }\n }\n dbInfo.db = null;\n\n return _getOriginalConnection(dbInfo).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n // store the latest db reference\n // in case the db was upgraded\n dbInfo.db = dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n })[\"catch\"](function (err) {\n _rejectReadiness(dbInfo, err);\n throw err;\n });\n}\n\n// FF doesn't like Promises (micro-tasks) and IDDB store operations,\n// so we have to do it with callbacks\nfunction createTransaction(dbInfo, mode, callback, retries) {\n if (retries === undefined) {\n retries = 1;\n }\n\n try {\n var tx = dbInfo.db.transaction(dbInfo.storeName, mode);\n callback(null, tx);\n } catch (err) {\n if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {\n return Promise$1.resolve().then(function () {\n if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {\n // increase the db version, to create the new ObjectStore\n if (dbInfo.db) {\n dbInfo.version = dbInfo.db.version + 1;\n }\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n }).then(function () {\n return _tryReconnect(dbInfo).then(function () {\n createTransaction(dbInfo, mode, callback, retries - 1);\n });\n })[\"catch\"](callback);\n }\n\n callback(err);\n }\n}\n\nfunction createDbContext() {\n return {\n // Running localForages sharing a database.\n forages: [],\n // Shared database.\n db: null,\n // Database readiness (promise).\n dbReady: null,\n // Deferred operations on the database.\n deferredOperations: []\n };\n}\n\n// Open the IndexedDB database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n // Get the current context of the database;\n var dbContext = dbContexts[dbInfo.name];\n\n // ...or create a new context.\n if (!dbContext) {\n dbContext = createDbContext();\n // Register the new context in the global container.\n dbContexts[dbInfo.name] = dbContext;\n }\n\n // Register itself as a running localForage in the current context.\n dbContext.forages.push(self);\n\n // Replace the default `ready()` function with the specialized one.\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n }\n\n // Create an array of initialization states of the related localForages.\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n }\n\n // Take a snapshot of the related localForages.\n var forages = dbContext.forages.slice(0);\n\n // Initialize the connection process only when\n // all the related localForages aren't pending.\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db;\n // Get the connection or open a new one without upgrade.\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo;\n // Share the final connection amongst related localForages.\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n}\n\nfunction getItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.get(key);\n\n req.onsuccess = function () {\n var value = req.result;\n if (value === undefined) {\n value = null;\n }\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n resolve(value);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items stored in database.\nfunction iterate(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openCursor();\n var iterationNumber = 1;\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (cursor) {\n var value = cursor.value;\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n var result = iterator(value, cursor.key, iterationNumber++);\n\n // when the iterator callback returns any\n // (non-`undefined`) value, then we stop\n // the iteration immediately\n if (result !== void 0) {\n resolve(result);\n } else {\n cursor[\"continue\"]();\n }\n } else {\n resolve();\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n\n return promise;\n}\n\nfunction setItem(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n var dbInfo;\n self.ready().then(function () {\n dbInfo = self._dbInfo;\n if (toString.call(value) === '[object Blob]') {\n return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {\n if (blobSupport) {\n return value;\n }\n return _encodeBlob(value);\n });\n }\n return value;\n }).then(function (value) {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n\n // The reason we don't _save_ null is because IE 10 does\n // not support saving the `null` type in IndexedDB. How\n // ironic, given the bug below!\n // See: https://github.com/mozilla/localForage/issues/161\n if (value === null) {\n value = undefined;\n }\n\n var req = store.put(value, key);\n\n transaction.oncomplete = function () {\n // Cast to undefined so the value passed to\n // callback/promise is the same as what one would get out\n // of `getItem()` later. This leads to some weirdness\n // (setItem('foo', undefined) will return `null`), but\n // it's not my fault localStorage is our baseline and that\n // it's weird.\n if (value === undefined) {\n value = null;\n }\n\n resolve(value);\n };\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction removeItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n // We use a Grunt task to make this safe for IE and some\n // versions of Android (including those used by Cordova).\n // Normally IE won't like `.delete()` and will insist on\n // using `['delete']()`, but we have a build step that\n // fixes this for us now.\n var req = store[\"delete\"](key);\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onerror = function () {\n reject(req.error);\n };\n\n // The request will be also be aborted if we've exceeded our storage\n // space.\n transaction.onabort = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction clear(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.clear();\n\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction length(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.count();\n\n req.onsuccess = function () {\n resolve(req.result);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction key(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n if (n < 0) {\n resolve(null);\n\n return;\n }\n\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var advanced = false;\n var req = store.openKeyCursor();\n\n req.onsuccess = function () {\n var cursor = req.result;\n if (!cursor) {\n // this means there weren't enough keys\n resolve(null);\n\n return;\n }\n\n if (n === 0) {\n // We have the first key, return it if that's what they\n // wanted.\n resolve(cursor.key);\n } else {\n if (!advanced) {\n // Otherwise, ask the cursor to skip ahead n\n // records.\n advanced = true;\n cursor.advance(n);\n } else {\n // When we get here, we've got the nth key.\n resolve(cursor.key);\n }\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openKeyCursor();\n var keys = [];\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (!cursor) {\n resolve(keys);\n return;\n }\n\n keys.push(cursor.key);\n cursor[\"continue\"]();\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;\n\n var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n return db;\n });\n\n if (!options.storeName) {\n promise = dbPromise.then(function (db) {\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n }\n\n var dropDBPromise = new Promise$1(function (resolve, reject) {\n var req = idb.deleteDatabase(options.name);\n\n req.onerror = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n reject(req.error);\n };\n\n req.onblocked = function () {\n // Closing all open connections in onversionchange handler should prevent this situation, but if\n // we do get here, it just means the request remains pending - eventually it will succeed or error\n console.warn('dropInstance blocked for database \"' + options.name + '\" until all open connections are closed');\n };\n\n req.onsuccess = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n resolve(db);\n };\n });\n\n return dropDBPromise.then(function (db) {\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n var _forage = forages[i];\n _advanceReadiness(_forage._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n } else {\n promise = dbPromise.then(function (db) {\n if (!db.objectStoreNames.contains(options.storeName)) {\n return;\n }\n\n var newVersion = db.version + 1;\n\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n forage._dbInfo.version = newVersion;\n }\n\n var dropObjectPromise = new Promise$1(function (resolve, reject) {\n var req = idb.open(options.name, newVersion);\n\n req.onerror = function (err) {\n var db = req.result;\n db.close();\n reject(err);\n };\n\n req.onupgradeneeded = function () {\n var db = req.result;\n db.deleteObjectStore(options.storeName);\n };\n\n req.onsuccess = function () {\n var db = req.result;\n db.close();\n resolve(db);\n };\n });\n\n return dropObjectPromise.then(function (db) {\n dbContext.db = db;\n for (var j = 0; j < forages.length; j++) {\n var _forage2 = forages[j];\n _forage2._dbInfo.db = db;\n _advanceReadiness(_forage2._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n }\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar asyncStorage = {\n _driver: 'asyncStorage',\n _initStorage: _initStorage,\n _support: isIndexedDBValid(),\n iterate: iterate,\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear,\n length: length,\n key: key,\n keys: keys,\n dropInstance: dropInstance\n};\n\nfunction isWebSQLValid() {\n return typeof openDatabase === 'function';\n}\n\n// Sadly, the best way to save binary data in WebSQL/localStorage is serializing\n// it to Base64, so this is how we store it to prevent very strange errors with less\n// verbose ways of binary <-> string data storage.\nvar BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nvar BLOB_TYPE_PREFIX = '~~local_forage_type~';\nvar BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;\n\nvar SERIALIZED_MARKER = '__lfsc__:';\nvar SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;\n\n// OMG the serializations!\nvar TYPE_ARRAYBUFFER = 'arbf';\nvar TYPE_BLOB = 'blob';\nvar TYPE_INT8ARRAY = 'si08';\nvar TYPE_UINT8ARRAY = 'ui08';\nvar TYPE_UINT8CLAMPEDARRAY = 'uic8';\nvar TYPE_INT16ARRAY = 'si16';\nvar TYPE_INT32ARRAY = 'si32';\nvar TYPE_UINT16ARRAY = 'ur16';\nvar TYPE_UINT32ARRAY = 'ui32';\nvar TYPE_FLOAT32ARRAY = 'fl32';\nvar TYPE_FLOAT64ARRAY = 'fl64';\nvar TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;\n\nvar toString$1 = Object.prototype.toString;\n\nfunction stringToBuffer(serializedString) {\n // Fill the string into a ArrayBuffer.\n var bufferLength = serializedString.length * 0.75;\n var len = serializedString.length;\n var i;\n var p = 0;\n var encoded1, encoded2, encoded3, encoded4;\n\n if (serializedString[serializedString.length - 1] === '=') {\n bufferLength--;\n if (serializedString[serializedString.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n var buffer = new ArrayBuffer(bufferLength);\n var bytes = new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = BASE_CHARS.indexOf(serializedString[i]);\n encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);\n encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);\n encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);\n\n /*jslint bitwise: true */\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return buffer;\n}\n\n// Converts a buffer to a string to store, serialized, in the backend\n// storage library.\nfunction bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}\n\n// Serialize a value, afterwards executing a callback (which usually\n// instructs the `setItem()` callback/promise to be executed). This is how\n// we store binary data with localStorage.\nfunction serialize(value, callback) {\n var valueType = '';\n if (value) {\n valueType = toString$1.call(value);\n }\n\n // Cannot use `value instanceof ArrayBuffer` or such here, as these\n // checks fail when running the tests using casper.js...\n //\n // TODO: See why those tests fail and use a better solution.\n if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {\n // Convert binary arrays to a string and prefix the string with\n // a special marker.\n var buffer;\n var marker = SERIALIZED_MARKER;\n\n if (value instanceof ArrayBuffer) {\n buffer = value;\n marker += TYPE_ARRAYBUFFER;\n } else {\n buffer = value.buffer;\n\n if (valueType === '[object Int8Array]') {\n marker += TYPE_INT8ARRAY;\n } else if (valueType === '[object Uint8Array]') {\n marker += TYPE_UINT8ARRAY;\n } else if (valueType === '[object Uint8ClampedArray]') {\n marker += TYPE_UINT8CLAMPEDARRAY;\n } else if (valueType === '[object Int16Array]') {\n marker += TYPE_INT16ARRAY;\n } else if (valueType === '[object Uint16Array]') {\n marker += TYPE_UINT16ARRAY;\n } else if (valueType === '[object Int32Array]') {\n marker += TYPE_INT32ARRAY;\n } else if (valueType === '[object Uint32Array]') {\n marker += TYPE_UINT32ARRAY;\n } else if (valueType === '[object Float32Array]') {\n marker += TYPE_FLOAT32ARRAY;\n } else if (valueType === '[object Float64Array]') {\n marker += TYPE_FLOAT64ARRAY;\n } else {\n callback(new Error('Failed to get type for BinaryArray'));\n }\n }\n\n callback(marker + bufferToString(buffer));\n } else if (valueType === '[object Blob]') {\n // Conver the blob to a binaryArray and then to a string.\n var fileReader = new FileReader();\n\n fileReader.onload = function () {\n // Backwards-compatible prefix for the blob type.\n var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);\n\n callback(SERIALIZED_MARKER + TYPE_BLOB + str);\n };\n\n fileReader.readAsArrayBuffer(value);\n } else {\n try {\n callback(JSON.stringify(value));\n } catch (e) {\n console.error(\"Couldn't convert value into a JSON string: \", value);\n\n callback(null, e);\n }\n }\n}\n\n// Deserialize data we've inserted into a value column/field. We place\n// special markers into our strings to mark them as encoded; this isn't\n// as nice as a meta field, but it's the only sane thing we can do whilst\n// keeping localStorage support intact.\n//\n// Oftentimes this will just deserialize JSON content, but if we have a\n// special marker (SERIALIZED_MARKER, defined above), we will extract\n// some kind of arraybuffer/binary data/typed array out of the string.\nfunction deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n return JSON.parse(value);\n }\n\n // The following code deals with deserializing some kind of Blob or\n // TypedArray. First we separate out the type of data we're dealing\n // with from the data itself.\n var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);\n var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);\n\n var blobType;\n // Backwards-compatible blob type serialization strategy.\n // DBs created with older versions of localForage will simply not have the blob type.\n if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {\n var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);\n blobType = matcher[1];\n serializedString = serializedString.substring(matcher[0].length);\n }\n var buffer = stringToBuffer(serializedString);\n\n // Return the right type based on the code/type set during\n // serialization.\n switch (type) {\n case TYPE_ARRAYBUFFER:\n return buffer;\n case TYPE_BLOB:\n return createBlob([buffer], { type: blobType });\n case TYPE_INT8ARRAY:\n return new Int8Array(buffer);\n case TYPE_UINT8ARRAY:\n return new Uint8Array(buffer);\n case TYPE_UINT8CLAMPEDARRAY:\n return new Uint8ClampedArray(buffer);\n case TYPE_INT16ARRAY:\n return new Int16Array(buffer);\n case TYPE_UINT16ARRAY:\n return new Uint16Array(buffer);\n case TYPE_INT32ARRAY:\n return new Int32Array(buffer);\n case TYPE_UINT32ARRAY:\n return new Uint32Array(buffer);\n case TYPE_FLOAT32ARRAY:\n return new Float32Array(buffer);\n case TYPE_FLOAT64ARRAY:\n return new Float64Array(buffer);\n default:\n throw new Error('Unkown type: ' + type);\n }\n}\n\nvar localforageSerializer = {\n serialize: serialize,\n deserialize: deserialize,\n stringToBuffer: stringToBuffer,\n bufferToString: bufferToString\n};\n\n/*\n * Includes code from:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n\nfunction createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}\n\n// Open the WebSQL database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n createDbTable(t, dbInfo, function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n }, reject);\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}\n\nfunction tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {\n t.executeSql(sqlStatement, args, callback, function (t, error) {\n if (error.code === error.SYNTAX_ERR) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name = ?\", [dbInfo.storeName], function (t, results) {\n if (!results.rows.length) {\n // if the table is missing (was deleted)\n // re-create it table and retry\n createDbTable(t, dbInfo, function () {\n t.executeSql(sqlStatement, args, callback, errorCallback);\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n}\n\nfunction getItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).value : null;\n\n // Check to see if this is serialized content we need to\n // unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction iterate$1(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {\n var rows = results.rows;\n var length = rows.length;\n\n for (var i = 0; i < length; i++) {\n var item = rows.item(i);\n var result = item.value;\n\n // Check to see if this is serialized content\n // we need to unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n result = iterator(result, item.key, i + 1);\n\n // void(0) prevents problems with redefinition\n // of `undefined`.\n if (result !== void 0) {\n resolve(result);\n return;\n }\n }\n\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction _setItem(key, value, callback, retriesLeft) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n // The localStorage API doesn't return undefined values in an\n // \"expected\" way, so undefined is always cast to null in all\n // drivers. See: https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {\n resolve(originalValue);\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n // The transaction failed; check\n // to see if it's a quota error.\n if (sqlError.code === sqlError.QUOTA_ERR) {\n // We reject the callback outright for now, but\n // it's worth trying to re-run the transaction.\n // Even if the user accepts the prompt to use\n // more storage on Safari, this error will\n // be called.\n //\n // Try to re-run the transaction.\n if (retriesLeft > 0) {\n resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));\n return;\n }\n reject(sqlError);\n }\n });\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction setItem$1(key, value, callback) {\n return _setItem.apply(this, [key, value, callback, 1]);\n}\n\nfunction removeItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Deletes every item in the table.\n// TODO: Find out if this resets the AUTO_INCREMENT number.\nfunction clear$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Does a simple `COUNT(key)` to get the number of items stored in\n// localForage.\nfunction length$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n // Ahhh, SQL makes this one soooooo easy.\n tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {\n var result = results.rows.item(0).c;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Return the key located at key index X; essentially gets the key from a\n// `WHERE id = ?`. This is the most efficient way I can think to implement\n// this rarely-used (in my experience) part of the API, but it can seem\n// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so\n// the ID of each key will change every time it's updated. Perhaps a stored\n// procedure for the `setItem()` SQL would solve this problem?\n// TODO: Don't change ID on `setItem()`.\nfunction key$1(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).key : null;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {\n var keys = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n keys.push(results.rows.item(i).key);\n }\n\n resolve(keys);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// https://www.w3.org/TR/webdatabase/#databases\n// > There is no way to enumerate or delete the databases available for an origin from this API.\nfunction getAllStoreNames(db) {\n return new Promise$1(function (resolve, reject) {\n db.transaction(function (t) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'\", [], function (t, results) {\n var storeNames = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n storeNames.push(results.rows.item(i).name);\n }\n\n resolve({\n db: db,\n storeNames: storeNames\n });\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n}\n\nfunction dropInstance$1(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n var db;\n if (options.name === currentConfig.name) {\n // use the db reference of the current instance\n db = self._dbInfo.db;\n } else {\n db = openDatabase(options.name, '', '', 0);\n }\n\n if (!options.storeName) {\n // drop all database tables\n resolve(getAllStoreNames(db));\n } else {\n resolve({\n db: db,\n storeNames: [options.storeName]\n });\n }\n }).then(function (operationInfo) {\n return new Promise$1(function (resolve, reject) {\n operationInfo.db.transaction(function (t) {\n function dropTable(storeName) {\n return new Promise$1(function (resolve, reject) {\n t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n }\n\n var operations = [];\n for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {\n operations.push(dropTable(operationInfo.storeNames[i]));\n }\n\n Promise$1.all(operations).then(function () {\n resolve();\n })[\"catch\"](function (e) {\n reject(e);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar webSQLStorage = {\n _driver: 'webSQLStorage',\n _initStorage: _initStorage$1,\n _support: isWebSQLValid(),\n iterate: iterate$1,\n getItem: getItem$1,\n setItem: setItem$1,\n removeItem: removeItem$1,\n clear: clear$1,\n length: length$1,\n key: key$1,\n keys: keys$1,\n dropInstance: dropInstance$1\n};\n\nfunction isLocalStorageValid() {\n try {\n return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&\n // in IE8 typeof localStorage.setItem === 'object'\n !!localStorage.setItem;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getKeyPrefix(options, defaultConfig) {\n var keyPrefix = options.name + '/';\n\n if (options.storeName !== defaultConfig.storeName) {\n keyPrefix += options.storeName + '/';\n }\n return keyPrefix;\n}\n\n// Check if localStorage throws when saving an item\nfunction checkIfLocalStorageThrows() {\n var localStorageTestKey = '_localforage_support_test';\n\n try {\n localStorage.setItem(localStorageTestKey, true);\n localStorage.removeItem(localStorageTestKey);\n\n return false;\n } catch (e) {\n return true;\n }\n}\n\n// Check if localStorage is usable and allows to save an item\n// This method checks if localStorage is usable in Safari Private Browsing\n// mode, or in any other case where the available quota for localStorage\n// is 0 and there wasn't any saved items yet.\nfunction _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n}\n\n// Config the localStorage backend, using options set in the config.\nfunction _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}\n\n// Remove all keys from the datastore, effectively destroying all data in\n// the app's key/value store!\nfunction clear$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var keyPrefix = self._dbInfo.keyPrefix;\n\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Retrieve an item from the store. Unlike the original async_storage\n// library in Gaia, we don't modify return values at all. If a key's value\n// is `undefined`, we pass that value to the callback function.\nfunction getItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result = localStorage.getItem(dbInfo.keyPrefix + key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the key\n // is likely undefined and we'll pass it straight to the\n // callback.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items in the store.\nfunction iterate$2(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var keyPrefix = dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.length;\n var length = localStorage.length;\n\n // We use a dedicated iterator instead of the `i` variable below\n // so other keys we fetch in localStorage aren't counted in\n // the `iterationNumber` argument passed to the `iterate()`\n // callback.\n //\n // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n var iterationNumber = 1;\n\n for (var i = 0; i < length; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(keyPrefix) !== 0) {\n continue;\n }\n var value = localStorage.getItem(key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the\n // key is likely undefined and we'll pass it straight\n // to the iterator.\n if (value) {\n value = dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Same as localStorage's key() method, except takes a callback.\nfunction key$2(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result;\n try {\n result = localStorage.key(n);\n } catch (error) {\n result = null;\n }\n\n // Remove the prefix from the key, if a key is found.\n if (result) {\n result = result.substring(dbInfo.keyPrefix.length);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var length = localStorage.length;\n var keys = [];\n\n for (var i = 0; i < length; i++) {\n var itemKey = localStorage.key(i);\n if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {\n keys.push(itemKey.substring(dbInfo.keyPrefix.length));\n }\n }\n\n return keys;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Supply the number of keys in the datastore to the callback function.\nfunction length$2(callback) {\n var self = this;\n var promise = self.keys().then(function (keys) {\n return keys.length;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Remove an item from the store, nice and simple.\nfunction removeItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n localStorage.removeItem(dbInfo.keyPrefix + key);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Set a key's value and run an optional callback once the value is set.\n// Unlike Gaia's implementation, the callback function is passed the value,\n// in case you want to operate on that value only after you're sure it\n// saved, or something like that.\nfunction setItem$2(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n // Convert undefined values to null.\n // https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n return new Promise$1(function (resolve, reject) {\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n try {\n localStorage.setItem(dbInfo.keyPrefix + key, value);\n resolve(originalValue);\n } catch (e) {\n // localStorage capacity exceeded.\n // TODO: Make this a specific error/event.\n if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n reject(e);\n }\n reject(e);\n }\n }\n });\n });\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance$2(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n var currentConfig = this.config();\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n if (!options.storeName) {\n resolve(options.name + '/');\n } else {\n resolve(_getKeyPrefix(options, self._defaultConfig));\n }\n }).then(function (keyPrefix) {\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar localStorageWrapper = {\n _driver: 'localStorageWrapper',\n _initStorage: _initStorage$2,\n _support: isLocalStorageValid(),\n iterate: iterate$2,\n getItem: getItem$2,\n setItem: setItem$2,\n removeItem: removeItem$2,\n clear: clear$2,\n length: length$2,\n key: key$2,\n keys: keys$2,\n dropInstance: dropInstance$2\n};\n\nvar sameValue = function sameValue(x, y) {\n return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);\n};\n\nvar includes = function includes(array, searchElement) {\n var len = array.length;\n var i = 0;\n while (i < len) {\n if (sameValue(array[i], searchElement)) {\n return true;\n }\n i++;\n }\n\n return false;\n};\n\nvar isArray = Array.isArray || function (arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n};\n\n// Drivers are stored here when `defineDriver()` is called.\n// They are shared across all instances of localForage.\nvar DefinedDrivers = {};\n\nvar DriverSupport = {};\n\nvar DefaultDrivers = {\n INDEXEDDB: asyncStorage,\n WEBSQL: webSQLStorage,\n LOCALSTORAGE: localStorageWrapper\n};\n\nvar DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];\n\nvar OptionalDriverMethods = ['dropInstance'];\n\nvar LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);\n\nvar DefaultConfig = {\n description: '',\n driver: DefaultDriverOrder.slice(),\n name: 'localforage',\n // Default DB size is _JUST UNDER_ 5MB, as it's the highest size\n // we can use without a prompt.\n size: 4980736,\n storeName: 'keyvaluepairs',\n version: 1.0\n};\n\nfunction callWhenReady(localForageInstance, libraryMethod) {\n localForageInstance[libraryMethod] = function () {\n var _args = arguments;\n return localForageInstance.ready().then(function () {\n return localForageInstance[libraryMethod].apply(localForageInstance, _args);\n });\n };\n}\n\nfunction extend() {\n for (var i = 1; i < arguments.length; i++) {\n var arg = arguments[i];\n\n if (arg) {\n for (var _key in arg) {\n if (arg.hasOwnProperty(_key)) {\n if (isArray(arg[_key])) {\n arguments[0][_key] = arg[_key].slice();\n } else {\n arguments[0][_key] = arg[_key];\n }\n }\n }\n }\n }\n\n return arguments[0];\n}\n\nvar LocalForage = function () {\n function LocalForage(options) {\n _classCallCheck(this, LocalForage);\n\n for (var driverTypeKey in DefaultDrivers) {\n if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {\n var driver = DefaultDrivers[driverTypeKey];\n var driverName = driver._driver;\n this[driverTypeKey] = driverName;\n\n if (!DefinedDrivers[driverName]) {\n // we don't need to wait for the promise,\n // since the default drivers can be defined\n // in a blocking manner\n this.defineDriver(driver);\n }\n }\n }\n\n this._defaultConfig = extend({}, DefaultConfig);\n this._config = extend({}, this._defaultConfig, options);\n this._driverSet = null;\n this._initDriver = null;\n this._ready = false;\n this._dbInfo = null;\n\n this._wrapLibraryMethodsWithReady();\n this.setDriver(this._config.driver)[\"catch\"](function () {});\n }\n\n // Set any config values for localForage; can be called anytime before\n // the first API call (e.g. `getItem`, `setItem`).\n // We loop through options so we don't overwrite existing config\n // values.\n\n\n LocalForage.prototype.config = function config(options) {\n // If the options argument is an object, we use it to set values.\n // Otherwise, we return either a specified config value or all\n // config values.\n if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {\n // If localforage is ready and fully initialized, we can't set\n // any new configuration values. Instead, we return an error.\n if (this._ready) {\n return new Error(\"Can't call config() after localforage \" + 'has been used.');\n }\n\n for (var i in options) {\n if (i === 'storeName') {\n options[i] = options[i].replace(/\\W/g, '_');\n }\n\n if (i === 'version' && typeof options[i] !== 'number') {\n return new Error('Database version must be a number.');\n }\n\n this._config[i] = options[i];\n }\n\n // after all config options are set and\n // the driver option is used, try setting it\n if ('driver' in options && options.driver) {\n return this.setDriver(this._config.driver);\n }\n\n return true;\n } else if (typeof options === 'string') {\n return this._config[options];\n } else {\n return this._config;\n }\n };\n\n // Used to define a custom driver, shared across all instances of\n // localForage.\n\n\n LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {\n var promise = new Promise$1(function (resolve, reject) {\n try {\n var driverName = driverObject._driver;\n var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');\n\n // A driver name should be defined and not overlap with the\n // library-defined, default drivers.\n if (!driverObject._driver) {\n reject(complianceError);\n return;\n }\n\n var driverMethods = LibraryMethods.concat('_initStorage');\n for (var i = 0, len = driverMethods.length; i < len; i++) {\n var driverMethodName = driverMethods[i];\n\n // when the property is there,\n // it should be a method even when optional\n var isRequired = !includes(OptionalDriverMethods, driverMethodName);\n if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {\n reject(complianceError);\n return;\n }\n }\n\n var configureMissingMethods = function configureMissingMethods() {\n var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {\n return function () {\n var error = new Error('Method ' + methodName + ' is not implemented by the current driver');\n var promise = Promise$1.reject(error);\n executeCallback(promise, arguments[arguments.length - 1]);\n return promise;\n };\n };\n\n for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {\n var optionalDriverMethod = OptionalDriverMethods[_i];\n if (!driverObject[optionalDriverMethod]) {\n driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);\n }\n }\n };\n\n configureMissingMethods();\n\n var setDriverSupport = function setDriverSupport(support) {\n if (DefinedDrivers[driverName]) {\n console.info('Redefining LocalForage driver: ' + driverName);\n }\n DefinedDrivers[driverName] = driverObject;\n DriverSupport[driverName] = support;\n // don't use a then, so that we can define\n // drivers that have simple _support methods\n // in a blocking manner\n resolve();\n };\n\n if ('_support' in driverObject) {\n if (driverObject._support && typeof driverObject._support === 'function') {\n driverObject._support().then(setDriverSupport, reject);\n } else {\n setDriverSupport(!!driverObject._support);\n }\n } else {\n setDriverSupport(true);\n }\n } catch (e) {\n reject(e);\n }\n });\n\n executeTwoCallbacks(promise, callback, errorCallback);\n return promise;\n };\n\n LocalForage.prototype.driver = function driver() {\n return this._driver || null;\n };\n\n LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {\n var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));\n\n executeTwoCallbacks(getDriverPromise, callback, errorCallback);\n return getDriverPromise;\n };\n\n LocalForage.prototype.getSerializer = function getSerializer(callback) {\n var serializerPromise = Promise$1.resolve(localforageSerializer);\n executeTwoCallbacks(serializerPromise, callback);\n return serializerPromise;\n };\n\n LocalForage.prototype.ready = function ready(callback) {\n var self = this;\n\n var promise = self._driverSet.then(function () {\n if (self._ready === null) {\n self._ready = self._initDriver();\n }\n\n return self._ready;\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n };\n\n LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {\n var self = this;\n\n if (!isArray(drivers)) {\n drivers = [drivers];\n }\n\n var supportedDrivers = this._getSupportedDrivers(drivers);\n\n function setDriverToConfig() {\n self._config.driver = self.driver();\n }\n\n function extendSelfWithDriver(driver) {\n self._extend(driver);\n setDriverToConfig();\n\n self._ready = self._initStorage(self._config);\n return self._ready;\n }\n\n function initDriver(supportedDrivers) {\n return function () {\n var currentDriverIndex = 0;\n\n function driverPromiseLoop() {\n while (currentDriverIndex < supportedDrivers.length) {\n var driverName = supportedDrivers[currentDriverIndex];\n currentDriverIndex++;\n\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(extendSelfWithDriver)[\"catch\"](driverPromiseLoop);\n }\n\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n }\n\n return driverPromiseLoop();\n };\n }\n\n // There might be a driver initialization in progress\n // so wait for it to finish in order to avoid a possible\n // race condition to set _dbInfo\n var oldDriverSetDone = this._driverSet !== null ? this._driverSet[\"catch\"](function () {\n return Promise$1.resolve();\n }) : Promise$1.resolve();\n\n this._driverSet = oldDriverSetDone.then(function () {\n var driverName = supportedDrivers[0];\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(function (driver) {\n self._driver = driver._driver;\n setDriverToConfig();\n self._wrapLibraryMethodsWithReady();\n self._initDriver = initDriver(supportedDrivers);\n });\n })[\"catch\"](function () {\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n });\n\n executeTwoCallbacks(this._driverSet, callback, errorCallback);\n return this._driverSet;\n };\n\n LocalForage.prototype.supports = function supports(driverName) {\n return !!DriverSupport[driverName];\n };\n\n LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {\n extend(this, libraryMethodsAndProperties);\n };\n\n LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {\n var supportedDrivers = [];\n for (var i = 0, len = drivers.length; i < len; i++) {\n var driverName = drivers[i];\n if (this.supports(driverName)) {\n supportedDrivers.push(driverName);\n }\n }\n return supportedDrivers;\n };\n\n LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {\n // Add a stub for each driver API method that delays the call to the\n // corresponding driver method until localForage is ready. These stubs\n // will be replaced by the driver methods as soon as the driver is\n // loaded, so there is no performance impact.\n for (var i = 0, len = LibraryMethods.length; i < len; i++) {\n callWhenReady(this, LibraryMethods[i]);\n }\n };\n\n LocalForage.prototype.createInstance = function createInstance(options) {\n return new LocalForage(options);\n };\n\n return LocalForage;\n}();\n\n// The actual localForage object that we expose as a module or via a\n// global. It's extended by pulling in one of our other libraries.\n\n\nvar localforage_js = new LocalForage();\n\nmodule.exports = localforage_js;\n\n},{\"3\":3}]},{},[4])(4)\n});\n", "/**\n * @file Store G3W-CLIENT plugins (editing, qplotly, qtimeseries, ...)\n * @since v3.6\n */\n\nimport G3WObject from 'g3w-object';\n\n/**\n * Object where store plugin\n * key = plugin name\n * value = plugin instance\n * \n * @since 3.11.0\n */\nconst PLUGINS = {};\n\nexport default Object.assign(new G3WObject, { setters: {\n /** store plugin into registry (if not already registered) */\n registerPlugin(plugin) { PLUGINS[plugin.name] = PLUGINS[plugin.name] || plugin; },\n },\n /** @returns Plugin instance */\n getPlugin(name) {\n return PLUGINS[name];\n },\n});", "/**\n * @param { number | string } epsg\n * \n * @returns { string | undefined }\n */\nexport function normalizeEpsg(epsg) {\n if ('number' === typeof epsg) {\n return `EPSG:${epsg}`;\n }\n epsg = epsg.replace(/[^\\d\\.\\-]/g, \"\");\n if ('' !== epsg) {\n return `EPSG:${parseInt(epsg)}`;\n }\n}", "/**\n * @file\n *\n * @since 3.11.0\n */\nimport { normalizeEpsg } from 'utils/normalizeEpsg';\nimport proj4 from 'proj4/dist/proj4-src';\n\n/**\n * ORIGINAL SOURCE: src/app/g3w-ol/projection/projection.js@v3.10.1\n * ORIGINAL SOURCE: src/app/g3w-ol/projection/projections.js@v3.10.1\n */\nexport default {\n\n get(crs = {}) {\n let p = ol.proj.get(crs.epsg);\n if (!p) {\n if (crs.proj4) {\n proj4.defs(crs.epsg, crs.proj4);\n }\n const proj = {\n code: crs.epsg,\n extent: crs.extent,\n axisOrientation: crs.axisinverted ? 'neu' : 'enu',\n units: crs.geographic ? 'degrees' : 'm'\n };\n p = new ol.proj.Projection(proj);\n p.getAxisOrientation = () => proj.axisOrientation;\n ol.proj.addProjection(p);\n ol.proj.proj4.register(proj4);\n }\n return p;\n },\n\n /**\n * Check and register epsg\n * \n * @param epsg : \"EPSG:\" Ex. \"EPSG:4326\"\n * \n * @returns { Promise }\n * \n * @since v3.8\n */\n async registerProjection(epsg) {\n let p = ol.proj.get(epsg) || undefined;\n\n // check if already registered\n if (!p) {\n const { result, data } = await (await fetch(`/crs/${epsg.split(':')[1]}/`)).json();\n if (result) {\n data.epsg = normalizeEpsg(data.epsg);\n p = this.get(data);\n ol.proj.proj4.register(proj4);\n return p;\n }\n }\n\n return p;\n }\n};", "import { INCHES_PER_UNIT, DOTS_PER_INCH } from 'g3w-constants';\n\nexport function getScaleFromResolution(resolution, units = 'm') {\n return Math.round(resolution * INCHES_PER_UNIT[units] * DOTS_PER_INCH);\n}", "import { INCHES_PER_UNIT, DOTS_PER_INCH } from 'g3w-constants';\n\nexport function getResolutionFromScale(scale, units = 'm') {\n // just to prevent that scale is passed as 1:10000 or 0.0001\n return 1 / (((scale >= 1.0) ? (1.0 / scale) : scale) * INCHES_PER_UNIT[units] * DOTS_PER_INCH);\n}", "import { FILTER_EXPRESSION_OPERATORS } from 'g3w-constants';\n\nconst operators = Object.entries(FILTER_EXPRESSION_OPERATORS);\n\nexport function createFilterFromString({ filter = '' }) {\n filter = operators\n .reduce((acc, [_, op]) => acc\n .replace(new RegExp(`\\\\s+${op}\\\\s+`, 'g'), `${op}`) // remove all blank space between operators\n .replace(new RegExp(`'${op}`, 'g'), `${op}`) // leading single quote\n .replace(new RegExp(`${op}'`, 'g'), `${op}`) // trailing single quote\n , filter)\n .replace(/'$/g, '')\n .replace(/\"/g, '');\n filter = operators\n .reduce((acc, [k, op]) => acc.replace(new RegExp(op, 'g'), ['AND', 'OR'].includes(op) ? `|${k},` : `|${k}|`), filter)\n // encode value\n .split('|')\n .map((v, i) => (0 === (i+1) % 3) ? encodeURIComponent(v) : v)\n .join('|');\n\n return filter;\n}", "/**\n * Migrate your consumer code away from jQuery promises.\n * Covert a jQuery promise into an ES6 Promise\n * \n * @param promise jquery promise\n */\nexport function promisify(promise) {\n if (promise instanceof Promise) {\n return promise;\n }\n if (!promise || !promise.then) {\n console.trace(promise);\n return Promise.reject('not a promise');\n }\n return new Promise((resolve, reject) => {\n promise.then(resolve).fail(reject);\n });\n}\n\n/**\n * Migrate your consumer code away from jQuery promises.\n * Convert ES6 Promise into jQuery\n * \n * @param promise async function or ES6 promise \n */\nexport function $promisify(promise) {\n if (undefined === promise) {\n console.trace();\n return $.Deferred(d => d.reject('not a promise')).promise();\n }\n if (promise.always) {\n return promise;\n }\n return $.Deferred(async d => {\n try { d.resolve(await (promise instanceof Promise ? promise : promise())); }\n catch (e) { console.trace(e); d.reject(e); }\n }).promise();\n}", "/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n", "\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n", "/**\n * @file ORIGINAL SOURCE: src/app/core/g3w-component.js@v3.10.2\n * @since 3.11.0\n */\n\nimport G3WObject from 'g3w-object';\nimport { noop } from 'utils/noop';\nimport { $promisify } from 'utils/promisify';\nimport GUI from 'services/gui';\n\n/** @deprecated */\nimport _cloneDeep from 'lodash.clonedeep';\nimport deprecate from 'util-deprecate';\n\nfunction merge(destination, source) {\n for (let key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n destination[key] = source[key];\n }\n }\n}\n\n/**\n * Component class\n * \n * ORIGINAL SOURCE src/app/gui/component/component.js@v3.9.3\n * \n * @param { Object} opts\n * @param { number } opts.id \n * @param { string } opts.title\n * @param { boolean } opts.visible\n * @param { boolean } opts.open\n * @param { boolean } opts.resizable\n * @param { null | unknown } opts.info\n * @param { boolean } opts.loading\n * @param { boolean } opts.disabled\n * @param { boolean } opts.closewhenshowviewportcontent\n * @param opts.events\n * @param opts.internalComponent since 3.10.0\n * @param opts.service since 3.10.0\n */\nexport default class Component extends G3WObject {\n\n constructor(opts = {}) {\n\n // BACKCOMP v3.x\n if (opts.iconConfig) {\n console.warn('[G3W-CLIENT] iconConfig is deprecated');\n console.trace();\n opts.iconColor = opts.iconConfig.color;\n opts.icon = opts.iconConfig.icon;\n delete opts.iconConfig;\n }\n\n // TODO: check why `GUI.getFontClass` is undefined\n opts.icon = GUI.getFontClass(opts.icon) || opts.icon;\n\n opts.open = opts.open ?? false;\n opts.mobile = opts.mobile ?? true;\n opts.collapsible = opts.collapsible ?? true;\n\n super({\n setters: {\n\n setOpen(bool) {\n this.state.open = bool;\n if (this._setOpen) {\n this._setOpen(bool);\n }\n },\n\n setVisible(bool) {\n this.state.visible = bool;\n if (this._setVisible) {\n this._setVisible(bool);\n }\n },\n\n setLoading(bool = false) {\n this.state.loading = bool;\n },\n\n setDisabled(bool = false) {\n this.state.disabled = bool;\n },\n\n reload() {\n console.warn('[G3W-CLIENT] reloading of components will be discontinued, please update your code as soon as possible', this.getId())\n if (this._reload) {\n this._reload();\n }\n },\n }\n\n });\n\n this._firstLayout = true;\n\n /** internal VUE component */\n this.internalComponent = opts.internalComponent ?? null;\n\n /** @type { Array } */\n this._components = [];\n\n /** @type { string } */\n this.id = opts.id ?? Math.random() * 1000;\n\n /** @type { string } */\n this.title = opts.title ?? '';\n\n this.state = {\n sizes: { width: 0, height:0 },\n info: opts.info ?? null,\n open: opts.open ?? false,\n visible: opts.visible ?? true,\n loading: opts.loading ?? false,\n disabled: opts.disabled ?? false,\n resizable: opts.resizable ?? false,\n closewhenshowviewportcontent: opts.closewhenshowviewportcontent ?? true,\n };\n\n this.setService(opts.service || this);\n\n if (opts.internalComponent) {\n this.setInternalComponent(opts.internalComponent);\n }\n\n merge(this, opts);\n\n // add events options\n this.events = opts.events ?? {};\n\n if (this.events.open) {\n const { when = \"after\", cb = () => {} } = this.events.open;\n this[`on${when}`]('setOpen', bool => cb(bool));\n }\n\n if (opts.vueComponentObject) {\n this.init(opts);\n }\n }\n\n /**\n * @param { Object } opts\n * @param { Array } opts.components\n * @param { Object } opts.service\n * @param { Function } opts.service.init\n * @param opts.vueComponentObject\n * @param opts.template\n * @param opts.propsData\n */\n init(opts = {}) {\n this.vueComponent = _cloneDeep(opts.vueComponentObject);\n this._components = opts.components || [];\n\n this.setService(opts.service || this._service || noop);\n\n if (this._service.init && this.init !== this._service.init) {\n this._service.init(opts);\n }\n\n if (opts.template) {\n this.vueComponent.template = opts.template;\n }\n\n this.setInternalComponent = function() {\n this.internalComponent = new (Vue.extend(this.vueComponent))({\n service: this._service,\n template: opts.template,\n propsData: opts.propsData\n });\n this.internalComponent.state = this.getService().state;\n };\n\n this.setInternalComponent();\n\n return this;\n }\n\n getId() {\n return this.id;\n }\n\n setId(id) {\n this.id = id;\n }\n\n getOpen() {\n return this.state.open;\n }\n\n getVisible() {\n return this.state.visible;\n }\n\n getTitle() {\n return this.state.title;\n }\n\n setTitle(title) {\n this.state.title = title;\n }\n\n getService() {\n return this._service;\n }\n\n setService(service) {\n this._service = service;\n }\n\n addComponent(Component) {\n this._components.push(Component);\n }\n\n removeComponent(Component) {\n this._components.find((c, i) => {\n if (c === Component) {\n this.splice(i, 1);\n return true;\n }\n })\n }\n\n getInternalComponent() {\n return this.internalComponent;\n }\n\n setInternalComponent(internalComponent, options={}) {\n this.internalComponent = undefined === internalComponent && this.internalComponentClass ? new this.internalComponentClass : internalComponent;\n (options.events || [])\n .forEach(e => this.internalComponent.$on(e.name, data => e.handler && e.handler(data) || this[`set${e.name[0].toUpperCase()}${e.name.slice(1)}`](data)));\n if (this._service && this._service.state) {\n this.internalComponent.state = this._service.state;\n }\n }\n\n /**\n * @param { Element | 'string' } parent DOM element\n * @param { boolean } append\n * \n * @returns jquery promise\n * \n * @fires internalComponent~ready\n * @fires mount event\n */\n mount(parent, append) {\n return $promisify(new Promise((resolve) => {\n if (!this.internalComponent) {\n this.setInternalComponent();\n }\n\n if (append) {\n $(parent).append(this.internalComponent.$mount().$el);\n }\n\n if (!append){\n this.internalComponent.$mount(parent);\n }\n\n this.internalComponent.$nextTick(() => {\n this.emit('ready');\n resolve(true);\n });\n\n // emit mount event\n this.emit('mount');\n }))\n }\n\n /**\n * @returns jquery promise\n * \n * @fires unmount\n */\n unmount() {\n return $promisify(async () => {\n if (!this.internalComponent) {\n return;\n }\n if (this.state.resizable) {\n this.internalComponent.$off('resize-component', this.internalComponent.layout);\n }\n this.state.open = false;\n this.internalComponent.$destroy(true); // destroy vue component\n $(this.internalComponent.$el).remove(); // remove dom element\n this.internalComponent = null; // set internal componet to null (for GC)\n this.emit('unmount'); // emit unmount event\n })\n }\n\n /**\n * @returns { Element } DOM element\n */\n ismount() {\n return this.internalComponent && this.internalComponent.$el;\n }\n\n /**\n * @param { number } width \n * @param { number } height \n * \n * @listens internalComponent~resize-component\n * @fires internalComponent~resize-component\n * @fires layout\n */\n layout(width, height) {\n if (this.state.resizable && this._firstLayout) {\n this.internalComponent.$on('resize-component', this.internalComponent.layout);\n this._firstLayout = false;\n }\n this.internalComponent.$nextTick(() => { this.internalComponent.$emit('resize-component', { width, height }); });\n this.emit('layout');\n }\n\n}\n\n/**\n * @deprecated since 3.10.0 Will be deleted in 4.x.\n */\nObject.assign(Component.prototype, {\n destroy: noop,\n click: noop,\n show: noop,\n /** used by the following plugins: \"cadastre\", \"iternet\" */\n overwriteServiceMethods: deprecate(function(o) { Object.entries(o).forEach(([n, m]) => this._service[n] = m) }, '[G3W-CLIENT] Component::overwriteServiceMethods(methodsOptions) is deprecated'),\n /** used by the following plugins: \"cadastre\" */\n extendInternalComponent: deprecate(function(o) { this.vueComponent ? Object.entries(o).forEach(([k, v]) => { switch (k) { case 'methods': this.extendInternalComponentMethods(v); break; case 'components': this.extendInternalComponentComponents(v); break; case 'computed': merge(this.vueComponent[k], v); break; case 'data': merge(this.vueComponent[k], v); break; } }): (this.vueComponent = o); }, '[G3W-CLIENT] Component::extendInternalComponent(internalComponentOptions) is deprecated'),\n});", "/**\n * @file ORIGINAL SOURCE: src/app/core/g3w-panel.js@v3.10.2\n * @since 3.11.0\n */\n\nimport GUI from 'services/gui';\nimport G3WObject from 'g3w-object';\nimport { $promisify } from 'utils/promisify';\n\n/**\n * ORIGINAL SOURCE: src/app/gui/panel.js@v3.9.3 \n */\nexport default class Panel extends G3WObject {\n\n constructor (opts = {}) {\n super();\n\n this.id = opts.id || null;\n\n this.title = opts.title || '';\n\n this.service = opts.service;\n\n if (opts.vueComponentObject) {\n this.internalPanel = new (Vue.extend(opts.vueComponentObject))({ service: this.service });\n } else {\n this.internalPanel = opts.panel || opts.internalPanel || null; \n }\n\n if (true === opts.show && this.internalPanel) {\n this.show();\n }\n }\n\n getId() {\n return this.id;\n }\n\n getTitle() {\n return this.title;\n }\n\n getService() {\n return this.service;\n }\n\n setService(service) {\n this.service = service;\n }\n\n getInternalPanel() {\n return this.internalPanel;\n }\n\n setInternalPanel(internalPanel) {\n this.internalPanel = internalPanel;\n }\n\n show() {\n GUI.showPanel(this);\n }\n\n close() {\n GUI.closePanel();\n }\n\n mount(parent) {\n const panel = this.internalPanel;\n const vueComp = panel.$mount();\n $(parent).append(vueComp.$el);\n vueComp.$nextTick(() => {\n if (panel.onShow) { panel.onShow();}\n });\n return $promisify(Promise.resolve(true));\n }\n\n unmount() {\n const panel = this.internalPanel;\n panel.$destroy(true);\n $(panel.$el).remove();\n if (panel.onClose) { panel.onClose();}\n this.internalComponent = null;\n if (this.service && this.service.clear) {\n this.service.clear();\n }\n return $promisify(Promise.resolve());\n }\n\n}", "/**\n * Almost the same as lodash@v4.0.0 groupBy\n * \n * @since 3.10.0\n */\nexport function groupBy(array, keyFn) {\n return array.reduce((result, item) => {\n const key = keyFn(item);\n if (!result[key]) {\n result[key] = [];\n }\n result[key].push(item);\n return result;\n }, {});\n}", "export const XHR = {\n\n /**\n *\n * @param url\n * @param params\n * @param signal //@since 3.11.0 (e.g. const controller = new AbortController(); const signal = controller.signal; controller.abort();) * @return {Promise}\n */\n async get({ url, params = {}, signal } = {}) {\n if (!url) {\n return Promise.reject('No url');\n }\n\n params = new URLSearchParams(JSON.parse(JSON.stringify(params || {}))).toString();\n\n const response = await (await fetch(url + (params ? '?' : '') + params, { signal })).text();\n\n // Try to parse response as JSON\n try {\n return JSON.parse(response);\n } catch(e) {\n return response;\n }\n },\n\n /**\n * @since 3.11.0\n * @param url\n * @param data\n * @param formdata\n * @param contentType\n * @param signal //@since 3.11.0 (e.g. const controller = new AbortController(); const signal = controller.signal; controller.abort();)\n * @return {Promise}\n */\n async put({ url, data, formdata = false, contentType, signal } = {}) {\n if (formdata) {\n formdata = new FormData();\n Object.entries(data).forEach(([key, value]) => formdata.append(key, value));\n } else if (!contentType) {\n formdata = new URLSearchParams(JSON.parse(JSON.stringify(data || {}))).toString();\n } else {\n formdata = 'string' === typeof data ? data : JSON.stringify(data || {});\n }\n\n const response = await (await fetch(url, {\n method: 'PUT',\n body: formdata,\n headers: {\n 'Content-Type': contentType || 'application/x-www-form-urlencoded'\n },\n signal,\n })).text();\n\n // Try to parse response as JSON\n try {\n return JSON.parse(response);\n } catch(e) {\n return response;\n }\n },\n\n /**\n *\n * @param url\n * @param data\n * @param formdata\n * @param contentType\n * @param signal //@since 3.11.0 (e.g. const controller = new AbortController(); const signal = controller.signal; controller.abort();)\n * @return {Promise}\n */\n async post({ url, data, formdata = false, contentType, signal } = {}) {\n if (formdata) {\n formdata = new FormData();\n Object.entries(data).forEach(([key, value]) => formdata.append(key, value));\n } else if (!contentType) {\n formdata = new URLSearchParams(JSON.parse(JSON.stringify(data || {}))).toString();\n } else {\n formdata = 'string' === typeof data ? data : JSON.stringify(data || {});\n }\n\n const response = await (await fetch(url, {\n method: 'POST',\n body: formdata,\n headers: {\n 'Content-Type': contentType || 'application/x-www-form-urlencoded'\n },\n signal,\n })).text();\n\n // Try to parse response as JSON\n try {\n return JSON.parse(response);\n } catch(e) {\n return response;\n }\n },\n\n};", "function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var defineProperty = require(\"./defineProperty.js\");\nfunction _objectSpread(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? Object(arguments[r]) : {},\n o = Object.keys(t);\n \"function\" == typeof Object.getOwnPropertySymbols && o.push.apply(o, Object.getOwnPropertySymbols(t).filter(function (e) {\n return Object.getOwnPropertyDescriptor(t, e).enumerable;\n })), o.forEach(function (r) {\n defineProperty(e, r, t[r]);\n });\n }\n return e;\n}\nmodule.exports = _objectSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _classCallCheck(a, n) {\n if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var _typeof = require(\"./typeof.js\")[\"default\"];\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\nfunction _possibleConstructorReturn(t, e) {\n if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e;\n if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return assertThisInitialized(t);\n}\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _getPrototypeOf(t) {\n return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {\n return t.__proto__ || Object.getPrototypeOf(t);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _getPrototypeOf(t);\n}\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _setPrototypeOf(t, e) {\n return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _setPrototypeOf(t, e);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var setPrototypeOf = require(\"./setPrototypeOf.js\");\nfunction _inherits(t, e) {\n if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\");\n t.prototype = Object.create(e && e.prototype, {\n constructor: {\n value: t,\n writable: !0,\n configurable: !0\n }\n }), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), e && setPrototypeOf(t, e);\n}\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\nvar iterableToArray = require(\"./iterableToArray.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "var arrayWithHoles = require(\"./arrayWithHoles.js\");\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableRest = require(\"./nonIterableRest.js\");\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;", "'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar _typeof = _interopDefault(require('@babel/runtime/helpers/typeof'));\nvar _objectSpread = _interopDefault(require('@babel/runtime/helpers/objectSpread'));\nvar _classCallCheck = _interopDefault(require('@babel/runtime/helpers/classCallCheck'));\nvar _createClass = _interopDefault(require('@babel/runtime/helpers/createClass'));\nvar _possibleConstructorReturn = _interopDefault(require('@babel/runtime/helpers/possibleConstructorReturn'));\nvar _getPrototypeOf = _interopDefault(require('@babel/runtime/helpers/getPrototypeOf'));\nvar _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized'));\nvar _inherits = _interopDefault(require('@babel/runtime/helpers/inherits'));\nvar _toConsumableArray = _interopDefault(require('@babel/runtime/helpers/toConsumableArray'));\nvar _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray'));\n\nvar consoleLogger = {\n type: 'logger',\n log: function log(args) {\n this.output('log', args);\n },\n warn: function warn(args) {\n this.output('warn', args);\n },\n error: function error(args) {\n this.output('error', args);\n },\n output: function output(type, args) {\n var _console;\n\n /* eslint no-console: 0 */\n if (console && console[type]) (_console = console)[type].apply(_console, _toConsumableArray(args));\n }\n};\n\nvar Logger =\n/*#__PURE__*/\nfunction () {\n function Logger(concreteLogger) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Logger);\n\n this.init(concreteLogger, options);\n }\n\n _createClass(Logger, [{\n key: \"init\",\n value: function init(concreteLogger) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.prefix = options.prefix || 'i18next:';\n this.logger = concreteLogger || consoleLogger;\n this.options = options;\n this.debug = options.debug;\n }\n }, {\n key: \"setDebug\",\n value: function setDebug(bool) {\n this.debug = bool;\n }\n }, {\n key: \"log\",\n value: function log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return this.forward(args, 'log', '', true);\n }\n }, {\n key: \"warn\",\n value: function warn() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return this.forward(args, 'warn', '', true);\n }\n }, {\n key: \"error\",\n value: function error() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return this.forward(args, 'error', '');\n }\n }, {\n key: \"deprecate\",\n value: function deprecate() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);\n }\n }, {\n key: \"forward\",\n value: function forward(args, lvl, prefix, debugOnly) {\n if (debugOnly && !this.debug) return null;\n if (typeof args[0] === 'string') args[0] = \"\".concat(prefix).concat(this.prefix, \" \").concat(args[0]);\n return this.logger[lvl](args);\n }\n }, {\n key: \"create\",\n value: function create(moduleName) {\n return new Logger(this.logger, _objectSpread({}, {\n prefix: \"\".concat(this.prefix, \":\").concat(moduleName, \":\")\n }, this.options));\n }\n }]);\n\n return Logger;\n}();\n\nvar baseLogger = new Logger();\n\nvar EventEmitter =\n/*#__PURE__*/\nfunction () {\n function EventEmitter() {\n _classCallCheck(this, EventEmitter);\n\n this.observers = {};\n }\n\n _createClass(EventEmitter, [{\n key: \"on\",\n value: function on(events, listener) {\n var _this = this;\n\n events.split(' ').forEach(function (event) {\n _this.observers[event] = _this.observers[event] || [];\n\n _this.observers[event].push(listener);\n });\n return this;\n }\n }, {\n key: \"off\",\n value: function off(event, listener) {\n if (!this.observers[event]) return;\n\n if (!listener) {\n delete this.observers[event];\n return;\n }\n\n this.observers[event] = this.observers[event].filter(function (l) {\n return l !== listener;\n });\n }\n }, {\n key: \"emit\",\n value: function emit(event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (this.observers[event]) {\n var cloned = [].concat(this.observers[event]);\n cloned.forEach(function (observer) {\n observer.apply(void 0, args);\n });\n }\n\n if (this.observers['*']) {\n var _cloned = [].concat(this.observers['*']);\n\n _cloned.forEach(function (observer) {\n observer.apply(observer, [event].concat(args));\n });\n }\n }\n }]);\n\n return EventEmitter;\n}();\n\n// http://lea.verou.me/2016/12/resolve-promises-externally-with-this-one-weird-trick/\nfunction defer() {\n var res;\n var rej;\n var promise = new Promise(function (resolve, reject) {\n res = resolve;\n rej = reject;\n });\n promise.resolve = res;\n promise.reject = rej;\n return promise;\n}\nfunction makeString(object) {\n if (object == null) return '';\n /* eslint prefer-template: 0 */\n\n return '' + object;\n}\nfunction copy(a, s, t) {\n a.forEach(function (m) {\n if (s[m]) t[m] = s[m];\n });\n}\n\nfunction getLastOfPath(object, path, Empty) {\n function cleanKey(key) {\n return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;\n }\n\n function canNotTraverseDeeper() {\n return !object || typeof object === 'string';\n }\n\n var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');\n\n while (stack.length > 1) {\n if (canNotTraverseDeeper()) return {};\n var key = cleanKey(stack.shift());\n if (!object[key] && Empty) object[key] = new Empty();\n object = object[key];\n }\n\n if (canNotTraverseDeeper()) return {};\n return {\n obj: object,\n k: cleanKey(stack.shift())\n };\n}\n\nfunction setPath(object, path, newValue) {\n var _getLastOfPath = getLastOfPath(object, path, Object),\n obj = _getLastOfPath.obj,\n k = _getLastOfPath.k;\n\n obj[k] = newValue;\n}\nfunction pushPath(object, path, newValue, concat) {\n var _getLastOfPath2 = getLastOfPath(object, path, Object),\n obj = _getLastOfPath2.obj,\n k = _getLastOfPath2.k;\n\n obj[k] = obj[k] || [];\n if (concat) obj[k] = obj[k].concat(newValue);\n if (!concat) obj[k].push(newValue);\n}\nfunction getPath(object, path) {\n var _getLastOfPath3 = getLastOfPath(object, path),\n obj = _getLastOfPath3.obj,\n k = _getLastOfPath3.k;\n\n if (!obj) return undefined;\n return obj[k];\n}\nfunction getPathWithDefaults(data, defaultData, key) {\n var value = getPath(data, key);\n\n if (value !== undefined) {\n return value;\n } // Fallback to default values\n\n\n return getPath(defaultData, key);\n}\nfunction deepExtend(target, source, overwrite) {\n /* eslint no-restricted-syntax: 0 */\n for (var prop in source) {\n if (prop in target) {\n // If we reached a leaf string in target or source then replace with source or skip depending on the 'overwrite' switch\n if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) {\n if (overwrite) target[prop] = source[prop];\n } else {\n deepExtend(target[prop], source[prop], overwrite);\n }\n } else {\n target[prop] = source[prop];\n }\n }\n\n return target;\n}\nfunction regexEscape(str) {\n /* eslint no-useless-escape: 0 */\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\n/* eslint-disable */\n\nvar _entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n};\n/* eslint-enable */\n\nfunction escape(data) {\n if (typeof data === 'string') {\n return data.replace(/[&<>\"'\\/]/g, function (s) {\n return _entityMap[s];\n });\n }\n\n return data;\n}\n\nvar ResourceStore =\n/*#__PURE__*/\nfunction (_EventEmitter) {\n _inherits(ResourceStore, _EventEmitter);\n\n function ResourceStore(data) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n ns: ['translation'],\n defaultNS: 'translation'\n };\n\n _classCallCheck(this, ResourceStore);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ResourceStore).call(this));\n EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor)\n\n _this.data = data || {};\n _this.options = options;\n\n if (_this.options.keySeparator === undefined) {\n _this.options.keySeparator = '.';\n }\n\n return _this;\n }\n\n _createClass(ResourceStore, [{\n key: \"addNamespaces\",\n value: function addNamespaces(ns) {\n if (this.options.ns.indexOf(ns) < 0) {\n this.options.ns.push(ns);\n }\n }\n }, {\n key: \"removeNamespaces\",\n value: function removeNamespaces(ns) {\n var index = this.options.ns.indexOf(ns);\n\n if (index > -1) {\n this.options.ns.splice(index, 1);\n }\n }\n }, {\n key: \"getResource\",\n value: function getResource(lng, ns, key) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var path = [lng, ns];\n if (key && typeof key !== 'string') path = path.concat(key);\n if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);\n\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n }\n\n return getPath(this.data, path);\n }\n }, {\n key: \"addResource\",\n value: function addResource(lng, ns, key, value) {\n var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n silent: false\n };\n var keySeparator = this.options.keySeparator;\n if (keySeparator === undefined) keySeparator = '.';\n var path = [lng, ns];\n if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);\n\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n value = ns;\n ns = path[1];\n }\n\n this.addNamespaces(ns);\n setPath(this.data, path, value);\n if (!options.silent) this.emit('added', lng, ns, key, value);\n }\n }, {\n key: \"addResources\",\n value: function addResources(lng, ns, resources) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n silent: false\n };\n\n /* eslint no-restricted-syntax: 0 */\n for (var m in resources) {\n if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], {\n silent: true\n });\n }\n\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n }, {\n key: \"addResourceBundle\",\n value: function addResourceBundle(lng, ns, resources, deep, overwrite) {\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {\n silent: false\n };\n var path = [lng, ns];\n\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n deep = resources;\n resources = ns;\n ns = path[1];\n }\n\n this.addNamespaces(ns);\n var pack = getPath(this.data, path) || {};\n\n if (deep) {\n deepExtend(pack, resources, overwrite);\n } else {\n pack = _objectSpread({}, pack, resources);\n }\n\n setPath(this.data, path, pack);\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n }, {\n key: \"removeResourceBundle\",\n value: function removeResourceBundle(lng, ns) {\n if (this.hasResourceBundle(lng, ns)) {\n delete this.data[lng][ns];\n }\n\n this.removeNamespaces(ns);\n this.emit('removed', lng, ns);\n }\n }, {\n key: \"hasResourceBundle\",\n value: function hasResourceBundle(lng, ns) {\n return this.getResource(lng, ns) !== undefined;\n }\n }, {\n key: \"getResourceBundle\",\n value: function getResourceBundle(lng, ns) {\n if (!ns) ns = this.options.defaultNS; // COMPATIBILITY: remove extend in v2.1.0\n\n if (this.options.compatibilityAPI === 'v1') return _objectSpread({}, {}, this.getResource(lng, ns));\n return this.getResource(lng, ns);\n }\n }, {\n key: \"getDataByLanguage\",\n value: function getDataByLanguage(lng) {\n return this.data[lng];\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return this.data;\n }\n }]);\n\n return ResourceStore;\n}(EventEmitter);\n\nvar postProcessor = {\n processors: {},\n addPostProcessor: function addPostProcessor(module) {\n this.processors[module.name] = module;\n },\n handle: function handle(processors, value, key, options, translator) {\n var _this = this;\n\n processors.forEach(function (processor) {\n if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);\n });\n return value;\n }\n};\n\nvar checkedLoadedFor = {};\n\nvar Translator =\n/*#__PURE__*/\nfunction (_EventEmitter) {\n _inherits(Translator, _EventEmitter);\n\n function Translator(services) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Translator);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Translator).call(this));\n EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor)\n\n copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, _assertThisInitialized(_this));\n _this.options = options;\n\n if (_this.options.keySeparator === undefined) {\n _this.options.keySeparator = '.';\n }\n\n _this.logger = baseLogger.create('translator');\n return _this;\n }\n\n _createClass(Translator, [{\n key: \"changeLanguage\",\n value: function changeLanguage(lng) {\n if (lng) this.language = lng;\n }\n }, {\n key: \"exists\",\n value: function exists(key) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n interpolation: {}\n };\n var resolved = this.resolve(key, options);\n return resolved && resolved.res !== undefined;\n }\n }, {\n key: \"extractFromKey\",\n value: function extractFromKey(key, options) {\n var nsSeparator = options.nsSeparator || this.options.nsSeparator;\n if (nsSeparator === undefined) nsSeparator = ':';\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var namespaces = options.ns || this.options.defaultNS;\n\n if (nsSeparator && key.indexOf(nsSeparator) > -1) {\n var parts = key.split(nsSeparator);\n if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();\n key = parts.join(keySeparator);\n }\n\n if (typeof namespaces === 'string') namespaces = [namespaces];\n return {\n key: key,\n namespaces: namespaces\n };\n }\n }, {\n key: \"translate\",\n value: function translate(keys, options) {\n var _this2 = this;\n\n if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {\n /* eslint prefer-rest-params: 0 */\n options = this.options.overloadTranslationOptionHandler(arguments);\n }\n\n if (!options) options = {}; // non valid keys handling\n\n if (keys === undefined || keys === null) return '';\n if (!Array.isArray(keys)) keys = [String(keys)]; // separators\n\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator; // get namespace(s)\n\n var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options),\n key = _this$extractFromKey.key,\n namespaces = _this$extractFromKey.namespaces;\n\n var namespace = namespaces[namespaces.length - 1]; // return key on CIMode\n\n var lng = options.lng || this.language;\n var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;\n\n if (lng && lng.toLowerCase() === 'cimode') {\n if (appendNamespaceToCIMode) {\n var nsSeparator = options.nsSeparator || this.options.nsSeparator;\n return namespace + nsSeparator + key;\n }\n\n return key;\n } // resolve from store\n\n\n var resolved = this.resolve(keys, options);\n var res = resolved && resolved.res;\n var resUsedKey = resolved && resolved.usedKey || key;\n var resExactUsedKey = resolved && resolved.exactUsedKey || key;\n var resType = Object.prototype.toString.apply(res);\n var noObject = ['[object Number]', '[object Function]', '[object RegExp]'];\n var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays; // object\n\n var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;\n var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';\n\n if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {\n if (!options.returnObjects && !this.options.returnObjects) {\n this.logger.warn('accessing an object - but returnObjects options is not enabled!');\n return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, options) : \"key '\".concat(key, \" (\").concat(this.language, \")' returned an object instead of string.\");\n } // if we got a separator we loop over children - else we just return object as is\n // as having it set to false means no hierarchy so no lookup for nested values\n\n\n if (keySeparator) {\n var resTypeIsArray = resType === '[object Array]';\n var copy$$1 = resTypeIsArray ? [] : {}; // apply child translation on a copy\n\n /* eslint no-restricted-syntax: 0 */\n\n var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;\n\n for (var m in res) {\n if (Object.prototype.hasOwnProperty.call(res, m)) {\n var deepKey = \"\".concat(newKeyToUse).concat(keySeparator).concat(m);\n copy$$1[m] = this.translate(deepKey, _objectSpread({}, options, {\n joinArrays: false,\n ns: namespaces\n }));\n if (copy$$1[m] === deepKey) copy$$1[m] = res[m]; // if nothing found use orginal value as fallback\n }\n }\n\n res = copy$$1;\n }\n } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {\n // array special treatment\n res = res.join(joinArrays);\n if (res) res = this.extendTranslation(res, keys, options);\n } else {\n // string, empty or null\n var usedDefault = false;\n var usedKey = false; // fallback value\n\n if (!this.isValidLookup(res) && options.defaultValue !== undefined) {\n usedDefault = true;\n\n if (options.count !== undefined) {\n var suffix = this.pluralResolver.getSuffix(lng, options.count);\n res = options[\"defaultValue\".concat(suffix)];\n }\n\n if (!res) res = options.defaultValue;\n }\n\n if (!this.isValidLookup(res)) {\n usedKey = true;\n res = key;\n } // save missing\n\n\n var updateMissing = options.defaultValue && options.defaultValue !== res && this.options.updateMissing;\n\n if (usedKey || usedDefault || updateMissing) {\n this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? options.defaultValue : res);\n var lngs = [];\n var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);\n\n if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {\n for (var i = 0; i < fallbackLngs.length; i++) {\n lngs.push(fallbackLngs[i]);\n }\n } else if (this.options.saveMissingTo === 'all') {\n lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);\n } else {\n lngs.push(options.lng || this.language);\n }\n\n var send = function send(l, k) {\n if (_this2.options.missingKeyHandler) {\n _this2.options.missingKeyHandler(l, namespace, k, updateMissing ? options.defaultValue : res, updateMissing, options);\n } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {\n _this2.backendConnector.saveMissing(l, namespace, k, updateMissing ? options.defaultValue : res, updateMissing, options);\n }\n\n _this2.emit('missingKey', l, namespace, k, res);\n };\n\n if (this.options.saveMissing) {\n var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n\n if (this.options.saveMissingPlurals && needsPluralHandling) {\n lngs.forEach(function (l) {\n var plurals = _this2.pluralResolver.getPluralFormsOfKey(l, key);\n\n plurals.forEach(function (p) {\n return send([l], p);\n });\n });\n } else {\n send(lngs, key);\n }\n }\n } // extend\n\n\n res = this.extendTranslation(res, keys, options, resolved); // append namespace if still key\n\n if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = \"\".concat(namespace, \":\").concat(key); // parseMissingKeyHandler\n\n if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res);\n } // return\n\n\n return res;\n }\n }, {\n key: \"extendTranslation\",\n value: function extendTranslation(res, key, options, resolved) {\n var _this3 = this;\n\n if (this.i18nFormat && this.i18nFormat.parse) {\n res = this.i18nFormat.parse(res, options, resolved.usedLng, resolved.usedNS, resolved.usedKey, {\n resolved: resolved\n });\n } else if (!options.skipInterpolation) {\n // i18next.parsing\n if (options.interpolation) this.interpolator.init(_objectSpread({}, options, {\n interpolation: _objectSpread({}, this.options.interpolation, options.interpolation)\n })); // interpolate\n\n var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;\n if (this.options.interpolation.defaultVariables) data = _objectSpread({}, this.options.interpolation.defaultVariables, data);\n res = this.interpolator.interpolate(res, data, options.lng || this.language, options); // nesting\n\n if (options.nest !== false) res = this.interpolator.nest(res, function () {\n return _this3.translate.apply(_this3, arguments);\n }, options);\n if (options.interpolation) this.interpolator.reset();\n } // post process\n\n\n var postProcess = options.postProcess || this.options.postProcess;\n var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;\n\n if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {\n res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread({\n i18nResolved: resolved\n }, options) : options, this);\n }\n\n return res;\n }\n }, {\n key: \"resolve\",\n value: function resolve(keys) {\n var _this4 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var found;\n var usedKey; // plain key\n\n var exactUsedKey; // key with context / plural\n\n var usedLng;\n var usedNS;\n if (typeof keys === 'string') keys = [keys]; // forEach possible key\n\n keys.forEach(function (k) {\n if (_this4.isValidLookup(found)) return;\n\n var extracted = _this4.extractFromKey(k, options);\n\n var key = extracted.key;\n usedKey = key;\n var namespaces = extracted.namespaces;\n if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);\n var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== '';\n var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);\n namespaces.forEach(function (ns) {\n if (_this4.isValidLookup(found)) return;\n usedNS = ns;\n\n if (!checkedLoadedFor[\"\".concat(codes[0], \"-\").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {\n checkedLoadedFor[\"\".concat(codes[0], \"-\").concat(ns)] = true;\n\n _this4.logger.warn(\"key \\\"\".concat(usedKey, \"\\\" for namespace \\\"\").concat(usedNS, \"\\\" for languages \\\"\").concat(codes.join(', '), \"\\\" won't get resolved as namespace was not yet loaded\"), 'This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n }\n\n codes.forEach(function (code) {\n if (_this4.isValidLookup(found)) return;\n usedLng = code;\n var finalKey = key;\n var finalKeys = [finalKey];\n\n if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {\n _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);\n } else {\n var pluralSuffix;\n if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count); // fallback for plural if context not found\n\n if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix); // get key for context if needed\n\n if (needsContextHandling) finalKeys.push(finalKey += \"\".concat(_this4.options.contextSeparator).concat(options.context)); // get key for plural if needed\n\n if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix);\n } // iterate over finalKeys starting with most specific pluralkey (-> contextkey only) -> singularkey only\n\n\n var possibleKey;\n /* eslint no-cond-assign: 0 */\n\n while (possibleKey = finalKeys.pop()) {\n if (!_this4.isValidLookup(found)) {\n exactUsedKey = possibleKey;\n found = _this4.getResource(code, ns, possibleKey, options);\n }\n }\n });\n });\n });\n return {\n res: found,\n usedKey: usedKey,\n exactUsedKey: exactUsedKey,\n usedLng: usedLng,\n usedNS: usedNS\n };\n }\n }, {\n key: \"isValidLookup\",\n value: function isValidLookup(res) {\n return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');\n }\n }, {\n key: \"getResource\",\n value: function getResource(code, ns, key) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);\n return this.resourceStore.getResource(code, ns, key, options);\n }\n }]);\n\n return Translator;\n}(EventEmitter);\n\nfunction capitalize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nvar LanguageUtil =\n/*#__PURE__*/\nfunction () {\n function LanguageUtil(options) {\n _classCallCheck(this, LanguageUtil);\n\n this.options = options;\n this.whitelist = this.options.whitelist || false;\n this.logger = baseLogger.create('languageUtils');\n }\n\n _createClass(LanguageUtil, [{\n key: \"getScriptPartFromCode\",\n value: function getScriptPartFromCode(code) {\n if (!code || code.indexOf('-') < 0) return null;\n var p = code.split('-');\n if (p.length === 2) return null;\n p.pop();\n return this.formatLanguageCode(p.join('-'));\n }\n }, {\n key: \"getLanguagePartFromCode\",\n value: function getLanguagePartFromCode(code) {\n if (!code || code.indexOf('-') < 0) return code;\n var p = code.split('-');\n return this.formatLanguageCode(p[0]);\n }\n }, {\n key: \"formatLanguageCode\",\n value: function formatLanguageCode(code) {\n // http://www.iana.org/assignments/language-tags/language-tags.xhtml\n if (typeof code === 'string' && code.indexOf('-') > -1) {\n var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];\n var p = code.split('-');\n\n if (this.options.lowerCaseLng) {\n p = p.map(function (part) {\n return part.toLowerCase();\n });\n } else if (p.length === 2) {\n p[0] = p[0].toLowerCase();\n p[1] = p[1].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n } else if (p.length === 3) {\n p[0] = p[0].toLowerCase(); // if lenght 2 guess it's a country\n\n if (p[1].length === 2) p[1] = p[1].toUpperCase();\n if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());\n }\n\n return p.join('-');\n }\n\n return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;\n }\n }, {\n key: \"isWhitelisted\",\n value: function isWhitelisted(code) {\n if (this.options.load === 'languageOnly' || this.options.nonExplicitWhitelist) {\n code = this.getLanguagePartFromCode(code);\n }\n\n return !this.whitelist || !this.whitelist.length || this.whitelist.indexOf(code) > -1;\n }\n }, {\n key: \"getFallbackCodes\",\n value: function getFallbackCodes(fallbacks, code) {\n if (!fallbacks) return [];\n if (typeof fallbacks === 'string') fallbacks = [fallbacks];\n if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;\n if (!code) return fallbacks[\"default\"] || []; // asume we have an object defining fallbacks\n\n var found = fallbacks[code];\n if (!found) found = fallbacks[this.getScriptPartFromCode(code)];\n if (!found) found = fallbacks[this.formatLanguageCode(code)];\n if (!found) found = fallbacks[\"default\"];\n return found || [];\n }\n }, {\n key: \"toResolveHierarchy\",\n value: function toResolveHierarchy(code, fallbackCode) {\n var _this = this;\n\n var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);\n var codes = [];\n\n var addCode = function addCode(c) {\n if (!c) return;\n\n if (_this.isWhitelisted(c)) {\n codes.push(c);\n } else {\n _this.logger.warn(\"rejecting non-whitelisted language code: \".concat(c));\n }\n };\n\n if (typeof code === 'string' && code.indexOf('-') > -1) {\n if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));\n if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));\n if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));\n } else if (typeof code === 'string') {\n addCode(this.formatLanguageCode(code));\n }\n\n fallbackCodes.forEach(function (fc) {\n if (codes.indexOf(fc) < 0) addCode(_this.formatLanguageCode(fc));\n });\n return codes;\n }\n }]);\n\n return LanguageUtil;\n}();\n\n/* eslint-disable */\n\nvar sets = [{\n lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'ti', 'tr', 'uz', 'wa'],\n nr: [1, 2],\n fc: 1\n}, {\n lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],\n nr: [1, 2],\n fc: 2\n}, {\n lngs: ['ay', 'bo', 'cgg', 'fa', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],\n nr: [1],\n fc: 3\n}, {\n lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],\n nr: [1, 2, 5],\n fc: 4\n}, {\n lngs: ['ar'],\n nr: [0, 1, 2, 3, 11, 100],\n fc: 5\n}, {\n lngs: ['cs', 'sk'],\n nr: [1, 2, 5],\n fc: 6\n}, {\n lngs: ['csb', 'pl'],\n nr: [1, 2, 5],\n fc: 7\n}, {\n lngs: ['cy'],\n nr: [1, 2, 3, 8],\n fc: 8\n}, {\n lngs: ['fr'],\n nr: [1, 2],\n fc: 9\n}, {\n lngs: ['ga'],\n nr: [1, 2, 3, 7, 11],\n fc: 10\n}, {\n lngs: ['gd'],\n nr: [1, 2, 3, 20],\n fc: 11\n}, {\n lngs: ['is'],\n nr: [1, 2],\n fc: 12\n}, {\n lngs: ['jv'],\n nr: [0, 1],\n fc: 13\n}, {\n lngs: ['kw'],\n nr: [1, 2, 3, 4],\n fc: 14\n}, {\n lngs: ['lt'],\n nr: [1, 2, 10],\n fc: 15\n}, {\n lngs: ['lv'],\n nr: [1, 2, 0],\n fc: 16\n}, {\n lngs: ['mk'],\n nr: [1, 2],\n fc: 17\n}, {\n lngs: ['mnk'],\n nr: [0, 1, 2],\n fc: 18\n}, {\n lngs: ['mt'],\n nr: [1, 2, 11, 20],\n fc: 19\n}, {\n lngs: ['or'],\n nr: [2, 1],\n fc: 2\n}, {\n lngs: ['ro'],\n nr: [1, 2, 20],\n fc: 20\n}, {\n lngs: ['sl'],\n nr: [5, 1, 2, 3],\n fc: 21\n}, {\n lngs: ['he'],\n nr: [1, 2, 20, 21],\n fc: 22\n}];\nvar _rulesPluralsTypes = {\n 1: function _(n) {\n return Number(n > 1);\n },\n 2: function _(n) {\n return Number(n != 1);\n },\n 3: function _(n) {\n return 0;\n },\n 4: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 5: function _(n) {\n return Number(n === 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5);\n },\n 6: function _(n) {\n return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);\n },\n 7: function _(n) {\n return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 8: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3);\n },\n 9: function _(n) {\n return Number(n >= 2);\n },\n 10: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);\n },\n 11: function _(n) {\n return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3);\n },\n 12: function _(n) {\n return Number(n % 10 != 1 || n % 100 == 11);\n },\n 13: function _(n) {\n return Number(n !== 0);\n },\n 14: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3);\n },\n 15: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 16: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2);\n },\n 17: function _(n) {\n return Number(n == 1 || n % 10 == 1 ? 0 : 1);\n },\n 18: function _(n) {\n return Number(n == 0 ? 0 : n == 1 ? 1 : 2);\n },\n 19: function _(n) {\n return Number(n == 1 ? 0 : n === 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3);\n },\n 20: function _(n) {\n return Number(n == 1 ? 0 : n === 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2);\n },\n 21: function _(n) {\n return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);\n },\n 22: function _(n) {\n return Number(n === 1 ? 0 : n === 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);\n }\n};\n/* eslint-enable */\n\nfunction createRules() {\n var rules = {};\n sets.forEach(function (set) {\n set.lngs.forEach(function (l) {\n rules[l] = {\n numbers: set.nr,\n plurals: _rulesPluralsTypes[set.fc]\n };\n });\n });\n return rules;\n}\n\nvar PluralResolver =\n/*#__PURE__*/\nfunction () {\n function PluralResolver(languageUtils) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, PluralResolver);\n\n this.languageUtils = languageUtils;\n this.options = options;\n this.logger = baseLogger.create('pluralResolver');\n this.rules = createRules();\n }\n\n _createClass(PluralResolver, [{\n key: \"addRule\",\n value: function addRule(lng, obj) {\n this.rules[lng] = obj;\n }\n }, {\n key: \"getRule\",\n value: function getRule(code) {\n return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];\n }\n }, {\n key: \"needsPlural\",\n value: function needsPlural(code) {\n var rule = this.getRule(code);\n return rule && rule.numbers.length > 1;\n }\n }, {\n key: \"getPluralFormsOfKey\",\n value: function getPluralFormsOfKey(code, key) {\n var _this = this;\n\n var ret = [];\n var rule = this.getRule(code);\n if (!rule) return ret;\n rule.numbers.forEach(function (n) {\n var suffix = _this.getSuffix(code, n);\n\n ret.push(\"\".concat(key).concat(suffix));\n });\n return ret;\n }\n }, {\n key: \"getSuffix\",\n value: function getSuffix(code, count) {\n var _this2 = this;\n\n var rule = this.getRule(code);\n\n if (rule) {\n // if (rule.numbers.length === 1) return ''; // only singular\n var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));\n var suffix = rule.numbers[idx]; // special treatment for lngs only having singular and plural\n\n if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n if (suffix === 2) {\n suffix = 'plural';\n } else if (suffix === 1) {\n suffix = '';\n }\n }\n\n var returnSuffix = function returnSuffix() {\n return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();\n }; // COMPATIBILITY JSON\n // v1\n\n\n if (this.options.compatibilityJSON === 'v1') {\n if (suffix === 1) return '';\n if (typeof suffix === 'number') return \"_plural_\".concat(suffix.toString());\n return returnSuffix();\n } else if (\n /* v2 */\n this.options.compatibilityJSON === 'v2') {\n return returnSuffix();\n } else if (\n /* v3 - gettext index */\n this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n return returnSuffix();\n }\n\n return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();\n }\n\n this.logger.warn(\"no plural rule found for: \".concat(code));\n return '';\n }\n }]);\n\n return PluralResolver;\n}();\n\nvar Interpolator =\n/*#__PURE__*/\nfunction () {\n function Interpolator() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Interpolator);\n\n this.logger = baseLogger.create('interpolator');\n this.options = options;\n\n this.format = options.interpolation && options.interpolation.format || function (value) {\n return value;\n };\n\n this.init(options);\n }\n /* eslint no-param-reassign: 0 */\n\n\n _createClass(Interpolator, [{\n key: \"init\",\n value: function init() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!options.interpolation) options.interpolation = {\n escapeValue: true\n };\n var iOpts = options.interpolation;\n this.escape = iOpts.escape !== undefined ? iOpts.escape : escape;\n this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;\n this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;\n this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';\n this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}';\n this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';\n this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-';\n this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || '';\n this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape('$t(');\n this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(')');\n this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000; // the regexp\n\n this.resetRegExp();\n }\n }, {\n key: \"reset\",\n value: function reset() {\n if (this.options) this.init(this.options);\n }\n }, {\n key: \"resetRegExp\",\n value: function resetRegExp() {\n // the regexp\n var regexpStr = \"\".concat(this.prefix, \"(.+?)\").concat(this.suffix);\n this.regexp = new RegExp(regexpStr, 'g');\n var regexpUnescapeStr = \"\".concat(this.prefix).concat(this.unescapePrefix, \"(.+?)\").concat(this.unescapeSuffix).concat(this.suffix);\n this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g');\n var nestingRegexpStr = \"\".concat(this.nestingPrefix, \"(.+?)\").concat(this.nestingSuffix);\n this.nestingRegexp = new RegExp(nestingRegexpStr, 'g');\n }\n }, {\n key: \"interpolate\",\n value: function interpolate(str, data, lng, options) {\n var _this = this;\n\n var match;\n var value;\n var replaces;\n var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};\n\n function regexSafe(val) {\n return val.replace(/\\$/g, '$$$$');\n }\n\n var handleFormat = function handleFormat(key) {\n if (key.indexOf(_this.formatSeparator) < 0) {\n return getPathWithDefaults(data, defaultData, key);\n }\n\n var p = key.split(_this.formatSeparator);\n var k = p.shift().trim();\n var f = p.join(_this.formatSeparator).trim();\n return _this.format(getPathWithDefaults(data, defaultData, k), f, lng);\n };\n\n this.resetRegExp();\n var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;\n replaces = 0; // unescape if has unescapePrefix/Suffix\n\n /* eslint no-cond-assign: 0 */\n\n while (match = this.regexpUnescape.exec(str)) {\n value = handleFormat(match[1].trim());\n\n if (value === undefined) {\n if (typeof missingInterpolationHandler === 'function') {\n var temp = missingInterpolationHandler(str, match, options);\n value = typeof temp === 'string' ? temp : '';\n } else {\n this.logger.warn(\"missed to pass in variable \".concat(match[1], \" for interpolating \").concat(str));\n value = '';\n }\n } else if (typeof value !== 'string' && !this.useRawValueToEscape) {\n value = makeString(value);\n }\n\n str = str.replace(match[0], regexSafe(value));\n this.regexpUnescape.lastIndex = 0;\n replaces++;\n\n if (replaces >= this.maxReplaces) {\n break;\n }\n }\n\n replaces = 0; // regular escape on demand\n\n while (match = this.regexp.exec(str)) {\n value = handleFormat(match[1].trim());\n\n if (value === undefined) {\n if (typeof missingInterpolationHandler === 'function') {\n var _temp = missingInterpolationHandler(str, match, options);\n\n value = typeof _temp === 'string' ? _temp : '';\n } else {\n this.logger.warn(\"missed to pass in variable \".concat(match[1], \" for interpolating \").concat(str));\n value = '';\n }\n } else if (typeof value !== 'string' && !this.useRawValueToEscape) {\n value = makeString(value);\n }\n\n value = this.escapeValue ? regexSafe(this.escape(value)) : regexSafe(value);\n str = str.replace(match[0], value);\n this.regexp.lastIndex = 0;\n replaces++;\n\n if (replaces >= this.maxReplaces) {\n break;\n }\n }\n\n return str;\n }\n }, {\n key: \"nest\",\n value: function nest(str, fc) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var match;\n var value;\n\n var clonedOptions = _objectSpread({}, options);\n\n clonedOptions.applyPostProcessor = false; // avoid post processing on nested lookup\n\n delete clonedOptions.defaultValue; // assert we do not get a endless loop on interpolating defaultValue again and again\n // if value is something like \"myKey\": \"lorem $(anotherKey, { \"count\": {{aValueInOptions}} })\"\n\n function handleHasOptions(key, inheritedOptions) {\n if (key.indexOf(',') < 0) return key;\n var p = key.split(',');\n key = p.shift();\n var optionsString = p.join(',');\n optionsString = this.interpolate(optionsString, clonedOptions);\n optionsString = optionsString.replace(/'/g, '\"');\n\n try {\n clonedOptions = JSON.parse(optionsString);\n if (inheritedOptions) clonedOptions = _objectSpread({}, inheritedOptions, clonedOptions);\n } catch (e) {\n this.logger.error(\"failed parsing options string in nesting for key \".concat(key), e);\n } // assert we do not get a endless loop on interpolating defaultValue again and again\n\n\n delete clonedOptions.defaultValue;\n return key;\n } // regular escape on demand\n\n\n while (match = this.nestingRegexp.exec(str)) {\n value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions); // is only the nesting key (key1 = '$(key2)') return the value without stringify\n\n if (value && match[0] === str && typeof value !== 'string') return value; // no string to include or empty\n\n if (typeof value !== 'string') value = makeString(value);\n\n if (!value) {\n this.logger.warn(\"missed to resolve \".concat(match[1], \" for nesting \").concat(str));\n value = '';\n } // Nested keys should not be escaped by default #854\n // value = this.escapeValue ? regexSafe(utils.escape(value)) : regexSafe(value);\n\n\n str = str.replace(match[0], value);\n this.regexp.lastIndex = 0;\n }\n\n return str;\n }\n }]);\n\n return Interpolator;\n}();\n\nfunction remove(arr, what) {\n var found = arr.indexOf(what);\n\n while (found !== -1) {\n arr.splice(found, 1);\n found = arr.indexOf(what);\n }\n}\n\nvar Connector =\n/*#__PURE__*/\nfunction (_EventEmitter) {\n _inherits(Connector, _EventEmitter);\n\n function Connector(backend, store, services) {\n var _this;\n\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n _classCallCheck(this, Connector);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this));\n EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor)\n\n _this.backend = backend;\n _this.store = store;\n _this.services = services;\n _this.languageUtils = services.languageUtils;\n _this.options = options;\n _this.logger = baseLogger.create('backendConnector');\n _this.state = {};\n _this.queue = [];\n\n if (_this.backend && _this.backend.init) {\n _this.backend.init(services, options.backend, options);\n }\n\n return _this;\n }\n\n _createClass(Connector, [{\n key: \"queueLoad\",\n value: function queueLoad(languages, namespaces, options, callback) {\n var _this2 = this;\n\n // find what needs to be loaded\n var toLoad = [];\n var pending = [];\n var toLoadLanguages = [];\n var toLoadNamespaces = [];\n languages.forEach(function (lng) {\n var hasAllNamespaces = true;\n namespaces.forEach(function (ns) {\n var name = \"\".concat(lng, \"|\").concat(ns);\n\n if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {\n _this2.state[name] = 2; // loaded\n } else if (_this2.state[name] < 0) ; else if (_this2.state[name] === 1) {\n if (pending.indexOf(name) < 0) pending.push(name);\n } else {\n _this2.state[name] = 1; // pending\n\n hasAllNamespaces = false;\n if (pending.indexOf(name) < 0) pending.push(name);\n if (toLoad.indexOf(name) < 0) toLoad.push(name);\n if (toLoadNamespaces.indexOf(ns) < 0) toLoadNamespaces.push(ns);\n }\n });\n if (!hasAllNamespaces) toLoadLanguages.push(lng);\n });\n\n if (toLoad.length || pending.length) {\n this.queue.push({\n pending: pending,\n loaded: {},\n errors: [],\n callback: callback\n });\n }\n\n return {\n toLoad: toLoad,\n pending: pending,\n toLoadLanguages: toLoadLanguages,\n toLoadNamespaces: toLoadNamespaces\n };\n }\n }, {\n key: \"loaded\",\n value: function loaded(name, err, data) {\n var _name$split = name.split('|'),\n _name$split2 = _slicedToArray(_name$split, 2),\n lng = _name$split2[0],\n ns = _name$split2[1];\n\n if (err) this.emit('failedLoading', lng, ns, err);\n\n if (data) {\n this.store.addResourceBundle(lng, ns, data);\n } // set loaded\n\n\n this.state[name] = err ? -1 : 2; // consolidated loading done in this run - only emit once for a loaded namespace\n\n var loaded = {}; // callback if ready\n\n this.queue.forEach(function (q) {\n pushPath(q.loaded, [lng], ns);\n remove(q.pending, name);\n if (err) q.errors.push(err);\n\n if (q.pending.length === 0 && !q.done) {\n // only do once per loaded -> this.emit('loaded', q.loaded);\n Object.keys(q.loaded).forEach(function (l) {\n if (!loaded[l]) loaded[l] = [];\n\n if (q.loaded[l].length) {\n q.loaded[l].forEach(function (ns) {\n if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns);\n });\n }\n });\n /* eslint no-param-reassign: 0 */\n\n q.done = true;\n\n if (q.errors.length) {\n q.callback(q.errors);\n } else {\n q.callback();\n }\n }\n }); // emit consolidated loaded event\n\n this.emit('loaded', loaded); // remove done load requests\n\n this.queue = this.queue.filter(function (q) {\n return !q.done;\n });\n }\n }, {\n key: \"read\",\n value: function read(lng, ns, fcName) {\n var _this3 = this;\n\n var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 250;\n var callback = arguments.length > 5 ? arguments[5] : undefined;\n if (!lng.length) return callback(null, {}); // noting to load\n\n return this.backend[fcName](lng, ns, function (err, data) {\n if (err && data\n /* = retryFlag */\n && tried < 5) {\n setTimeout(function () {\n _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);\n }, wait);\n return;\n }\n\n callback(err, data);\n });\n }\n /* eslint consistent-return: 0 */\n\n }, {\n key: \"prepareLoading\",\n value: function prepareLoading(languages, namespaces) {\n var _this4 = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var callback = arguments.length > 3 ? arguments[3] : undefined;\n\n if (!this.backend) {\n this.logger.warn('No backend was added via i18next.use. Will not load resources.');\n return callback && callback();\n }\n\n if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);\n if (typeof namespaces === 'string') namespaces = [namespaces];\n var toLoad = this.queueLoad(languages, namespaces, options, callback);\n\n if (!toLoad.toLoad.length) {\n if (!toLoad.pending.length) callback(); // nothing to load and no pendings...callback now\n\n return null; // pendings will trigger callback\n }\n\n toLoad.toLoad.forEach(function (name) {\n _this4.loadOne(name);\n });\n }\n }, {\n key: \"load\",\n value: function load(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {}, callback);\n }\n }, {\n key: \"reload\",\n value: function reload(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {\n reload: true\n }, callback);\n }\n }, {\n key: \"loadOne\",\n value: function loadOne(name) {\n var _this5 = this;\n\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var _name$split3 = name.split('|'),\n _name$split4 = _slicedToArray(_name$split3, 2),\n lng = _name$split4[0],\n ns = _name$split4[1];\n\n this.read(lng, ns, 'read', null, null, function (err, data) {\n if (err) _this5.logger.warn(\"\".concat(prefix, \"loading namespace \").concat(ns, \" for language \").concat(lng, \" failed\"), err);\n if (!err && data) _this5.logger.log(\"\".concat(prefix, \"loaded namespace \").concat(ns, \" for language \").concat(lng), data);\n\n _this5.loaded(name, err, data);\n });\n }\n }, {\n key: \"saveMissing\",\n value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n\n if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {\n this.logger.warn(\"did not save key \\\"\".concat(key, \"\\\" for namespace \\\"\").concat(namespace, \"\\\" as the namespace was not yet loaded\"), 'This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n return;\n }\n\n if (this.backend && this.backend.create) {\n this.backend.create(languages, namespace, key, fallbackValue, null\n /* unused callback */\n , _objectSpread({}, options, {\n isUpdate: isUpdate\n }));\n } // write to store to avoid resending\n\n\n if (!languages || !languages[0]) return;\n this.store.addResource(languages[0], namespace, key, fallbackValue);\n }\n }]);\n\n return Connector;\n}(EventEmitter);\n\nfunction get() {\n return {\n debug: false,\n initImmediate: true,\n ns: ['translation'],\n defaultNS: ['translation'],\n fallbackLng: ['dev'],\n fallbackNS: false,\n // string or array of namespaces\n whitelist: false,\n // array with whitelisted languages\n nonExplicitWhitelist: false,\n load: 'all',\n // | currentOnly | languageOnly\n preload: false,\n // array with preload languages\n simplifyPluralSuffix: true,\n keySeparator: '.',\n nsSeparator: ':',\n pluralSeparator: '_',\n contextSeparator: '_',\n partialBundledLanguages: false,\n // allow bundling certain languages that are not remotely fetched\n saveMissing: false,\n // enable to send missing values\n updateMissing: false,\n // enable to update default values if different from translated value (only useful on initial development, or when keeping code as source of truth)\n saveMissingTo: 'fallback',\n // 'current' || 'all'\n saveMissingPlurals: true,\n // will save all forms not only singular key\n missingKeyHandler: false,\n // function(lng, ns, key, fallbackValue) -> override if prefer on handling\n missingInterpolationHandler: false,\n // function(str, match)\n postProcess: false,\n // string or array of postProcessor names\n postProcessPassResolved: false,\n // pass resolved object into 'options.i18nResolved' for postprocessor\n returnNull: true,\n // allows null value as valid translation\n returnEmptyString: true,\n // allows empty string value as valid translation\n returnObjects: false,\n joinArrays: false,\n // or string to join array\n returnedObjectHandler: false,\n // function(key, value, options) triggered if key returns object but returnObjects is set to false\n parseMissingKeyHandler: false,\n // function(key) parsed a key that was not found in t() before returning\n appendNamespaceToMissingKey: false,\n appendNamespaceToCIMode: false,\n overloadTranslationOptionHandler: function handle(args) {\n var ret = {};\n if (_typeof(args[1]) === 'object') ret = args[1];\n if (typeof args[1] === 'string') ret.defaultValue = args[1];\n if (typeof args[2] === 'string') ret.tDescription = args[2];\n\n if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {\n var options = args[3] || args[2];\n Object.keys(options).forEach(function (key) {\n ret[key] = options[key];\n });\n }\n\n return ret;\n },\n interpolation: {\n escapeValue: true,\n format: function format(value, _format, lng) {\n return value;\n },\n prefix: '{{',\n suffix: '}}',\n formatSeparator: ',',\n // prefixEscaped: '{{',\n // suffixEscaped: '}}',\n // unescapeSuffix: '',\n unescapePrefix: '-',\n nestingPrefix: '$t(',\n nestingSuffix: ')',\n // nestingPrefixEscaped: '$t(',\n // nestingSuffixEscaped: ')',\n // defaultVariables: undefined // object that can have values to interpolate on - extends passed in interpolation data\n maxReplaces: 1000 // max replaces to prevent endless loop\n\n }\n };\n}\n/* eslint no-param-reassign: 0 */\n\nfunction transformOptions(options) {\n // create namespace object if namespace is passed in as string\n if (typeof options.ns === 'string') options.ns = [options.ns];\n if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];\n if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS]; // extend whitelist with cimode\n\n if (options.whitelist && options.whitelist.indexOf('cimode') < 0) {\n options.whitelist = options.whitelist.concat(['cimode']);\n }\n\n return options;\n}\n\nfunction noop() {}\n\nvar I18n =\n/*#__PURE__*/\nfunction (_EventEmitter) {\n _inherits(I18n, _EventEmitter);\n\n function I18n() {\n var _this;\n\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n\n _classCallCheck(this, I18n);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(I18n).call(this));\n EventEmitter.call(_assertThisInitialized(_this)); // <=IE10 fix (unable to call parent constructor)\n\n _this.options = transformOptions(options);\n _this.services = {};\n _this.logger = baseLogger;\n _this.modules = {\n external: []\n };\n\n if (callback && !_this.isInitialized && !options.isClone) {\n // https://github.com/i18next/i18next/issues/879\n if (!_this.options.initImmediate) {\n _this.init(options, callback);\n\n return _possibleConstructorReturn(_this, _assertThisInitialized(_this));\n }\n\n setTimeout(function () {\n _this.init(options, callback);\n }, 0);\n }\n\n return _this;\n }\n\n _createClass(I18n, [{\n key: \"init\",\n value: function init() {\n var _this2 = this;\n\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n this.options = _objectSpread({}, get(), this.options, transformOptions(options));\n this.format = this.options.interpolation.format;\n if (!callback) callback = noop;\n\n function createClassOnDemand(ClassOrObject) {\n if (!ClassOrObject) return null;\n if (typeof ClassOrObject === 'function') return new ClassOrObject();\n return ClassOrObject;\n } // init services\n\n\n if (!this.options.isClone) {\n if (this.modules.logger) {\n baseLogger.init(createClassOnDemand(this.modules.logger), this.options);\n } else {\n baseLogger.init(null, this.options);\n }\n\n var lu = new LanguageUtil(this.options);\n this.store = new ResourceStore(this.options.resources, this.options);\n var s = this.services;\n s.logger = baseLogger;\n s.resourceStore = this.store;\n s.languageUtils = lu;\n s.pluralResolver = new PluralResolver(lu, {\n prepend: this.options.pluralSeparator,\n compatibilityJSON: this.options.compatibilityJSON,\n simplifyPluralSuffix: this.options.simplifyPluralSuffix\n });\n s.interpolator = new Interpolator(this.options);\n s.utils = {\n hasLoadedNamespace: this.hasLoadedNamespace.bind(this)\n };\n s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options); // pipe events from backendConnector\n\n s.backendConnector.on('*', function (event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n _this2.emit.apply(_this2, [event].concat(args));\n });\n\n if (this.modules.languageDetector) {\n s.languageDetector = createClassOnDemand(this.modules.languageDetector);\n s.languageDetector.init(s, this.options.detection, this.options);\n }\n\n if (this.modules.i18nFormat) {\n s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);\n if (s.i18nFormat.init) s.i18nFormat.init(this);\n }\n\n this.translator = new Translator(this.services, this.options); // pipe events from translator\n\n this.translator.on('*', function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n _this2.emit.apply(_this2, [event].concat(args));\n });\n this.modules.external.forEach(function (m) {\n if (m.init) m.init(_this2);\n });\n } // append api\n\n\n var storeApi = ['getResource', 'addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];\n storeApi.forEach(function (fcName) {\n _this2[fcName] = function () {\n var _this2$store;\n\n return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);\n };\n });\n var deferred = defer();\n\n var load = function load() {\n _this2.changeLanguage(_this2.options.lng, function (err, t) {\n _this2.isInitialized = true;\n\n _this2.logger.log('initialized', _this2.options);\n\n _this2.emit('initialized', _this2.options);\n\n deferred.resolve(t); // not rejecting on err (as err is only a loading translation failed warning)\n\n callback(err, t);\n });\n };\n\n if (this.options.resources || !this.options.initImmediate) {\n load();\n } else {\n setTimeout(load, 0);\n }\n\n return deferred;\n }\n /* eslint consistent-return: 0 */\n\n }, {\n key: \"loadResources\",\n value: function loadResources(language) {\n var _this3 = this;\n\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n var usedCallback = callback;\n var usedLng = typeof language === 'string' ? language : this.language;\n if (typeof language === 'function') usedCallback = language;\n\n if (!this.options.resources || this.options.partialBundledLanguages) {\n if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback(); // avoid loading resources for cimode\n\n var toLoad = [];\n\n var append = function append(lng) {\n if (!lng) return;\n\n var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);\n\n lngs.forEach(function (l) {\n if (toLoad.indexOf(l) < 0) toLoad.push(l);\n });\n };\n\n if (!usedLng) {\n // at least load fallbacks in this case\n var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n fallbacks.forEach(function (l) {\n return append(l);\n });\n } else {\n append(usedLng);\n }\n\n if (this.options.preload) {\n this.options.preload.forEach(function (l) {\n return append(l);\n });\n }\n\n this.services.backendConnector.load(toLoad, this.options.ns, usedCallback);\n } else {\n usedCallback(null);\n }\n }\n }, {\n key: \"reloadResources\",\n value: function reloadResources(lngs, ns, callback) {\n var deferred = defer();\n if (!lngs) lngs = this.languages;\n if (!ns) ns = this.options.ns;\n if (!callback) callback = noop;\n this.services.backendConnector.reload(lngs, ns, function (err) {\n deferred.resolve(); // not rejecting on err (as err is only a loading translation failed warning)\n\n callback(err);\n });\n return deferred;\n }\n }, {\n key: \"use\",\n value: function use(module) {\n if (module.type === 'backend') {\n this.modules.backend = module;\n }\n\n if (module.type === 'logger' || module.log && module.warn && module.error) {\n this.modules.logger = module;\n }\n\n if (module.type === 'languageDetector') {\n this.modules.languageDetector = module;\n }\n\n if (module.type === 'i18nFormat') {\n this.modules.i18nFormat = module;\n }\n\n if (module.type === 'postProcessor') {\n postProcessor.addPostProcessor(module);\n }\n\n if (module.type === '3rdParty') {\n this.modules.external.push(module);\n }\n\n return this;\n }\n }, {\n key: \"changeLanguage\",\n value: function changeLanguage(lng, callback) {\n var _this4 = this;\n\n this.isLanguageChangingTo = lng;\n var deferred = defer();\n this.emit('languageChanging', lng);\n\n var done = function done(err, l) {\n if (l) {\n _this4.language = l;\n _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);\n\n _this4.translator.changeLanguage(l);\n\n _this4.isLanguageChangingTo = undefined;\n\n _this4.emit('languageChanged', l);\n\n _this4.logger.log('languageChanged', l);\n } else {\n _this4.isLanguageChangingTo = undefined;\n }\n\n deferred.resolve(function () {\n return _this4.t.apply(_this4, arguments);\n });\n if (callback) callback(err, function () {\n return _this4.t.apply(_this4, arguments);\n });\n };\n\n var setLng = function setLng(l) {\n if (l) {\n if (!_this4.language) {\n _this4.language = l;\n _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);\n }\n\n if (!_this4.translator.language) _this4.translator.changeLanguage(l);\n if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l);\n }\n\n _this4.loadResources(l, function (err) {\n done(err, l);\n });\n };\n\n if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {\n setLng(this.services.languageDetector.detect());\n } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {\n this.services.languageDetector.detect(setLng);\n } else {\n setLng(lng);\n }\n\n return deferred;\n }\n }, {\n key: \"getFixedT\",\n value: function getFixedT(lng, ns) {\n var _this5 = this;\n\n var fixedT = function fixedT(key, opts) {\n var options;\n\n if (_typeof(opts) !== 'object') {\n for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n rest[_key3 - 2] = arguments[_key3];\n }\n\n options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));\n } else {\n options = _objectSpread({}, opts);\n }\n\n options.lng = options.lng || fixedT.lng;\n options.lngs = options.lngs || fixedT.lngs;\n options.ns = options.ns || fixedT.ns;\n return _this5.t(key, options);\n };\n\n if (typeof lng === 'string') {\n fixedT.lng = lng;\n } else {\n fixedT.lngs = lng;\n }\n\n fixedT.ns = ns;\n return fixedT;\n }\n }, {\n key: \"t\",\n value: function t() {\n var _this$translator;\n\n return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);\n }\n }, {\n key: \"exists\",\n value: function exists() {\n var _this$translator2;\n\n return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);\n }\n }, {\n key: \"setDefaultNamespace\",\n value: function setDefaultNamespace(ns) {\n this.options.defaultNS = ns;\n }\n }, {\n key: \"hasLoadedNamespace\",\n value: function hasLoadedNamespace(ns) {\n var _this6 = this;\n\n if (!this.isInitialized) {\n this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);\n return false;\n }\n\n if (!this.languages || !this.languages.length) {\n this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);\n return false;\n }\n\n var lng = this.languages[0];\n var fallbackLng = this.options ? this.options.fallbackLng : false;\n var lastLng = this.languages[this.languages.length - 1]; // we're in cimode so this shall pass\n\n if (lng.toLowerCase() === 'cimode') return true;\n\n var loadNotPending = function loadNotPending(l, n) {\n var loadState = _this6.services.backendConnector.state[\"\".concat(l, \"|\").concat(n)];\n\n return loadState === -1 || loadState === 2;\n }; // loaded -> SUCCESS\n\n\n if (this.hasResourceBundle(lng, ns)) return true; // were not loading at all -> SEMI SUCCESS\n\n if (!this.services.backendConnector.backend) return true; // failed loading ns - but at least fallback is not pending -> SEMI SUCCESS\n\n if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;\n return false;\n }\n }, {\n key: \"loadNamespaces\",\n value: function loadNamespaces(ns, callback) {\n var _this7 = this;\n\n var deferred = defer();\n\n if (!this.options.ns) {\n callback && callback();\n return Promise.resolve();\n }\n\n if (typeof ns === 'string') ns = [ns];\n ns.forEach(function (n) {\n if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n);\n });\n this.loadResources(function (err) {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n }, {\n key: \"loadLanguages\",\n value: function loadLanguages(lngs, callback) {\n var deferred = defer();\n if (typeof lngs === 'string') lngs = [lngs];\n var preloaded = this.options.preload || [];\n var newLngs = lngs.filter(function (lng) {\n return preloaded.indexOf(lng) < 0;\n }); // Exit early if all given languages are already preloaded\n\n if (!newLngs.length) {\n if (callback) callback();\n return Promise.resolve();\n }\n\n this.options.preload = preloaded.concat(newLngs);\n this.loadResources(function (err) {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n }, {\n key: \"dir\",\n value: function dir(lng) {\n if (!lng) lng = this.languages && this.languages.length > 0 ? this.languages[0] : this.language;\n if (!lng) return 'rtl';\n var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam'];\n return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) >= 0 ? 'rtl' : 'ltr';\n }\n /* eslint class-methods-use-this: 0 */\n\n }, {\n key: \"createInstance\",\n value: function createInstance() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n return new I18n(options, callback);\n }\n }, {\n key: \"cloneInstance\",\n value: function cloneInstance() {\n var _this8 = this;\n\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n\n var mergedOptions = _objectSpread({}, this.options, options, {\n isClone: true\n });\n\n var clone = new I18n(mergedOptions);\n var membersToCopy = ['store', 'services', 'language'];\n membersToCopy.forEach(function (m) {\n clone[m] = _this8[m];\n });\n clone.translator = new Translator(clone.services, clone.options);\n clone.translator.on('*', function (event) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n clone.emit.apply(clone, [event].concat(args));\n });\n clone.init(mergedOptions, callback);\n clone.translator.options = clone.options; // sync options\n\n return clone;\n }\n }]);\n\n return I18n;\n}(EventEmitter);\n\nvar i18next = new I18n();\n\nmodule.exports = i18next;\n", "import ApplicationState from 'store/application';\n\nexport const i18next = require('i18next');\n\nexport const getAppLanguage = () => window.initConfig.user.i18n || \"en\";\n/* function to translate */\nexport const t = text => i18next.t(text);\n\n /* function to translate plugins */\nexport const tPlugin = text => i18next.t(`plugins.${text}`);\n\nexport const addI18n = i18nObject => {\n for (const lang in i18nObject) {\n for (const key in i18nObject[lang]) {\n i18next.addResource(lang, 'translation', key, i18nObject[lang][key])\n }\n }\n};\n\nexport const addI18nPlugin = ({ name, config }) => {\n for (const lang in config) {\n if (ApplicationState.i18n.plugins[lang]) {\n ApplicationState.i18n.plugins[lang].plugins[name] = config[lang]\n }\n }\n for (const lang in ApplicationState.i18n.plugins) {\n for (const key in ApplicationState.i18n.plugins[lang]) {\n i18next.addResource(lang, 'translation', key, ApplicationState.i18n.plugins[lang][key])\n }\n }\n};\n\nexport default {\n getAppLanguage,\n t,\n tPlugin,\n addI18n,\n addI18nPlugin,\n};\n", "/**\n * @file\n * @since v3.6\n */\nimport { G3W_FID, QUERY_POINT_TOLERANCE } from 'g3w-constants';\nimport ApplicationState from 'store/application'\nimport GUI from 'services/gui';\n\nimport { groupBy } from 'utils/groupBy';\nimport { getMapLayersByFilter } from 'utils/getMapLayersByFilter';\nimport { XHR } from 'utils/XHR';\nimport { $promisify, promisify } from 'utils/promisify';\nimport { t } from 'g3w-i18n';\n\nconst handleQueryPromises = async (promises = []) => {\n const responses = await Promise.allSettled(promises);\n // at least one response\n if (responses.some(r => 'fulfilled' === r.status)) {\n return responses.filter(r => 'fulfilled' === r.status).map(r => r.value);\n }\n // show all errors\n return Promise.reject(responses.filter(r => 'rejected' === r.status).map(r => r.reason));\n}\n\nexport default {\n\n /**\n * @param { string } contextAndMethod function name (eg. \"query:coordinates\", \"query:bbox\", \"query:polygon\")\n * @param options\n * \n * @returns {Promise}\n */\n async getData(contextAndMethod, options = {}) {\n const { inputs = {}, outputs = {} } = options;\n const promise = this[contextAndMethod](inputs);\n if (outputs) {\n GUI.outputDataPlace(promise, outputs);\n }\n return await (await promise);\n },\n\n /**\n * @param {{ coordinates: unknown, layerIds: unknown[], multilayers: boolean, query_point_tolerance: number, feature_count: number }}\n */\n async 'query:coordinates'({\n coordinates,\n layerIds = [], // see: `QueryResultsService::addLayerFeaturesToResultsAction()`\n multilayers = false,\n query_point_tolerance = QUERY_POINT_TOLERANCE,\n /** @since 3.8.0 **/\n addExternal = true,\n feature_count\n } = {}) {\n\n const external = GUI.getService('catalog').state.external.vector.some(l => l.selected);\n const layers = getMapLayersByFilter({\n QUERYABLE: true,\n SELECTED_OR_ALL: (0 === layerIds.length),\n VISIBLE: true,\n IDS: layerIds.length ? layerIds.map(id => id) : undefined,\n });\n try {\n return {\n result: true,\n type: 'ows',\n query: {\n coordinates,\n type: 'coordinates',\n external: {\n add: (!external || layerIds.length > 0)\n ? (1 === layers.length && layers[0].isSelected() ? false : addExternal) // avoid querying a temporary layer (external layer) when another layer is selected\n : addExternal, // an external layer is selected\n filter: {\n SELECTED: external\n }\n }\n },\n data: ((!external || layerIds.length > 0) && await promisify(this.getQueryLayersPromisesByCoordinates(layers, {\n multilayers,\n feature_count,\n query_point_tolerance,\n coordinates\n })) || []).flatMap(({ data = [] }) => data),\n \n };\n } catch (error) {\n console.warn(error);\n throw error;\n }\n\n },\n\n /**\n * @param bbox\n * @param feature_count\n * @param multilayers\n * @param condition\n * @param filterConfig\n * @param addExternal\n * @param layersFilterObject\n */\n async 'query:bbox'({\n bbox,\n feature_count = ApplicationState.project.state.feature_count || 5,\n filterConfig = {},\n multilayers = false,\n condition = { filtrable: { ows: 'WFS' } },\n /** @since 3.8.0 **/\n excludeSelected = null,\n /** @since 3.8.0 **/\n addExternal = true,\n layersFilterObject = { SELECTED_OR_ALL: true, FILTERABLE: true, VISIBLE: true }\n } = {}) {\n\n const external = GUI.getService('catalog').state.external.vector.some(l => l.selected);\n const selected = external || (('boolean' == typeof excludeSelected) ? excludeSelected : false);\n\n try {\n return {\n result: true,\n type: 'ows',\n query: {\n bbox,\n type: 'bbox',\n filterConfig,\n external: {\n add: addExternal,\n filter: {\n SELECTED: selected\n }\n },\n },\n data: (!external && await this.getQueryLayersPromisesByGeometry(\n // layers\n getMapLayersByFilter(layersFilterObject, condition),\n // options\n {\n geometry: ol.geom.Polygon.fromExtent(bbox),\n feature_count,\n filterConfig,\n multilayers,\n projection: GUI.getService('map').getMap().getView().getProjection(),\n }\n ) || []).flatMap(({ data = [] }) => data),\n };\n } catch (error) {\n console.warn(error);\n throw error;\n }\n\n },\n\n /**\n * @param {{ feature: unknown, feature_count: unknown, filterConfig: unknown, multilayers: boolean, condition: boolean, excludeLayers: unknown[] }}\n */\n async 'query:polygon'({\n feature,\n feature_count = ApplicationState.project.state.feature_count || 5,\n filterConfig = {},\n multilayers = false,\n condition = { filtrable: { ows: 'WFS' } },\n /** @since 3.8.0 */\n layerName = '',\n /** @since 3.8.0 */\n excludeSelected = null,\n /** @since 3.8.0 **/\n external = {\n add: true,\n filter: {\n SELECTED : false\n }\n },\n /**@since 3.9.0**/\n type = 'polygon'\n } = {}) {\n const geometry = feature.getGeometry();\n\n try {\n return {\n result: true,\n type: 'ows',\n error: !geometry,\n query: {\n fid: GUI.getService('catalog').state.external.vector.some(l => l.selected) ? feature.getId() : feature.get(G3W_FID),\n geometry,\n layerName,\n type,\n filterConfig,\n external\n },\n usermessage: !geometry && {\n type: 'warning',\n message: `${layerName} - ${t('sdk.mapcontrols.querybypolygon.no_geometry')}`,\n messagetext: true,\n autoclose: false\n },\n data: (await this.getQueryLayersPromisesByGeometry(\n // layers\n getMapLayersByFilter({\n ...(\n \"boolean\" === typeof excludeSelected\n ? { SELECTED: !excludeSelected }\n : { SELECTED_OR_ALL: true }\n ),\n FILTERABLE: true,\n VISIBLE: true\n }, condition),\n // options\n {\n geometry,\n multilayers,\n feature_count,\n filterConfig,\n projection: ApplicationState.project.getProjection()\n }\n ) || []).flatMap(({ data = [] }) => data),\n };\n } catch (error) {\n console.warn(error);\n throw error;\n }\n },\n\n /**\n * Method to search features\n * \n * @param options.layer\n * @param options.filter\n * @param options.raw\n * @param options.queryUrl\n * @param options.feature_count\n * @param options.formatter\n * @param options.ordering\n * @param options.autofilter //@since 3.11.0\n * \n * @returns { Promise<{ data: [], query: { type: 'search', search: * }, type: 'api' | 'ows' }> }\n */\n async 'search:features'(options = {\n layer,\n filter,\n raw: false,\n queryUrl,\n feature_count,\n formatter: 1,\n ordering,\n autofilter: 0,\n //@since 3.11.0 pagination\n page,\n page_sizes,\n }) {\n const { layer, ...params } = options;\n params.filter = [].concat(params.filter); // check if filter is an array\n params.page_size = (params.page_sizes || [])[0]; //get page size\n //@since 3.11.0 count features returned by\n const counts = [];\n const page_sizes = []; //set pages based on count feature returned by server\n return {\n data: (await Promise.allSettled(\n [].concat(layer).map((l, i) => l.searchFeatures({ ...params, filter: params.filter[i] }))\n ))\n .filter(d => 'fulfilled' === d.status)\n .map(({ value } = {}) => {\n //@since 3.11.0 In case autofilter set\n if (1 === params.autofilter) {\n (value.data || [])\n .forEach(({ layer, filtertoken }) => {\n //in the case of filtertoken response attribute set, need to set it to layer\n if (filtertoken) {\n layer.state.selection.active = layer.state.filter.active = true;\n layer.setFilterToken(filtertoken); }\n })\n }\n\n if (params.page_sizes) {\n //get max number of elements per page\n const max = Math.max(...(Array.isArray(params.page_sizes)? params.page_sizes : [params.page_sizes]));\n //Check if count (total number of elements of search is more o less than max)\n page_sizes.push(max <= value.count ? params.page_sizes : [...params.page_sizes.filter(p => p < value.count), value.count]);\n //add a count element on counts array\n counts.push(value.count);\n }\n if (params.raw) { return { data: value }; }\n if (Array.isArray(value.data) && value.data.length > 0) { return value.data[0]; }\n }),\n query: {\n type: 'search',\n search: params.filter, //filter search (array of filter)\n autofilter: !!params.autofilter, //@since 3.11.0 set Boolean\n //@since 3.11.0 pagination\n pagination: params.page_size && {\n pages: params.page && counts.map(count => Math.round(count / params.page_size)), //set number of pages\n current: params.page && counts.map(() => params.page), //current page\n page_sizes, //Array contains a number of features that want get with pagination\n counts,\n //Object contains info for do another request by another part of code\n getData: {\n params: params.filter.map(filter => ({ ...params, filter })),\n method: 'searchFeatures',\n layers: layer\n }\n },\n },\n type: 'api',\n };\n },\n\n /**\n * Return feature from api\n * \n * @param opts.layer\n * @param opts.formatter\n * @param opts.fids\n */\n async 'search:fids'({\n layer,\n formatter = 0,\n fids = [],\n } = {}) {\n let features = []; \n try {\n // convert API response to Open Layer Features\n features = ((layer && await layer.getFeatureByFids({ fids, formatter })) || []).map(f => {\n const properties = undefined !== f.properties ? f.properties : {}\n properties[G3W_FID] = f.id;\n const olFeat = new ol.Feature(f.geometry && new ol.geom[f.geometry.type](f.geometry.coordinates));\n olFeat.setProperties(properties);\n olFeat.setId(f.id);\n return olFeat;\n });\n } catch(e) {\n console.warn(e);\n }\n return {\n data: [{\n layer,\n features\n }],\n query: { type: 'search' },\n };\n },\n\n /**\n * Search service function to load many layers with each one with its fids\n * \n * @param options.layers - Array of layers that we want serach fids features\n * @param options.fids - Array of array of fids\n * @param options.formatter - how we want visualize\n */\n async 'search:layersfids'({\n layers = [],\n fids = [],\n formatter = 0,\n } = {}) {\n let data = [];\n try {\n data = (await Promise.all(\n layers.map((layer, i) => this['search:fids']({ layer, fids: fids[i], formatter }))\n )).map(response => response.data);\n } catch(e) {\n console.warn(e);\n }\n return {\n data,\n query: { type: 'search' }\n };\n },\n\n /**\n * POST only: accepts\n * \n * Mandatory JSON body: expression\n * Optional JSON body: form_data and qgs_layer_id (QGIS layer id)\n * \n * @param params.qgis_layer_id layer id owner of the form data\n * @param params.layer_id layer owner of the data\n * @param params.form_data\n * @param params.field_name since 3.8.0\n * @param params.expression\n * @param params.formatter\n * @param params.parent\n */\n async 'expression:expression'(params = {}) {\n try {\n const response = await XHR.post({\n url: `${ApplicationState.project.getUrl('vector_data')}${params.layer_id}/`,\n contentType: 'application/json',\n data: JSON.stringify(params),\n });\n\n return response.result ? (response.vector.data.features || []) : Promise.reject(JSON.stringify(response.error));\n } catch(e) {\n console.warn(e);\n return Promise.reject(e);\n }\n },\n\n /**\n * POST only method to return QGIS Expressions evaluated in Project an optional Layer/Form context\n *\n * Mandatory JSON body: expression\n * Optional JSON body: form_data and qgs_layer_id (QGIS layer id)\n * \n * @param params.layer_id\n * @param params.qgis_layer_id\n * @param params.form_data\n * @param params.field_name since 3.8.0\n * @param params.expression\n * @param params.formatter\n * @param params.parent\n */\n async 'expression:expression_eval'(params = {}) {\n try {\n const {result, value, error } = await XHR.post({\n url: `/api/expression_eval/${ApplicationState.project.getId()}/`,\n contentType: 'application/json',\n data: JSON.stringify(params),\n });\n return result ? value : Promise.reject(JSON.stringify(error));\n } catch(e) {\n console.warn(e);\n return Promise.reject(e);\n }\n\n },\n\n /**\n * @param data: Object conitans data to pass to proxy\n */\n async 'proxy:wms'({ url, method='GET', params={}, headers={} } = {}) {\n if (method === 'GET') {\n url = new URL(url);\n Object.keys(params).forEach(p => url.searchParams.set(p, params[p]));\n url = url.toString();\n }\n try {\n return {\n response: await XHR.post({\n data: JSON.stringify({ url, params, headers, method }),\n contentType: 'application/json',\n url: `${window.initConfig.proxyurl}`\n }),\n data: JSON.stringify({ url, params, headers, method }),\n };\n } catch(e) {\n console.warn(e);\n }\n },\n\n /**\n * Generic proxy data function\n */\n 'proxy:data'(params = {}) {},\n\n /**\n * used by the following plugins: \"archiweb\"\n * \n * @param layers \n * @param { Object } opts\n * @param opts.coordinates\n * @param opts.feature_count\n * @param opts.query_point_tolerance\n * @param { boolean } opts.multilayers Group query by layers instead single layer request\n * @param opts.reproject\n * \n * @returns { JQuery.Promise }\n * \n * @since 3.11.0\n */\n getQueryLayersPromisesByCoordinates(layers, {\n coordinates,\n feature_count = 10,\n query_point_tolerance = QUERY_POINT_TOLERANCE,\n multilayers = false,\n reproject = true,\n } = {}) {\n // skip when no features\n if (0 === layers.length) {\n return $promisify(Promise.resolve(layers));\n }\n\n const map = GUI.getService('map').getMap();\n const size = map.getSize();\n const mapProjection = map.getView().getProjection();\n const resolution = map.getView().getResolution();\n\n return $promisify(async () => await handleQueryPromises(Object.values(\n multilayers\n ? groupBy(layers, l => `${l.getInfoFormat()}:${l.getInfoUrl()}:${l.getMultiLayerId()}`)\n : layers\n ).map(layers => promisify(\n [].concat(layers)[0].query(\n multilayers\n ? { feature_count, coordinates, query_point_tolerance, mapProjection, size, resolution, reproject, layers }\n : { feature_count, coordinates, query_point_tolerance, mapProjection, size, resolution }\n )\n )\n )));\n\n },\n\n /**\n * @param layers\n * @param { Object } opts\n * @param { boolean } opts.multilayers Group query by layers instead single layer request\n * @param opts.bbox\n * @param opts.geometry\n * @param opts.projection\n * @param opts.feature_count\n * \n * @returns { JQuery.Promise }\n * \n * @since 3.11.0\n */\n async getQueryLayersPromisesByGeometry(layers,\n {\n geometry,\n projection,\n filterConfig = {},\n multilayers = false,\n feature_count = 10\n } = {}\n ) {\n // skip when no features\n if (0 === layers.length) {\n return [];\n }\n\n const mapCrs = projection.getCode();\n\n return await handleQueryPromises(Object.values(\n multilayers\n ? groupBy(layers, l => `${l.getMultiLayerId()}_${l.getProjection().getCode()}`)\n : layers\n ).map(layers => {\n const layer = [].concat(layers)[0];\n const crs = layer.getProjection().getCode();\n const filter = {\n config: filterConfig,\n type: 'geometry',\n // Convert filter geometry from map to layer CRS\n value: mapCrs === crs ? geometry : geometry.clone().transform(mapCrs, crs),\n };\n return promisify(layer.query(\n multilayers\n ? { filter, feature_count, layers }\n : { filter, feature_count, filterConfig }\n ))\n }));\n },\n\n};\n\n", "/**\n * @file\n * @since v3.6\n */\n\nimport G3WObject from 'g3w-object';\nimport GUI from 'services/gui';\nimport DataRouterService from 'services/data';\nimport ApplicationState from 'store/application'\nimport PluginsRegistry from 'store/plugins';\nimport Projections from 'store/projections';\nimport { normalizeEpsg } from 'utils/normalizeEpsg';\nimport { getUniqueDomId } from 'utils/getUniqueDomId';\n\n/**\n * @param epsg: Number Code of epsg Ex.4326\n * \n * @returns String Normalize epsg: From number ex: 4326 to 'EPSG:4326'\n * \n * @since 3.9.1\n */\nasync function _getEpsgFromParam(epsg) {\n epsg = normalizeEpsg(epsg)\n await Projections.registerProjection(epsg);\n return epsg;\n}\n\n/**\n * @example template.html\n * \n * ```html\n * \n * \n * \n * \n * Test Iframe\n * \n * \n * \n * \n * \n * \n * ```\n */\nclass IframePluginService {\n\n constructor() {\n this.pendingactions = {};\n this.getMessage = this.getMessage.bind(this);\n this.eventResponseServiceHandler = this.eventResponseServiceHandler.bind(this);\n }\n\n /**\n * @param { Object } opts\n * @param opts.project current project sends by application service\n */\n async init({\n project,\n } = {}) {\n\n await GUI.isReady();\n\n this.services = {\n app: new AppService(),\n editing: new EditingService(),\n };\n\n // get layer attributes from project layers state\n const layers = project.state.layers.map(l => ({ id: l.id, name: l.name }));\n\n // initialize all services\n const serviceNames = Object.keys(this.services);\n\n for (let i = 0; i < serviceNames.length; i++) {\n const service = this.services[serviceNames[i]];\n // set common layer attribute service just one time\n if (undefined === service.getLayers()) {\n service.setLayers(layers);\n } \n await service.init();\n service.on('response', this.eventResponseServiceHandler);\n }\n\n // Send post-message is ready\n this.postMessage({\n id: null,\n action: 'app:ready',\n response: { result: true, data: { layers } },\n });\n\n window.addEventListener('message', this.getMessage, false);\n }\n\n // set eventResponse handler to alla services\n eventResponseServiceHandler({ action, response }) {\n this.postMessage({ id: null, action, response })\n }\n\n /**\n * Outputplace iframe get by DataRouteService\n * \n * @param dataPromise\n * @param options\n * \n * @returns { Promise }\n */\n async outputDataPlace(dataPromise, options = {}) {\n let outputData;\n const { action = 'app:results' } = options;\n let { result, data = [] } = await dataPromise;\n const parser = new ol.format.GeoJSON();\n try {\n outputData = data.map(({ layer, features }) => ({ [layer.getId()]: { features: parser.writeFeatures(features) } }));\n } catch(e) {\n console.warn(e);\n result = false;\n outputData = e;\n }\n\n this.postMessage({\n id: null,\n action,\n response: { result, data: outputData }\n })\n }\n\n /**\n * post a message to parent\n */\n postMessage(message = {}) {\n if (window.parent) { window.parent.postMessage(message, '*') }\n }\n\n async stopPendingActions() {\n const promises = [];\n Object\n .keys(this.pendingactions)\n .forEach(id => {\n promises.push(this.services[this.pendingactions[id].context].stop());\n delete this.pendingactions[id];\n });\n return Promise.allSettled(promises)\n };\n\n /**\n * handle all messages from the window\n */\n async getMessage(evt) {\n if (evt && evt.data) {\n const {\n id = getUniqueDomId(),\n single = true,\n action,\n data: params\n } = evt.data;\n const [ context, method ] = (action || '').split(':');\n let result = false;\n let data;\n try {\n const is_ready = this.services[context].getReady();\n if (is_ready && single) {\n await this.stopPendingActions();\n }\n if (is_ready) {\n this.pendingactions[id] = { context };\n data = await this.services[context][method](params);\n result = true;\n }\n } catch(e) {\n console.warn(e);\n result = false;\n data = e;\n }\n this.postMessage({\n id,\n action,\n response: { result, data },\n });\n delete this.pendingactions[id];\n }\n }\n\n /**\n * Called when change map or clear\n */\n async clear() {\n const serviceNames = Object.keys(this.services);\n for (let i = 0; i < serviceNames.length; i++) {\n this.services[serviceNames[i]].off('response', this.eventResponseServiceHandler)\n }\n await this.stopPendingActions();\n window.removeEventListener('message', this.getMessage, false);\n }\n\n}\n\n/**\n * ORIGINAL SOURCE: src/app/core/iframe/services/baseservice.js@3.9.0\n */\nclass BaseIframeService extends G3WObject {\n\n constructor() {\n\n super();\n\n /**\n * @type { boolean }\n */\n this.ready = false;\n\n /**\n * Map service\n */\n this.mapService = GUI.getService('map');\n\n /**\n * Current project\n */\n this.project = ApplicationState.project;\n\n /**\n * @type { Array | undefined }\n */\n this.layers = undefined;\n\n // common attributes between plugin service\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @since 3.9.1\n */\n this.pluginName;\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @since 3.9.1\n */\n this.dependencyApi = {};\n\n }\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @virtual method need to be implemented by subclasses\n * \n * @since 3.9.1\n */\n async init({\n layers = {}\n } = {}) {\n this.layers = layers;\n // skip when plugin is not in configuration (ie. added to the application)\n if (!ApplicationState.configurationPlugins.includes(this.pluginName)) {\n return;\n }\n const plugin = PluginsRegistry.getPlugin(this.pluginName);\n if (plugin) {\n this.setDependencyApi(plugin.getApi());\n this.setReady(true);\n } else {\n PluginsRegistry\n .onafter('registerPlugin', async plugin => {\n await plugin.isReady();\n if (plugin.getName() === this.pluginName) {\n this.setDependencyApi(plugin.getApi());\n this.setReady(true);\n }\n })\n }\n }\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @virtual method need to be implemented by subclasses \n * \n * @since 3.9.1\n */\n setDependencyApi(api = {}) {\n this.dependencyApi = api;\n }\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @virtual method need to be implemented by subclasses \n * \n * @since 3.9.1\n */\n getDependecyApi() {\n return this.dependencyApi;\n }\n\n /**\n * Return a qgs_layer_id array based on passed qgis_layer_id\n * \n * @param { Object } opts\n * @param { string | string[] | null | undefined } opts.qgs_layer_id\n * @param { Array } noValue\n * \n * @returns { string[] } qgs_layer_id\n * \n * @private\n */\n getQgsLayerId({\n qgs_layer_id,\n noValue = this.layers.map(l => l.id),\n }) {\n return qgs_layer_id ? [].concat(qgs_layer_id) : noValue;\n };\n\n /**\n * getFeature from DataProvider\n * \n * @private\n */\n async searchFeature({\n layer,\n feature,\n }) {\n const { data = [] } = await DataRouterService.getData('search:features', {\n inputs: {\n layer,\n filter: [].concat(feature.value).map(v => `${feature.field}|eq|${encodeURIComponent(v)}`).join('|OR,')\n },\n outputs: false\n });\n return data;\n };\n\n /**\n * Search feature(s) by field and value\n * \n * @param { Object } opts\n * @param opts.qgs_layer_id\n * @param opts.feature\n * @param opts.zoom\n * @param opts.highlight\n * \n * @returns { Promise<{ qgs_layer_id: null, features: [], found: boolean }>}\n */\n async findFeaturesWithGeometry({\n feature,\n qgs_layer_id = [],\n zoom = false,\n highlight = false,\n } = {}) {\n const response = {\n found: false,\n features: [],\n qgs_layer_id: null\n };\n let layersCount = qgs_layer_id.length;\n let i = 0;\n while (!response.found && i < layersCount) {\n const layer = this.project.getLayerById(qgs_layer_id[i]);\n try {\n const data = layer && await this.searchFeature({ layer, feature });\n const features = data.length && data[0].features;\n response.found = features && features.length > 0 && !!features.find(f => f.getGeometry());\n if (!features || !response.found) {\n throw 'invalid response';\n }\n response.features = features;\n response.qgs_layer_id = qgs_layer_id[i];\n if (zoom) {\n await this.mapService.zoomToFeatures(features, { highlight });\n }\n } catch(e) { i++; console.warn(e);}\n }\n // in case of no response zoom to an initial extent\n if (!response.found) {\n this.zoomToExtent(this.mapService.project.state.initextent)\n }\n return response;\n }\n\n /**\n * Set layer function\n * \n * @param layers\n */\n setLayers(layers = []) {\n this.layers = layers;\n }\n\n getLayers() {\n return this.layers;\n }\n\n /**\n * Set ready service\n * \n * @param bool\n */\n setReady(bool = false) {\n this.ready = bool;\n }\n\n getReady() {\n return this.ready;\n }\n\n /**\n * Overwrite single service: Usefult to stop eventually running action\n * \n * @virtual method need to be implemented by subclasses\n * \n * @returns { Promise }\n */\n async stop() {}\n\n /**\n * Overwrite each single service\n * \n * @virtual method need to be implemented by subclasses\n */\n clear() {}\n\n}\n\n/**\n * ORIGINAL SOURCE: src/services/iframe-app.js@3.9.0\n */\nclass AppService extends BaseIframeService {\n\n constructor() {\n super();\n this.mapControls = {\n screenshot: { control: null },\n changeMap: { control: null },\n };\n }\n\n /**\n * Init service\n * \n * @returns { Promise }\n */\n init() {\n return new Promise(resolve => {\n this.mapService.once('ready', () => {\n this._map = this.mapService.getMap();\n this._mapCrs = this.mapService.getCrs();\n this.mapControls.screenshot.control = this.mapService.getMapControlByType({ type: 'screenshot' });\n this.setReady(true);\n resolve();\n });\n })\n }\n\n /**\n * @returns { Promise }\n */\n async results({\n capture = true,\n }) {\n GUI.currentoutputplace = capture ? 'iframe' : 'gui';\n return [];\n }\n\n /**\n * @returns { Promise }\n */\n async screenshot({\n capture = true,\n }) {\n // skip when ..\n if (!capture) {\n this.mapControls.screenshot.control.resetOriginalOnClickEvent();\n return;\n }\n\n this.mapControls.screenshot.control.overwriteOnClickEvent(async() => {\n let response;\n try {\n response = { result: true, data: await this.mapService.createMapImage() };\n } catch(e) {\n console.warn(e);\n response = { result: false, data: e };\n } finally {\n this.emit('response', { response, action: 'app:screenshot' });\n }\n });\n }\n\n /**\n * Eventually send as param the projection in which we would like get center of map\n * \n * @param { Object } params\n * @param params.epsg since 3.9.1\n * \n * @returns { Promise }\n */\n async getcenter(params = {}) {\n const center = this.mapService.getCenter();\n if (undefined !== params.epsg) {\n return ol.proj.transform(\n center,\n this.mapService.getEpsg(),\n await _getEpsgFromParam(params.epsg)\n );\n }\n return center;\n }\n\n /**\n * Zoom to coordinates\n * \n * @param { Object } params\n * @param { Array } params.coordinates\n * @param params.epsg since 3.9.1\n * \n * @returns { Promise }\n */\n async zoomtocoordinates(params = {}) {\n let {\n coordinates = [],\n epsg,\n } = params;\n // skip when coordinates in params are null or are an array with more than item 2\n if (!(coordinates && Array.isArray(coordinates) && 2 === coordinates.length)) {\n return Promise.reject(coordinates);\n }\n if (undefined !== epsg) {\n // normalized psg code\n epsg = await _getEpsgFromParam(epsg);\n coordinates = ol.proj.transform(coordinates, epsg, this.mapService.getEpsg());\n }\n this.mapService.zoomTo(coordinates);\n return coordinates;\n }\n\n /**\n * Eventually send as param the projection in which we would like get center of map\n * \n * @param { Object } params\n * @param params.epsg since 3.9.1\n * \n * @returns { Promise }\n */\n async getextent(params = {}) {\n const extent = this.mapService.getMapExtent();\n /** @FIXME add description */\n if (undefined !== params.epsg) {\n return ol.proj.transformExtent(\n extent,\n this.mapService.getEpsg(),\n await _getEpsgFromParam(params.epsg)\n );\n }\n return extent;\n }\n\n /**\n * @param { Object } params\n * @param { Array } params.extent\n * @param params.epsg since 3.9.1\n * \n * @returns { Promise }\n */\n async zoomtoextent(params = {}) {\n let { extent = [], epsg } = params;\n // skip when an extent is null ora an array with number of ites not equal to 4\n if (!(extent && Array.isArray(extent) && 4 === extent.length)) {\n return Promise.reject(extent);\n }\n /** If epsg is provide, get epsg definition */\n if (undefined !== epsg) {\n epsg = _getEpsgFromParam(epsg);\n extent = ol.proj.transformExtent(extent, epsg, this.mapService.getEpsg());\n } else {\n this.mapService.goToBBox(extent);\n }\n return extent;\n };\n\n /**\n * Zoom to features\n * \n * @param { Object } params\n * @param params.qgs_layer_id\n * @param params.feature\n * @param { boolean } params.highlight \n * \n * @returns { Promise } qgs_layer_id\n */\n async zoomtofeature(params = {}) {\n let {\n qgs_layer_id,\n feature,\n highlight = false,\n } = params;\n\n qgs_layer_id = this.getQgsLayerId({ qgs_layer_id });\n\n const response = await this.findFeaturesWithGeometry({\n qgs_layer_id,\n feature,\n zoom: true,\n highlight,\n });\n\n return response.qgs_layer_id;\n }\n\n}\n\n/**\n * ORIGINAL SOURCE: src/services/iframe-editing.js@3.9.0\n */\nclass EditingService extends BaseIframeService {\n\n constructor() {\n super();\n\n this.pluginName = 'editing';\n\n this.subscribevents = [];\n \n this.isRunning = false;\n \n this.responseObject = {\n cb: null, // resolve or reject promise method\n qgs_layer_id: null,\n error: null,\n };\n \n this.config = {\n tools: {\n add: {\n disabled:[\n { id: 'deletefeature' },\n { id: 'copyfeatures' },\n { id: 'editmultiattributes' },\n { id: 'deletePart' },\n { id: 'splitfeature' },\n { id: 'mergefeatures' },\n ]\n },\n update: {\n disabled: [\n { id: 'addfeature' },\n { id: 'copyfeatures' },\n { id: 'deletefeature' },\n { id: 'editmultiattributes' },\n { id: 'deletePart' },\n { id: 'splitfeature' },\n { id: 'mergefeatures' },\n ]\n },\n delete: {\n enabled: [\n { id:'deletefeature', options: { active: true } },\n ]\n }\n }\n };\n\n /**\n * subscribers handlers\n */\n this.subscribersHandlers = {\n\n canUndo:({ activeTool, disableToolboxes = [] }) => bool => {\n //set currenttoolbocx id in editing to null\n if (false === bool) {\n this.responseObject.qgs_layer_id = null;\n this.responseObject.error = null;\n }\n activeTool.setEnabled(!bool);\n disableToolboxes.forEach(toolbox => toolbox.setEditing(!bool))\n },\n\n canRedo:() => {},\n\n //run callback\n cancelform:cb => () => { cb() },\n\n addfeature: ({ properties, toolboxes } = {}) => feature => {\n\n Object\n .keys(properties)\n .forEach(p => feature.set(p, properties[p]));\n\n let activeTool;\n const disableToolboxes = [];\n\n toolboxes\n .forEach(t => {\n const tool = t.getToolById('addfeature');\n if (tool.isActive()) {\n tool.setEnabled(false);\n activeTool = tool;\n } else {\n t.setEditing(false);\n disableToolboxes.push(t)\n }\n });\n\n // just one time\n if (this.subscribevents.find(e => 'canUndo' !== e.event)) {\n this.addSubscribeEvents('cancelform', this.addSubscribeEvents('canUndo', { activeTool, disableToolboxes }));\n }\n },\n\n closeeditingpanel: ({ qgs_layer_id }) => () => {\n // response to router service\n this.responseObject.cb({\n qgs_layer_id: this.responseObject.qgs_layer_id,\n error: this.responseObject.error,\n });\n // stop action\n this.stopAction({ qgs_layer_id });\n },\n\n };\n\n }\n\n // METHODS CALLED FROM EACH ACTION METHOD\n\n /**\n * run before each action\n */\n async startAction({\n toolboxes,\n resolve,\n reject,\n }) {\n\n this.responseObject.cb = reject;\n\n // set same mode autosave\n this.dependencyApi.setSaveConfig({\n cb: {\n // called when commit changes are done successuffly\n done: toolbox => {\n //set toolbox id\n this.responseObject.cb = resolve;\n this.responseObject.qgs_layer_id = toolbox.getId();\n this.responseObject.error = null;\n // close panel that fire closeediting panel event\n this.dependencyApi.hidePanel();\n },\n // called whe commit change receive an error\n error: (toolbox, error) => {\n this.responseObject.cb = reject;\n this.responseObject.qgs_layer_id = toolbox.getId();\n this.responseObject.error = error;\n },\n }\n });\n\n // set toolboxes visible base on the value of qgs_layer_id\n this.dependencyApi.showPanel({ toolboxes });\n\n this.isRunning = true;\n }\n\n /**\n * run after each action\n */\n async stopAction(opts = {}) {\n if (opts.qgs_layer_id) {\n await this.stopEditing(opts.qgs_layer_id);\n }\n }\n\n /**\n * add subscribe refenrence\n */\n addSubscribeEvents(event, options = {}) {\n const handler = this.subscribersHandlers[event](options);\n this.dependencyApi.subscribe(event, handler);\n this.subscribevents.push({ event, handler });\n return handler;\n };\n\n /**\n * Reset subscriber editing plugin events\n */\n resetSubscribeEvents() {\n this.subscribevents.forEach(d => { this.dependencyApi.unsubscribe(d.event, d.handler); });\n };\n\n /**\n * Called whe we want to add a feature\n * \n * @param { Object } config\n * @param config.qgs_layer_id\n * @param config.properties\n * \n * @returns { Promise }\n */\n add(config = {}) {\n return new Promise(async (resolve, reject) => {\n // skip when ..\n if (this.isRunning) {\n return reject();\n }\n\n // extract `qgs_layer_id9` from a configuration message\n const { qgs_layer_id: configQglLayerId, ...data } = config;\n const { properties } = data;\n\n const qgs_layer_id = this.getQgsLayerId({\n qgs_layer_id: configQglLayerId,\n noValue: this.dependencyApi.getEditableLayersId(),\n });\n\n // call method common\n await this.startAction({ toolboxes: qgs_layer_id, resolve, reject });\n\n // return all toolboxes\n const toolboxes = (\n await this.startEditing(qgs_layer_id, {\n tools: this.config.tools.add,\n startstopediting: false,\n action : 'add',\n selected: 1 === qgs_layer_id.length,\n })\n )\n .filter(p => 'fulfilled' === p.status)\n .map(p => p.value);\n\n /** @FIXME add description */\n if (!GUI.isSidebarVisible()) {\n GUI.showSidebar();\n }\n\n /** @FIXME add description */\n if (1 === toolboxes.length && toolboxes[0]) {\n toolboxes[0].setActiveTool(toolboxes[0].getToolById('addfeature'));\n }\n\n // in case of no feature add avent subscribe\n this.addSubscribeEvents('addfeature', { properties, toolboxes });\n this.addSubscribeEvents('closeeditingpanel', { qgs_layer_id })\n });\n }\n\n /**\n * Called when we want to update a know feature field\n * \n * @param config\n * \n * @returns { Promise }\n */\n async update(config = {}) {\n return new Promise(async (resolve, reject) => {\n // skip when ..\n if (this.isRunning) {\n return reject();\n }\n\n const { qgs_layer_id: configQglLayerId, ...data } = config;\n const { feature } = data;\n const qgs_layer_id = this.getQgsLayerId({\n qgs_layer_id: configQglLayerId,\n noValue: this.dependencyApi.getEditableLayersId()\n });\n\n const response = await this.findFeaturesWithGeometry({\n qgs_layer_id,\n feature,\n zoom: true,\n highlight: true,\n selected: 1 === qgs_layer_id.length // set selected toolbox\n });\n\n // skip when ..\n if (!response.found) {\n return reject();\n }\n\n await this.startAction({ toolboxes: [response.qgs_layer_id], resolve, reject });\n\n // return all toolboxes\n await this.startEditing([response.qgs_layer_id], {\n feature,\n tools: this.config.tools.update,\n startstopediting: false,\n action: 'update',\n });\n\n if (!GUI.isSidebarVisible()) {\n GUI.showSidebar();\n }\n\n this.addSubscribeEvents('closeeditingpanel', { qgs_layer_id: [response.qgs_layer_id] });\n });\n }\n\n /**\n * @virtual method need to be implemented by subclasses \n */\n delete() {}\n\n /**\n * Called when we want to start editing\n * \n * @param { Array } qgs_layer_id\n * @param { Object } options\n * \n * @returns { Promise< unknown | void > }\n */\n async startEditing(qgs_layer_id = [], options = {}) {\n const { action = 'add', feature } = options;\n const filter = {};\n options.filter = filter;\n switch (action) {\n case 'add': filter.nofeatures = true; break;\n case 'update': filter.field = `${feature.field}|eq|${feature.value}`; break;\n }\n const promises = [];\n qgs_layer_id.forEach(id => { promises.push(this.dependencyApi.startEditing(id, options)) });\n return await Promise.allSettled(promises);\n }\n\n /**\n * Stop editing\n * \n * @param qgs_layer_id\n * \n * @returns { Promise }\n */\n async stopEditing(qgs_layer_id) {\n const promises = [];\n qgs_layer_id.forEach(id => { promises.push(this.dependencyApi.stopEditing(id)); });\n await Promise.allSettled(promises);\n this.clear();\n }\n\n stop() {\n return new Promise(resolve => {\n this.dependencyApi.hidePanel();\n GUI.hideSidebar();\n this.once('clear', resolve);\n });\n }\n\n /**\n * Called wen we want to reset default editing plugin behaviour\n */\n clear() {\n this.dependencyApi.resetDefault();\n this.isRunning = false;\n this.responseObject = {\n cb: null, // resolve or reject promise method\n qgs_layer_id: null,\n error: null,\n };\n this.resetSubscribeEvents();\n this.emit('clear');\n }\n\n}\n\nexport default new IframePluginService();", "export function toRawType(value) {\n return Object.prototype.toString.call(value).slice(8, -1)\n}", "import ApplicationState from 'store/application';\n\n/** used by the following plugins: \"iframe\", \"archiweb\" */\nexport function getListableProjects() {\n window.initConfig.projects\n return window.initConfig.projects.filter(p => {\n if (![null, undefined].includes(p.listable)) {\n return p.listable;\n }\n if (\n p.id === ApplicationState.project.getId() ||\n (window.initConfig.overviewproject && p.gid === window.initConfig.overviewproject)\n ) {\n return false;\n }\n return p;\n }).sort((a, b) => (a.title || '').localeCompare(b.title));\n}", "/**\n * @param gid\n * \n * @returns {string}\n */\nexport function getProjectUrl(gid) {\n const project = window.initConfig.projects.find(p => gid === p.gid);\n try {\n return `${(new URL(window.initConfig.urls.baseurl))}${project.url}`;\n } catch(e) {\n console.warn(e);\n return `${location.origin}${window.initConfig.urls.baseurl}${project.url}`;\n }\n}", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n import ApplicationState from \"store/application\";\n\n const __vue_script__ = {\n name: \"SidebarItem\",\n data() {\n const { component } = this.$options;\n return {\n info: component.info || { state: null, style: null, class: null },\n main: true,\n component,\n active: false,\n title: component.title || '',\n open: !!component.state.open,\n icon: component.icon,\n iconColor: component.iconColor,\n collapsible: false !== component.collapsible,\n actions: component.actions,\n sidebar : ApplicationState.gui.sidebar\n };\n },\n methods: {\n triggerAction(action, component) {\n action.fnc(component);\n },\n },\n\n mounted() {\n const opts = this.$options.opts || {};\n const sidebar = document.getElementById('g3w-sidebarcomponents');\n\n // append to `g3w-sidebarcomponents`\n if ([null, undefined].includes(opts.position) || opts.position < 0 || opts.position >= sidebar.children.length) {\n $(sidebar).append(this.$el);\n }\n \n // append to `g3w-sidebarcomponents` (by position)\n else {\n Array.from(sidebar.children).forEach((child, i) => {\n if (i === opts.position || child.id === opts.position) {\n child.insertAdjacentElement((!!opts.before || undefined === opts.before) ? 'beforebegin' : 'afterend', this.$el);\n }\n });\n }\n\n this.component.mount(this.$refs['component-placeholder']);\n\n // set component click handler\n this.component.click = ({ open = false } = {}) => {\n if (open) {\n ApplicationState.sidebar.components.forEach(comp => {\n if (comp !== this.component && comp.getOpen()) {\n comp.click({ open: false });\n }\n });\n }\n const node = this.component.getInternalComponent().$el;\n //@since 3.11.0 Need to add check of sidebar components, in case, for example, close\n // contents element and some sidebar component is related to it's close, for example, qplotly\n //a toggle menu open of
    \n if (node.classList) {\n node.classList.toggle('menu-open', open);\n }\n // toggle active of
  • element\n node.parentNode.classList.toggle('active', open);\n\n this.component.setOpen(open);\n\n };\n },\n\n }\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.component.state.visible),expression:\"component.state.visible\"},{name:\"disabled\",rawName:\"v-disabled\",value:(_vm.component.state.disabled),expression:\"component.state.disabled\"}],staticClass:\"treeview sidebaritem\",class:{'active': _vm.open },attrs:{\"id\":_vm.component.id}},[_c('bar-loader',{attrs:{\"loading\":_vm.component.state.loading}}),_vm._v(\" \"),_c('a',{directives:[{name:\"t-tooltip\",rawName:\"v-t-tooltip:right.create\",value:(_vm.sidebar.open ? '' : _vm.title),expression:\"sidebar.open ? '' : title\",arg:\"right\",modifiers:{\"create\":true}}],staticStyle:{\"display\":\"flex\",\"justify-content\":\"space-between\",\"align-items\":\"center\"},attrs:{\"href\":\"#\",\"current-tooltip\":_vm.sidebar.open ? '' : _vm.title}},[_c('div',[(!_vm.sidebar.open)?_c('span',[_c('i',{class:_vm.icon,style:({ color: _vm.iconColor })})]):_c('i',{class:_vm.icon,style:({ color: _vm.iconColor })}),_vm._v(\" \"),_c('span',{directives:[{name:\"t\",rawName:\"v-t\",value:(_vm.title),expression:\"title\"}],staticClass:\"treeview-label\"})]),_vm._v(\" \"),_c('div',[(_vm.info.state)?_c('span',{class:_vm.info.class,staticStyle:{\"position\":\"absolute\",\"right\":\"5px\",\"font-weight\":\"bold\"},style:(_vm.info.style),attrs:{\"title\":_vm.info.tooltip}},[_vm._v(_vm._s(_vm.info.state))]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.actions),function(action){return _c('span',{directives:[{name:\"t-tooltip\",rawName:\"v-t-tooltip:left.create\",value:(action.tooltip),expression:\"action.tooltip\",arg:\"left\",modifiers:{\"create\":true}}],key:action.id,staticClass:\"action skin-tooltip-left\",class:action.class,staticStyle:{\"font-weight\":\"bold\",\"padding\":\"3px\"},style:(action.style),on:{\"click\":function($event){$event.stopPropagation();return _vm.triggerAction(action, _vm.component.internalComponent)}}})})],2),_vm._v(\" \"),(_vm.collapsible)?_c('i',{staticClass:\"pull-right\",class:_vm.$fa('angle-left')}):_vm._e()]),_vm._v(\" \"),_c('div',{ref:\"component-placeholder\"})],1)}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = undefined\n /* scoped */\n const __vue_scope_id__ = undefined\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"SidebarItem.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (false) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/**\n * @TODO remove \"Vue.extend\" from module export\n */\nconst __vue_script__ = Vue.extend({\n\n /** @since 3.8.6 */\n name: 'form-header',\n\n props: {\n headers: {\n type: Array,\n default: []\n },\n currentid: {\n type: String\n },\n update: {\n type: Boolean\n },\n valid: {\n type: Boolean\n }\n },\n methods: {\n click(id) {\n /**\n * @deprecated since 3.6.2\n * This was used when form headers has more than one (case relation)\n */\n if (id !== this.currentid && this.headers.length > 1) {\n this.$emit('clickheader', id);\n }\n },\n resizeForm(perc) {\n this.$emit('resize-form', perc);\n }\n }\n});\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"g3wform_header box-header with-border\",staticStyle:{\"display\":\"flex\",\"flex-direction\":\"column\"}},[_c('section',{staticClass:\"g3wform_header_content\"},_vm._l((_vm.headers),function(header){return _c('span',{key:header.id,staticClass:\"title\",class:[{item_selected: _vm.currentid === header.id && _vm.headers.length > 1},[_vm.headers.length > 1 ? 'tabs' : 'one' ]],staticStyle:{\"display\":\"flex\",\"justify-content\":\"space-between\",\"align-items\":\"center\"},style:({fontSize: _vm.isMobile() && '1em !important'}),on:{\"click\":function($event){$event.stopPropagation();return _vm.click(header.id)}}},[(header.icon)?_c('span',{staticStyle:{\"margin-right\":\"5px\"}},[_c('i',{class:header.icon})]):_vm._e(),_vm._v(\" \"),_c('span',{directives:[{name:\"t\",rawName:\"v-t:pre\",value:(header.title),expression:\"header.title\",arg:\"pre\"}],staticClass:\"g3w-long-text\"},[_vm._v(_vm._s(header.name))]),_vm._v(\" \"),_c(header.component,{tag:\"component\",attrs:{\"valid\":_vm.valid,\"update\":_vm.update}})],1)}),0)])}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = undefined\n /* scoped */\n const __vue_scope_id__ = undefined\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"FormHeader.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (false) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/**\n * @TODO remove \"Vue.extend\" from module export\n */\nconst __vue_script__ = Vue.extend({\n\n /** @since 3.8.6 */\n name: 'form-footer',\n\n props: {\n state: {\n type: Object\n },\n backToRoot: {\n type: Function,\n default: () => {}\n },\n isRootComponent: {\n type: Function\n }\n },\n data() {\n /**\n * need toget a deep copy of buttons\n * @type {T[]}\n */\n this.originalbuttons = this.state.buttons.map(button => ({\n ...button\n }));\n return {\n id: \"footer\",\n active: true,\n show: true,\n }\n },\n computed: {\n enableSave() {\n return this.state.valid && this.state.update;\n }\n },\n methods: {\n exec(cbk) {\n cbk instanceof Function ? cbk(this.state.fields): (function() { return this.state.fields})();\n },\n btnEnabled(button) {\n const { enabled = true, type } = button;\n return enabled && (type !== 'save' || (type === 'save' && this.enableSave));\n },\n isValid() {\n return this.state.valid;\n },\n },\n watch: {\n 'state.component'(component) {\n this.show = this.isRootComponent(component)\n },\n 'state.update': {\n immediate: true,\n handler(value) {\n this.state.buttons.find((button, index) => {\n if (button.eventButtons && button.eventButtons.update) {\n if (button.eventButtons.update[value]) {\n this.state.buttons.splice(index,1, {\n ...button,\n ...button.eventButtons.update[value]\n })\n } else {\n this.state.buttons.splice(index,1, this.originalbuttons[index]);\n }\n }\n });\n }\n }\n },\n activated() {\n this.active = true;\n },\n deactivated() {\n this.active = false;\n }\n});\n\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"form-group g3wform_footer\"},[(_vm.show)?[_vm._t(\"default\",function(){return [_c('div',{staticStyle:{\"margin\":\"3px\",\"font-weight\":\"bold\"}},[_vm._v(\"\\n * \"),_c('span',{directives:[{name:\"t\",rawName:\"v-t\",value:('sdk.form.footer.required_fields'),expression:\"'sdk.form.footer.required_fields'\"}]}),_vm._v(\" \"),(_vm.state.footer.message)?_c('div',{style:([_vm.state.footer.style])},[_vm._v(\"\\n \"+_vm._s(_vm.state.footer.message)+\"\\n \")]):_vm._e()]),_vm._v(\" \"),_vm._l((_vm.state.buttons),function(button){return _c('button',{directives:[{name:\"disabled\",rawName:\"v-disabled\",value:(!_vm.btnEnabled(button)),expression:\"!btnEnabled(button)\"},{name:\"t\",rawName:\"v-t\",value:(button.title),expression:\"button.title\"}],key:button.id,staticClass:\"btn\",class:[button.class],attrs:{\"update\":_vm.state.update,\"valid\":_vm.state.valid},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.exec(button.cbk)}}})})]})]:[_c('button',{directives:[{name:\"t\",rawName:\"v-t\",value:('back'),expression:\"'back'\"}],staticClass:\"btn skin-button\",on:{\"click\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"prevet\",undefined,$event.key,undefined)){ return null; }$event.stopPropagation();return _vm.backToRoot.apply(null, arguments)}}})]],2)}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = undefined\n /* scoped */\n const __vue_scope_id__ = undefined\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"FormFooter.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (false) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport HeaderFormComponent from 'components/FormHeader.vue';\nimport G3wFormFooter from 'components/FormFooter.vue';\n\nconst __vue_script__ = {\n\n /** @since 3.8.6 */\n name: 'g3w-form',\n\n data() {\n return {\n state: {},\n switchcomponent: false,\n body: {\n components: {\n before: [],\n after: []\n }\n }\n }\n },\n components: {\n g3wformheader: HeaderFormComponent,\n G3wFormFooter\n },\n transitions: { 'addremovetransition': 'showhide' },\n methods: {\n isRootComponent(component) {\n return this.$options.service.isRootComponent(component);\n },\n backToRoot() {\n this.$options.service.setRootComponent();\n },\n handleRelation(relationId) {\n this.$options.service.handleRelation(relationId);\n },\n disableComponent({ id, disabled = false }) {\n this.$options.service.disableComponent({\n id,\n disabled\n });\n },\n resizeForm(perc) {\n this.$options.service.setCurrentFormPercentage(perc)\n },\n switchComponent(id) {\n this.switchcomponent = true;\n this.$options.service.setCurrentComponentById(id);\n },\n changeInput(input) {\n return this.$options.service.changeInput(input);\n },\n addToValidate(input) {\n this.$options.service.addToValidate(input);\n },\n removeToValidate(input) {\n this.$options.service.removeToValidate(input);\n },\n // set layout\n reloadLayout() {\n const height = $(this.$el).height();\n if (!height) { return };\n const footerDOM = $(this.$refs.g3w_form_footer.$el);\n const bodyFromDOM = $(this.$refs.g3wform_body);\n const footerHeight = footerDOM.height() ? footerDOM.height() + 50 : 50;\n const bodyHeight = height - ($(this.$refs.g3wformheader.$el).height() + footerHeight);\n bodyFromDOM.height(bodyHeight);\n },\n },\n async updated() {\n await this.$nextTick();\n if (this.switchcomponent) { setTimeout(() => this.switchcomponent = false, 0) }\n },\n created() {\n this.$options.service.getEventBus().$on('set-main-component', () => {\n this.switchComponent(0);\n });\n this.$options.service.getEventBus().$on('component-validation', ({id, valid}) => {\n this.$options.service.setValidComponent({ id, valid });\n });\n this.$options.service.getEventBus().$on('addtovalidate', this.addToValidate);\n this.$options.service.getEventBus().$on('disable-component', this.disableComponent);\n },\n mounted() {\n // check if is valid form (it used by footer component)\n this.$options.service.isValid();\n this.$options.service.setReady(true);\n },\n beforeDestroy() {\n this.$options.service.clearAll();\n }\n};\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"g3wform_content\",staticStyle:{\"position\":\"relative\"}},[_c('bar-loader',{attrs:{\"loading\":_vm.state.loading}}),_vm._v(\" \"),_c('g3wformheader',{ref:\"g3wformheader\",attrs:{\"currentid\":_vm.state.currentheaderid,\"headers\":_vm.state.headers,\"update\":_vm.state.update,\"valid\":_vm.state.valid},on:{\"resize-form\":_vm.resizeForm,\"clickheader\":_vm.switchComponent}}),_vm._v(\" \"),_c('div',{ref:\"g3wform_body\",staticClass:\"g3wform_body\"},[_vm._l((_vm.body.components.before),function(component){return _c(component,{tag:\"component\",attrs:{\"fields\":_vm.state.fields}})}),_vm._v(\" \"),_c('keep-alive',[_c(_vm.state.component,{tag:\"component\",attrs:{\"handleRelation\":_vm.handleRelation,\"state\":_vm.state},on:{\"hook:activated\":_vm.reloadLayout,\"addtovalidate\":_vm.addToValidate,\"removetovalidate\":_vm.removeToValidate,\"changeinput\":_vm.changeInput}})],1),_vm._v(\" \"),_vm._l((_vm.body.components.after),function(component){return _c(component,{tag:\"component\",attrs:{\"fields\":_vm.state.fields}})})],2),_vm._v(\" \"),_c('g3w-form-footer',{ref:\"g3w_form_footer\",attrs:{\"isRootComponent\":_vm.isRootComponent,\"backToRoot\":_vm.backToRoot,\"state\":_vm.state}})],1)}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = undefined\n /* scoped */\n const __vue_scope_id__ = undefined\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"Form.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (false) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n )\n\n export default __vue_component__", "import ApplicationState from 'store/application';\n\n/**\n * ORIGINAL SOURCE: src/app/core/layers/layersstoreregistry.js@v3.10.2\n */\nexport function getCatalogLayerById(id) {\n return Object.values(ApplicationState.catalog).map(s => s.getLayerById(id)).find(l => l);\n}", "/**\n * @file\n * @since v3.7\n */\n\nimport { getCatalogLayerById } from 'utils/getCatalogLayerById';\n\nexport default {\n methods: {\n async autocompleteRequest({ layerId, field, value } = {}) {\n let data = [];\n try {\n data = await getCatalogLayerById(layerId).getFilterData({\n suggest: `${field}|${value}`,\n unique: field\n })\n } catch(e) {\n console.warn(e);\n }\n return data.map(value => ({ id: value, text: value }))\n }\n }\n};", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nconst __vue_script__ = {\n name: \"field\",\n props: ['state']\n}\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"field\"},[(_vm.state.label)?_c('div',{staticClass:\"col-sm-6 field_label\"},[_vm._t(\"label\",function(){return [_vm._v(_vm._s(_vm.state.label))]})],2):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"field_value\",class:[_vm.state.label ? 'col-sm-6' : null ]},[_vm._t(\"field\",function(){return [_c('span',{staticStyle:{\"word-wrap\":\"break-word\"},domProps:{\"innerHTML\":_vm._s(_vm.state.value)}})]})],2)])}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = function (inject) {\n if (!inject) return\n inject(\"data-v-6e3a094b_0\", { source: \".field[data-v-6e3a094b]{background-color:transparent!important;padding-top:3px;padding-bottom:3px;display:flex;align-items:center}.value[data-v-6e3a094b]{position:relative}.field div[data-v-6e3a094b]{padding-left:3px}.field_value button[data-v-6e3a094b]{margin-right:5px}.field_value[data-v-6e3a094b]{padding-left:0!important;padding-right:8px;text-align:right}\", map: undefined, media: undefined })\n\n }\n /* scoped */\n const __vue_scope_id__ = \"data-v-6e3a094b\"\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"Field.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (true) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n function __vue_create_injector__() {\n const styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {})\n const isOldIE =\n typeof navigator !== 'undefined' &&\n /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase())\n\n return function addStyle(id, css) {\n if (document.querySelector('style[data-vue-ssr-id~=\"' + id + '\"]')) return // SSR styles are present.\n\n const group = isOldIE ? css.media || 'default' : id\n const style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined })\n\n if (!style.ids.includes(id)) {\n let code = css.source\n let index = style.ids.length\n\n style.ids.push(id)\n\n if (true && css.map) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n code +=\n '\\n/*# sourceMappingURL=data:application/json;base64,' +\n btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +\n ' */'\n }\n\n if (isOldIE) {\n style.element = style.element || document.querySelector('style[data-group=' + group + ']')\n }\n\n if (!style.element) {\n const head = document.head || document.getElementsByTagName('head')[0]\n const el = style.element = document.createElement('style')\n el.type = 'text/css'\n\n if (css.media) el.setAttribute('media', css.media)\n if (isOldIE) {\n el.setAttribute('data-group', group)\n el.setAttribute('data-next-index', '0')\n }\n\n head.appendChild(el)\n }\n\n if (isOldIE) {\n index = parseInt(style.element.getAttribute('data-next-index'))\n style.element.setAttribute('data-next-index', index + 1)\n }\n\n if (style.element.styleSheet) {\n style.parts.push(code)\n style.element.styleSheet.cssText = style.parts\n .filter(Boolean)\n .join('\\n')\n } else {\n const textNode = document.createTextNode(code)\n const nodes = style.element.childNodes\n if (nodes[index]) style.element.removeChild(nodes[index])\n if (nodes.length) style.element.insertBefore(textNode, nodes[index])\n else style.element.appendChild(textNode)\n }\n }\n }\n }\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n __vue_create_injector__,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n\nimport Field from 'components/Field.vue';\n\nconst __vue_script__ = {\n\n /** @since 3.8.6 */\n name: \"field-text\",\n\n props: ['state'],\n\n components: {\n Field\n },\n\n created() {},\n\n};\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('field',{attrs:{\"state\":_vm.state}})}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = function (inject) {\n if (!inject) return\n inject(\"data-v-18457c68_0\", { source: \".field_text_table[data-v-18457c68]{background-color:transparent!important}.field_text_table .field_label[data-v-18457c68]{font-weight:700}\", map: undefined, media: undefined })\n\n }\n /* scoped */\n const __vue_scope_id__ = \"data-v-18457c68\"\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"FieldText.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (true) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n function __vue_create_injector__() {\n const styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {})\n const isOldIE =\n typeof navigator !== 'undefined' &&\n /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase())\n\n return function addStyle(id, css) {\n if (document.querySelector('style[data-vue-ssr-id~=\"' + id + '\"]')) return // SSR styles are present.\n\n const group = isOldIE ? css.media || 'default' : id\n const style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined })\n\n if (!style.ids.includes(id)) {\n let code = css.source\n let index = style.ids.length\n\n style.ids.push(id)\n\n if (true && css.map) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n code +=\n '\\n/*# sourceMappingURL=data:application/json;base64,' +\n btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +\n ' */'\n }\n\n if (isOldIE) {\n style.element = style.element || document.querySelector('style[data-group=' + group + ']')\n }\n\n if (!style.element) {\n const head = document.head || document.getElementsByTagName('head')[0]\n const el = style.element = document.createElement('style')\n el.type = 'text/css'\n\n if (css.media) el.setAttribute('media', css.media)\n if (isOldIE) {\n el.setAttribute('data-group', group)\n el.setAttribute('data-next-index', '0')\n }\n\n head.appendChild(el)\n }\n\n if (isOldIE) {\n index = parseInt(style.element.getAttribute('data-next-index'))\n style.element.setAttribute('data-next-index', index + 1)\n }\n\n if (style.element.styleSheet) {\n style.parts.push(code)\n style.element.styleSheet.cssText = style.parts\n .filter(Boolean)\n .join('\\n')\n } else {\n const textNode = document.createTextNode(code)\n const nodes = style.element.childNodes\n if (nodes[index]) style.element.removeChild(nodes[index])\n if (nodes.length) style.element.insertBefore(textNode, nodes[index])\n else style.element.appendChild(textNode)\n }\n }\n }\n }\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n __vue_create_injector__,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport Field from 'components/Field.vue';\n\nconst __vue_script__ = {\n\n /** @since 3.8.6 */\n name: \"field-link\",\n\n props: ['state'],\n data() {\n return {\n value: null\n }\n },\n components: {\n Field\n },\n methods: {\n openLink(link_url) {\n window.open(link_url, '_blank');\n }\n },\n created() {\n this.value = this.state.value && typeof this.state.value === 'object' ? this.state.value.value : this.state.value;\n }\n};\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('field',{attrs:{\"state\":_vm.state}},[_c('button',{directives:[{name:\"t\",rawName:\"v-t\",value:('info.link_button'),expression:\"'info.link_button'\"}],staticClass:\"btn skin-button field_link\",attrs:{\"slot\":\"field\",\"title\":_vm.value},on:{\"click\":function($event){$event.stopPropagation();return _vm.openLink(_vm.value)}},slot:\"field\"})])}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = function (inject) {\n if (!inject) return\n inject(\"data-v-145d6e0c_0\", { source: \".field_link[data-v-145d6e0c]{max-width:100%}\", map: undefined, media: undefined })\n\n }\n /* scoped */\n const __vue_scope_id__ = \"data-v-145d6e0c\"\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"FieldLink.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (true) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n function __vue_create_injector__() {\n const styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {})\n const isOldIE =\n typeof navigator !== 'undefined' &&\n /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase())\n\n return function addStyle(id, css) {\n if (document.querySelector('style[data-vue-ssr-id~=\"' + id + '\"]')) return // SSR styles are present.\n\n const group = isOldIE ? css.media || 'default' : id\n const style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined })\n\n if (!style.ids.includes(id)) {\n let code = css.source\n let index = style.ids.length\n\n style.ids.push(id)\n\n if (true && css.map) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n code +=\n '\\n/*# sourceMappingURL=data:application/json;base64,' +\n btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +\n ' */'\n }\n\n if (isOldIE) {\n style.element = style.element || document.querySelector('style[data-group=' + group + ']')\n }\n\n if (!style.element) {\n const head = document.head || document.getElementsByTagName('head')[0]\n const el = style.element = document.createElement('style')\n el.type = 'text/css'\n\n if (css.media) el.setAttribute('media', css.media)\n if (isOldIE) {\n el.setAttribute('data-group', group)\n el.setAttribute('data-next-index', '0')\n }\n\n head.appendChild(el)\n }\n\n if (isOldIE) {\n index = parseInt(style.element.getAttribute('data-next-index'))\n style.element.setAttribute('data-next-index', index + 1)\n }\n\n if (style.element.styleSheet) {\n style.parts.push(code)\n style.element.styleSheet.cssText = style.parts\n .filter(Boolean)\n .join('\\n')\n } else {\n const textNode = document.createTextNode(code)\n const nodes = style.element.childNodes\n if (nodes[index]) style.element.removeChild(nodes[index])\n if (nodes.length) style.element.insertBefore(textNode, nodes[index])\n else style.element.appendChild(textNode)\n }\n }\n }\n }\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n __vue_create_injector__,\n undefined,\n undefined\n )\n\n export default __vue_component__", "//\n//\n//\n//\n//\n//\n\nvar script = {\n name: 'teleport',\n props: {\n to: {\n type: String,\n required: true,\n },\n where: {\n type: String,\n default: 'after',\n },\n disabled: Boolean,\n },\n data: function data() {\n return {\n nodes: [],\n waiting: false,\n observer: null,\n parent: null,\n };\n },\n watch: {\n to: 'maybeMove',\n where: 'maybeMove',\n disabled: function disabled(value) {\n var this$1 = this;\n\n if (value) {\n this.disable();\n // Ensure all event done.\n this.$nextTick(function () {\n this$1.teardownObserver();\n });\n } else {\n this.bootObserver();\n this.move();\n }\n },\n },\n mounted: function mounted() {\n // Store a reference to the nodes\n this.nodes = Array.from(this.$el.childNodes);\n\n if (!this.disabled) {\n this.bootObserver();\n }\n\n // Move slot content to target\n this.maybeMove();\n },\n beforeDestroy: function beforeDestroy() {\n // Fix nodes reference\n this.nodes = this.getComponentChildrenNode();\n\n // Move back\n this.disable();\n\n // Stop observing\n this.teardownObserver();\n },\n computed: {\n classes: function classes() {\n if (this.disabled) {\n return ['teleporter'];\n }\n\n return ['teleporter', 'hidden'];\n },\n },\n methods: {\n maybeMove: function maybeMove() {\n if (!this.disabled) {\n this.move();\n }\n },\n move: function move() {\n this.waiting = false;\n\n this.parent = document.querySelector(this.to);\n\n if (!this.parent) {\n this.disable();\n\n this.waiting = true;\n\n return;\n }\n\n if (this.where === 'before') {\n this.parent.prepend(this.getFragment());\n } else {\n this.parent.appendChild(this.getFragment());\n }\n },\n disable: function disable() {\n this.$el.appendChild(this.getFragment());\n this.parent = null;\n },\n // Using a fragment is faster because it'll trigger only a single reflow\n // See https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment\n getFragment: function getFragment() {\n var fragment = document.createDocumentFragment();\n\n this.nodes.forEach(function (node) { return fragment.appendChild(node); });\n\n return fragment;\n },\n onMutations: function onMutations(mutations) {\n var this$1 = this;\n\n // Makes sure the move operation is only done once\n var shouldMove = false;\n\n for (var i = 0; i < mutations.length; i++) {\n var mutation = mutations[i];\n var filteredAddedNodes = Array.from(mutation.addedNodes).filter(function (node) { return !this$1.nodes.includes(node); });\n\n if (Array.from(mutation.removedNodes).includes(this.parent)) {\n this.disable();\n this.waiting = !this.disabled;\n } else if (this.waiting && filteredAddedNodes.length > 0) {\n shouldMove = true;\n }\n }\n\n if (shouldMove) {\n this.move();\n }\n },\n bootObserver: function bootObserver() {\n var this$1 = this;\n\n if (this.observer) {\n return;\n }\n\n this.observer = new MutationObserver(function (mutations) { return this$1.onMutations(mutations); });\n\n this.observer.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: false,\n characterData: false,\n });\n\n if (this.childObserver) {\n return;\n }\n // watch childNodes change\n this.childObserver = new MutationObserver(function (mutations) {\n var childChangeRecord = mutations.find(function (i) { return i.target === this$1.$el; });\n if (childChangeRecord) {\n // Remove old nodes before update position.\n this$1.nodes.forEach(function (node) { return node.parentNode && node.parentNode.removeChild(node); });\n this$1.nodes = this$1.getComponentChildrenNode();\n this$1.maybeMove();\n }\n });\n\n this.childObserver.observe(this.$el, {\n childList: true,\n subtree: false,\n attributes: false,\n characterData: false,\n });\n },\n teardownObserver: function teardownObserver() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n if (this.childObserver) {\n this.childObserver.disconnect();\n this.childObserver = null;\n }\n },\n getComponentChildrenNode: function getComponentChildrenNode() {\n return this.$vnode.componentOptions.children\n .map(function (i) { return i.elm; })\n .filter(function (i) { return i; });\n },\n },\n};\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\r\n if (typeof shadowMode !== 'boolean') {\r\n createInjectorSSR = createInjector;\r\n createInjector = shadowMode;\r\n shadowMode = false;\r\n }\r\n // Vue.extend constructor export interop.\r\n var options = typeof script === 'function' ? script.options : script;\r\n // render functions\r\n if (template && template.render) {\r\n options.render = template.render;\r\n options.staticRenderFns = template.staticRenderFns;\r\n options._compiled = true;\r\n // functional template\r\n if (isFunctionalTemplate) {\r\n options.functional = true;\r\n }\r\n }\r\n // scopedId\r\n if (scopeId) {\r\n options._scopeId = scopeId;\r\n }\r\n var hook;\r\n if (moduleIdentifier) {\r\n // server build\r\n hook = function (context) {\r\n // 2.3 injection\r\n context =\r\n context || // cached call\r\n (this.$vnode && this.$vnode.ssrContext) || // stateful\r\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional\r\n // 2.2 with runInNewContext: true\r\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\r\n context = __VUE_SSR_CONTEXT__;\r\n }\r\n // inject component styles\r\n if (style) {\r\n style.call(this, createInjectorSSR(context));\r\n }\r\n // register component module identifier for async chunk inference\r\n if (context && context._registeredComponents) {\r\n context._registeredComponents.add(moduleIdentifier);\r\n }\r\n };\r\n // used by ssr in case component is cached and beforeCreate\r\n // never gets called\r\n options._ssrRegister = hook;\r\n }\r\n else if (style) {\r\n hook = shadowMode\r\n ? function (context) {\r\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));\r\n }\r\n : function (context) {\r\n style.call(this, createInjector(context));\r\n };\r\n }\r\n if (hook) {\r\n if (options.functional) {\r\n // register for functional component in vue file\r\n var originalRender = options.render;\r\n options.render = function renderWithStyleInjection(h, context) {\r\n hook.call(context);\r\n return originalRender(h, context);\r\n };\r\n }\r\n else {\r\n // inject component registration as beforeCreate hook\r\n var existing = options.beforeCreate;\r\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\r\n }\r\n }\r\n return script;\r\n}\n\nvar isOldIE = typeof navigator !== 'undefined' &&\r\n /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase());\r\nfunction createInjector(context) {\r\n return function (id, style) { return addStyle(id, style); };\r\n}\r\nvar HEAD;\r\nvar styles = {};\r\nfunction addStyle(id, css) {\r\n var group = isOldIE ? css.media || 'default' : id;\r\n var style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });\r\n if (!style.ids.has(id)) {\r\n style.ids.add(id);\r\n var code = css.source;\r\n if (css.map) {\r\n // https://developer.chrome.com/devtools/docs/javascript-debugging\r\n // this makes source maps inside style tags work properly in Chrome\r\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */';\r\n // http://stackoverflow.com/a/26603875\r\n code +=\r\n '\\n/*# sourceMappingURL=data:application/json;base64,' +\r\n btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +\r\n ' */';\r\n }\r\n if (!style.element) {\r\n style.element = document.createElement('style');\r\n style.element.type = 'text/css';\r\n if (css.media)\r\n { style.element.setAttribute('media', css.media); }\r\n if (HEAD === undefined) {\r\n HEAD = document.head || document.getElementsByTagName('head')[0];\r\n }\r\n HEAD.appendChild(style.element);\r\n }\r\n if ('styleSheet' in style.element) {\r\n style.styles.push(code);\r\n style.element.styleSheet.cssText = style.styles\r\n .filter(Boolean)\r\n .join('\\n');\r\n }\r\n else {\r\n var index = style.ids.size - 1;\r\n var textNode = document.createTextNode(code);\r\n var nodes = style.element.childNodes;\r\n if (nodes[index])\r\n { style.element.removeChild(nodes[index]); }\r\n if (nodes.length)\r\n { style.element.insertBefore(textNode, nodes[index]); }\r\n else\r\n { style.element.appendChild(textNode); }\r\n }\r\n }\r\n}\n\n/* script */\nvar __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function() {\n var _vm = this;\n var _h = _vm.$createElement;\n var _c = _vm._self._c || _h;\n return _c(\"div\", { class: _vm.classes }, [_vm._t(\"default\")], 2)\n};\nvar __vue_staticRenderFns__ = [];\n__vue_render__._withStripped = true;\n\n /* style */\n var __vue_inject_styles__ = function (inject) {\n if (!inject) { return }\n inject(\"data-v-50f4b45b_0\", { source: \".hidden[data-v-50f4b45b] {\\n visibility: hidden;\\n display: none;\\n}\\n\\n/*# sourceMappingURL=Teleport.vue.map */\", map: {\"version\":3,\"sources\":[\"/home/shodan/Projects/vue2-teleport/src/Teleport.vue\",\"Teleport.vue\"],\"names\":[],\"mappings\":\"AA2LA;EACA,kBAAA;EACA,aAAA;AC1LA;;AAEA,uCAAuC\",\"file\":\"Teleport.vue\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\",\".hidden {\\n visibility: hidden;\\n display: none;\\n}\\n\\n/*# sourceMappingURL=Teleport.vue.map */\"]}, media: undefined });\n\n };\n /* scoped */\n var __vue_scope_id__ = \"data-v-50f4b45b\";\n /* module identifier */\n var __vue_module_identifier__ = undefined;\n /* functional template */\n var __vue_is_functional_template__ = false;\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n var __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n createInjector,\n undefined,\n undefined\n );\n\n// Taken from https://vuejs.org/v2/cookbook/packaging-sfc-for-npm.html\n\n// Declare install function executed by Vue.use()\nfunction install (Vue) {\n if (install.installed) { return; }\n\n install.installed = true;\n Vue.component('Teleport', __vue_component__);\n}\n\n// Create module definition for Vue.use()\nvar plugin = {\n install: install,\n};\n\n// Auto-install when vue is found (eg. in browser via \n * \n * ```\n */\nclass IframePluginService {\n\n constructor() {\n this.pendingactions = {};\n this.getMessage = this.getMessage.bind(this);\n this.eventResponseServiceHandler = this.eventResponseServiceHandler.bind(this);\n }\n\n /**\n * @param { Object } opts\n * @param opts.project current project sends by application service\n */\n async init({\n project,\n } = {}) {\n\n await GUI.isReady();\n\n this.services = {\n app: new AppService(),\n editing: new EditingService(),\n };\n\n // get layer attributes from project layers state\n const layers = project.state.layers.map(l => ({ id: l.id, name: l.name }));\n\n // initialize all services\n const serviceNames = Object.keys(this.services);\n\n for (let i = 0; i < serviceNames.length; i++) {\n const service = this.services[serviceNames[i]];\n // set common layer attribute service just one time\n if (undefined === service.getLayers()) {\n service.setLayers(layers);\n } \n await service.init();\n service.on('response', this.eventResponseServiceHandler);\n }\n\n // Send post-message is ready\n this.postMessage({\n id: null,\n action: 'app:ready',\n response: { result: true, data: { layers } },\n });\n\n window.addEventListener('message', this.getMessage, false);\n }\n\n // set eventResponse handler to alla services\n eventResponseServiceHandler({ action, response }) {\n this.postMessage({ id: null, action, response })\n }\n\n /**\n * Outputplace iframe get by DataRouteService\n * \n * @param dataPromise\n * @param options\n * \n * @returns { Promise }\n */\n async outputDataPlace(dataPromise, options = {}) {\n let outputData;\n const { action = 'app:results' } = options;\n let { result, data = [] } = await dataPromise;\n const parser = new ol.format.GeoJSON();\n try {\n outputData = data.map(({ layer, features }) => ({ [layer.getId()]: { features: parser.writeFeatures(features) } }));\n } catch(e) {\n console.warn(e);\n result = false;\n outputData = e;\n }\n\n this.postMessage({\n id: null,\n action,\n response: { result, data: outputData }\n })\n }\n\n /**\n * post a message to parent\n */\n postMessage(message = {}) {\n if (window.parent) { window.parent.postMessage(message, '*') }\n }\n\n async stopPendingActions() {\n const promises = [];\n Object\n .keys(this.pendingactions)\n .forEach(id => {\n promises.push(this.services[this.pendingactions[id].context].stop());\n delete this.pendingactions[id];\n });\n return Promise.allSettled(promises)\n };\n\n /**\n * handle all messages from the window\n */\n async getMessage(evt) {\n if (evt && evt.data) {\n const {\n id = getUniqueDomId(),\n single = true,\n action,\n data: params\n } = evt.data;\n const [ context, method ] = (action || '').split(':');\n let result = false;\n let data;\n try {\n const is_ready = this.services[context].getReady();\n if (is_ready && single) {\n await this.stopPendingActions();\n }\n if (is_ready) {\n this.pendingactions[id] = { context };\n data = await this.services[context][method](params);\n result = true;\n }\n } catch(e) {\n console.warn(e);\n result = false;\n data = e;\n }\n this.postMessage({\n id,\n action,\n response: { result, data },\n });\n delete this.pendingactions[id];\n }\n }\n\n /**\n * Called when change map or clear\n */\n async clear() {\n const serviceNames = Object.keys(this.services);\n for (let i = 0; i < serviceNames.length; i++) {\n this.services[serviceNames[i]].off('response', this.eventResponseServiceHandler)\n }\n await this.stopPendingActions();\n window.removeEventListener('message', this.getMessage, false);\n }\n\n}\n\n/**\n * ORIGINAL SOURCE: src/app/core/iframe/services/baseservice.js@3.9.0\n */\nclass BaseIframeService extends G3WObject {\n\n constructor() {\n\n super();\n\n /**\n * @type { boolean }\n */\n this.ready = false;\n\n /**\n * Map service\n */\n this.mapService = GUI.getService('map');\n\n /**\n * Current project\n */\n this.project = ApplicationState.project;\n\n /**\n * @type { Array | undefined }\n */\n this.layers = undefined;\n\n // common attributes between plugin service\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @since 3.9.1\n */\n this.pluginName;\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @since 3.9.1\n */\n this.dependencyApi = {};\n\n }\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @virtual method need to be implemented by subclasses\n * \n * @since 3.9.1\n */\n async init({\n layers = {}\n } = {}) {\n this.layers = layers;\n // skip when plugin is not in configuration (ie. added to the application)\n if (!ApplicationState.configurationPlugins.includes(this.pluginName)) {\n return;\n }\n const plugin = PluginsRegistry.getPlugin(this.pluginName);\n if (plugin) {\n this.setDependencyApi(plugin.getApi());\n this.setReady(true);\n } else {\n PluginsRegistry\n .onafter('registerPlugin', async plugin => {\n await plugin.isReady();\n if (plugin.getName() === this.pluginName) {\n this.setDependencyApi(plugin.getApi());\n this.setReady(true);\n }\n })\n }\n }\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @virtual method need to be implemented by subclasses \n * \n * @since 3.9.1\n */\n setDependencyApi(api = {}) {\n this.dependencyApi = api;\n }\n\n /**\n * ORIGINAL SOURCE: src/app/core/iframe/services/plugins/service.js@3.9.0\n * \n * @virtual method need to be implemented by subclasses \n * \n * @since 3.9.1\n */\n getDependecyApi() {\n return this.dependencyApi;\n }\n\n /**\n * Return a qgs_layer_id array based on passed qgis_layer_id\n * \n * @param { Object } opts\n * @param { string | string[] | null | undefined } opts.qgs_layer_id\n * @param { Array } noValue\n * \n * @returns { string[] } qgs_layer_id\n * \n * @private\n */\n getQgsLayerId({\n qgs_layer_id,\n noValue = this.layers.map(l => l.id),\n }) {\n return qgs_layer_id ? [].concat(qgs_layer_id) : noValue;\n };\n\n /**\n * getFeature from DataProvider\n * \n * @private\n */\n async searchFeature({\n layer,\n feature,\n }) {\n const { data = [] } = await DataRouterService.getData('search:features', {\n inputs: {\n layer,\n filter: [].concat(feature.value).map(v => `${feature.field}|eq|${encodeURIComponent(v)}`).join('|OR,')\n },\n outputs: false\n });\n return data;\n };\n\n /**\n * Search feature(s) by field and value\n * \n * @param { Object } opts\n * @param opts.qgs_layer_id\n * @param opts.feature\n * @param opts.zoom\n * @param opts.highlight\n * \n * @returns { Promise<{ qgs_layer_id: null, features: [], found: boolean }>}\n */\n async findFeaturesWithGeometry({\n feature,\n qgs_layer_id = [],\n zoom = false,\n highlight = false,\n } = {}) {\n const response = {\n found: false,\n features: [],\n qgs_layer_id: null\n };\n let layersCount = qgs_layer_id.length;\n let i = 0;\n while (!response.found && i < layersCount) {\n const layer = this.project.getLayerById(qgs_layer_id[i]);\n try {\n const data = layer && await this.searchFeature({ layer, feature });\n const features = data.length && data[0].features;\n response.found = features && features.length > 0 && !!features.find(f => f.getGeometry());\n if (!features || !response.found) {\n throw 'invalid response';\n }\n response.features = features;\n response.qgs_layer_id = qgs_layer_id[i];\n if (zoom) {\n await this.mapService.zoomToFeatures(features, { highlight });\n }\n } catch(e) { i++; console.warn(e);}\n }\n // in case of no response zoom to an initial extent\n if (!response.found) {\n this.zoomToExtent(this.mapService.project.state.initextent)\n }\n return response;\n }\n\n /**\n * Set layer function\n * \n * @param layers\n */\n setLayers(layers = []) {\n this.layers = layers;\n }\n\n getLayers() {\n return this.layers;\n }\n\n /**\n * Set ready service\n * \n * @param bool\n */\n setReady(bool = false) {\n this.ready = bool;\n }\n\n getReady() {\n return this.ready;\n }\n\n /**\n * Overwrite single service: Usefult to stop eventually running action\n * \n * @virtual method need to be implemented by subclasses\n * \n * @returns { Promise }\n */\n async stop() {}\n\n /**\n * Overwrite each single service\n * \n * @virtual method need to be implemented by subclasses\n */\n clear() {}\n\n}\n\n/**\n * ORIGINAL SOURCE: src/services/iframe-app.js@3.9.0\n */\nclass AppService extends BaseIframeService {\n\n constructor() {\n super();\n this.mapControls = {\n screenshot: { control: null },\n changeMap: { control: null },\n };\n }\n\n /**\n * Init service\n * \n * @returns { Promise }\n */\n init() {\n return new Promise(resolve => {\n this.mapService.once('ready', () => {\n this._map = this.mapService.getMap();\n this._mapCrs = this.mapService.getCrs();\n this.mapControls.screenshot.control = this.mapService.getMapControlByType({ type: 'screenshot' });\n this.setReady(true);\n resolve();\n });\n })\n }\n\n /**\n * @returns { Promise }\n */\n async results({\n capture = true,\n }) {\n GUI.currentoutputplace = capture ? 'iframe' : 'gui';\n return [];\n }\n\n /**\n * @returns { Promise }\n */\n async screenshot({\n capture = true,\n }) {\n // skip when ..\n if (!capture) {\n this.mapControls.screenshot.control.resetOriginalOnClickEvent();\n return;\n }\n\n this.mapControls.screenshot.control.overwriteOnClickEvent(async() => {\n let response;\n try {\n response = { result: true, data: await this.mapService.createMapImage() };\n } catch(e) {\n console.warn(e);\n response = { result: false, data: e };\n } finally {\n this.emit('response', { response, action: 'app:screenshot' });\n }\n });\n }\n\n /**\n * Eventually send as param the projection in which we would like get center of map\n * \n * @param { Object } params\n * @param params.epsg since 3.9.1\n * \n * @returns { Promise }\n */\n async getcenter(params = {}) {\n const center = this.mapService.getCenter();\n if (undefined !== params.epsg) {\n return ol.proj.transform(\n center,\n this.mapService.getEpsg(),\n await _getEpsgFromParam(params.epsg)\n );\n }\n return center;\n }\n\n /**\n * Zoom to coordinates\n * \n * @param { Object } params\n * @param { Array } params.coordinates\n * @param params.epsg since 3.9.1\n * \n * @returns { Promise }\n */\n async zoomtocoordinates(params = {}) {\n let {\n coordinates = [],\n epsg,\n } = params;\n // skip when coordinates in params are null or are an array with more than item 2\n if (!(coordinates && Array.isArray(coordinates) && 2 === coordinates.length)) {\n return Promise.reject(coordinates);\n }\n if (undefined !== epsg) {\n // normalized psg code\n epsg = await _getEpsgFromParam(epsg);\n coordinates = ol.proj.transform(coordinates, epsg, this.mapService.getEpsg());\n }\n this.mapService.zoomTo(coordinates);\n return coordinates;\n }\n\n /**\n * Eventually send as param the projection in which we would like get center of map\n * \n * @param { Object } params\n * @param params.epsg since 3.9.1\n * \n * @returns { Promise }\n */\n async getextent(params = {}) {\n const extent = this.mapService.getMapExtent();\n /** @FIXME add description */\n if (undefined !== params.epsg) {\n return ol.proj.transformExtent(\n extent,\n this.mapService.getEpsg(),\n await _getEpsgFromParam(params.epsg)\n );\n }\n return extent;\n }\n\n /**\n * @param { Object } params\n * @param { Array } params.extent\n * @param params.epsg since 3.9.1\n * \n * @returns { Promise }\n */\n async zoomtoextent(params = {}) {\n let { extent = [], epsg } = params;\n // skip when an extent is null ora an array with number of ites not equal to 4\n if (!(extent && Array.isArray(extent) && 4 === extent.length)) {\n return Promise.reject(extent);\n }\n /** If epsg is provide, get epsg definition */\n if (undefined !== epsg) {\n epsg = _getEpsgFromParam(epsg);\n extent = ol.proj.transformExtent(extent, epsg, this.mapService.getEpsg());\n } else {\n this.mapService.goToBBox(extent);\n }\n return extent;\n };\n\n /**\n * Zoom to features\n * \n * @param { Object } params\n * @param params.qgs_layer_id\n * @param params.feature\n * @param { boolean } params.highlight \n * \n * @returns { Promise } qgs_layer_id\n */\n async zoomtofeature(params = {}) {\n let {\n qgs_layer_id,\n feature,\n highlight = false,\n } = params;\n\n qgs_layer_id = this.getQgsLayerId({ qgs_layer_id });\n\n const response = await this.findFeaturesWithGeometry({\n qgs_layer_id,\n feature,\n zoom: true,\n highlight,\n });\n\n return response.qgs_layer_id;\n }\n\n}\n\n/**\n * ORIGINAL SOURCE: src/services/iframe-editing.js@3.9.0\n */\nclass EditingService extends BaseIframeService {\n\n constructor() {\n super();\n\n this.pluginName = 'editing';\n\n this.subscribevents = [];\n \n this.isRunning = false;\n \n this.responseObject = {\n cb: null, // resolve or reject promise method\n qgs_layer_id: null,\n error: null,\n };\n \n this.config = {\n tools: {\n add: {\n disabled:[\n { id: 'deletefeature' },\n { id: 'copyfeatures' },\n { id: 'editmultiattributes' },\n { id: 'deletePart' },\n { id: 'splitfeature' },\n { id: 'mergefeatures' },\n ]\n },\n update: {\n disabled: [\n { id: 'addfeature' },\n { id: 'copyfeatures' },\n { id: 'deletefeature' },\n { id: 'editmultiattributes' },\n { id: 'deletePart' },\n { id: 'splitfeature' },\n { id: 'mergefeatures' },\n ]\n },\n delete: {\n enabled: [\n { id:'deletefeature', options: { active: true } },\n ]\n }\n }\n };\n\n /**\n * subscribers handlers\n */\n this.subscribersHandlers = {\n\n canUndo:({ activeTool, disableToolboxes = [] }) => bool => {\n //set currenttoolbocx id in editing to null\n if (false === bool) {\n this.responseObject.qgs_layer_id = null;\n this.responseObject.error = null;\n }\n activeTool.setEnabled(!bool);\n disableToolboxes.forEach(toolbox => toolbox.setEditing(!bool))\n },\n\n canRedo:() => {},\n\n //run callback\n cancelform:cb => () => { cb() },\n\n addfeature: ({ properties, toolboxes } = {}) => feature => {\n\n Object\n .keys(properties)\n .forEach(p => feature.set(p, properties[p]));\n\n let activeTool;\n const disableToolboxes = [];\n\n toolboxes\n .forEach(t => {\n const tool = t.getToolById('addfeature');\n if (tool.isActive()) {\n tool.setEnabled(false);\n activeTool = tool;\n } else {\n t.setEditing(false);\n disableToolboxes.push(t)\n }\n });\n\n // just one time\n if (this.subscribevents.find(e => 'canUndo' !== e.event)) {\n this.addSubscribeEvents('cancelform', this.addSubscribeEvents('canUndo', { activeTool, disableToolboxes }));\n }\n },\n\n closeeditingpanel: ({ qgs_layer_id }) => () => {\n // response to router service\n this.responseObject.cb({\n qgs_layer_id: this.responseObject.qgs_layer_id,\n error: this.responseObject.error,\n });\n // stop action\n this.stopAction({ qgs_layer_id });\n },\n\n };\n\n }\n\n // METHODS CALLED FROM EACH ACTION METHOD\n\n /**\n * run before each action\n */\n async startAction({\n toolboxes,\n resolve,\n reject,\n }) {\n\n this.responseObject.cb = reject;\n\n // set same mode autosave\n this.dependencyApi.setSaveConfig({\n cb: {\n // called when commit changes are done successuffly\n done: toolbox => {\n //set toolbox id\n this.responseObject.cb = resolve;\n this.responseObject.qgs_layer_id = toolbox.getId();\n this.responseObject.error = null;\n // close panel that fire closeediting panel event\n this.dependencyApi.hidePanel();\n },\n // called whe commit change receive an error\n error: (toolbox, error) => {\n this.responseObject.cb = reject;\n this.responseObject.qgs_layer_id = toolbox.getId();\n this.responseObject.error = error;\n },\n }\n });\n\n // set toolboxes visible base on the value of qgs_layer_id\n this.dependencyApi.showPanel({ toolboxes });\n\n this.isRunning = true;\n }\n\n /**\n * run after each action\n */\n async stopAction(opts = {}) {\n if (opts.qgs_layer_id) {\n await this.stopEditing(opts.qgs_layer_id);\n }\n }\n\n /**\n * add subscribe refenrence\n */\n addSubscribeEvents(event, options = {}) {\n const handler = this.subscribersHandlers[event](options);\n this.dependencyApi.subscribe(event, handler);\n this.subscribevents.push({ event, handler });\n return handler;\n };\n\n /**\n * Reset subscriber editing plugin events\n */\n resetSubscribeEvents() {\n this.subscribevents.forEach(d => { this.dependencyApi.unsubscribe(d.event, d.handler); });\n };\n\n /**\n * Called whe we want to add a feature\n * \n * @param { Object } config\n * @param config.qgs_layer_id\n * @param config.properties\n * \n * @returns { Promise }\n */\n add(config = {}) {\n return new Promise(async (resolve, reject) => {\n // skip when ..\n if (this.isRunning) {\n return reject();\n }\n\n // extract `qgs_layer_id9` from a configuration message\n const { qgs_layer_id: configQglLayerId, ...data } = config;\n const { properties } = data;\n\n const qgs_layer_id = this.getQgsLayerId({\n qgs_layer_id: configQglLayerId,\n noValue: this.dependencyApi.getEditableLayersId(),\n });\n\n // call method common\n await this.startAction({ toolboxes: qgs_layer_id, resolve, reject });\n\n // return all toolboxes\n const toolboxes = (\n await this.startEditing(qgs_layer_id, {\n tools: this.config.tools.add,\n startstopediting: false,\n action : 'add',\n selected: 1 === qgs_layer_id.length,\n })\n )\n .filter(p => 'fulfilled' === p.status)\n .map(p => p.value);\n\n /** @FIXME add description */\n if (!GUI.isSidebarVisible()) {\n GUI.showSidebar();\n }\n\n /** @FIXME add description */\n if (1 === toolboxes.length && toolboxes[0]) {\n toolboxes[0].setActiveTool(toolboxes[0].getToolById('addfeature'));\n }\n\n // in case of no feature add avent subscribe\n this.addSubscribeEvents('addfeature', { properties, toolboxes });\n this.addSubscribeEvents('closeeditingpanel', { qgs_layer_id })\n });\n }\n\n /**\n * Called when we want to update a know feature field\n * \n * @param config\n * \n * @returns { Promise }\n */\n async update(config = {}) {\n return new Promise(async (resolve, reject) => {\n // skip when ..\n if (this.isRunning) {\n return reject();\n }\n\n const { qgs_layer_id: configQglLayerId, ...data } = config;\n const { feature } = data;\n const qgs_layer_id = this.getQgsLayerId({\n qgs_layer_id: configQglLayerId,\n noValue: this.dependencyApi.getEditableLayersId()\n });\n\n const response = await this.findFeaturesWithGeometry({\n qgs_layer_id,\n feature,\n zoom: true,\n highlight: true,\n selected: 1 === qgs_layer_id.length // set selected toolbox\n });\n\n // skip when ..\n if (!response.found) {\n return reject();\n }\n\n await this.startAction({ toolboxes: [response.qgs_layer_id], resolve, reject });\n\n // return all toolboxes\n await this.startEditing([response.qgs_layer_id], {\n feature,\n tools: this.config.tools.update,\n startstopediting: false,\n action: 'update',\n });\n\n if (!GUI.isSidebarVisible()) {\n GUI.showSidebar();\n }\n\n this.addSubscribeEvents('closeeditingpanel', { qgs_layer_id: [response.qgs_layer_id] });\n });\n }\n\n /**\n * @virtual method need to be implemented by subclasses \n */\n delete() {}\n\n /**\n * Called when we want to start editing\n * \n * @param { Array } qgs_layer_id\n * @param { Object } options\n * \n * @returns { Promise< unknown | void > }\n */\n async startEditing(qgs_layer_id = [], options = {}) {\n const { action = 'add', feature } = options;\n const filter = {};\n options.filter = filter;\n switch (action) {\n case 'add': filter.nofeatures = true; break;\n case 'update': filter.field = `${feature.field}|eq|${feature.value}`; break;\n }\n const promises = [];\n qgs_layer_id.forEach(id => { promises.push(this.dependencyApi.startEditing(id, options)) });\n return await Promise.allSettled(promises);\n }\n\n /**\n * Stop editing\n * \n * @param qgs_layer_id\n * \n * @returns { Promise }\n */\n async stopEditing(qgs_layer_id) {\n const promises = [];\n qgs_layer_id.forEach(id => { promises.push(this.dependencyApi.stopEditing(id)); });\n await Promise.allSettled(promises);\n this.clear();\n }\n\n stop() {\n return new Promise(resolve => {\n this.dependencyApi.hidePanel();\n GUI.hideSidebar();\n this.once('clear', resolve);\n });\n }\n\n /**\n * Called wen we want to reset default editing plugin behaviour\n */\n clear() {\n this.dependencyApi.resetDefault();\n this.isRunning = false;\n this.responseObject = {\n cb: null, // resolve or reject promise method\n qgs_layer_id: null,\n error: null,\n };\n this.resetSubscribeEvents();\n this.emit('clear');\n }\n\n}\n\nexport default new IframePluginService();", "export function toRawType(value) {\n return Object.prototype.toString.call(value).slice(8, -1)\n}", "import ApplicationState from 'store/application';\n\n/** used by the following plugins: \"iframe\", \"archiweb\" */\nexport function getListableProjects() {\n window.initConfig.projects\n return window.initConfig.projects.filter(p => {\n if (![null, undefined].includes(p.listable)) {\n return p.listable;\n }\n if (\n p.id === ApplicationState.project.getId() ||\n (window.initConfig.overviewproject && p.gid === window.initConfig.overviewproject)\n ) {\n return false;\n }\n return p;\n }).sort((a, b) => (a.title || '').localeCompare(b.title));\n}", "/**\n * @param gid\n * \n * @returns {string}\n */\nexport function getProjectUrl(gid) {\n const project = window.initConfig.projects.find(p => gid === p.gid);\n try {\n return `${(new URL(window.initConfig.urls.baseurl))}${project.url}`;\n } catch(e) {\n console.warn(e);\n return `${location.origin}${window.initConfig.urls.baseurl}${project.url}`;\n }\n}", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n import ApplicationState from \"store/application\";\n\n const __vue_script__ = {\n name: \"SidebarItem\",\n data() {\n const { component } = this.$options;\n return {\n info: component.info || { state: null, style: null, class: null },\n main: true,\n component,\n active: false,\n title: component.title || '',\n open: !!component.state.open,\n icon: component.icon,\n iconColor: component.iconColor,\n collapsible: false !== component.collapsible,\n actions: component.actions,\n sidebar : ApplicationState.gui.sidebar\n };\n },\n methods: {\n triggerAction(action, component) {\n action.fnc(component);\n },\n },\n\n mounted() {\n const opts = this.$options.opts || {};\n const sidebar = document.getElementById('g3w-sidebarcomponents');\n\n // append to `g3w-sidebarcomponents`\n if ([null, undefined].includes(opts.position) || opts.position < 0 || opts.position >= sidebar.children.length) {\n $(sidebar).append(this.$el);\n }\n \n // append to `g3w-sidebarcomponents` (by position)\n else {\n Array.from(sidebar.children).forEach((child, i) => {\n if (i === opts.position || child.id === opts.position) {\n child.insertAdjacentElement((!!opts.before || undefined === opts.before) ? 'beforebegin' : 'afterend', this.$el);\n }\n });\n }\n\n this.component.mount(this.$refs['component-placeholder']);\n\n // set component click handler\n this.component.click = ({ open = false } = {}) => {\n if (open) {\n ApplicationState.sidebar.components.forEach(comp => {\n if (comp !== this.component && comp.getOpen()) {\n comp.click({ open: false });\n }\n });\n }\n const node = this.component.getInternalComponent().$el;\n //@since 3.11.0 Need to add check of sidebar components, in case, for example, close\n // contents element and some sidebar component is related to it's close, for example, qplotly\n //a toggle menu open of
      \n if (node.classList) {\n node.classList.toggle('menu-open', open);\n }\n // toggle active of
    • element\n node.parentNode.classList.toggle('active', open);\n\n this.component.setOpen(open);\n\n };\n },\n\n }\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.component.state.visible),expression:\"component.state.visible\"},{name:\"disabled\",rawName:\"v-disabled\",value:(_vm.component.state.disabled),expression:\"component.state.disabled\"}],staticClass:\"treeview sidebaritem\",class:{'active': _vm.open },attrs:{\"id\":_vm.component.id}},[_c('bar-loader',{attrs:{\"loading\":_vm.component.state.loading}}),_vm._v(\" \"),_c('a',{directives:[{name:\"t-tooltip\",rawName:\"v-t-tooltip:right.create\",value:(_vm.sidebar.open ? '' : _vm.title),expression:\"sidebar.open ? '' : title\",arg:\"right\",modifiers:{\"create\":true}}],staticStyle:{\"display\":\"flex\",\"justify-content\":\"space-between\",\"align-items\":\"center\"},attrs:{\"href\":\"#\",\"current-tooltip\":_vm.sidebar.open ? '' : _vm.title}},[_c('div',[(!_vm.sidebar.open)?_c('span',[_c('i',{class:_vm.icon,style:({ color: _vm.iconColor })})]):_c('i',{class:_vm.icon,style:({ color: _vm.iconColor })}),_vm._v(\" \"),_c('span',{directives:[{name:\"t\",rawName:\"v-t\",value:(_vm.title),expression:\"title\"}],staticClass:\"treeview-label\"})]),_vm._v(\" \"),_c('div',[(_vm.info.state)?_c('span',{class:_vm.info.class,staticStyle:{\"position\":\"absolute\",\"right\":\"5px\",\"font-weight\":\"bold\"},style:(_vm.info.style),attrs:{\"title\":_vm.info.tooltip}},[_vm._v(_vm._s(_vm.info.state))]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.actions),function(action){return _c('span',{directives:[{name:\"t-tooltip\",rawName:\"v-t-tooltip:left.create\",value:(action.tooltip),expression:\"action.tooltip\",arg:\"left\",modifiers:{\"create\":true}}],key:action.id,staticClass:\"action skin-tooltip-left\",class:action.class,staticStyle:{\"font-weight\":\"bold\",\"padding\":\"3px\"},style:(action.style),on:{\"click\":function($event){$event.stopPropagation();return _vm.triggerAction(action, _vm.component.internalComponent)}}})})],2),_vm._v(\" \"),(_vm.collapsible)?_c('i',{staticClass:\"pull-right\",class:_vm.$fa('angle-left')}):_vm._e()]),_vm._v(\" \"),_c('div',{ref:\"component-placeholder\"})],1)}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = undefined\n /* scoped */\n const __vue_scope_id__ = undefined\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"SidebarItem.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (false) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/**\n * @TODO remove \"Vue.extend\" from module export\n */\nconst __vue_script__ = Vue.extend({\n\n /** @since 3.8.6 */\n name: 'form-header',\n\n props: {\n headers: {\n type: Array,\n default: []\n },\n currentid: {\n type: String\n },\n update: {\n type: Boolean\n },\n valid: {\n type: Boolean\n }\n },\n methods: {\n click(id) {\n /**\n * @deprecated since 3.6.2\n * This was used when form headers has more than one (case relation)\n */\n if (id !== this.currentid && this.headers.length > 1) {\n this.$emit('clickheader', id);\n }\n },\n resizeForm(perc) {\n this.$emit('resize-form', perc);\n }\n }\n});\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"g3wform_header box-header with-border\",staticStyle:{\"display\":\"flex\",\"flex-direction\":\"column\"}},[_c('section',{staticClass:\"g3wform_header_content\"},_vm._l((_vm.headers),function(header){return _c('span',{key:header.id,staticClass:\"title\",class:[{item_selected: _vm.currentid === header.id && _vm.headers.length > 1},[_vm.headers.length > 1 ? 'tabs' : 'one' ]],staticStyle:{\"display\":\"flex\",\"justify-content\":\"space-between\",\"align-items\":\"center\"},style:({fontSize: _vm.isMobile() && '1em !important'}),on:{\"click\":function($event){$event.stopPropagation();return _vm.click(header.id)}}},[(header.icon)?_c('span',{staticStyle:{\"margin-right\":\"5px\"}},[_c('i',{class:header.icon})]):_vm._e(),_vm._v(\" \"),_c('span',{directives:[{name:\"t\",rawName:\"v-t:pre\",value:(header.title),expression:\"header.title\",arg:\"pre\"}],staticClass:\"g3w-long-text\"},[_vm._v(_vm._s(header.name))]),_vm._v(\" \"),_c(header.component,{tag:\"component\",attrs:{\"valid\":_vm.valid,\"update\":_vm.update}})],1)}),0)])}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = undefined\n /* scoped */\n const __vue_scope_id__ = undefined\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"FormHeader.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (false) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n/**\n * @TODO remove \"Vue.extend\" from module export\n */\nconst __vue_script__ = Vue.extend({\n\n /** @since 3.8.6 */\n name: 'form-footer',\n\n props: {\n state: {\n type: Object\n },\n backToRoot: {\n type: Function,\n default: () => {}\n },\n isRootComponent: {\n type: Function\n }\n },\n data() {\n /**\n * need toget a deep copy of buttons\n * @type {T[]}\n */\n this.originalbuttons = this.state.buttons.map(button => ({\n ...button\n }));\n return {\n id: \"footer\",\n active: true,\n show: true,\n }\n },\n computed: {\n enableSave() {\n return this.state.valid && this.state.update;\n }\n },\n methods: {\n exec(cbk) {\n cbk instanceof Function ? cbk(this.state.fields): (function() { return this.state.fields})();\n },\n btnEnabled(button) {\n const { enabled = true, type } = button;\n return enabled && (type !== 'save' || (type === 'save' && this.enableSave));\n },\n isValid() {\n return this.state.valid;\n },\n },\n watch: {\n 'state.component'(component) {\n this.show = this.isRootComponent(component)\n },\n 'state.update': {\n immediate: true,\n handler(value) {\n this.state.buttons.find((button, index) => {\n if (button.eventButtons && button.eventButtons.update) {\n if (button.eventButtons.update[value]) {\n this.state.buttons.splice(index,1, {\n ...button,\n ...button.eventButtons.update[value]\n })\n } else {\n this.state.buttons.splice(index,1, this.originalbuttons[index]);\n }\n }\n });\n }\n }\n },\n activated() {\n this.active = true;\n },\n deactivated() {\n this.active = false;\n }\n});\n\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"form-group g3wform_footer\"},[(_vm.show)?[_vm._t(\"default\",function(){return [_c('div',{staticStyle:{\"margin\":\"3px\",\"font-weight\":\"bold\"}},[_vm._v(\"\\n * \"),_c('span',{directives:[{name:\"t\",rawName:\"v-t\",value:('sdk.form.footer.required_fields'),expression:\"'sdk.form.footer.required_fields'\"}]}),_vm._v(\" \"),(_vm.state.footer.message)?_c('div',{style:([_vm.state.footer.style])},[_vm._v(\"\\n \"+_vm._s(_vm.state.footer.message)+\"\\n \")]):_vm._e()]),_vm._v(\" \"),_vm._l((_vm.state.buttons),function(button){return _c('button',{directives:[{name:\"disabled\",rawName:\"v-disabled\",value:(!_vm.btnEnabled(button)),expression:\"!btnEnabled(button)\"},{name:\"t\",rawName:\"v-t\",value:(button.title),expression:\"button.title\"}],key:button.id,staticClass:\"btn\",class:[button.class],attrs:{\"update\":_vm.state.update,\"valid\":_vm.state.valid},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.exec(button.cbk)}}})})]})]:[_c('button',{directives:[{name:\"t\",rawName:\"v-t\",value:('back'),expression:\"'back'\"}],staticClass:\"btn skin-button\",on:{\"click\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"prevet\",undefined,$event.key,undefined)){ return null; }$event.stopPropagation();return _vm.backToRoot.apply(null, arguments)}}})]],2)}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = undefined\n /* scoped */\n const __vue_scope_id__ = undefined\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"FormFooter.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (false) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport HeaderFormComponent from 'components/FormHeader.vue';\nimport G3wFormFooter from 'components/FormFooter.vue';\n\nconst __vue_script__ = {\n\n /** @since 3.8.6 */\n name: 'g3w-form',\n\n data() {\n return {\n state: {},\n switchcomponent: false,\n body: {\n components: {\n before: [],\n after: []\n }\n }\n }\n },\n components: {\n g3wformheader: HeaderFormComponent,\n G3wFormFooter\n },\n transitions: { 'addremovetransition': 'showhide' },\n methods: {\n isRootComponent(component) {\n return this.$options.service.isRootComponent(component);\n },\n backToRoot() {\n this.$options.service.setRootComponent();\n },\n handleRelation(relationId) {\n this.$options.service.handleRelation(relationId);\n },\n disableComponent({ id, disabled = false }) {\n this.$options.service.disableComponent({\n id,\n disabled\n });\n },\n resizeForm(perc) {\n this.$options.service.setCurrentFormPercentage(perc)\n },\n switchComponent(id) {\n this.switchcomponent = true;\n this.$options.service.setCurrentComponentById(id);\n },\n changeInput(input) {\n return this.$options.service.changeInput(input);\n },\n addToValidate(input) {\n this.$options.service.addToValidate(input);\n },\n removeToValidate(input) {\n this.$options.service.removeToValidate(input);\n },\n // set layout\n reloadLayout() {\n const height = $(this.$el).height();\n if (!height) { return };\n const footerDOM = $(this.$refs.g3w_form_footer.$el);\n const bodyFromDOM = $(this.$refs.g3wform_body);\n const footerHeight = footerDOM.height() ? footerDOM.height() + 50 : 50;\n const bodyHeight = height - ($(this.$refs.g3wformheader.$el).height() + footerHeight);\n bodyFromDOM.height(bodyHeight);\n },\n },\n async updated() {\n await this.$nextTick();\n if (this.switchcomponent) { setTimeout(() => this.switchcomponent = false, 0) }\n },\n created() {\n this.$options.service.getEventBus().$on('set-main-component', () => {\n this.switchComponent(0);\n });\n this.$options.service.getEventBus().$on('component-validation', ({id, valid}) => {\n this.$options.service.setValidComponent({ id, valid });\n });\n this.$options.service.getEventBus().$on('addtovalidate', this.addToValidate);\n this.$options.service.getEventBus().$on('disable-component', this.disableComponent);\n },\n mounted() {\n // check if is valid form (it used by footer component)\n this.$options.service.isValid();\n this.$options.service.setReady(true);\n },\n beforeDestroy() {\n this.$options.service.clearAll();\n }\n};\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"g3wform_content\",staticStyle:{\"position\":\"relative\"}},[_c('bar-loader',{attrs:{\"loading\":_vm.state.loading}}),_vm._v(\" \"),_c('g3wformheader',{ref:\"g3wformheader\",attrs:{\"currentid\":_vm.state.currentheaderid,\"headers\":_vm.state.headers,\"update\":_vm.state.update,\"valid\":_vm.state.valid},on:{\"resize-form\":_vm.resizeForm,\"clickheader\":_vm.switchComponent}}),_vm._v(\" \"),_c('div',{ref:\"g3wform_body\",staticClass:\"g3wform_body\"},[_vm._l((_vm.body.components.before),function(component){return _c(component,{tag:\"component\",attrs:{\"fields\":_vm.state.fields}})}),_vm._v(\" \"),_c('keep-alive',[_c(_vm.state.component,{tag:\"component\",attrs:{\"handleRelation\":_vm.handleRelation,\"state\":_vm.state},on:{\"hook:activated\":_vm.reloadLayout,\"addtovalidate\":_vm.addToValidate,\"removetovalidate\":_vm.removeToValidate,\"changeinput\":_vm.changeInput}})],1),_vm._v(\" \"),_vm._l((_vm.body.components.after),function(component){return _c(component,{tag:\"component\",attrs:{\"fields\":_vm.state.fields}})})],2),_vm._v(\" \"),_c('g3w-form-footer',{ref:\"g3w_form_footer\",attrs:{\"isRootComponent\":_vm.isRootComponent,\"backToRoot\":_vm.backToRoot,\"state\":_vm.state}})],1)}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = undefined\n /* scoped */\n const __vue_scope_id__ = undefined\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"Form.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (false) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n )\n\n export default __vue_component__", "import ApplicationState from 'store/application';\n\n/**\n * ORIGINAL SOURCE: src/app/core/layers/layersstoreregistry.js@v3.10.2\n */\nexport function getCatalogLayerById(id) {\n return Object.values(ApplicationState.catalog).map(s => s.getLayerById(id)).find(l => l);\n}", "/**\n * @file\n * @since v3.7\n */\n\nimport { getCatalogLayerById } from 'utils/getCatalogLayerById';\n\nexport default {\n methods: {\n async autocompleteRequest({ layerId, field, value } = {}) {\n let data = [];\n try {\n data = await getCatalogLayerById(layerId).getFilterData({\n suggest: `${field}|${value}`,\n unique: field\n })\n } catch(e) {\n console.warn(e);\n }\n return data.map(value => ({ id: value, text: value }))\n }\n }\n};", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nconst __vue_script__ = {\n name: \"field\",\n props: ['state']\n}\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"field\"},[(_vm.state.label)?_c('div',{staticClass:\"col-sm-6 field_label\"},[_vm._t(\"label\",function(){return [_vm._v(_vm._s(_vm.state.label))]})],2):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"field_value\",class:[_vm.state.label ? 'col-sm-6' : null ]},[_vm._t(\"field\",function(){return [_c('span',{staticStyle:{\"word-wrap\":\"break-word\"},domProps:{\"innerHTML\":_vm._s(_vm.state.value)}})]})],2)])}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = function (inject) {\n if (!inject) return\n inject(\"data-v-6e3a094b_0\", { source: \".field[data-v-6e3a094b]{background-color:transparent!important;padding-top:3px;padding-bottom:3px;display:flex;align-items:center}.value[data-v-6e3a094b]{position:relative}.field div[data-v-6e3a094b]{padding-left:3px}.field_value button[data-v-6e3a094b]{margin-right:5px}.field_value[data-v-6e3a094b]{padding-left:0!important;padding-right:8px;text-align:right}\", map: undefined, media: undefined })\n\n }\n /* scoped */\n const __vue_scope_id__ = \"data-v-6e3a094b\"\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"Field.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (true) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n function __vue_create_injector__() {\n const styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {})\n const isOldIE =\n typeof navigator !== 'undefined' &&\n /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase())\n\n return function addStyle(id, css) {\n if (document.querySelector('style[data-vue-ssr-id~=\"' + id + '\"]')) return // SSR styles are present.\n\n const group = isOldIE ? css.media || 'default' : id\n const style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined })\n\n if (!style.ids.includes(id)) {\n let code = css.source\n let index = style.ids.length\n\n style.ids.push(id)\n\n if (true && css.map) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n code +=\n '\\n/*# sourceMappingURL=data:application/json;base64,' +\n btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +\n ' */'\n }\n\n if (isOldIE) {\n style.element = style.element || document.querySelector('style[data-group=' + group + ']')\n }\n\n if (!style.element) {\n const head = document.head || document.getElementsByTagName('head')[0]\n const el = style.element = document.createElement('style')\n el.type = 'text/css'\n\n if (css.media) el.setAttribute('media', css.media)\n if (isOldIE) {\n el.setAttribute('data-group', group)\n el.setAttribute('data-next-index', '0')\n }\n\n head.appendChild(el)\n }\n\n if (isOldIE) {\n index = parseInt(style.element.getAttribute('data-next-index'))\n style.element.setAttribute('data-next-index', index + 1)\n }\n\n if (style.element.styleSheet) {\n style.parts.push(code)\n style.element.styleSheet.cssText = style.parts\n .filter(Boolean)\n .join('\\n')\n } else {\n const textNode = document.createTextNode(code)\n const nodes = style.element.childNodes\n if (nodes[index]) style.element.removeChild(nodes[index])\n if (nodes.length) style.element.insertBefore(textNode, nodes[index])\n else style.element.appendChild(textNode)\n }\n }\n }\n }\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n __vue_create_injector__,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n\nimport Field from 'components/Field.vue';\n\nconst __vue_script__ = {\n\n /** @since 3.8.6 */\n name: \"field-text\",\n\n props: ['state'],\n\n components: {\n Field\n },\n\n created() {},\n\n};\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('field',{attrs:{\"state\":_vm.state}})}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = function (inject) {\n if (!inject) return\n inject(\"data-v-18457c68_0\", { source: \".field_text_table[data-v-18457c68]{background-color:transparent!important}.field_text_table .field_label[data-v-18457c68]{font-weight:700}\", map: undefined, media: undefined })\n\n }\n /* scoped */\n const __vue_scope_id__ = \"data-v-18457c68\"\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"FieldText.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (true) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n function __vue_create_injector__() {\n const styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {})\n const isOldIE =\n typeof navigator !== 'undefined' &&\n /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase())\n\n return function addStyle(id, css) {\n if (document.querySelector('style[data-vue-ssr-id~=\"' + id + '\"]')) return // SSR styles are present.\n\n const group = isOldIE ? css.media || 'default' : id\n const style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined })\n\n if (!style.ids.includes(id)) {\n let code = css.source\n let index = style.ids.length\n\n style.ids.push(id)\n\n if (true && css.map) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n code +=\n '\\n/*# sourceMappingURL=data:application/json;base64,' +\n btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +\n ' */'\n }\n\n if (isOldIE) {\n style.element = style.element || document.querySelector('style[data-group=' + group + ']')\n }\n\n if (!style.element) {\n const head = document.head || document.getElementsByTagName('head')[0]\n const el = style.element = document.createElement('style')\n el.type = 'text/css'\n\n if (css.media) el.setAttribute('media', css.media)\n if (isOldIE) {\n el.setAttribute('data-group', group)\n el.setAttribute('data-next-index', '0')\n }\n\n head.appendChild(el)\n }\n\n if (isOldIE) {\n index = parseInt(style.element.getAttribute('data-next-index'))\n style.element.setAttribute('data-next-index', index + 1)\n }\n\n if (style.element.styleSheet) {\n style.parts.push(code)\n style.element.styleSheet.cssText = style.parts\n .filter(Boolean)\n .join('\\n')\n } else {\n const textNode = document.createTextNode(code)\n const nodes = style.element.childNodes\n if (nodes[index]) style.element.removeChild(nodes[index])\n if (nodes.length) style.element.insertBefore(textNode, nodes[index])\n else style.element.appendChild(textNode)\n }\n }\n }\n }\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n __vue_create_injector__,\n undefined,\n undefined\n )\n\n export default __vue_component__", "/* script */\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport Field from 'components/Field.vue';\n\nconst __vue_script__ = {\n\n /** @since 3.8.6 */\n name: \"field-link\",\n\n props: ['state'],\n data() {\n return {\n value: null\n }\n },\n components: {\n Field\n },\n methods: {\n openLink(link_url) {\n window.open(link_url, '_blank');\n }\n },\n created() {\n this.value = this.state.value && typeof this.state.value === 'object' ? this.state.value.value : this.state.value;\n }\n};\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('field',{attrs:{\"state\":_vm.state}},[_c('button',{directives:[{name:\"t\",rawName:\"v-t\",value:('info.link_button'),expression:\"'info.link_button'\"}],staticClass:\"btn skin-button field_link\",attrs:{\"slot\":\"field\",\"title\":_vm.value},on:{\"click\":function($event){$event.stopPropagation();return _vm.openLink(_vm.value)}},slot:\"field\"})])}\nvar __vue_staticRenderFns__ = []\n\n /* style */\n const __vue_inject_styles__ = function (inject) {\n if (!inject) return\n inject(\"data-v-145d6e0c_0\", { source: \".field_link[data-v-145d6e0c]{max-width:100%}\", map: undefined, media: undefined })\n\n }\n /* scoped */\n const __vue_scope_id__ = \"data-v-145d6e0c\"\n /* module identifier */\n const __vue_module_identifier__ = undefined\n /* functional template */\n const __vue_is_functional_template__ = false\n /* component normalizer */\n function __vue_normalize__(\n template, style, script,\n scope, functional, moduleIdentifier, shadowMode,\n createInjector, createInjectorSSR, createInjectorShadow\n ) {\n const component = (typeof script === 'function' ? script.options : script) || {}\n\n // For security concerns, we use only base name in production mode.\n component.__file = \"FieldLink.vue\"\n\n if (!component.render) {\n component.render = template.render\n component.staticRenderFns = template.staticRenderFns\n component._compiled = true\n\n if (functional) component.functional = true\n }\n\n component._scopeId = scope\n\n if (true) {\n let hook\n if (false) {\n // In SSR.\n hook = function(context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (style) {\n style.call(this, createInjectorSSR(context))\n }\n // register component module identifier for async chunk inference\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n component._ssrRegister = hook\n }\n else if (style) {\n hook = shadowMode \n ? function(context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot))\n }\n : function(context) {\n style.call(this, createInjector(context))\n }\n }\n\n if (hook !== undefined) {\n if (component.functional) {\n // register for functional component in vue file\n const originalRender = component.render\n component.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n const existing = component.beforeCreate\n component.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n }\n\n return component\n }\n /* style inject */\n function __vue_create_injector__() {\n const styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {})\n const isOldIE =\n typeof navigator !== 'undefined' &&\n /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase())\n\n return function addStyle(id, css) {\n if (document.querySelector('style[data-vue-ssr-id~=\"' + id + '\"]')) return // SSR styles are present.\n\n const group = isOldIE ? css.media || 'default' : id\n const style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined })\n\n if (!style.ids.includes(id)) {\n let code = css.source\n let index = style.ids.length\n\n style.ids.push(id)\n\n if (true && css.map) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n code +=\n '\\n/*# sourceMappingURL=data:application/json;base64,' +\n btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +\n ' */'\n }\n\n if (isOldIE) {\n style.element = style.element || document.querySelector('style[data-group=' + group + ']')\n }\n\n if (!style.element) {\n const head = document.head || document.getElementsByTagName('head')[0]\n const el = style.element = document.createElement('style')\n el.type = 'text/css'\n\n if (css.media) el.setAttribute('media', css.media)\n if (isOldIE) {\n el.setAttribute('data-group', group)\n el.setAttribute('data-next-index', '0')\n }\n\n head.appendChild(el)\n }\n\n if (isOldIE) {\n index = parseInt(style.element.getAttribute('data-next-index'))\n style.element.setAttribute('data-next-index', index + 1)\n }\n\n if (style.element.styleSheet) {\n style.parts.push(code)\n style.element.styleSheet.cssText = style.parts\n .filter(Boolean)\n .join('\\n')\n } else {\n const textNode = document.createTextNode(code)\n const nodes = style.element.childNodes\n if (nodes[index]) style.element.removeChild(nodes[index])\n if (nodes.length) style.element.insertBefore(textNode, nodes[index])\n else style.element.appendChild(textNode)\n }\n }\n }\n }\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/__vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n __vue_create_injector__,\n undefined,\n undefined\n )\n\n export default __vue_component__", "//\n//\n//\n//\n//\n//\n\nvar script = {\n name: 'teleport',\n props: {\n to: {\n type: String,\n required: true,\n },\n where: {\n type: String,\n default: 'after',\n },\n disabled: Boolean,\n },\n data: function data() {\n return {\n nodes: [],\n waiting: false,\n observer: null,\n parent: null,\n };\n },\n watch: {\n to: 'maybeMove',\n where: 'maybeMove',\n disabled: function disabled(value) {\n var this$1 = this;\n\n if (value) {\n this.disable();\n // Ensure all event done.\n this.$nextTick(function () {\n this$1.teardownObserver();\n });\n } else {\n this.bootObserver();\n this.move();\n }\n },\n },\n mounted: function mounted() {\n // Store a reference to the nodes\n this.nodes = Array.from(this.$el.childNodes);\n\n if (!this.disabled) {\n this.bootObserver();\n }\n\n // Move slot content to target\n this.maybeMove();\n },\n beforeDestroy: function beforeDestroy() {\n // Fix nodes reference\n this.nodes = this.getComponentChildrenNode();\n\n // Move back\n this.disable();\n\n // Stop observing\n this.teardownObserver();\n },\n computed: {\n classes: function classes() {\n if (this.disabled) {\n return ['teleporter'];\n }\n\n return ['teleporter', 'hidden'];\n },\n },\n methods: {\n maybeMove: function maybeMove() {\n if (!this.disabled) {\n this.move();\n }\n },\n move: function move() {\n this.waiting = false;\n\n this.parent = document.querySelector(this.to);\n\n if (!this.parent) {\n this.disable();\n\n this.waiting = true;\n\n return;\n }\n\n if (this.where === 'before') {\n this.parent.prepend(this.getFragment());\n } else {\n this.parent.appendChild(this.getFragment());\n }\n },\n disable: function disable() {\n this.$el.appendChild(this.getFragment());\n this.parent = null;\n },\n // Using a fragment is faster because it'll trigger only a single reflow\n // See https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment\n getFragment: function getFragment() {\n var fragment = document.createDocumentFragment();\n\n this.nodes.forEach(function (node) { return fragment.appendChild(node); });\n\n return fragment;\n },\n onMutations: function onMutations(mutations) {\n var this$1 = this;\n\n // Makes sure the move operation is only done once\n var shouldMove = false;\n\n for (var i = 0; i < mutations.length; i++) {\n var mutation = mutations[i];\n var filteredAddedNodes = Array.from(mutation.addedNodes).filter(function (node) { return !this$1.nodes.includes(node); });\n\n if (Array.from(mutation.removedNodes).includes(this.parent)) {\n this.disable();\n this.waiting = !this.disabled;\n } else if (this.waiting && filteredAddedNodes.length > 0) {\n shouldMove = true;\n }\n }\n\n if (shouldMove) {\n this.move();\n }\n },\n bootObserver: function bootObserver() {\n var this$1 = this;\n\n if (this.observer) {\n return;\n }\n\n this.observer = new MutationObserver(function (mutations) { return this$1.onMutations(mutations); });\n\n this.observer.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: false,\n characterData: false,\n });\n\n if (this.childObserver) {\n return;\n }\n // watch childNodes change\n this.childObserver = new MutationObserver(function (mutations) {\n var childChangeRecord = mutations.find(function (i) { return i.target === this$1.$el; });\n if (childChangeRecord) {\n // Remove old nodes before update position.\n this$1.nodes.forEach(function (node) { return node.parentNode && node.parentNode.removeChild(node); });\n this$1.nodes = this$1.getComponentChildrenNode();\n this$1.maybeMove();\n }\n });\n\n this.childObserver.observe(this.$el, {\n childList: true,\n subtree: false,\n attributes: false,\n characterData: false,\n });\n },\n teardownObserver: function teardownObserver() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n if (this.childObserver) {\n this.childObserver.disconnect();\n this.childObserver = null;\n }\n },\n getComponentChildrenNode: function getComponentChildrenNode() {\n return this.$vnode.componentOptions.children\n .map(function (i) { return i.elm; })\n .filter(function (i) { return i; });\n },\n },\n};\n\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\r\n if (typeof shadowMode !== 'boolean') {\r\n createInjectorSSR = createInjector;\r\n createInjector = shadowMode;\r\n shadowMode = false;\r\n }\r\n // Vue.extend constructor export interop.\r\n var options = typeof script === 'function' ? script.options : script;\r\n // render functions\r\n if (template && template.render) {\r\n options.render = template.render;\r\n options.staticRenderFns = template.staticRenderFns;\r\n options._compiled = true;\r\n // functional template\r\n if (isFunctionalTemplate) {\r\n options.functional = true;\r\n }\r\n }\r\n // scopedId\r\n if (scopeId) {\r\n options._scopeId = scopeId;\r\n }\r\n var hook;\r\n if (moduleIdentifier) {\r\n // server build\r\n hook = function (context) {\r\n // 2.3 injection\r\n context =\r\n context || // cached call\r\n (this.$vnode && this.$vnode.ssrContext) || // stateful\r\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional\r\n // 2.2 with runInNewContext: true\r\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\r\n context = __VUE_SSR_CONTEXT__;\r\n }\r\n // inject component styles\r\n if (style) {\r\n style.call(this, createInjectorSSR(context));\r\n }\r\n // register component module identifier for async chunk inference\r\n if (context && context._registeredComponents) {\r\n context._registeredComponents.add(moduleIdentifier);\r\n }\r\n };\r\n // used by ssr in case component is cached and beforeCreate\r\n // never gets called\r\n options._ssrRegister = hook;\r\n }\r\n else if (style) {\r\n hook = shadowMode\r\n ? function (context) {\r\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));\r\n }\r\n : function (context) {\r\n style.call(this, createInjector(context));\r\n };\r\n }\r\n if (hook) {\r\n if (options.functional) {\r\n // register for functional component in vue file\r\n var originalRender = options.render;\r\n options.render = function renderWithStyleInjection(h, context) {\r\n hook.call(context);\r\n return originalRender(h, context);\r\n };\r\n }\r\n else {\r\n // inject component registration as beforeCreate hook\r\n var existing = options.beforeCreate;\r\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\r\n }\r\n }\r\n return script;\r\n}\n\nvar isOldIE = typeof navigator !== 'undefined' &&\r\n /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase());\r\nfunction createInjector(context) {\r\n return function (id, style) { return addStyle(id, style); };\r\n}\r\nvar HEAD;\r\nvar styles = {};\r\nfunction addStyle(id, css) {\r\n var group = isOldIE ? css.media || 'default' : id;\r\n var style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });\r\n if (!style.ids.has(id)) {\r\n style.ids.add(id);\r\n var code = css.source;\r\n if (css.map) {\r\n // https://developer.chrome.com/devtools/docs/javascript-debugging\r\n // this makes source maps inside style tags work properly in Chrome\r\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */';\r\n // http://stackoverflow.com/a/26603875\r\n code +=\r\n '\\n/*# sourceMappingURL=data:application/json;base64,' +\r\n btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +\r\n ' */';\r\n }\r\n if (!style.element) {\r\n style.element = document.createElement('style');\r\n style.element.type = 'text/css';\r\n if (css.media)\r\n { style.element.setAttribute('media', css.media); }\r\n if (HEAD === undefined) {\r\n HEAD = document.head || document.getElementsByTagName('head')[0];\r\n }\r\n HEAD.appendChild(style.element);\r\n }\r\n if ('styleSheet' in style.element) {\r\n style.styles.push(code);\r\n style.element.styleSheet.cssText = style.styles\r\n .filter(Boolean)\r\n .join('\\n');\r\n }\r\n else {\r\n var index = style.ids.size - 1;\r\n var textNode = document.createTextNode(code);\r\n var nodes = style.element.childNodes;\r\n if (nodes[index])\r\n { style.element.removeChild(nodes[index]); }\r\n if (nodes.length)\r\n { style.element.insertBefore(textNode, nodes[index]); }\r\n else\r\n { style.element.appendChild(textNode); }\r\n }\r\n }\r\n}\n\n/* script */\nvar __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function() {\n var _vm = this;\n var _h = _vm.$createElement;\n var _c = _vm._self._c || _h;\n return _c(\"div\", { class: _vm.classes }, [_vm._t(\"default\")], 2)\n};\nvar __vue_staticRenderFns__ = [];\n__vue_render__._withStripped = true;\n\n /* style */\n var __vue_inject_styles__ = function (inject) {\n if (!inject) { return }\n inject(\"data-v-50f4b45b_0\", { source: \".hidden[data-v-50f4b45b] {\\n visibility: hidden;\\n display: none;\\n}\\n\\n/*# sourceMappingURL=Teleport.vue.map */\", map: {\"version\":3,\"sources\":[\"/home/shodan/Projects/vue2-teleport/src/Teleport.vue\",\"Teleport.vue\"],\"names\":[],\"mappings\":\"AA2LA;EACA,kBAAA;EACA,aAAA;AC1LA;;AAEA,uCAAuC\",\"file\":\"Teleport.vue\",\"sourcesContent\":[\"\\n\\n\\n\\n\\n\",\".hidden {\\n visibility: hidden;\\n display: none;\\n}\\n\\n/*# sourceMappingURL=Teleport.vue.map */\"]}, media: undefined });\n\n };\n /* scoped */\n var __vue_scope_id__ = \"data-v-50f4b45b\";\n /* module identifier */\n var __vue_module_identifier__ = undefined;\n /* functional template */\n var __vue_is_functional_template__ = false;\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n var __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n createInjector,\n undefined,\n undefined\n );\n\n// Taken from https://vuejs.org/v2/cookbook/packaging-sfc-for-npm.html\n\n// Declare install function executed by Vue.use()\nfunction install (Vue) {\n if (install.installed) { return; }\n\n install.installed = true;\n Vue.component('Teleport', __vue_component__);\n}\n\n// Create module definition for Vue.use()\nvar plugin = {\n install: install,\n};\n\n// Auto-install when vue is found (eg. in browser via