@sipsgmedo/mapmost-onemap-x 3.5.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * sipsgmedo-mapmost-onemap-x 3.5.0-beta1
3
+ *
4
+ * @link
5
+ * @source
6
+ * @copyright (c) 2022-2026 园测信息科技股份有限公司
7
+ */
8
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jszip"),require("util"),require("vue"),require("element-ui"),require("@mapmost/mapmost-webgl"),require("mapbox-gl-utils"),require("@turf/turf"),require("wellknown"),require("shapefile"),require("terraformer-wkt-parser"),require("axios"),require("jsencrypt"),require("sm-crypto"),require("screenfull"),require("jquery"),require("html2canvas"),require("xml2js"),require("@mapmost/mapmost-webgl-measure3D"),require("xlsx"),require("vue-drag-resize")):"function"==typeof define&&define.amd?define(["exports","jszip","util","vue","element-ui","@mapmost/mapmost-webgl","mapbox-gl-utils","@turf/turf","wellknown","shapefile","terraformer-wkt-parser","axios","jsencrypt","sm-crypto","screenfull","jquery","html2canvas","xml2js","@mapmost/mapmost-webgl-measure3D","xlsx","vue-drag-resize"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).sipsgmedoMapmostOnemapX={},t.jszip,t.util,t.Vue,t.ElementUI,t.mapmost,t.U,t.turf,t.wellknown,t.shapefile,t.WKT,t.Axios,t.JSEncrypt,t.smCrypto,t.screenfull,t.$,t.html2canvas,t.xml2js,t.Measure3D,t.xlsx,t.VueDragResize)}(this,(function(t,e,i,s,a,n,o,r,l,h,c,p,u,d,m,g,y,f,_,v,x){"use strict";function C(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function L(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var M=C(e),b=C(i),w=C(s),S=C(a),I=C(n),E=C(o),T=L(r),D=L(l),P=L(h),O=C(c),k=C(p),N=C(u),A=C(m),R=C(g),F=C(y),B=C(_),G=C(x);w.default.directive("drag",{inserted(t){t.onmousedown=function(t){if("INPUT"==t.target.nodeName||"TEXTAREA"==t.target.nodeName||t.target.classList.contains("el-slider__button"))return;let{id:e}=t.target;if(""==e&&(e=t.currentTarget.id),!e)return;const i=t.clientX-document.getElementById(e).offsetLeft,s=t.clientY-document.getElementById(e).offsetTop;return document.onmousemove=function(t){const a=t.clientX-i,n=t.clientY-s;n>=0&&(document.getElementById(e).style.top=`${n}px`),document.getElementById(e).style.left=`${a}px`},document.onmouseup=function(){return document.onmousemove=null,document.onmouseup=null,!1},!1}}});var z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function j(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function U(t,e){return t(e={exports:{}},e.exports),e.exports}var V,q,H=U((function(t,e){e.__esModule=!0,e.default={el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},empty:{description:"暂无数据"}}}})),$=j(H),W=function(t){return t&&t.Math===Math&&t},K=W("object"==typeof globalThis&&globalThis)||W("object"==typeof window&&window)||W("object"==typeof self&&self)||W("object"==typeof z&&z)||W("object"==typeof z&&z)||function(){return this}()||Function("return this")(),Y=function(t){try{return!!t()}catch(t){return!0}},J=!Y((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),X=!Y((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),Q=Function.prototype.call,Z=X?Q.bind(Q):function(){return Q.apply(Q,arguments)},tt={}.propertyIsEnumerable,et=Object.getOwnPropertyDescriptor,it=et&&!tt.call({1:2},1)?function(t){var e=et(this,t);return!!e&&e.enumerable}:tt,st={f:it},at=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},nt=Function.prototype,ot=nt.call,rt=X&&nt.bind.bind(ot,ot),lt=X?rt:function(t){return function(){return ot.apply(t,arguments)}},ht=lt({}.toString),ct=lt("".slice),pt=function(t){return ct(ht(t),8,-1)},ut=Object,dt=lt("".split),mt=Y((function(){return!ut("z").propertyIsEnumerable(0)}))?function(t){return"String"===pt(t)?dt(t,""):ut(t)}:ut,gt=function(t){return null==t},yt=TypeError,ft=function(t){if(gt(t))throw new yt("Can't call method on "+t);return t},_t=function(t){return mt(ft(t))},vt="object"==typeof document&&document.all,xt=void 0===vt&&void 0!==vt?function(t){return"function"==typeof t||t===vt}:function(t){return"function"==typeof t},Ct=function(t){return"object"==typeof t?null!==t:xt(t)},Lt=function(t,e){return arguments.length<2?(i=K[t],xt(i)?i:void 0):K[t]&&K[t][e];var i},Mt=lt({}.isPrototypeOf),bt="undefined"!=typeof navigator&&String(navigator.userAgent)||"",wt=K.process,St=K.Deno,It=wt&&wt.versions||St&&St.version,Et=It&&It.v8;Et&&(q=(V=Et.split("."))[0]>0&&V[0]<4?1:+(V[0]+V[1])),!q&&bt&&(!(V=bt.match(/Edge\/(\d+)/))||V[1]>=74)&&(V=bt.match(/Chrome\/(\d+)/))&&(q=+V[1]);var Tt=q,Dt=K.String,Pt=!!Object.getOwnPropertySymbols&&!Y((function(){var t=Symbol("symbol detection");return!Dt(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Tt&&Tt<41})),Ot=Pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,kt=Object,Nt=Ot?function(t){return"symbol"==typeof t}:function(t){var e=Lt("Symbol");return xt(e)&&Mt(e.prototype,kt(t))},At=String,Rt=TypeError,Ft=function(t){if(xt(t))return t;throw new Rt(function(t){try{return At(t)}catch(t){return"Object"}}(t)+" is not a function")},Bt=TypeError,Gt=Object.defineProperty,zt=function(t,e){try{Gt(K,t,{value:e,configurable:!0,writable:!0})}catch(i){K[t]=e}return e},jt=U((function(t){var e="__core-js_shared__",i=t.exports=K[e]||zt(e,{});(i.versions||(i.versions=[])).push({version:"3.36.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),Ut=function(t,e){return jt[t]||(jt[t]=e||{})},Vt=Object,qt=function(t){return Vt(ft(t))},Ht=lt({}.hasOwnProperty),$t=Object.hasOwn||function(t,e){return Ht(qt(t),e)},Wt=0,Kt=Math.random(),Yt=lt(1..toString),Jt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Yt(++Wt+Kt,36)},Xt=K.Symbol,Qt=Ut("wks"),Zt=Ot?Xt.for||Xt:Xt&&Xt.withoutSetter||Jt,te=function(t){return $t(Qt,t)||(Qt[t]=Pt&&$t(Xt,t)?Xt[t]:Zt("Symbol."+t)),Qt[t]},ee=TypeError,ie=te("toPrimitive"),se=function(t,e){if(!Ct(t)||Nt(t))return t;var i,s=function(t,e){var i=t[e];return gt(i)?void 0:Ft(i)}(t,ie);if(s){if(void 0===e&&(e="default"),i=Z(s,t,e),!Ct(i)||Nt(i))return i;throw new ee("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var i,s;if("string"===e&&xt(i=t.toString)&&!Ct(s=Z(i,t)))return s;if(xt(i=t.valueOf)&&!Ct(s=Z(i,t)))return s;if("string"!==e&&xt(i=t.toString)&&!Ct(s=Z(i,t)))return s;throw new Bt("Can't convert object to primitive value")}(t,e)},ae=function(t){var e=se(t,"string");return Nt(e)?e:e+""},ne=K.document,oe=Ct(ne)&&Ct(ne.createElement),re=!J&&!Y((function(){return 7!==Object.defineProperty((t="div",oe?ne.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),le=Object.getOwnPropertyDescriptor,he=J?le:function(t,e){if(t=_t(t),e=ae(e),re)try{return le(t,e)}catch(t){}if($t(t,e))return at(!Z(st.f,t,e),t[e])},ce={f:he},pe=J&&Y((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),ue=String,de=TypeError,me=function(t){if(Ct(t))return t;throw new de(ue(t)+" is not an object")},ge=TypeError,ye=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,_e="enumerable",ve="configurable",xe="writable",Ce=J?pe?function(t,e,i){if(me(t),e=ae(e),me(i),"function"==typeof t&&"prototype"===e&&"value"in i&&xe in i&&!i[xe]){var s=fe(t,e);s&&s[xe]&&(t[e]=i.value,i={configurable:ve in i?i[ve]:s[ve],enumerable:_e in i?i[_e]:s[_e],writable:!1})}return ye(t,e,i)}:ye:function(t,e,i){if(me(t),e=ae(e),me(i),re)try{return ye(t,e,i)}catch(t){}if("get"in i||"set"in i)throw new ge("Accessors not supported");return"value"in i&&(t[e]=i.value),t},Le={f:Ce},Me=J?function(t,e,i){return Le.f(t,e,at(1,i))}:function(t,e,i){return t[e]=i,t},be=Function.prototype,we=J&&Object.getOwnPropertyDescriptor,Se=$t(be,"name"),Ie={EXISTS:Se,PROPER:Se&&"something"===function(){}.name,CONFIGURABLE:Se&&(!J||J&&we(be,"name").configurable)},Ee=lt(Function.toString);xt(jt.inspectSource)||(jt.inspectSource=function(t){return Ee(t)});var Te,De,Pe,Oe=jt.inspectSource,ke=K.WeakMap,Ne=xt(ke)&&/native code/.test(String(ke)),Ae=Ut("keys"),Re={},Fe="Object already initialized",Be=K.TypeError,Ge=K.WeakMap;if(Ne||jt.state){var ze=jt.state||(jt.state=new Ge);ze.get=ze.get,ze.has=ze.has,ze.set=ze.set,Te=function(t,e){if(ze.has(t))throw new Be(Fe);return e.facade=t,ze.set(t,e),e},De=function(t){return ze.get(t)||{}},Pe=function(t){return ze.has(t)}}else{var je=function(t){return Ae[t]||(Ae[t]=Jt(t))}("state");Re[je]=!0,Te=function(t,e){if($t(t,je))throw new Be(Fe);return e.facade=t,Me(t,je,e),e},De=function(t){return $t(t,je)?t[je]:{}},Pe=function(t){return $t(t,je)}}var Ue={set:Te,get:De,has:Pe,enforce:function(t){return Pe(t)?De(t):Te(t,{})},getterFor:function(t){return function(e){var i;if(!Ct(e)||(i=De(e)).type!==t)throw new Be("Incompatible receiver, "+t+" required");return i}}},Ve=U((function(t){var e=Ie.CONFIGURABLE,i=Ue.enforce,s=Ue.get,a=String,n=Object.defineProperty,o=lt("".slice),r=lt("".replace),l=lt([].join),h=J&&!Y((function(){return 8!==n((function(){}),"length",{value:8}).length})),c=String(String).split("String"),p=t.exports=function(t,s,p){"Symbol("===o(a(s),0,7)&&(s="["+r(a(s),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),p&&p.getter&&(s="get "+s),p&&p.setter&&(s="set "+s),(!$t(t,"name")||e&&t.name!==s)&&(J?n(t,"name",{value:s,configurable:!0}):t.name=s),h&&p&&$t(p,"arity")&&t.length!==p.arity&&n(t,"length",{value:p.arity});try{p&&$t(p,"constructor")&&p.constructor?J&&n(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=i(t);return $t(u,"source")||(u.source=l(c,"string"==typeof s?s:"")),t};Function.prototype.toString=p((function(){return xt(this)&&s(this).source||Oe(this)}),"toString")})),qe=function(t,e,i,s){s||(s={});var a=s.enumerable,n=void 0!==s.name?s.name:e;if(xt(i)&&Ve(i,n,s),s.global)a?t[e]=i:zt(e,i);else{try{s.unsafe?t[e]&&(a=!0):delete t[e]}catch(t){}a?t[e]=i:Le.f(t,e,{value:i,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return t},He=Math.ceil,$e=Math.floor,We=Math.trunc||function(t){var e=+t;return(e>0?$e:He)(e)},Ke=function(t){var e=+t;return e!=e||0===e?0:We(e)},Ye=Math.max,Je=Math.min,Xe=Math.min,Qe=function(t){var e=Ke(t);return e>0?Xe(e,9007199254740991):0},Ze=function(t){return Qe(t.length)},ti=function(t){return function(e,i,s){var a=_t(e),n=Ze(a);if(0===n)return!t&&-1;var o,r=function(t,e){var i=Ke(t);return i<0?Ye(i+e,0):Je(i,e)}(s,n);if(t&&i!=i){for(;n>r;)if((o=a[r++])!=o)return!0}else for(;n>r;r++)if((t||r in a)&&a[r]===i)return t||r||0;return!t&&-1}},ei={includes:ti(!0),indexOf:ti(!1)}.indexOf,ii=lt([].push),si=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),ai=Object.getOwnPropertyNames||function(t){return function(t,e){var i,s=_t(t),a=0,n=[];for(i in s)!$t(Re,i)&&$t(s,i)&&ii(n,i);for(;e.length>a;)$t(s,i=e[a++])&&(~ei(n,i)||ii(n,i));return n}(t,si)},ni={f:ai},oi={f:Object.getOwnPropertySymbols},ri=lt([].concat),li=Lt("Reflect","ownKeys")||function(t){var e=ni.f(me(t)),i=oi.f;return i?ri(e,i(t)):e},hi=function(t,e,i){for(var s=li(e),a=Le.f,n=ce.f,o=0;o<s.length;o++){var r=s[o];$t(t,r)||i&&$t(i,r)||a(t,r,n(e,r))}},ci=/#|\.prototype\./,pi=function(t,e){var i=di[ui(t)];return i===gi||i!==mi&&(xt(e)?Y(e):!!e)},ui=pi.normalize=function(t){return String(t).replace(ci,".").toLowerCase()},di=pi.data={},mi=pi.NATIVE="N",gi=pi.POLYFILL="P",yi=pi,fi=ce.f,_i=function(t,e){var i,s,a,n,o,r=t.target,l=t.global,h=t.stat;if(i=l?K:h?K[r]||zt(r,{}):K[r]&&K[r].prototype)for(s in e){if(n=e[s],a=t.dontCallGetSet?(o=fi(i,s))&&o.value:i[s],!yi(l?s:r+(h?".":"#")+s,t.forced)&&void 0!==a){if(typeof n==typeof a)continue;hi(n,a)}(t.sham||a&&a.sham)&&Me(n,"sham",!0),qe(i,s,n,t)}},vi=Array.isArray||function(t){return"Array"===pt(t)},xi=TypeError,Ci=Object.getOwnPropertyDescriptor,Li=J&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(vi(t)&&!Ci(t,"length").writable)throw new xi("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},Mi=TypeError;function bi(t,e,i,s,a,n,o,r,l,h){"boolean"!=typeof o&&(l=r,r=o,o=!1);const c="function"==typeof i?i.options:i;let p;if(t&&t.render&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),s&&(c._scopeId=s),n?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},c._ssrRegister=p):e&&(p=o?function(t){e.call(this,h(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,r(t))}),p)if(c.functional){const t=c.render;c.render=function(e,i){return p.call(i),t(e,i)}}else{const t=c.beforeCreate;c.beforeCreate=t?[].concat(t,p):[p]}return i}_i({target:"Array",proto:!0,arity:1,forced:Y((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=qt(this),i=Ze(e),s=arguments.length;!function(t){if(t>9007199254740991)throw Mi("Maximum allowed index exceeded")}(i+s);for(var a=0;a<s;a++)e[i]=arguments[a],i++;return Li(e,i),i}});const wi={props:{visible:{type:Boolean,default:!1},data:{type:Object,default:{mapResourceList:[],label:""}},baseIndex:{type:Number,default:0},selectIndex:{type:String,default:""}},methods:{change(t){this.$emit("change",this.data,t,this.baseIndex)}}};var Si=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-drop-panel"},[i("span",{staticClass:"mx-map-layer-tools__arrow"}),t._v(" "),t._l(t.data.mapResourceList,(function(e,s){return[i("div",{key:s,staticClass:"mx-layer-hover-line",class:{activeHover:t.selectIndex==t.baseIndex+"-"+s},on:{click:function(e){return e.stopPropagation(),t.change(s)}}},[i("span",[i("i",{staticClass:"el-icon-files mx-el-icon-layer"}),t._v("\n "+t._s(e.layerLabel||e.mapResourceName))])])]}))],2)};Si._withStripped=!0;const Ii=bi({render:Si,staticRenderFns:[]},undefined,wi,"data-v-7061d317",false,undefined,!1,void 0,void 0,void 0);var Ei={name:"MapSwitch",components:{MapStyle:Ii},props:{data:{type:Array,default:()=>[]},MapSwitch:{type:[Boolean,Object],default:()=>!1}},inject:{adapter:{from:"adapter",default:()=>null},mapP:{from:"mapP",default:()=>null}},data:()=>({mapLoading:!0,selectIndex:"",refreshPopover:!1,mouseOverDrop:!1,localData:[],baseLayer:{},baseLayerStyles:{},opacity:0,layers:[],showLayerTool:!1,showIsCheck:!1,defaultLayer:null,visibleState:{},defaultIndex:"0",forceCheckMode:!1}),created(){this.adapter?Object.assign(this,this.adapter().MS.props):this.localData=this.data},mounted(){if(this.map=this.mapP(),"object"==typeof this.MapSwitch&&(this.defaultIndex=void 0!==this.MapSwitch.defaultIndex&&this.MapSwitch.defaultIndex||this.defaultIndex,this.forceCheckMode=!0===this.MapSwitch.forceCheckMode),this.showLayerTool=!1,0==this.localData.length)return;let t=this.localData.filter((t=>t.default))[0];var e=this.defaultIndex.split("-");!t&&this.localData.length>0&&(t=this.localData[e[0]]),t.styleURL&&(this.showIsCheck=!0),this.showIsCheck||(e.length>1&&0!=e[1]?this.changeBaseMap({styleIndex:e[1],index:e[0]}):this.forceCheckMode?(this.showIsCheck=!0,this.changeLayer(t,0!=e[0]?e[0]:0)):this.changeLayer(t,0!=e[0]?e[0]:0)),this.map.getMapSwitchSelectIndex=()=>this.selectIndex,this.map.on("style.load",(()=>{this.mapLoading=!0,this.map.mapIsLoading=!1}))},methods:{mouseLeaveDrop(){this.mouseOverDrop=!1,this.refreshPopover=!1},changeDropStyle(t,e){this.visibleState[e.id]&&(this.mouseOverDrop=t,t?this.refreshPopover=t:setTimeout((()=>{this.mouseOverDrop||(this.refreshPopover=!1)}),200))},changeStyle(t,e,i){this.refreshPopover=!0,this.$nextTick((()=>{this.refreshPopover=!1}));let s=JSON.parse(JSON.stringify(t));const a=s.mapResourceList[e];s.mapResourceList=[a],this.baseLayer.id==s.id&&(this.baseLayer={}),this.changeLayer(s,i),this.selectIndex=i+"-"+e},styleDropdown(t){var e=!1;const i=t.mapResourceList;return i.length>1&&(e="style"==i[1].layerType),this.visibleState[t.id]=e,e},getIco:t=>JSON.parse(t.icon).icon,changeBaseMap(t){"object"==typeof t?this.changeStyle(this.localData[t.index],t.styleIndex,t.index):this.changeLayer(this.localData[t],t)},changeLayer(t,e=0,i){if(this.mapLoading){if(this.baseLayer.id==t.id)return this.showIsCheck?(this.layerIds&&this.layerIds.length>0&&this.layerIds.forEach((t=>{this.map.M.layerManager.removeLayerById(t)})),this.layerIds=[],this.baseLayer={},this.selectIndex="",void setTimeout((()=>{this.map.M.layerManager.initBaseMapStyleSheet(this.map)}),200)):void 0;this.baseLayer.id&&(this.layerIds&&this.layerIds.length>0&&this.layerIds.forEach((t=>{this.map.M.layerManager.removeLayerById(t)})),this.layerIds=[]),this.layerIds&&this.layerIds.length>0&&this.layerIds.forEach((t=>{this.map.M.layerManager.removeLayerById(t)})),this.layerIds=[],this.addLayerHandler(t),this.selectIndex=e+"-0"}},addLayerHandler(t){this.baseLayer=t;const{mapResourceList:e}=t;if(e.length>0)try{this.addBaseMapCallBack(e,0)}catch(t){this.mapLoading=!0}finally{this.mapLoading=!0}},addBaseMapCallBack(t,e){const i=t[e];"style"==i.layerType&&t.length>1&&(t=[t[e]]),this.map.M.layerManager.addBaseLayer(i,(()=>{let s=e+1;this.layerIds.push(i.id),t[s]&&this.addBaseMapCallBack(t,s)}))},onOpacityChange(){for(const t of this.layers)t.setOpacity(parseFloat(this.opacity))},onPopoverShow(){if(this.layers=[],this.baseLayer)for(const t of this.baseLayer.mapResourceList){const e=this.map.M.layerManager.getLayerById(t.id);this.layers.push(e),this.opacity=e.getOpacity()}},toggleLayer(){const t=this.localData.filter((t=>t.id!=this.baseLayer.id))[0];t&&this.changeLayer(t)}},destroyed(){}};const Ti=Ei;var Di=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-switch"},t._l(t.localData,(function(e,s){return i("div",{key:s,staticClass:"mx-map-btn",class:{active:t.baseLayer.id==e.id||t.selectIndex.indexOf(s+"-")>-1},on:{click:function(i){return t.changeLayer(e,s)},mouseover:function(i){return t.changeDropStyle(!0,e)},mouseleave:function(i){return t.changeDropStyle(!1,e)}}},[e.icon?i("i",{class:e.icon}):i("i",{class:e.label.indexOf("地图")>-1?"icon-map-o":"icon-earth"}),t._v(" "),t.styleDropdown(e)?i("div",{staticClass:"mx-map-switch-drop"},[i("div",{staticClass:"drop-style"},[i("span",[t._v(t._s(e.label)),i("i",{staticClass:"el-icon-arrow-down"})])]),t._v(" "),t.refreshPopover&&t.styleDropdown(e)?i("div",{staticClass:"mx-popver-style el-popover",on:{mouseover:function(e){t.mouseOverDrop=!0},mouseleave:t.mouseLeaveDrop}},[i("map-style",{attrs:{data:e,selectIndex:t.selectIndex,baseIndex:s},on:{change:t.changeStyle}})],1):t._e()]):i("span",[t._v(t._s(e.label))]),t._v(" "),t.showLayerTool&&t.baseLayer.id==e.id?i("el-popover",{attrs:{placement:"bottom",trigger:"hover"},on:{show:t.onPopoverShow}},[i("a",{attrs:{slot:"reference"},slot:"reference"},[i("i",{staticClass:"el-icon-arrow-down"})]),t._v(" "),i("div",[i("label",[t._v("透明度")]),t._v(" "),i("div",[i("input",{directives:[{name:"model",rawName:"v-model",value:t.opacity,expression:"opacity"}],staticStyle:{width:"100%"},attrs:{type:"range",min:"0",max:"1",step:"0.1"},domProps:{value:t.opacity},on:{input:function(e){return t.onOpacityChange()},change:function(e){return t.onOpacityChange()},__r:function(e){t.opacity=e.target.value}}})])])]):t._e()],1)})),0)};Di._withStripped=!0;const Pi=bi({render:Di,staticRenderFns:[]},undefined,Ti,"data-v-593061ba",false,undefined,!1,void 0,void 0,void 0);class Oi{constructor(){this.subUid=0,this.topics={}}publish(t,e){if(!this.topics[t])return!1;const i=this.topics[t];let s=i?i.length:0;for(;s--;)i[s].func(e);return this}subscribe(t,e){this.topics[t]||(this.topics[t]=[]);const i=(++this.subUid).toString();return this.topics[t].push({token:i,func:e}),i}remove(t,e){if(!this.topics[t])return;const i=this.topics[t];for(let s=0;s<i.length;s++)void 0===e?i[s].key===t&&i.splice(s,1):i[s].token===e&&i.splice(s,1)}}var ki=function(t,e,i){return i.get&&Ve(i.get,e,{getter:!0}),i.set&&Ve(i.set,e,{setter:!0}),Le.f(t,e,i)},Ni=function(t,e,i){try{return lt(Ft(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}},Ai=TypeError,Ri=Ni(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==pt(t))throw new Ai("ArrayBuffer expected");return t.byteLength},Fi=lt(ArrayBuffer.prototype.slice),Bi=function(t){if(0!==Ri(t))return!1;try{return Fi(t,0,0),!1}catch(t){return!0}},Gi=ArrayBuffer.prototype;J&&!("detached"in Gi)&&ki(Gi,"detached",{configurable:!0,get:function(){return Bi(this)}});var zi,ji,Ui,Vi,qi=RangeError,Hi="process"===pt(K.process),$i="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Wi=!$i&&!Hi&&"object"==typeof window&&"object"==typeof document,Ki=K.structuredClone,Yi=!!Ki&&!Y((function(){if($i&&Tt>92||Hi&&Tt>94||Wi&&Tt>97)return!1;var t=new ArrayBuffer(8),e=Ki(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})),Ji=K.structuredClone,Xi=K.ArrayBuffer,Qi=K.MessageChannel,Zi=!1;if(Yi)Zi=function(t){Ji(t,{transfer:[t]})};else if(Xi)try{Qi||(zi=function(t){try{if(Hi)return Function('return require("'+t+'")')()}catch(t){}}("worker_threads"),zi&&(Qi=zi.MessageChannel)),Qi&&(ji=new Qi,Ui=new Xi(2),Vi=function(t){ji.port1.postMessage(null,[t])},2===Ui.byteLength&&(Vi(Ui),0===Ui.byteLength&&(Zi=Vi)))}catch(t){}var ts=Zi,es=K.structuredClone,is=K.ArrayBuffer,ss=K.DataView,as=K.TypeError,ns=Math.min,os=is.prototype,rs=ss.prototype,ls=lt(os.slice),hs=Ni(os,"resizable","get"),cs=Ni(os,"maxByteLength","get"),ps=lt(rs.getInt8),us=lt(rs.setInt8),ds=(Yi||ts)&&function(t,e,i){var s,a=Ri(t),n=void 0===e?a:function(t){if(void 0===t)return 0;var e=Ke(t),i=Qe(e);if(e!==i)throw new qi("Wrong length or index");return i}(e),o=!hs||!hs(t);if(Bi(t))throw new as("ArrayBuffer is detached");if(Yi&&(t=es(t,{transfer:[t]}),a===n&&(i||o)))return t;if(a>=n&&(!i||o))s=ls(t,0,n);else{var r=i&&!o&&cs?{maxByteLength:cs(t)}:void 0;s=new is(n,r);for(var l=new ss(t),h=new ss(s),c=ns(n,a),p=0;p<c;p++)us(h,p,ps(l,p))}return Yi||ts(t),s};ds&&_i({target:"ArrayBuffer",proto:!0},{transfer:function(){return ds(this,arguments.length?arguments[0]:void 0,!0)}}),ds&&_i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return ds(this,arguments.length?arguments[0]:void 0,!1)}});var ms=U((function(t,e){
9
+ /**
10
+ * JSTS. See https://github.com/bjornharrtell/jsts
11
+ * https://github.com/bjornharrtell/jsts/blob/master/LICENSE_EDLv1.txt
12
+ * https://github.com/bjornharrtell/jsts/blob/master/LICENSE_EPLv1.txt
13
+ * @license
14
+ */
15
+ !function(t){class e{static equalsWithTolerance(t,e,i){return Math.abs(t-e)<=i}}class i extends Error{constructor(t){super(t),this.name=Object.keys({Exception:i})[0]}toString(){return this.message}}class s extends i{constructor(t){super(t),this.name=Object.keys({IllegalArgumentException:s})[0]}}class a{constructor(t,e){this.low=e||0,this.high=t||0}static toBinaryString(t){let e,i="";for(e=2147483648;e>0;e>>>=1)i+=(t.high&e)===e?"1":"0";for(e=2147483648;e>0;e>>>=1)i+=(t.low&e)===e?"1":"0";return i}}function n(){}function o(){}function r(){}function l(){}function h(){}n.NaN=NaN,n.isNaN=t=>Number.isNaN(t),n.isInfinite=t=>!Number.isFinite(t),n.MAX_VALUE=Number.MAX_VALUE,n.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,n.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,"function"==typeof Float64Array&&"function"==typeof Int32Array?function(){const t=2146435072,e=new Float64Array(1),i=new Int32Array(e.buffer);n.doubleToLongBits=function(s){e[0]=s;let n=0|i[0],o=0|i[1];return(o&t)===t&&!!(1048575&o)&&0!==n&&(n=0,o=2146959360),new a(o,n)},n.longBitsToDouble=function(t){return i[0]=t.low,i[1]=t.high,e[0]}}():function(){const t=1023,e=Math.log2,i=Math.floor,s=Math.pow,o=function(){for(let t=53;t>0;t--){const a=s(2,t)-1;if(i(e(a))+1===t)return a}return 0}();n.doubleToLongBits=function(n){let r,l,h,c,p,u,d,m,g;if(n<0||1/n===Number.NEGATIVE_INFINITY?(u=1<<31,n=-n):u=0,0===n)return g=0,m=u,new a(m,g);if(n===1/0)return g=0,m=2146435072|u,new a(m,g);if(n!=n)return g=0,m=2146959360,new a(m,g);if(c=0,g=0,r=i(n),r>1)if(r<=o)c=i(e(r)),c<=20?(g=0,m=r<<20-c&1048575):(h=c-20,l=s(2,h),g=r%l<<32-h,m=r/l&1048575);else for(h=r,g=0;l=h/2,h=i(l),0!==h;)c++,g>>>=1,g|=(1&m)<<31,m>>>=1,l!==h&&(m|=524288);if(d=c+t,p=0===r,r=n-r,c<52&&0!==r)for(h=0;;){if(l=2*r,l>=1?(r=l-1,p?(d--,p=!1):(h<<=1,h|=1,c++)):(r=l,p?0==--d&&(c++,p=!1):(h<<=1,c++)),20===c)m|=h,h=0;else if(52===c){g|=h;break}if(1===l){c<20?m|=h<<20-c:c<52&&(g|=h<<52-c);break}}return m|=d<<20,m|=u,new a(m,g)},n.longBitsToDouble=function(e){let i,a,n,o;const r=e.high,l=e.low,h=r&1<<31?-1:1;for(n=((2146435072&r)>>20)-t,o=0,a=1<<19,i=1;i<=20;i++)r&a&&(o+=s(2,-i)),a>>>=1;for(a=1<<31,i=21;i<=52;i++)l&a&&(o+=s(2,-i)),a>>>=1;if(-1023===n){if(0===o)return 0*h;n=-1022}else{if(1024===n)return 0===o?h/0:NaN;o+=1}return h*o*s(2,n)}}();class c extends i{constructor(t){super(t),this.name=Object.keys({RuntimeException:c})[0]}}class p extends c{constructor(){super(),p.constructor_.apply(this,arguments)}static constructor_(){if(0===arguments.length)c.constructor_.call(this);else if(1===arguments.length){const t=arguments[0];c.constructor_.call(this,t)}}}class u{static shouldNeverReachHere(){if(0===arguments.length)u.shouldNeverReachHere(null);else if(1===arguments.length){const t=arguments[0];throw new p("Should never reach here"+(null!==t?": "+t:""))}}static isTrue(){if(1===arguments.length){const t=arguments[0];u.isTrue(t,null)}else if(2===arguments.length){const t=arguments[1];if(!arguments[0])throw null===t?new p:new p(t)}}static equals(){if(2===arguments.length){const t=arguments[0],e=arguments[1];u.equals(t,e,null)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];if(!e.equals(t))throw new p("Expected "+t+" but encountered "+e+(null!==i?": "+i:""))}}}const d=new ArrayBuffer(8),m=new Float64Array(d),g=new Int32Array(d);class y{constructor(){y.constructor_.apply(this,arguments)}static constructor_(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)y.constructor_.call(this,0,0);else if(1===arguments.length){const t=arguments[0];y.constructor_.call(this,t.x,t.y,t.getZ())}else if(2===arguments.length){const t=arguments[0],e=arguments[1];y.constructor_.call(this,t,e,y.NULL_ORDINATE)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this.x=t,this.y=e,this.z=i}}static hashCode(t){return m[0]=t,g[0]^g[1]}getM(){return n.NaN}setOrdinate(t,e){switch(t){case y.X:this.x=e;break;case y.Y:this.y=e;break;case y.Z:this.setZ(e);break;default:throw new s("Invalid ordinate index: "+t)}}equals2D(){if(1===arguments.length){const t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){const t=arguments[0],i=arguments[1];return!!e.equalsWithTolerance(this.x,t.x,i)&&!!e.equalsWithTolerance(this.y,t.y,i)}}setM(t){throw new s("Invalid ordinate index: "+y.M)}getZ(){return this.z}getOrdinate(t){switch(t){case y.X:return this.x;case y.Y:return this.y;case y.Z:return this.getZ()}throw new s("Invalid ordinate index: "+t)}equals3D(t){return this.x===t.x&&this.y===t.y&&(this.getZ()===t.getZ()||n.isNaN(this.getZ())&&n.isNaN(t.getZ()))}equals(t){return t instanceof y&&this.equals2D(t)}equalInZ(t,i){return e.equalsWithTolerance(this.getZ(),t.getZ(),i)}setX(t){this.x=t}compareTo(t){const e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0}getX(){return this.x}setZ(t){this.z=t}clone(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return u.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}}copy(){return new y(this)}toString(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}distance3D(t){const e=this.x-t.x,i=this.y-t.y,s=this.getZ()-t.getZ();return Math.sqrt(e*e+i*i+s*s)}getY(){return this.y}setY(t){this.y=t}distance(t){const e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)}hashCode(){let t=17;return t=37*t+y.hashCode(this.x),t=37*t+y.hashCode(this.y),t}setCoordinate(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}get interfaces_(){return[o,r,h]}}class f{constructor(){f.constructor_.apply(this,arguments)}static constructor_(){if(this._dimensionsToTest=2,0===arguments.length)f.constructor_.call(this,2);else if(1===arguments.length){const t=arguments[0];if(2!==t&&3!==t)throw new s("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}static compare(t,e){return t<e?-1:t>e?1:n.isNaN(t)?n.isNaN(e)?0:-1:n.isNaN(e)?1:0}compare(t,e){const i=f.compare(t.x,e.x);if(0!==i)return i;const s=f.compare(t.y,e.y);return 0!==s?s:this._dimensionsToTest<=2?0:f.compare(t.getZ(),e.getZ())}get interfaces_(){return[l]}}y.DimensionalComparator=f,y.NULL_ORDINATE=n.NaN,y.X=0,y.Y=1,y.Z=2,y.M=3;class _ extends y{constructor(){super(),_.constructor_.apply(this,arguments)}static constructor_(){if(0===arguments.length)y.constructor_.call(this);else if(1===arguments.length){if(arguments[0]instanceof _){const t=arguments[0];y.constructor_.call(this,t.x,t.y)}else if(arguments[0]instanceof y){const t=arguments[0];y.constructor_.call(this,t.x,t.y)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];y.constructor_.call(this,t,e,y.NULL_ORDINATE)}}setOrdinate(t,e){switch(t){case _.X:this.x=e;break;case _.Y:this.y=e;break;default:throw new s("Invalid ordinate index: "+t)}}getZ(){return y.NULL_ORDINATE}getOrdinate(t){switch(t){case _.X:return this.x;case _.Y:return this.y}throw new s("Invalid ordinate index: "+t)}setZ(t){throw new s("CoordinateXY dimension 2 does not support z-ordinate")}copy(){return new _(this)}toString(){return"("+this.x+", "+this.y+")"}setCoordinate(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}}_.X=0,_.Y=1,_.Z=-1,_.M=-1;class v extends y{constructor(){super(),v.constructor_.apply(this,arguments)}static constructor_(){if(this._m=null,0===arguments.length)y.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof v){const t=arguments[0];y.constructor_.call(this,t.x,t.y),this._m=t._m}else if(arguments[0]instanceof y){const t=arguments[0];y.constructor_.call(this,t.x,t.y),this._m=this.getM()}}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];y.constructor_.call(this,t,e,y.NULL_ORDINATE),this._m=i}}getM(){return this._m}setOrdinate(t,e){switch(t){case v.X:this.x=e;break;case v.Y:this.y=e;break;case v.M:this._m=e;break;default:throw new s("Invalid ordinate index: "+t)}}setM(t){this._m=t}getZ(){return y.NULL_ORDINATE}getOrdinate(t){switch(t){case v.X:return this.x;case v.Y:return this.y;case v.M:return this._m}throw new s("Invalid ordinate index: "+t)}setZ(t){throw new s("CoordinateXY dimension 2 does not support z-ordinate")}copy(){return new v(this)}toString(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}setCoordinate(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}v.X=0,v.Y=1,v.Z=-1,v.M=2;class x extends y{constructor(){super(),x.constructor_.apply(this,arguments)}static constructor_(){if(this._m=null,0===arguments.length)y.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof x){const t=arguments[0];y.constructor_.call(this,t),this._m=t._m}else if(arguments[0]instanceof y){const t=arguments[0];y.constructor_.call(this,t),this._m=this.getM()}}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];y.constructor_.call(this,t,e,i),this._m=s}}getM(){return this._m}setOrdinate(t,e){switch(t){case y.X:this.x=e;break;case y.Y:this.y=e;break;case y.Z:this.z=e;break;case y.M:this._m=e;break;default:throw new s("Invalid ordinate index: "+t)}}setM(t){this._m=t}getOrdinate(t){switch(t){case y.X:return this.x;case y.Y:return this.y;case y.Z:return this.getZ();case y.M:return this.getM()}throw new s("Invalid ordinate index: "+t)}copy(){return new x(this)}toString(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}setCoordinate(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}function C(t,e){return t.interfaces_&&t.interfaces_.indexOf(e)>-1}class L{add(){}addAll(){}isEmpty(){}iterator(){}size(){}toArray(){}remove(){}}class M extends i{constructor(t){super(t),this.name=Object.keys({IndexOutOfBoundsException:M})[0]}}class b extends L{get(){}set(){}isEmpty(){}}class w extends i{constructor(t){super(t),this.name=Object.keys({NoSuchElementException:w})[0]}}class S extends b{constructor(t){super(),this.array=[],t instanceof L&&this.addAll(t)}get interfaces_(){return[b,L]}ensureCapacity(){}add(t){return 1===arguments.length?this.array.push(t):this.array.splice(arguments[0],0,arguments[1]),!0}clear(){this.array=[]}addAll(t){for(const e of t)this.array.push(e)}set(t,e){const i=this.array[t];return this.array[t]=e,i}iterator(){return new I(this)}get(t){if(t<0||t>=this.size())throw new M;return this.array[t]}isEmpty(){return 0===this.array.length}sort(t){t?this.array.sort(((e,i)=>t.compare(e,i))):this.array.sort()}size(){return this.array.length}toArray(){return this.array.slice()}remove(t){for(let e=0,i=this.array.length;e<i;e++)if(this.array[e]===t)return!!this.array.splice(e,1);return!1}[Symbol.iterator](){return this.array.values()}}class I{constructor(t){this.arrayList=t,this.position=0}next(){if(this.position===this.arrayList.size())throw new w;return this.arrayList.get(this.position++)}hasNext(){return this.position<this.arrayList.size()}set(t){return this.arrayList.set(this.position-1,t)}remove(){this.arrayList.remove(this.arrayList.get(this.position))}}class E extends S{constructor(){super(),E.constructor_.apply(this,arguments)}static constructor_(){if(0===arguments.length);else if(1===arguments.length){const t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.ensureCapacity(t.length),this.add(t,e)}}getCoordinate(t){return this.get(t)}addAll(){if(2===arguments.length&&"boolean"==typeof arguments[1]&&C(arguments[0],L)){const t=arguments[1];let e=!1;for(let i=arguments[0].iterator();i.hasNext();)this.add(i.next(),t),e=!0;return e}return super.addAll.apply(this,arguments)}clone(){const t=super.clone.call(this);for(let e=0;e<this.size();e++)t.add(e,this.get(e).clone());return t}toCoordinateArray(){if(0===arguments.length)return this.toArray(E.coordArrayType);if(1===arguments.length){if(arguments[0])return this.toArray(E.coordArrayType);const t=this.size(),e=new Array(t).fill(null);for(let i=0;i<t;i++)e[i]=this.get(t-i-1);return e}}add(){if(1===arguments.length){const t=arguments[0];return super.add.call(this,t)}if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){const t=arguments[0],e=arguments[1];return this.add(t,e,!0),!0}if(arguments[0]instanceof y&&"boolean"==typeof arguments[1]){const t=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(t))return null;super.add.call(this,t)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){const t=arguments[0],e=arguments[1];return this.add(t,e),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){const t=arguments[0],e=arguments[1];if(arguments[2])for(let i=0;i<t.length;i++)this.add(t[i],e);else for(let i=t.length-1;i>=0;i--)this.add(t[i],e);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1];if(!arguments[2]){const i=this.size();if(i>0){if(t>0&&this.get(t-1).equals2D(e))return null;if(t<i&&this.get(t).equals2D(e))return null}}super.add.call(this,t,e)}}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];let a=1;i>s&&(a=-1);for(let n=i;n!==s;n+=a)this.add(t[n],e);return!0}}closeRing(){if(this.size()>0){const t=this.get(0).copy();this.add(t,!1)}}}E.coordArrayType=new Array(0).fill(null);class T{filter(t,e){}isDone(){}isGeometryChanged(){}}class D{constructor(){D.constructor_.apply(this,arguments)}static constructor_(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof y){const t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof D){const t=arguments[0];this.init(t)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.init(t.x,e.x,t.y,e.y)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this.init(t,e,i,s)}}static intersects(){if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return i.x>=(t.x<e.x?t.x:e.x)&&i.x<=(t.x>e.x?t.x:e.x)&&i.y>=(t.y<e.y?t.y:e.y)&&i.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];let a=Math.min(i.x,s.x),n=Math.max(i.x,s.x),o=Math.min(t.x,e.x),r=Math.max(t.x,e.x);return!(o>n||r<a||(a=Math.min(i.y,s.y),n=Math.max(i.y,s.y),o=Math.min(t.y,e.y),r=Math.max(t.y,e.y),o>n||r<a))}}getArea(){return this.getWidth()*this.getHeight()}equals(t){if(!(t instanceof D))return!1;const e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()}intersection(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new D;const e=this._minx>t._minx?this._minx:t._minx,i=this._miny>t._miny?this._miny:t._miny,s=this._maxx<t._maxx?this._maxx:t._maxx,a=this._maxy<t._maxy?this._maxy:t._maxy;return new D(e,s,i,a)}isNull(){return this._maxx<this._minx}getMaxX(){return this._maxx}covers(){if(1===arguments.length){if(arguments[0]instanceof y){const t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof D){const t=arguments[0];return!this.isNull()&&!t.isNull()&&t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];return!this.isNull()&&t>=this._minx&&t<=this._maxx&&e>=this._miny&&e<=this._maxy}}intersects(){if(1===arguments.length){if(arguments[0]instanceof D){const t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof y){const t=arguments[0];return this.intersects(t.x,t.y)}}else if(2===arguments.length){if(arguments[0]instanceof y&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1];return!(this.isNull()||(t.x<e.x?t.x:e.x)>this._maxx||(t.x>e.x?t.x:e.x)<this._minx||(t.y<e.y?t.y:e.y)>this._maxy||(t.y>e.y?t.y:e.y)<this._miny)}if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1];return!this.isNull()&&!(t>this._maxx||t<this._minx||e>this._maxy||e<this._miny)}}}getMinY(){return this._miny}getDiameter(){if(this.isNull())return 0;const t=this.getWidth(),e=this.getHeight();return Math.sqrt(t*t+e*e)}getMinX(){return this._minx}expandToInclude(){if(1===arguments.length){if(arguments[0]instanceof y){const t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof D){const t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.isNull()?(this._minx=t,this._maxx=t,this._miny=e,this._maxy=e):(t<this._minx&&(this._minx=t),t>this._maxx&&(this._maxx=t),e<this._miny&&(this._miny=e),e>this._maxy&&(this._maxy=e))}}minExtent(){if(this.isNull())return 0;const t=this.getWidth(),e=this.getHeight();return t<e?t:e}getWidth(){return this.isNull()?0:this._maxx-this._minx}compareTo(t){const e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0}translate(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)}copy(){return new D(this)}toString(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}setToNull(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}disjoint(t){return!(!this.isNull()&&!t.isNull())||t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny}getHeight(){return this.isNull()?0:this._maxy-this._miny}maxExtent(){if(this.isNull())return 0;const t=this.getWidth(),e=this.getHeight();return t>e?t:e}expandBy(){if(1===arguments.length){const t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=e,this._maxy+=e,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}contains(){if(1===arguments.length){if(arguments[0]instanceof D){const t=arguments[0];return this.covers(t)}if(arguments[0]instanceof y){const t=arguments[0];return this.covers(t)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];return this.covers(t,e)}}centre(){return this.isNull()?null:new y((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}init(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof y){const t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof D){const t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.init(t.x,e.x,t.y,e.y)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];t<e?(this._minx=t,this._maxx=e):(this._minx=e,this._maxx=t),i<s?(this._miny=i,this._maxy=s):(this._miny=s,this._maxy=i)}}getMaxY(){return this._maxy}distance(t){if(this.intersects(t))return 0;let e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);let i=0;return this._maxy<t._miny?i=t._miny-this._maxy:this._miny>t._maxy&&(i=this._miny-t._maxy),0===e?i:0===i?e:Math.sqrt(e*e+i*i)}hashCode(){let t=17;return t=37*t+y.hashCode(this._minx),t=37*t+y.hashCode(this._maxx),t=37*t+y.hashCode(this._miny),t=37*t+y.hashCode(this._maxy),t}get interfaces_(){return[o,h]}}class P{constructor(t){this.str=t}append(t){this.str+=t}setCharAt(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}toString(){return this.str}}class O{constructor(t){this.value=t}intValue(){return this.value}compareTo(t){return this.value<t?-1:this.value>t?1:0}static compare(t,e){return t<e?-1:t>e?1:0}static isNan(t){return Number.isNaN(t)}static valueOf(t){return new O(t)}}class k{static isWhitespace(t){return t<=32&&t>=0||127===t}static toUpperCase(t){return t.toUpperCase()}}class N{constructor(){N.constructor_.apply(this,arguments)}static constructor_(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){const t=arguments[0];this.init(t)}else if(arguments[0]instanceof N){const t=arguments[0];this.init(t)}else if("string"==typeof arguments[0]){const t=arguments[0];N.constructor_.call(this,N.parse(t))}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.init(t,e)}}static determinant(){if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];return N.determinant(N.valueOf(t),N.valueOf(e),N.valueOf(i),N.valueOf(s))}if(arguments[3]instanceof N&&arguments[2]instanceof N&&arguments[0]instanceof N&&arguments[1]instanceof N){const t=arguments[1],e=arguments[2],i=arguments[3];return arguments[0].multiply(i).selfSubtract(t.multiply(e))}}static sqr(t){return N.valueOf(t).selfMultiply(t)}static valueOf(){if("string"==typeof arguments[0]){const t=arguments[0];return N.parse(t)}if("number"==typeof arguments[0])return new N(arguments[0])}static sqrt(t){return N.valueOf(t).sqrt()}static parse(t){let e=0;const i=t.length;for(;k.isWhitespace(t.charAt(e));)e++;let s=!1;if(e<i){const i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(s=!0))}const a=new N;let n=0,o=0,r=0,l=!1;for(;!(e>=i);){const i=t.charAt(e);if(e++,k.isDigit(i)){const t=i-"0";a.selfMultiply(N.TEN),a.selfAdd(t),n++}else{if("."!==i){if("e"===i||"E"===i){const i=t.substring(e);try{r=O.parseInt(i)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+i+" in string "+t):e}break}throw new NumberFormatException("Unexpected character '"+i+"' at position "+e+" in string "+t)}o=n,l=!0}}let h=a;l||(o=n);const c=n-o-r;if(0===c)h=a;else if(c>0){const t=N.TEN.pow(c);h=a.divide(t)}else if(c<0){const t=N.TEN.pow(-c);h=a.multiply(t)}return s?h.negate():h}static createNaN(){return new N(n.NaN,n.NaN)}static copy(t){return new N(t)}static magnitude(t){const e=Math.abs(t),i=Math.log(e)/Math.log(10);let s=Math.trunc(Math.floor(i));return 10*Math.pow(10,s)<=e&&(s+=1),s}static stringOfChar(t,e){const i=new P;for(let s=0;s<e;s++)i.append(t);return i.toString()}le(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<=t._lo}extractSignificantDigits(t,e){let i=this.abs(),s=N.magnitude(i._hi);const a=N.TEN.pow(s);i=i.divide(a),i.gt(N.TEN)?(i=i.divide(N.TEN),s+=1):i.lt(N.ONE)&&(i=i.multiply(N.TEN),s-=1);const n=s+1,o=new P,r=N.MAX_PRINT_DIGITS-1;for(let e=0;e<=r;e++){t&&e===n&&o.append(".");const s=Math.trunc(i._hi);if(s<0)break;let a=!1,l=0;s>9?(a=!0,l="9"):l="0"+s,o.append(l),i=i.subtract(N.valueOf(s)).multiply(N.TEN),a&&i.selfAdd(N.TEN);let h=!0;const c=N.magnitude(i._hi);if(c<0&&Math.abs(c)>=r-e&&(h=!1),!h)break}return e[0]=s,o.toString()}sqr(){return this.multiply(this)}doubleValue(){return this._hi+this._lo}subtract(){if(arguments[0]instanceof N){const t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){const t=arguments[0];return this.add(-t)}}equals(){if(1===arguments.length&&arguments[0]instanceof N){const t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}}isZero(){return 0===this._hi&&0===this._lo}selfSubtract(){if(arguments[0]instanceof N){const t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){const t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}}getSpecialNumberString(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}min(t){return this.le(t)?this:t}selfDivide(){if(1===arguments.length){if(arguments[0]instanceof N){const t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){const t=arguments[0];return this.selfDivide(t,0)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];let i=null,s=null,a=null,n=null,o=null,r=null,l=null,h=null;return o=this._hi/t,r=N.SPLIT*o,i=r-o,h=N.SPLIT*t,i=r-i,s=o-i,a=h-t,l=o*t,a=h-a,n=t-a,h=i*a-l+i*n+s*a+s*n,r=(this._hi-l-h+this._lo-o*e)/t,h=o+r,this._hi=h,this._lo=o-h+r,this}}dump(){return"DD<"+this._hi+", "+this._lo+">"}divide(){if(arguments[0]instanceof N){const t=arguments[0];let e=null,i=null,s=null,a=null,n=null,o=null,r=null,l=null;return n=this._hi/t._hi,o=N.SPLIT*n,e=o-n,l=N.SPLIT*t._hi,e=o-e,i=n-e,s=l-t._hi,r=n*t._hi,s=l-s,a=t._hi-s,l=e*s-r+e*a+i*s+i*a,o=(this._hi-r-l+this._lo-n*t._lo)/t._hi,l=n+o,new N(l,n-l+o)}if("number"==typeof arguments[0]){const t=arguments[0];return n.isNaN(t)?N.createNaN():N.copy(this).selfDivide(t,0)}}ge(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo}pow(t){if(0===t)return N.valueOf(1);let e=new N(this),i=N.valueOf(1),s=Math.abs(t);if(s>1)for(;s>0;)s%2==1&&i.selfMultiply(e),s/=2,s>0&&(e=e.sqr());else i=e;return t<0?i.reciprocal():i}ceil(){if(this.isNaN())return N.NaN;const t=Math.ceil(this._hi);let e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new N(t,e)}compareTo(t){const e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0}rint(){return this.isNaN()?this:this.add(.5).floor()}setValue(){if(arguments[0]instanceof N){const t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){const t=arguments[0];return this.init(t),this}}max(t){return this.ge(t)?this:t}sqrt(){if(this.isZero())return N.valueOf(0);if(this.isNegative())return N.NaN;const t=1/Math.sqrt(this._hi),e=this._hi*t,i=N.valueOf(e),s=this.subtract(i.sqr())._hi*(.5*t);return i.add(s)}selfAdd(){if(1===arguments.length){if(arguments[0]instanceof N){const t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){const t=arguments[0];let e=null,i=null,s=null,a=null,n=null,o=null;return s=this._hi+t,n=s-this._hi,a=s-n,a=t-n+(this._hi-a),o=a+this._lo,e=s+o,i=o+(s-e),this._hi=e+i,this._lo=i+(e-this._hi),this}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];let i=null,s=null,a=null,n=null,o=null,r=null,l=null,h=null;o=this._hi+t,a=this._lo+e,l=o-this._hi,h=a-this._lo,r=o-l,n=a-h,r=t-l+(this._hi-r),n=e-h+(this._lo-n),l=r+a,i=o+l,s=l+(o-i),l=n+s;const c=i+l,p=l+(i-c);return this._hi=c,this._lo=p,this}}selfMultiply(){if(1===arguments.length){if(arguments[0]instanceof N){const t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){const t=arguments[0];return this.selfMultiply(t,0)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];let i=null,s=null,a=null,n=null,o=null,r=null;o=N.SPLIT*this._hi,i=o-this._hi,r=N.SPLIT*t,i=o-i,s=this._hi-i,a=r-t,o=this._hi*t,a=r-a,n=t-a,r=i*a-o+i*n+s*a+s*n+(this._hi*e+this._lo*t);const l=o+r;i=o-l;const h=r+i;return this._hi=l,this._lo=h,this}}selfSqr(){return this.selfMultiply(this)}floor(){if(this.isNaN())return N.NaN;const t=Math.floor(this._hi);let e=0;return t===this._hi&&(e=Math.floor(this._lo)),new N(t,e)}negate(){return this.isNaN()?this:new N(-this._hi,-this._lo)}clone(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}}multiply(){if(arguments[0]instanceof N){const t=arguments[0];return t.isNaN()?N.createNaN():N.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){const t=arguments[0];return n.isNaN(t)?N.createNaN():N.copy(this).selfMultiply(t,0)}}isNaN(){return n.isNaN(this._hi)}intValue(){return Math.trunc(this._hi)}toString(){const t=N.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()}toStandardNotation(){const t=this.getSpecialNumberString();if(null!==t)return t;const e=new Array(1).fill(null),i=this.extractSignificantDigits(!0,e),s=e[0]+1;let a=i;if("."===i.charAt(0))a="0"+i;else if(s<0)a="0."+N.stringOfChar("0",-s)+i;else if(-1===i.indexOf(".")){const t=s-i.length;a=i+N.stringOfChar("0",t)+".0"}return this.isNegative()?"-"+a:a}reciprocal(){let t=null,e=null,i=null,s=null,a=null,n=null,o=null,r=null;a=1/this._hi,n=N.SPLIT*a,t=n-a,r=N.SPLIT*this._hi,t=n-t,e=a-t,i=r-this._hi,o=a*this._hi,i=r-i,s=this._hi-i,r=t*i-o+t*s+e*i+e*s,n=(1-o-r-a*this._lo)/this._hi;const l=a+n;return new N(l,a-l+n)}toSciNotation(){if(this.isZero())return N.SCI_NOT_ZERO;const t=this.getSpecialNumberString();if(null!==t)return t;const e=new Array(1).fill(null),i=this.extractSignificantDigits(!1,e),s=N.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===i.charAt(0))throw new IllegalStateException("Found leading zero: "+i);let a="";i.length>1&&(a=i.substring(1));const n=i.charAt(0)+"."+a;return this.isNegative()?"-"+n+s:n+s}abs(){return this.isNaN()?N.NaN:this.isNegative()?this.negate():new N(this)}isPositive(){return this._hi>0||0===this._hi&&this._lo>0}lt(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<t._lo}add(){if(arguments[0]instanceof N){const t=arguments[0];return N.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){const t=arguments[0];return N.copy(this).selfAdd(t)}}init(){if(1===arguments.length){if("number"==typeof arguments[0]){const t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof N){const t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._hi=t,this._lo=e}}gt(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>t._lo}isNegative(){return this._hi<0||0===this._hi&&this._lo<0}trunc(){return this.isNaN()?N.NaN:this.isPositive()?this.floor():this.ceil()}signum(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}get interfaces_(){return[h,o,r]}}N.PI=new N(3.141592653589793,12246467991473532e-32),N.TWO_PI=new N(6.283185307179586,24492935982947064e-32),N.PI_2=new N(1.5707963267948966,6123233995736766e-32),N.E=new N(2.718281828459045,14456468917292502e-32),N.NaN=new N(n.NaN,n.NaN),N.EPS=123259516440783e-46,N.SPLIT=134217729,N.MAX_PRINT_DIGITS=32,N.TEN=N.valueOf(10),N.ONE=N.valueOf(1),N.SCI_NOT_EXPONENT_CHAR="E",N.SCI_NOT_ZERO="0.0E0";class A{static orientationIndex(t,e,i){const s=A.orientationIndexFilter(t,e,i);if(s<=1)return s;const a=N.valueOf(e.x).selfAdd(-t.x),n=N.valueOf(e.y).selfAdd(-t.y),o=N.valueOf(i.x).selfAdd(-e.x),r=N.valueOf(i.y).selfAdd(-e.y);return a.selfMultiply(r).selfSubtract(n.selfMultiply(o)).signum()}static signOfDet2x2(){if(arguments[3]instanceof N&&arguments[2]instanceof N&&arguments[0]instanceof N&&arguments[1]instanceof N){const t=arguments[1],e=arguments[2],i=arguments[3];return arguments[0].multiply(i).selfSubtract(t.multiply(e)).signum()}if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=N.valueOf(t),n=N.valueOf(e),o=N.valueOf(i),r=N.valueOf(s);return a.multiply(r).selfSubtract(n.multiply(o)).signum()}}static intersection(t,e,i,s){const a=new N(t.y).selfSubtract(e.y),o=new N(e.x).selfSubtract(t.x),r=new N(t.x).selfMultiply(e.y).selfSubtract(new N(e.x).selfMultiply(t.y)),l=new N(i.y).selfSubtract(s.y),h=new N(s.x).selfSubtract(i.x),c=new N(i.x).selfMultiply(s.y).selfSubtract(new N(s.x).selfMultiply(i.y)),p=o.multiply(c).selfSubtract(h.multiply(r)),u=l.multiply(r).selfSubtract(a.multiply(c)),d=a.multiply(h).selfSubtract(l.multiply(o)),m=p.selfDivide(d).doubleValue(),g=u.selfDivide(d).doubleValue();return n.isNaN(m)||n.isInfinite(m)||n.isNaN(g)||n.isInfinite(g)?null:new y(m,g)}static orientationIndexFilter(t,e,i){let s=null;const a=(t.x-i.x)*(e.y-i.y),n=(t.y-i.y)*(e.x-i.x),o=a-n;if(a>0){if(n<=0)return A.signum(o);s=a+n}else{if(!(a<0))return A.signum(o);if(n>=0)return A.signum(o);s=-a-n}const r=A.DP_SAFE_EPSILON*s;return o>=r||-o>=r?A.signum(o):2}static signum(t){return t>0?1:t<0?-1:0}}A.DP_SAFE_EPSILON=1e-15;class R{getM(t){if(this.hasM()){const e=this.getDimension()-this.getMeasures();return this.getOrdinate(t,e)}return n.NaN}setOrdinate(t,e,i){}getZ(t){return this.hasZ()?this.getOrdinate(t,2):n.NaN}size(){}getOrdinate(t,e){}getCoordinate(){}getCoordinateCopy(t){}createCoordinate(){}getDimension(){}hasM(){return this.getMeasures()>0}getX(t){}hasZ(){return this.getDimension()-this.getMeasures()>2}getMeasures(){return 0}expandEnvelope(t){}copy(){}getY(t){}toCoordinateArray(){}get interfaces_(){return[r]}}R.X=0,R.Y=1,R.Z=2,R.M=3;class F{static index(t,e,i){return A.orientationIndex(t,e,i)}static isCCW(){if(arguments[0]instanceof Array){const t=arguments[0],e=t.length-1;if(e<3)throw new s("Ring has fewer than 4 points, so orientation cannot be determined");let i=t[0],a=0;for(let s=1;s<=e;s++){const e=t[s];e.y>i.y&&(i=e,a=s)}let n=a;do{n-=1,n<0&&(n=e)}while(t[n].equals2D(i)&&n!==a);let o=a;do{o=(o+1)%e}while(t[o].equals2D(i)&&o!==a);const r=t[n],l=t[o];if(r.equals2D(i)||l.equals2D(i)||r.equals2D(l))return!1;const h=F.index(r,i,l);let c=null;return c=0===h?r.x>l.x:h>0,c}if(C(arguments[0],R)){const t=arguments[0],e=t.size()-1;if(e<3)throw new s("Ring has fewer than 4 points, so orientation cannot be determined");let i=t.getCoordinate(0),a=0;for(let s=1;s<=e;s++){const e=t.getCoordinate(s);e.y>i.y&&(i=e,a=s)}let n=null,o=a;do{o-=1,o<0&&(o=e),n=t.getCoordinate(o)}while(n.equals2D(i)&&o!==a);let r=null,l=a;do{l=(l+1)%e,r=t.getCoordinate(l)}while(r.equals2D(i)&&l!==a);if(n.equals2D(i)||r.equals2D(i)||n.equals2D(r))return!1;const h=F.index(n,i,r);let c=null;return c=0===h?n.x>r.x:h>0,c}}}F.CLOCKWISE=-1,F.RIGHT=F.CLOCKWISE,F.COUNTERCLOCKWISE=1,F.LEFT=F.COUNTERCLOCKWISE,F.COLLINEAR=0,F.STRAIGHT=F.COLLINEAR;class B{static intersection(t,e,i,s){const a=t.x<e.x?t.x:e.x,o=t.y<e.y?t.y:e.y,r=t.x>e.x?t.x:e.x,l=t.y>e.y?t.y:e.y,h=i.x<s.x?i.x:s.x,c=i.y<s.y?i.y:s.y,p=i.x>s.x?i.x:s.x,u=i.y>s.y?i.y:s.y,d=((a>h?a:h)+(r<p?r:p))/2,m=((o>c?o:c)+(l<u?l:u))/2,g=t.x-d,f=t.y-m,_=e.x-d,v=e.y-m,x=i.x-d,C=i.y-m,L=s.x-d,M=s.y-m,b=f-v,w=_-g,S=g*v-_*f,I=C-M,E=L-x,T=x*M-L*C,D=b*E-I*w,P=(w*T-E*S)/D,O=(I*S-b*T)/D;return n.isNaN(P)||n.isInfinite(P)||n.isNaN(O)||n.isInfinite(O)?null:new y(P+d,O+m)}}class G{static arraycopy(t,e,i,s,a){let n=0;for(let o=e;o<e+a;o++)i[s+n]=t[o],n++}static getProperty(t){return{"line.separator":"\n"}[t]}}class z{static log10(t){const e=Math.log(t);return n.isInfinite(e)||n.isNaN(e)?e:e/z.LOG_10}static min(t,e,i,s){let a=t;return e<a&&(a=e),i<a&&(a=i),s<a&&(a=s),a}static clamp(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1],i=arguments[2];return t<e?e:t>i?i:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1],i=arguments[2];return t<e?e:t>i?i:t}}static wrap(t,e){return t<0?e- -t%e:t%e}static max(){if(3===arguments.length){const t=arguments[1],e=arguments[2];let i=arguments[0];return t>i&&(i=t),e>i&&(i=e),i}if(4===arguments.length){const t=arguments[1],e=arguments[2],i=arguments[3];let s=arguments[0];return t>s&&(s=t),e>s&&(s=e),i>s&&(s=i),s}}static average(t,e){return(t+e)/2}}z.LOG_10=Math.log(10);class j{static segmentToSegment(t,e,i,s){if(t.equals(e))return j.pointToSegment(t,i,s);if(i.equals(s))return j.pointToSegment(s,t,e);let a=!1;if(D.intersects(t,e,i,s)){const n=(e.x-t.x)*(s.y-i.y)-(e.y-t.y)*(s.x-i.x);if(0===n)a=!0;else{const o=(t.y-i.y)*(s.x-i.x)-(t.x-i.x)*(s.y-i.y),r=((t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y))/n,l=o/n;(l<0||l>1||r<0||r>1)&&(a=!0)}}else a=!0;return a?z.min(j.pointToSegment(t,i,s),j.pointToSegment(e,i,s),j.pointToSegment(i,t,e),j.pointToSegment(s,t,e)):0}static pointToSegment(t,e,i){if(e.x===i.x&&e.y===i.y)return t.distance(e);const s=(i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y),a=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/s;if(a<=0)return t.distance(e);if(a>=1)return t.distance(i);const n=((e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y))/s;return Math.abs(n)*Math.sqrt(s)}static pointToLinePerpendicular(t,e,i){const s=(i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y),a=((e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y))/s;return Math.abs(a)*Math.sqrt(s)}static pointToSegmentString(t,e){if(0===e.length)throw new s("Line array must contain at least one vertex");let i=t.distance(e[0]);for(let s=0;s<e.length-1;s++){const a=j.pointToSegment(t,e[s],e[s+1]);a<i&&(i=a)}return i}}class U{create(){if(1===arguments.length)arguments[0]instanceof Array||C(arguments[0],R);else if(2===arguments.length);else if(3===arguments.length){const t=arguments[0],e=arguments[1];return this.create(t,e)}}}class V{filter(t){}}class q{constructor(){q.constructor_.apply(this,arguments)}isGeometryCollection(){return this.getTypeCode()===q.TYPECODE_GEOMETRYCOLLECTION}getFactory(){return this._factory}getGeometryN(t){return this}getArea(){return 0}isRectangle(){return!1}equalsExact(t){return this===t||this.equalsExact(t,0)}geometryChanged(){this.apply(q.geometryChangedFilter)}geometryChangedAction(){this._envelope=null}equalsNorm(t){return null!==t&&this.norm().equalsExact(t.norm())}getLength(){return 0}getNumGeometries(){return 1}compareTo(){let t;if(1===arguments.length){const e=arguments[0];return t=e,this.getTypeCode()!==t.getTypeCode()?this.getTypeCode()-t.getTypeCode():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}if(2===arguments.length){const e=arguments[0],i=arguments[1];return t=e,this.getTypeCode()!==t.getTypeCode()?this.getTypeCode()-t.getTypeCode():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e,i)}}getUserData(){return this._userData}getSRID(){return this._SRID}getEnvelope(){return this.getFactory().toGeometry(this.getEnvelopeInternal())}checkNotGeometryCollection(t){if(t.getTypeCode()===q.TYPECODE_GEOMETRYCOLLECTION)throw new s("This method does not support GeometryCollection arguments")}equal(t,e,i){return 0===i?t.equals(e):t.distance(e)<=i}norm(){const t=this.copy();return t.normalize(),t}reverse(){const t=this.reverseInternal();return null!=this.envelope&&(t.envelope=this.envelope.copy()),t.setSRID(this.getSRID()),t}copy(){const t=this.copyInternal();return t.envelope=null==this._envelope?null:this._envelope.copy(),t._SRID=this._SRID,t._userData=this._userData,t}getPrecisionModel(){return this._factory.getPrecisionModel()}getEnvelopeInternal(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new D(this._envelope)}setSRID(t){this._SRID=t}setUserData(t){this._userData=t}compare(t,e){const i=t.iterator(),s=e.iterator();for(;i.hasNext()&&s.hasNext();){const t=i.next(),e=s.next(),a=t.compareTo(e);if(0!==a)return a}return i.hasNext()?1:s.hasNext()?-1:0}hashCode(){return this.getEnvelopeInternal().hashCode()}isEquivalentClass(t){return this.getClass()===t.getClass()}isGeometryCollectionOrDerived(){return this.getTypeCode()===q.TYPECODE_GEOMETRYCOLLECTION||this.getTypeCode()===q.TYPECODE_MULTIPOINT||this.getTypeCode()===q.TYPECODE_MULTILINESTRING||this.getTypeCode()===q.TYPECODE_MULTIPOLYGON}get interfaces_(){return[r,o,h]}getClass(){return q}static hasNonEmptyElements(t){for(let e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1}static hasNullElements(t){for(let e=0;e<t.length;e++)if(null===t[e])return!0;return!1}}q.constructor_=function(t){t&&(this._envelope=null,this._userData=null,this._factory=t,this._SRID=t.getSRID())},q.TYPECODE_POINT=0,q.TYPECODE_MULTIPOINT=1,q.TYPECODE_LINESTRING=2,q.TYPECODE_LINEARRING=3,q.TYPECODE_MULTILINESTRING=4,q.TYPECODE_POLYGON=5,q.TYPECODE_MULTIPOLYGON=6,q.TYPECODE_GEOMETRYCOLLECTION=7,q.TYPENAME_POINT="Point",q.TYPENAME_MULTIPOINT="MultiPoint",q.TYPENAME_LINESTRING="LineString",q.TYPENAME_LINEARRING="LinearRing",q.TYPENAME_MULTILINESTRING="MultiLineString",q.TYPENAME_POLYGON="Polygon",q.TYPENAME_MULTIPOLYGON="MultiPolygon",q.TYPENAME_GEOMETRYCOLLECTION="GeometryCollection",q.geometryChangedFilter={get interfaces_(){return[V]},filter(t){t.geometryChangedAction()}};class H{filter(t){}}class ${static ofLine(t){const e=t.size();if(e<=1)return 0;let i=0;const s=new y;t.getCoordinate(0,s);let a=s.x,n=s.y;for(let o=1;o<e;o++){t.getCoordinate(o,s);const e=s.x,r=s.y,l=e-a,h=r-n;i+=Math.sqrt(l*l+h*h),a=e,n=r}return i}}class W{}class K{static copyCoord(t,e,i,s){const a=Math.min(t.getDimension(),i.getDimension());for(let n=0;n<a;n++)i.setOrdinate(s,n,t.getOrdinate(e,n))}static isRing(t){const e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,R.X)===t.getOrdinate(e-1,R.X)&&t.getOrdinate(0,R.Y)===t.getOrdinate(e-1,R.Y)}static scroll(){if(2===arguments.length){if(C(arguments[0],R)&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1];K.scroll(t,e,K.isRing(t))}else if(C(arguments[0],R)&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1],i=K.indexOf(e,t);if(i<=0)return null;K.scroll(t,i)}}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];if(e<=0)return null;const s=t.copy(),a=i?t.size()-1:t.size();for(let i=0;i<a;i++)for(let n=0;n<t.getDimension();n++)t.setOrdinate(i,n,s.getOrdinate((e+i)%a,n));if(i)for(let e=0;e<t.getDimension();e++)t.setOrdinate(a,e,t.getOrdinate(0,e))}}static isEqual(t,e){const i=t.size();if(i!==e.size())return!1;const s=Math.min(t.getDimension(),e.getDimension());for(let a=0;a<i;a++)for(let i=0;i<s;i++){const s=t.getOrdinate(a,i),o=e.getOrdinate(a,i);if(!(t.getOrdinate(a,i)===e.getOrdinate(a,i)||n.isNaN(s)&&n.isNaN(o)))return!1}return!0}static minCoordinateIndex(){if(1===arguments.length){const t=arguments[0];return K.minCoordinateIndex(t,0,t.size()-1)}if(3===arguments.length){const t=arguments[0],e=arguments[2];let i=-1,s=null;for(let a=arguments[1];a<=e;a++){const e=t.getCoordinate(a);(null===s||s.compareTo(e)>0)&&(s=e,i=a)}return i}}static extend(t,e,i){const s=t.create(i,e.getDimension()),a=e.size();if(K.copy(e,0,s,0,a),a>0)for(let t=a;t<i;t++)K.copy(e,a-1,s,t,1);return s}static reverse(t){const e=t.size()-1,i=Math.trunc(e/2);for(let s=0;s<=i;s++)K.swap(t,s,e-s)}static swap(t,e,i){if(e===i)return null;for(let s=0;s<t.getDimension();s++){const a=t.getOrdinate(e,s);t.setOrdinate(e,s,t.getOrdinate(i,s)),t.setOrdinate(i,s,a)}}static copy(t,e,i,s,a){for(let n=0;n<a;n++)K.copyCoord(t,e+n,i,s+n)}static ensureValidRing(t,e){const i=e.size();return 0===i?e:i<=3?K.createClosedRing(t,e,4):e.getOrdinate(0,R.X)===e.getOrdinate(i-1,R.X)&&e.getOrdinate(0,R.Y)===e.getOrdinate(i-1,R.Y)?e:K.createClosedRing(t,e,i+1)}static indexOf(t,e){for(let i=0;i<e.size();i++)if(t.x===e.getOrdinate(i,R.X)&&t.y===e.getOrdinate(i,R.Y))return i;return-1}static createClosedRing(t,e,i){const s=t.create(i,e.getDimension()),a=e.size();K.copy(e,0,s,0,a);for(let t=a;t<i;t++)K.copy(e,0,s,t,1);return s}static minCoordinate(t){let e=null;for(let i=0;i<t.size();i++){const s=t.getCoordinate(i);(null===e||e.compareTo(s)>0)&&(e=s)}return e}}class Y extends i{constructor(t){super(t),this.name=Object.keys({UnsupportedOperationException:Y})[0]}}class J{static toDimensionSymbol(t){switch(t){case J.FALSE:return J.SYM_FALSE;case J.TRUE:return J.SYM_TRUE;case J.DONTCARE:return J.SYM_DONTCARE;case J.P:return J.SYM_P;case J.L:return J.SYM_L;case J.A:return J.SYM_A}throw new s("Unknown dimension value: "+t)}static toDimensionValue(t){switch(k.toUpperCase(t)){case J.SYM_FALSE:return J.FALSE;case J.SYM_TRUE:return J.TRUE;case J.SYM_DONTCARE:return J.DONTCARE;case J.SYM_P:return J.P;case J.SYM_L:return J.L;case J.SYM_A:return J.A}throw new s("Unknown dimension symbol: "+t)}}J.P=0,J.L=1,J.A=2,J.FALSE=-1,J.TRUE=-2,J.DONTCARE=-3,J.SYM_FALSE="F",J.SYM_TRUE="T",J.SYM_DONTCARE="*",J.SYM_P="0",J.SYM_L="1",J.SYM_A="2";class X{filter(t){}}class Q extends q{constructor(){super(),Q.constructor_.apply(this,arguments)}static constructor_(){if(this._points=null,0===arguments.length);else if(2===arguments.length){const t=arguments[0],e=arguments[1];q.constructor_.call(this,e),this.init(t)}}computeEnvelopeInternal(){return this.isEmpty()?new D:this._points.expandEnvelope(new D)}isRing(){return this.isClosed()&&this.isSimple()}getCoordinates(){return this._points.toCoordinateArray()}copyInternal(){return new Q(this._points.copy(),this._factory)}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof q){const t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;const i=t;if(this._points.size()!==i._points.size())return!1;for(let t=0;t<this._points.size();t++)if(!this.equal(this._points.getCoordinate(t),i._points.getCoordinate(t),e))return!1;return!0}return super.equalsExact.apply(this,arguments)}normalize(){for(let t=0;t<Math.trunc(this._points.size()/2);t++){const e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e))){if(this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0){const t=this._points.copy();K.reverse(t),this._points=t}return null}}}getCoordinate(){return this.isEmpty()?null:this._points.getCoordinate(0)}getBoundaryDimension(){return this.isClosed()?J.FALSE:0}isClosed(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}reverseInternal(){const t=this._points.copy();return K.reverse(t),this.getFactory().createLineString(t)}getEndPoint(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}getTypeCode(){return q.TYPECODE_LINESTRING}getDimension(){return 1}getLength(){return $.ofLine(this._points)}getNumPoints(){return this._points.size()}compareToSameClass(){if(1===arguments.length){const t=arguments[0];let e=0,i=0;for(;e<this._points.size()&&i<t._points.size();){const s=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(i));if(0!==s)return s;e++,i++}return e<this._points.size()?1:i<t._points.size()?-1:0}if(2===arguments.length){const t=arguments[0];return arguments[1].compare(this._points,t._points)}}apply(){if(C(arguments[0],H)){const t=arguments[0];for(let e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e))}else if(C(arguments[0],T)){const t=arguments[0];if(0===this._points.size())return null;for(let e=0;e<this._points.size()&&(t.filter(this._points,e),!t.isDone());e++);t.isGeometryChanged()&&this.geometryChanged()}else(C(arguments[0],X)||C(arguments[0],V))&&arguments[0].filter(this)}getBoundary(){throw new Y}isEquivalentClass(t){return t instanceof Q}getCoordinateN(t){return this._points.getCoordinate(t)}getGeometryType(){return q.TYPENAME_LINESTRING}getCoordinateSequence(){return this._points}isEmpty(){return 0===this._points.size()}init(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new s("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t}isCoordinate(t){for(let e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1}getStartPoint(){return this.isEmpty()?null:this.getPointN(0)}getPointN(t){return this.getFactory().createPoint(this._points.getCoordinate(t))}get interfaces_(){return[W]}}class Z{}class tt extends q{constructor(){super(),tt.constructor_.apply(this,arguments)}static constructor_(){this._coordinates=null;const t=arguments[0],e=arguments[1];q.constructor_.call(this,e),this.init(t)}computeEnvelopeInternal(){if(this.isEmpty())return new D;const t=new D;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t}getCoordinates(){return this.isEmpty()?[]:[this.getCoordinate()]}copyInternal(){return new tt(this._coordinates.copy(),this._factory)}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof q){const t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&(!(!this.isEmpty()||!t.isEmpty())||this.isEmpty()===t.isEmpty()&&this.equal(t.getCoordinate(),this.getCoordinate(),e))}return super.equalsExact.apply(this,arguments)}normalize(){}getCoordinate(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null}getBoundaryDimension(){return J.FALSE}reverseInternal(){return this.getFactory().createPoint(this._coordinates.copy())}getTypeCode(){return q.TYPECODE_POINT}getDimension(){return 0}getNumPoints(){return this.isEmpty()?0:1}getX(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x}compareToSameClass(){if(1===arguments.length){const t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){const t=arguments[0];return arguments[1].compare(this._coordinates,t._coordinates)}}apply(){if(C(arguments[0],H)){const t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(C(arguments[0],T)){const t=arguments[0];if(this.isEmpty())return null;t.filter(this._coordinates,0),t.isGeometryChanged()&&this.geometryChanged()}else(C(arguments[0],X)||C(arguments[0],V))&&arguments[0].filter(this)}getBoundary(){return this.getFactory().createGeometryCollection()}getGeometryType(){return q.TYPENAME_POINT}getCoordinateSequence(){return this._coordinates}getY(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y}isEmpty(){return 0===this._coordinates.size()}init(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),u.isTrue(t.size()<=1),this._coordinates=t}isSimple(){return!0}get interfaces_(){return[Z]}}class et{static ofRing(){if(arguments[0]instanceof Array){const t=arguments[0];return Math.abs(et.ofRingSigned(t))}if(C(arguments[0],R)){const t=arguments[0];return Math.abs(et.ofRingSigned(t))}}static ofRingSigned(){if(arguments[0]instanceof Array){const t=arguments[0];if(t.length<3)return 0;let e=0;const i=t[0].x;for(let s=1;s<t.length-1;s++){const a=t[s].x-i,n=t[s+1].y;e+=a*(t[s-1].y-n)}return e/2}if(C(arguments[0],R)){const t=arguments[0],e=t.size();if(e<3)return 0;const i=new y,s=new y,a=new y;t.getCoordinate(0,s),t.getCoordinate(1,a);const n=s.x;a.x-=n;let o=0;for(let r=1;r<e-1;r++)i.y=s.y,s.x=a.x,s.y=a.y,t.getCoordinate(r+1,a),a.x-=n,o+=s.x*(i.y-a.y);return o/2}}}class it{static sort(){const t=arguments[0];if(1===arguments.length)t.sort(((t,e)=>t.compareTo(e)));else if(2===arguments.length)t.sort(((t,e)=>arguments[1].compare(t,e)));else if(3===arguments.length){const e=t.slice(arguments[1],arguments[2]);e.sort();const i=t.slice(0,arguments[1]).concat(e,t.slice(arguments[2],t.length));t.splice(0,t.length);for(const e of i)t.push(e)}else if(4===arguments.length){const e=t.slice(arguments[1],arguments[2]);e.sort(((t,e)=>arguments[3].compare(t,e)));const i=t.slice(0,arguments[1]).concat(e,t.slice(arguments[2],t.length));t.splice(0,t.length);for(const e of i)t.push(e)}}static asList(t){const e=new S;for(const i of t)e.add(i);return e}static copyOf(t,e){return t.slice(0,e)}}class st{}class at extends q{constructor(){super(),at.constructor_.apply(this,arguments)}static constructor_(){this._shell=null,this._holes=null;let t=arguments[0],e=arguments[1],i=arguments[2];if(q.constructor_.call(this,i),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),q.hasNullElements(e))throw new s("holes must not contain null elements");if(t.isEmpty()&&q.hasNonEmptyElements(e))throw new s("shell is empty but holes are not");this._shell=t,this._holes=e}computeEnvelopeInternal(){return this._shell.getEnvelopeInternal()}getCoordinates(){if(this.isEmpty())return[];const t=new Array(this.getNumPoints()).fill(null);let e=-1;const i=this._shell.getCoordinates();for(let s=0;s<i.length;s++)e++,t[e]=i[s];for(let i=0;i<this._holes.length;i++){const s=this._holes[i].getCoordinates();for(let i=0;i<s.length;i++)e++,t[e]=s[i]}return t}getArea(){let t=0;t+=et.ofRing(this._shell.getCoordinateSequence());for(let e=0;e<this._holes.length;e++)t-=et.ofRing(this._holes[e].getCoordinateSequence());return t}copyInternal(){const t=this._shell.copy(),e=new Array(this._holes.length).fill(null);for(let t=0;t<this._holes.length;t++)e[t]=this._holes[t].copy();return new at(t,e,this._factory)}isRectangle(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;const t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal();for(let i=0;i<5;i++){const s=t.getX(i);if(s!==e.getMinX()&&s!==e.getMaxX())return!1;const a=t.getY(i);if(a!==e.getMinY()&&a!==e.getMaxY())return!1}let i=t.getX(0),s=t.getY(0);for(let e=1;e<=4;e++){const a=t.getX(e),n=t.getY(e);if(a!==i==(n!==s))return!1;i=a,s=n}return!0}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof q){const t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;const i=t,s=this._shell,a=i._shell;if(!s.equalsExact(a,e))return!1;if(this._holes.length!==i._holes.length)return!1;for(let t=0;t<this._holes.length;t++)if(!this._holes[t].equalsExact(i._holes[t],e))return!1;return!0}return super.equalsExact.apply(this,arguments)}normalize(){if(0===arguments.length){this._shell=this.normalized(this._shell,!0);for(let t=0;t<this._holes.length;t++)this._holes[t]=this.normalized(this._holes[t],!1);it.sort(this._holes)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];if(t.isEmpty())return null;const i=t.getCoordinateSequence(),s=K.minCoordinateIndex(i,0,i.size()-2);K.scroll(i,s,!0),F.isCCW(i)===e&&K.reverse(i)}}getCoordinate(){return this._shell.getCoordinate()}getNumInteriorRing(){return this._holes.length}getBoundaryDimension(){return 1}reverseInternal(){const t=this.getExteriorRing().reverse(),e=new Array(this.getNumInteriorRing()).fill(null);for(let t=0;t<e.length;t++)e[t]=this.getInteriorRingN(t).reverse();return this.getFactory().createPolygon(t,e)}getTypeCode(){return q.TYPECODE_POLYGON}getDimension(){return 2}getLength(){let t=0;t+=this._shell.getLength();for(let e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t}getNumPoints(){let t=this._shell.getNumPoints();for(let e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t}convexHull(){return this.getExteriorRing().convexHull()}normalized(t,e){const i=t.copy();return this.normalize(i,e),i}compareToSameClass(){if(1===arguments.length){const t=arguments[0],e=this._shell,i=t._shell;return e.compareToSameClass(i)}if(2===arguments.length){const t=arguments[1],e=arguments[0],i=this._shell,s=e._shell,a=i.compareToSameClass(s,t);if(0!==a)return a;const n=this.getNumInteriorRing(),o=e.getNumInteriorRing();let r=0;for(;r<n&&r<o;){const i=this.getInteriorRingN(r),s=e.getInteriorRingN(r),a=i.compareToSameClass(s,t);if(0!==a)return a;r++}return r<n?1:r<o?-1:0}}apply(){if(C(arguments[0],H)){const t=arguments[0];this._shell.apply(t);for(let e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(C(arguments[0],T)){const t=arguments[0];if(this._shell.apply(t),!t.isDone())for(let e=0;e<this._holes.length&&(this._holes[e].apply(t),!t.isDone());e++);t.isGeometryChanged()&&this.geometryChanged()}else if(C(arguments[0],X))arguments[0].filter(this);else if(C(arguments[0],V)){const t=arguments[0];t.filter(this),this._shell.apply(t);for(let e=0;e<this._holes.length;e++)this._holes[e].apply(t)}}getBoundary(){if(this.isEmpty())return this.getFactory().createMultiLineString();const t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(let e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)}getGeometryType(){return q.TYPENAME_POLYGON}getExteriorRing(){return this._shell}isEmpty(){return this._shell.isEmpty()}getInteriorRingN(t){return this._holes[t]}get interfaces_(){return[st]}}class nt extends L{contains(){}}class ot extends nt{}class rt extends ot{constructor(t){super(),this.array=[],t instanceof L&&this.addAll(t)}contains(t){for(const e of this.array)if(0===e.compareTo(t))return!0;return!1}add(t){if(this.contains(t))return!1;for(let e=0,i=this.array.length;e<i;e++)if(1===this.array[e].compareTo(t))return!!this.array.splice(e,0,t);return this.array.push(t),!0}addAll(t){for(const e of t)this.add(e);return!0}remove(){throw new Y}size(){return this.array.length}isEmpty(){return 0===this.array.length}toArray(){return this.array.slice()}iterator(){return new lt(this.array)}}class lt{constructor(t){this.array=t,this.position=0}next(){if(this.position===this.array.length)throw new w;return this.array[this.position++]}hasNext(){return this.position<this.array.length}remove(){throw new Y}}class ht extends q{constructor(){super(),ht.constructor_.apply(this,arguments)}static constructor_(){if(this._geometries=null,0===arguments.length);else if(2===arguments.length){let t=arguments[0],e=arguments[1];if(q.constructor_.call(this,e),null===t&&(t=[]),q.hasNullElements(t))throw new s("geometries must not contain null elements");this._geometries=t}}computeEnvelopeInternal(){const t=new D;for(let e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t}getGeometryN(t){return this._geometries[t]}getCoordinates(){const t=new Array(this.getNumPoints()).fill(null);let e=-1;for(let i=0;i<this._geometries.length;i++){const s=this._geometries[i].getCoordinates();for(let i=0;i<s.length;i++)e++,t[e]=s[i]}return t}getArea(){let t=0;for(let e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t}copyInternal(){const t=new Array(this._geometries.length).fill(null);for(let e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new ht(t,this._factory)}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof q){const t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;const i=t;if(this._geometries.length!==i._geometries.length)return!1;for(let t=0;t<this._geometries.length;t++)if(!this._geometries[t].equalsExact(i._geometries[t],e))return!1;return!0}return super.equalsExact.apply(this,arguments)}normalize(){for(let t=0;t<this._geometries.length;t++)this._geometries[t].normalize();it.sort(this._geometries)}getCoordinate(){return this.isEmpty()?null:this._geometries[0].getCoordinate()}getBoundaryDimension(){let t=J.FALSE;for(let e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t}reverseInternal(){const t=this._geometries.length,e=new S(t);for(let i=0;i<t;i++)e.add(this._geometries[i].reverse());return this.getFactory().buildGeometry(e)}getTypeCode(){return q.TYPECODE_GEOMETRYCOLLECTION}getDimension(){let t=J.FALSE;for(let e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t}getLength(){let t=0;for(let e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t}getNumPoints(){let t=0;for(let e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t}getNumGeometries(){return this._geometries.length}compareToSameClass(){if(1===arguments.length){const t=arguments[0],e=new rt(it.asList(this._geometries)),i=new rt(it.asList(t._geometries));return this.compare(e,i)}if(2===arguments.length){const t=arguments[1],e=arguments[0],i=this.getNumGeometries(),s=e.getNumGeometries();let a=0;for(;a<i&&a<s;){const i=this.getGeometryN(a),s=e.getGeometryN(a),n=i.compareToSameClass(s,t);if(0!==n)return n;a++}return a<i?1:a<s?-1:0}}apply(){if(C(arguments[0],H)){const t=arguments[0];for(let e=0;e<this._geometries.length;e++)this._geometries[e].apply(t)}else if(C(arguments[0],T)){const t=arguments[0];if(0===this._geometries.length)return null;for(let e=0;e<this._geometries.length&&(this._geometries[e].apply(t),!t.isDone());e++);t.isGeometryChanged()&&this.geometryChanged()}else if(C(arguments[0],X)){const t=arguments[0];t.filter(this);for(let e=0;e<this._geometries.length;e++)this._geometries[e].apply(t)}else if(C(arguments[0],V)){const t=arguments[0];t.filter(this);for(let e=0;e<this._geometries.length;e++)this._geometries[e].apply(t)}}getBoundary(){return q.checkNotGeometryCollection(this),u.shouldNeverReachHere(),null}getGeometryType(){return q.TYPENAME_GEOMETRYCOLLECTION}isEmpty(){for(let t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0}}class ct extends ht{constructor(){super(),ct.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0],e=arguments[1];ht.constructor_.call(this,t,e)}copyInternal(){const t=new Array(this._geometries.length).fill(null);for(let e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new ct(t,this._factory)}isValid(){return!0}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof q){const t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&super.equalsExact.call(this,t,e)}return super.equalsExact.apply(this,arguments)}getCoordinate(){if(1===arguments.length&&Number.isInteger(arguments[0])){const t=arguments[0];return this._geometries[t].getCoordinate()}return super.getCoordinate.apply(this,arguments)}getBoundaryDimension(){return J.FALSE}getTypeCode(){return q.TYPECODE_MULTIPOINT}getDimension(){return 0}getBoundary(){return this.getFactory().createGeometryCollection()}getGeometryType(){return q.TYPENAME_MULTIPOINT}get interfaces_(){return[Z]}}class pt extends Q{constructor(){super(),pt.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0],e=arguments[1];Q.constructor_.call(this,t,e),this.validateConstruction()}copyInternal(){return new pt(this._points.copy(),this._factory)}getBoundaryDimension(){return J.FALSE}isClosed(){return!!this.isEmpty()||super.isClosed.call(this)}reverseInternal(){const t=this._points.copy();return K.reverse(t),this.getFactory().createLinearRing(t)}getTypeCode(){return q.TYPECODE_LINEARRING}validateConstruction(){if(!this.isEmpty()&&!super.isClosed.call(this))throw new s("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<pt.MINIMUM_VALID_SIZE)throw new s("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")}getGeometryType(){return q.TYPENAME_LINEARRING}}pt.MINIMUM_VALID_SIZE=4;class ut{static measures(t){return t instanceof _?0:t instanceof v||t instanceof x?1:0}static dimension(t){return t instanceof _?2:t instanceof v?3:t instanceof x?4:3}static create(){if(1===arguments.length){const t=arguments[0];return ut.create(t,0)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return 2===t?new _:3===t&&0===e?new y:3===t&&1===e?new v:4===t&&1===e?new x:new y}}}class dt{static isRing(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))}static ptNotInList(t,e){for(let i=0;i<t.length;i++){const s=t[i];if(dt.indexOf(s,e)<0)return s}return null}static scroll(t,e){const i=dt.indexOf(e,t);if(i<0)return null;const s=new Array(t.length).fill(null);G.arraycopy(t,i,s,0,t.length-i),G.arraycopy(t,0,s,t.length-i,i),G.arraycopy(s,0,t,0,t.length)}static equals(){if(2===arguments.length){const t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].equals(e[i]))return!1;return!0}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(0!==i.compare(t[s],e[s]))return!1;return!0}}static intersection(t,e){const i=new E;for(let s=0;s<t.length;s++)e.intersects(t[s])&&i.add(t[s],!0);return i.toCoordinateArray()}static measures(t){if(null===t||0===t.length)return 0;let e=0;for(const i of t)e=Math.max(e,ut.measures(i));return e}static hasRepeatedPoints(t){for(let e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1}static removeRepeatedPoints(t){return dt.hasRepeatedPoints(t)?new E(t,!1).toCoordinateArray():t}static reverse(t){const e=t.length-1,i=Math.trunc(e/2);for(let s=0;s<=i;s++){const i=t[s];t[s]=t[e-s],t[e-s]=i}}static removeNull(t){let e=0;for(let i=0;i<t.length;i++)null!==t[i]&&e++;const i=new Array(e).fill(null);if(0===e)return i;let s=0;for(let e=0;e<t.length;e++)null!==t[e]&&(i[s++]=t[e]);return i}static copyDeep(){if(1===arguments.length){const t=arguments[0],e=new Array(t.length).fill(null);for(let i=0;i<t.length;i++)e[i]=t[i].copy();return e}if(5===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4];for(let n=0;n<a;n++)i[s+n]=t[e+n].copy()}}static isEqualReversed(t,e){for(let i=0;i<t.length;i++){const s=t[i],a=e[t.length-i-1];if(0!==s.compareTo(a))return!1}return!0}static envelope(t){const e=new D;for(let i=0;i<t.length;i++)e.expandToInclude(t[i]);return e}static toCoordinateArray(t){return t.toArray(dt.coordArrayType)}static dimension(t){if(null===t||0===t.length)return 3;let e=0;for(const i of t)e=Math.max(e,ut.dimension(i));return e}static atLeastNCoordinatesOrNothing(t,e){return e.length>=t?e:[]}static indexOf(t,e){for(let i=0;i<e.length;i++)if(t.equals(e[i]))return i;return-1}static increasingDirection(t){for(let e=0;e<Math.trunc(t.length/2);e++){const i=t.length-1-e,s=t[e].compareTo(t[i]);if(0!==s)return s}return 1}static compare(t,e){let i=0;for(;i<t.length&&i<e.length;){const s=t[i].compareTo(e[i]);if(0!==s)return s;i++}return i<e.length?-1:i<t.length?1:0}static minCoordinate(t){let e=null;for(let i=0;i<t.length;i++)(null===e||e.compareTo(t[i])>0)&&(e=t[i]);return e}static extract(t,e,i){e=z.clamp(e,0,t.length);let s=(i=z.clamp(i,-1,t.length))-e+1;i<0&&(s=0),e>=t.length&&(s=0),i<e&&(s=0);const a=new Array(s).fill(null);if(0===s)return a;let n=0;for(let s=e;s<=i;s++)a[n++]=t[s];return a}}dt.ForwardComparator=class{compare(t,e){const i=t,s=e;return dt.compare(i,s)}get interfaces_(){return[l]}},dt.BidirectionalComparator=class{compare(t,e){const i=t,s=e;if(i.length<s.length)return-1;if(i.length>s.length)return 1;if(0===i.length)return 0;const a=dt.compare(i,s);return dt.isEqualReversed(i,s)?0:a}OLDcompare(t,e){const i=t,s=e;if(i.length<s.length)return-1;if(i.length>s.length)return 1;if(0===i.length)return 0;const a=dt.increasingDirection(i),n=dt.increasingDirection(s);let o=a>0?0:i.length-1,r=n>0?0:i.length-1;for(let t=0;t<i.length;t++){const t=i[o].compareTo(s[r]);if(0!==t)return t;o+=a,r+=n}return 0}get interfaces_(){return[l]}},dt.coordArrayType=new Array(0).fill(null);class mt{constructor(t){this.str=t}append(t){this.str+=t}setCharAt(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}toString(){return this.str}}class gt{constructor(){gt.constructor_.apply(this,arguments)}static constructor_(){if(this._dimension=3,this._measures=0,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){const t=arguments[0];gt.constructor_.call(this,t,dt.dimension(t),dt.measures(t))}else if(Number.isInteger(arguments[0])){const t=arguments[0];this._coordinates=new Array(t).fill(null);for(let e=0;e<t;e++)this._coordinates[e]=new y}else if(C(arguments[0],R)){const t=arguments[0];if(null===t)return this._coordinates=new Array(0).fill(null),null;this._dimension=t.getDimension(),this._measures=t.getMeasures(),this._coordinates=new Array(t.size()).fill(null);for(let e=0;e<this._coordinates.length;e++)this._coordinates[e]=t.getCoordinateCopy(e)}}else if(2===arguments.length){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1];gt.constructor_.call(this,t,e,dt.measures(t))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1];this._coordinates=new Array(t).fill(null),this._dimension=e;for(let i=0;i<t;i++)this._coordinates[i]=ut.create(e)}}else if(3===arguments.length)if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1],i=arguments[2];this._dimension=e,this._measures=i,this._coordinates=null===t?new Array(0).fill(null):t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1],i=arguments[2];this._coordinates=new Array(t).fill(null),this._dimension=e,this._measures=i;for(let e=0;e<t;e++)this._coordinates[e]=this.createCoordinate()}}getM(t){return this.hasM()?this._coordinates[t].getM():n.NaN}setOrdinate(t,e,i){switch(e){case R.X:this._coordinates[t].x=i;break;case R.Y:this._coordinates[t].y=i;break;default:this._coordinates[t].setOrdinate(e,i)}}getZ(t){return this.hasZ()?this._coordinates[t].getZ():n.NaN}size(){return this._coordinates.length}getOrdinate(t,e){switch(e){case R.X:return this._coordinates[t].x;case R.Y:return this._coordinates[t].y;default:return this._coordinates[t].getOrdinate(e)}}getCoordinate(){if(1===arguments.length){const t=arguments[0];return this._coordinates[t]}if(2===arguments.length){const t=arguments[0];arguments[1].setCoordinate(this._coordinates[t])}}getCoordinateCopy(t){const e=this.createCoordinate();return e.setCoordinate(this._coordinates[t]),e}createCoordinate(){return ut.create(this.getDimension(),this.getMeasures())}getDimension(){return this._dimension}getX(t){return this._coordinates[t].x}getMeasures(){return this._measures}expandEnvelope(t){for(let e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t}copy(){const t=new Array(this.size()).fill(null);for(let e=0;e<this._coordinates.length;e++){const i=this.createCoordinate();i.setCoordinate(this._coordinates[e]),t[e]=i}return new gt(t,this._dimension,this._measures)}toString(){if(this._coordinates.length>0){const t=new mt(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(let e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"}getY(t){return this._coordinates[t].y}toCoordinateArray(){return this._coordinates}get interfaces_(){return[R,h]}}class yt{static instance(){return yt.instanceObject}readResolve(){return yt.instance()}create(){if(1===arguments.length){if(arguments[0]instanceof Array)return new gt(arguments[0]);if(C(arguments[0],R))return new gt(arguments[0])}else{if(2===arguments.length){let t=arguments[1];return t>3&&(t=3),t<2&&(t=2),new gt(arguments[0],t)}if(3===arguments.length){let t=arguments[2],e=arguments[1]-t;return t>1&&(t=1),e>3&&(e=3),e<2&&(e=2),new gt(arguments[0],e+t,t)}}}get interfaces_(){return[U,h]}}yt.instanceObject=new yt;class ft extends ht{constructor(){super(),ft.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0],e=arguments[1];ht.constructor_.call(this,t,e)}copyInternal(){const t=new Array(this._geometries.length).fill(null);for(let e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new ft(t,this._factory)}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof q){const t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&super.equalsExact.call(this,t,e)}return super.equalsExact.apply(this,arguments)}getBoundaryDimension(){return 1}getTypeCode(){return q.TYPECODE_MULTIPOLYGON}getDimension(){return 2}getBoundary(){if(this.isEmpty())return this.getFactory().createMultiLineString();const t=new S;for(let e=0;e<this._geometries.length;e++){const i=this._geometries[e].getBoundary();for(let e=0;e<i.getNumGeometries();e++)t.add(i.getGeometryN(e))}const e=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(e))}getGeometryType(){return q.TYPENAME_MULTIPOLYGON}get interfaces_(){return[st]}}class _t{get(){}put(){}size(){}values(){}entrySet(){}}class vt extends nt{constructor(t){super(),this.map=new Map,t instanceof L&&this.addAll(t)}contains(t){const e=t.hashCode?t.hashCode():t;return!!this.map.has(e)}add(t){const e=t.hashCode?t.hashCode():t;return!this.map.has(e)&&!!this.map.set(e,t)}addAll(t){for(const e of t)this.add(e);return!0}remove(){throw new Y}size(){return this.map.size}isEmpty(){return 0===this.map.size}toArray(){return Array.from(this.map.values())}iterator(){return new xt(this.map)}[Symbol.iterator](){return this.map}}class xt{constructor(t){this.iterator=t.values();const{done:e,value:i}=this.iterator.next();this.done=e,this.value=i}next(){if(this.done)throw new w;const t=this.value,{done:e,value:i}=this.iterator.next();return this.done=e,this.value=i,t}hasNext(){return!this.done}remove(){throw new Y}}class Ct extends _t{constructor(){super(),this.map=new Map}get(t){return this.map.get(t)||null}put(t,e){return this.map.set(t,e),e}values(){const t=new S,e=this.map.values();let i=e.next();for(;!i.done;)t.add(i.value),i=e.next();return t}entrySet(){const t=new vt;return this.map.entries().forEach((e=>t.add(e))),t}size(){return this.map.size()}}class Lt{constructor(){Lt.constructor_.apply(this,arguments)}static constructor_(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=Lt.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof Mt){const t=arguments[0];this._modelType=t,t===Lt.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){const t=arguments[0];this._modelType=Lt.FIXED,this.setScale(t)}else if(arguments[0]instanceof Lt){const t=arguments[0];this._modelType=t._modelType,this._scale=t._scale}}static mostPrecise(t,e){return t.compareTo(e)>=0?t:e}equals(t){if(!(t instanceof Lt))return!1;const e=t;return this._modelType===e._modelType&&this._scale===e._scale}compareTo(t){const e=t,i=this.getMaximumSignificantDigits(),s=e.getMaximumSignificantDigits();return O.compare(i,s)}getScale(){return this._scale}isFloating(){return this._modelType===Lt.FLOATING||this._modelType===Lt.FLOATING_SINGLE}getType(){return this._modelType}toString(){let t="UNKNOWN";return this._modelType===Lt.FLOATING?t="Floating":this._modelType===Lt.FLOATING_SINGLE?t="Floating-Single":this._modelType===Lt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t}makePrecise(){if("number"==typeof arguments[0]){const t=arguments[0];return n.isNaN(t)||this._modelType===Lt.FLOATING_SINGLE?t:this._modelType===Lt.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof y){const t=arguments[0];if(this._modelType===Lt.FLOATING)return null;t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y)}}getMaximumSignificantDigits(){let t=16;return this._modelType===Lt.FLOATING?t=16:this._modelType===Lt.FLOATING_SINGLE?t=6:this._modelType===Lt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t}setScale(t){this._scale=Math.abs(t)}get interfaces_(){return[h,o]}}class Mt{constructor(){Mt.constructor_.apply(this,arguments)}static constructor_(){this._name=null;const t=arguments[0];this._name=t,Mt.nameToTypeMap.put(t,this)}readResolve(){return Mt.nameToTypeMap.get(this._name)}toString(){return this._name}get interfaces_(){return[h]}}Mt.nameToTypeMap=new Ct,Lt.Type=Mt,Lt.FIXED=new Mt("FIXED"),Lt.FLOATING=new Mt("FLOATING"),Lt.FLOATING_SINGLE=new Mt("FLOATING SINGLE"),Lt.maximumPreciseValue=9007199254740992;class bt extends ht{constructor(){super(),bt.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0],e=arguments[1];ht.constructor_.call(this,t,e)}copyInternal(){const t=new Array(this._geometries.length).fill(null);for(let e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new bt(t,this._factory)}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof q){const t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&super.equalsExact.call(this,t,e)}return super.equalsExact.apply(this,arguments)}getBoundaryDimension(){return this.isClosed()?J.FALSE:0}isClosed(){if(this.isEmpty())return!1;for(let t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0}getTypeCode(){return q.TYPECODE_MULTILINESTRING}getDimension(){return 1}getBoundary(){throw new Y}getGeometryType(){return q.TYPENAME_MULTILINESTRING}get interfaces_(){return[W]}}class wt{constructor(){wt.constructor_.apply(this,arguments)}static constructor_(){if(this._precisionModel=null,this._coordinateSequenceFactory=null,this._SRID=null,0===arguments.length)wt.constructor_.call(this,new Lt,0);else if(1===arguments.length){if(C(arguments[0],U)){const t=arguments[0];wt.constructor_.call(this,new Lt,0,t)}else if(arguments[0]instanceof Lt){const t=arguments[0];wt.constructor_.call(this,t,0,wt.getDefaultCoordinateSequenceFactory())}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];wt.constructor_.call(this,t,e,wt.getDefaultCoordinateSequenceFactory())}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._precisionModel=t,this._coordinateSequenceFactory=i,this._SRID=e}}static toMultiPolygonArray(t){const e=new Array(t.size()).fill(null);return t.toArray(e)}static toGeometryArray(t){if(null===t)return null;const e=new Array(t.size()).fill(null);return t.toArray(e)}static getDefaultCoordinateSequenceFactory(){return yt.instance()}static toMultiLineStringArray(t){const e=new Array(t.size()).fill(null);return t.toArray(e)}static toLineStringArray(t){const e=new Array(t.size()).fill(null);return t.toArray(e)}static toMultiPointArray(t){const e=new Array(t.size()).fill(null);return t.toArray(e)}static toLinearRingArray(t){const e=new Array(t.size()).fill(null);return t.toArray(e)}static toPointArray(t){const e=new Array(t.size()).fill(null);return t.toArray(e)}static toPolygonArray(t){const e=new Array(t.size()).fill(null);return t.toArray(e)}static createPointFromInternalCoord(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)}createEmpty(t){switch(t){case-1:return this.createGeometryCollection();case 0:return this.createPoint();case 1:return this.createLineString();case 2:return this.createPolygon();default:throw new s("Invalid dimension: "+t)}}toGeometry(t){return t.isNull()?this.createPoint():t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new y(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new y(t.getMinX(),t.getMinY()),new y(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new y(t.getMinX(),t.getMinY()),new y(t.getMinX(),t.getMaxY()),new y(t.getMaxX(),t.getMaxY()),new y(t.getMaxX(),t.getMinY()),new y(t.getMinX(),t.getMinY())]),null)}createLineString(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){const t=arguments[0];return this.createLineString(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(C(arguments[0],R))return new Q(arguments[0],this)}}createMultiLineString(){return 0===arguments.length?new bt(null,this):1===arguments.length?new bt(arguments[0],this):void 0}buildGeometry(t){let e=null,i=!1,s=!1;for(let a=t.iterator();a.hasNext();){const t=a.next(),n=t.getTypeCode();null===e&&(e=n),n!==e&&(i=!0),t instanceof ht&&(s=!0)}if(null===e)return this.createGeometryCollection();if(i||s)return this.createGeometryCollection(wt.toGeometryArray(t));const a=t.iterator().next();if(t.size()>1){if(a instanceof at)return this.createMultiPolygon(wt.toPolygonArray(t));if(a instanceof Q)return this.createMultiLineString(wt.toLineStringArray(t));if(a instanceof tt)return this.createMultiPoint(wt.toPointArray(t));u.shouldNeverReachHere("Unhandled geometry type: "+a.getGeometryType())}return a}createMultiPointFromCoords(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}createPoint(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof y){const t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(C(arguments[0],R))return new tt(arguments[0],this)}}getCoordinateSequenceFactory(){return this._coordinateSequenceFactory}createPolygon(){if(0===arguments.length)return this.createPolygon(null,null);if(1===arguments.length){if(C(arguments[0],R)){const t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){const t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof pt){const t=arguments[0];return this.createPolygon(t,null)}}else if(2===arguments.length)return new at(arguments[0],arguments[1],this)}getSRID(){return this._SRID}createGeometryCollection(){return 0===arguments.length?new ht(null,this):1===arguments.length?new ht(arguments[0],this):void 0}getPrecisionModel(){return this._precisionModel}createLinearRing(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){const t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(C(arguments[0],R))return new pt(arguments[0],this)}}createMultiPolygon(){return 0===arguments.length?new ft(null,this):1===arguments.length?new ft(arguments[0],this):void 0}createMultiPoint(){if(0===arguments.length)return new ct(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new ct(arguments[0],this);if(C(arguments[0],R)){const t=arguments[0];if(null===t)return this.createMultiPoint(new Array(0).fill(null));const e=new Array(t.size()).fill(null);for(let i=0;i<t.size();i++){const s=this.getCoordinateSequenceFactory().create(1,t.getDimension(),t.getMeasures());K.copy(t,i,s,0,1),e[i]=this.createPoint(s)}return this.createMultiPoint(e)}}}get interfaces_(){return[h]}}const St="XY",It="XYZ",Et="XYM",Tt="XYZM",Dt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},Pt="EMPTY",Ot=1,kt=2,Nt=3,At=4,Rt=5,Ft=6;for(const t in Dt)Dt[t].toUpperCase();class Bt{constructor(t){this.wkt=t,this.index_=-1}isAlpha_(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isNumeric_(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)}isWhiteSpace_(t){return" "==t||"\t"==t||"\r"==t||"\n"==t}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const t=this.nextChar_(),e=this.index_;let i,s=t;if("("==t)i=kt;else if(","==t)i=Rt;else if(")"==t)i=Nt;else if(this.isNumeric_(t)||"-"==t)i=At,s=this.readNumber_();else if(this.isAlpha_(t))i=Ot,s=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(""!==t)throw new Error("Unexpected character: "+t);i=Ft}return{position:e,value:s,type:i}}readNumber_(){let t;const e=this.index_;let i=!1,s=!1;do{"."==t?i=!0:"e"!=t&&"E"!=t||(s=!0),t=this.nextChar_()}while(this.isNumeric_(t,i)||!s&&("e"==t||"E"==t)||s&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))}readText_(){let t;const e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}class Gt{constructor(t,e){this.lexer_=t,this.token_,this.layout_=St,this.factory=e}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(t){return this.token_.type==t}match(t){const e=this.isTokenType(t);return e&&this.consume_(),e}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let t=St;const e=this.token_;if(this.isTokenType(Ot)){const i=e.value;"Z"===i?t=It:"M"===i?t=Et:"ZM"===i&&(t=Tt),t!==St&&this.consume_()}return t}parseGeometryCollectionText_(){if(this.match(kt)){const t=[];do{t.push(this.parseGeometry_())}while(this.match(Rt));if(this.match(Nt))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(kt)){const t=this.parsePoint_();if(this.match(Nt))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(kt)){const t=this.parsePointList_();if(this.match(Nt))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(kt)){const t=this.parseLineStringTextList_();if(this.match(Nt))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(kt)){let t;if(t=this.token_.type==kt?this.parsePointTextList_():this.parsePointList_(),this.match(Nt))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(kt)){const t=this.parseLineStringTextList_();if(this.match(Nt))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(kt)){const t=this.parsePolygonTextList_();if(this.match(Nt))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}parsePoint_(){const t=[],e=this.layout_.length;for(let i=0;i<e;++i){const e=this.token_;if(!this.match(At))break;t.push(e.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())}parsePointList_(){const t=[this.parsePoint_()];for(;this.match(Rt);)t.push(this.parsePoint_());return t}parsePointTextList_(){const t=[this.parsePointText_()];for(;this.match(Rt);)t.push(this.parsePointText_());return t}parseLineStringTextList_(){const t=[this.parseLineStringText_()];for(;this.match(Rt);)t.push(this.parseLineStringText_());return t}parsePolygonTextList_(){const t=[this.parsePolygonText_()];for(;this.match(Rt);)t.push(this.parsePolygonText_());return t}isEmptyGeometry_(){const t=this.isTokenType(Ot)&&this.token_.value==Pt;return t&&this.consume_(),t}formatErrorMessage_(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}parseGeometry_(){const t=this.factory,e=t=>new y(...t),i=i=>{const s=i.map((i=>t.createLinearRing(i.map(e))));return s.length>1?t.createPolygon(s[0],s.slice(1)):t.createPolygon(s[0])},s=this.token_;if(this.match(Ot)){const a=s.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==a){const e=this.parseGeometryCollectionText_();return t.createGeometryCollection(e)}switch(a){case"POINT":{const e=this.parsePointText_();return e?t.createPoint(new y(...e)):t.createPoint()}case"LINESTRING":{const i=this.parseLineStringText_().map(e);return t.createLineString(i)}case"LINEARRING":{const i=this.parseLineStringText_().map(e);return t.createLinearRing(i)}case"POLYGON":{const e=this.parsePolygonText_();return e&&0!==e.length?i(e):t.createPolygon()}case"MULTIPOINT":{const i=this.parseMultiPointText_();if(!i||0===i.length)return t.createMultiPoint();const s=i.map(e).map((e=>t.createPoint(e)));return t.createMultiPoint(s)}case"MULTILINESTRING":{const i=this.parseMultiLineStringText_().map((i=>t.createLineString(i.map(e))));return t.createMultiLineString(i)}case"MULTIPOLYGON":{const e=this.parseMultiPolygonText_();if(!e||0===e.length)return t.createMultiPolygon();const s=e.map(i);return t.createMultiPolygon(s)}default:throw new Error("Invalid geometry type: "+a)}}throw new Error(this.formatErrorMessage_())}}function zt(t){if(t.isEmpty())return"";const e=t.getCoordinate(),i=[e.x,e.y];return void 0===e.z||Number.isNaN(e.z)||i.push(e.z),void 0===e.m||Number.isNaN(e.m)||i.push(e.m),i.join(" ")}function jt(t){const e=t.getCoordinates().map((t=>{const e=[t.x,t.y];return void 0===t.z||Number.isNaN(t.z)||e.push(t.z),void 0===t.m||Number.isNaN(t.m)||e.push(t.m),e})),i=[];for(let t=0,s=e.length;t<s;++t)i.push(e[t].join(" "));return i.join(", ")}function Ut(t){const e=[];e.push("("+jt(t.getExteriorRing())+")");for(let i=0,s=t.getNumInteriorRing();i<s;++i)e.push("("+jt(t.getInteriorRingN(i))+")");return e.join(", ")}const Vt={Point:zt,LineString:jt,LinearRing:jt,Polygon:Ut,MultiPoint:function(t){const e=[];for(let i=0,s=t.getNumGeometries();i<s;++i)e.push("("+zt(t.getGeometryN(i))+")");return e.join(", ")},MultiLineString:function(t){const e=[];for(let i=0,s=t.getNumGeometries();i<s;++i)e.push("("+jt(t.getGeometryN(i))+")");return e.join(", ")},MultiPolygon:function(t){const e=[];for(let i=0,s=t.getNumGeometries();i<s;++i)e.push("("+Ut(t.getGeometryN(i))+")");return e.join(", ")},GeometryCollection:function(t){const e=[];for(let i=0,s=t.getNumGeometries();i<s;++i)e.push(qt(t.getGeometryN(i)));return e.join(", ")}};function qt(t){let e=t.getGeometryType();const i=Vt[e];e=e.toUpperCase();const s=function(t){let e="";if(t.isEmpty())return e;const i=t.getCoordinate();return void 0===i.z||Number.isNaN(i.z)||(e+="Z"),void 0===i.m||Number.isNaN(i.m)||(e+="M"),e}(t);return s.length>0&&(e+=" "+s),t.isEmpty()?e+" "+Pt:e+" ("+i(t)+")"}class Ht{constructor(t){this.geometryFactory=t||new wt,this.precisionModel=this.geometryFactory.getPrecisionModel()}read(t){const e=new Bt(t);return new Gt(e,this.geometryFactory).parse()}write(t){return qt(t)}}class $t{constructor(t){this.parser=new Ht(t)}write(t){return this.parser.write(t)}static toLineString(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}class Wt{constructor(){Wt.constructor_.apply(this,arguments)}static constructor_(){this._result=null,this._inputLines=Array(2).fill().map((()=>Array(2))),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new y,this._intPt[1]=new y,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}static computeEdgeDistance(t,e,i){const s=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y);let n=-1;if(t.equals(e))n=0;else if(t.equals(i))n=s>a?s:a;else{const i=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);n=s>a?i:o,0!==n||t.equals(e)||(n=Math.max(i,o))}return u.isTrue(!(0===n&&!t.equals(e)),"Bad distance calculation"),n}static nonRobustComputeEdgeDistance(t,e,i){const s=t.x-e.x,a=t.y-e.y,n=Math.sqrt(s*s+a*a);return u.isTrue(!(0===n&&!t.equals(e)),"Invalid distance calculation"),n}getIndexAlongSegment(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]}getTopologySummary(){const t=new mt;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()}computeIntersection(t,e,i,s){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=i,this._inputLines[1][1]=s,this._result=this.computeIntersect(t,e,i,s)}getIntersectionNum(){return this._result}computeIntLineIndex(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((()=>Array(2))),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){const t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}}isProper(){return this.hasIntersection()&&this._isProper}setPrecisionModel(t){this._precisionModel=t}isInteriorIntersection(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){const t=arguments[0];for(let e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}}getIntersection(t){return this._intPt[t]}isEndPoint(){return this.hasIntersection()&&!this._isProper}hasIntersection(){return this._result!==Wt.NO_INTERSECTION}getEdgeDistance(t,e){return Wt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])}isCollinear(){return this._result===Wt.COLLINEAR_INTERSECTION}toString(){return $t.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+$t.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()}getEndpoint(t,e){return this._inputLines[t][e]}isIntersection(t){for(let e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1}getIntersectionAlongSegment(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]}}Wt.DONT_INTERSECT=0,Wt.DO_INTERSECT=1,Wt.COLLINEAR=2,Wt.NO_INTERSECTION=0,Wt.POINT_INTERSECTION=1,Wt.COLLINEAR_INTERSECTION=2;class Kt extends Wt{constructor(){super()}static nearestEndpoint(t,e,i,s){let a=t,n=j.pointToSegment(t,i,s),o=j.pointToSegment(e,i,s);return o<n&&(n=o,a=e),o=j.pointToSegment(i,t,e),o<n&&(n=o,a=i),o=j.pointToSegment(s,t,e),o<n&&(n=o,a=s),a}isInSegmentEnvelopes(t){const e=new D(this._inputLines[0][0],this._inputLines[0][1]),i=new D(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&i.contains(t)}computeIntersection(){if(3!==arguments.length)return super.computeIntersection.apply(this,arguments);{const t=arguments[0],e=arguments[1],i=arguments[2];if(this._isProper=!1,D.intersects(e,i,t)&&0===F.index(e,i,t)&&0===F.index(i,e,t))return this._isProper=!0,(t.equals(e)||t.equals(i))&&(this._isProper=!1),this._result=Wt.POINT_INTERSECTION,null;this._result=Wt.NO_INTERSECTION}}intersection(t,e,i,s){let a=this.intersectionSafe(t,e,i,s);return this.isInSegmentEnvelopes(a)||(a=new y(Kt.nearestEndpoint(t,e,i,s))),null!==this._precisionModel&&this._precisionModel.makePrecise(a),a}checkDD(t,e,i,s,a){const n=A.intersection(t,e,i,s),o=this.isInSegmentEnvelopes(n);G.out.println("DD in env = "+o+" --------------------- "+n),a.distance(n)>1e-4&&G.out.println("Distance = "+a.distance(n))}intersectionSafe(t,e,i,s){let a=B.intersection(t,e,i,s);return null===a&&(a=Kt.nearestEndpoint(t,e,i,s)),a}computeCollinearIntersection(t,e,i,s){const a=D.intersects(t,e,i),n=D.intersects(t,e,s),o=D.intersects(i,s,t),r=D.intersects(i,s,e);return a&&n?(this._intPt[0]=i,this._intPt[1]=s,Wt.COLLINEAR_INTERSECTION):o&&r?(this._intPt[0]=t,this._intPt[1]=e,Wt.COLLINEAR_INTERSECTION):a&&o?(this._intPt[0]=i,this._intPt[1]=t,!i.equals(t)||n||r?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):a&&r?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||n||o?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):n&&o?(this._intPt[0]=s,this._intPt[1]=t,!s.equals(t)||a||r?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):n&&r?(this._intPt[0]=s,this._intPt[1]=e,!s.equals(e)||a||o?Wt.COLLINEAR_INTERSECTION:Wt.POINT_INTERSECTION):Wt.NO_INTERSECTION}computeIntersect(t,e,i,s){if(this._isProper=!1,!D.intersects(t,e,i,s))return Wt.NO_INTERSECTION;const a=F.index(t,e,i),n=F.index(t,e,s);if(a>0&&n>0||a<0&&n<0)return Wt.NO_INTERSECTION;const o=F.index(i,s,t),r=F.index(i,s,e);return o>0&&r>0||o<0&&r<0?Wt.NO_INTERSECTION:0===a&&0===n&&0===o&&0===r?this.computeCollinearIntersection(t,e,i,s):(0===a||0===n||0===o||0===r?(this._isProper=!1,t.equals2D(i)||t.equals2D(s)?this._intPt[0]=t:e.equals2D(i)||e.equals2D(s)?this._intPt[0]=e:0===a?this._intPt[0]=new y(i):0===n?this._intPt[0]=new y(s):0===o?this._intPt[0]=new y(t):0===r&&(this._intPt[0]=new y(e))):(this._isProper=!0,this._intPt[0]=this.intersection(t,e,i,s)),Wt.POINT_INTERSECTION)}}class Yt{constructor(){Yt.constructor_.apply(this,arguments)}static constructor_(){if(this.p0=null,this.p1=null,0===arguments.length)Yt.constructor_.call(this,new y,new y);else if(1===arguments.length){const t=arguments[0];Yt.constructor_.call(this,t.p0,t.p1)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.p0=t,this.p1=e}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];Yt.constructor_.call(this,new y(t,e),new y(i,s))}}static midPoint(t,e){return new y((t.x+e.x)/2,(t.y+e.y)/2)}minX(){return Math.min(this.p0.x,this.p1.x)}orientationIndex(){if(arguments[0]instanceof Yt){const t=arguments[0],e=F.index(this.p0,this.p1,t.p0),i=F.index(this.p0,this.p1,t.p1);return e>=0&&i>=0||e<=0&&i<=0?Math.max(e,i):0}if(arguments[0]instanceof y){const t=arguments[0];return F.index(this.p0,this.p1,t)}}toGeometry(t){return t.createLineString([this.p0,this.p1])}isVertical(){return this.p0.x===this.p1.x}equals(t){if(!(t instanceof Yt))return!1;const e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)}intersection(t){const e=new Kt;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null}project(){if(arguments[0]instanceof y){const t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new y(t);const e=this.projectionFactor(t),i=new y;return i.x=this.p0.x+e*(this.p1.x-this.p0.x),i.y=this.p0.y+e*(this.p1.y-this.p0.y),i}if(arguments[0]instanceof Yt){const t=arguments[0],e=this.projectionFactor(t.p0),i=this.projectionFactor(t.p1);if(e>=1&&i>=1)return null;if(e<=0&&i<=0)return null;let s=this.project(t.p0);e<0&&(s=this.p0),e>1&&(s=this.p1);let a=this.project(t.p1);return i<0&&(a=this.p0),i>1&&(a=this.p1),new Yt(s,a)}}normalize(){this.p1.compareTo(this.p0)<0&&this.reverse()}angle(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}getCoordinate(t){return 0===t?this.p0:this.p1}distancePerpendicular(t){return j.pointToLinePerpendicular(t,this.p0,this.p1)}minY(){return Math.min(this.p0.y,this.p1.y)}midPoint(){return Yt.midPoint(this.p0,this.p1)}projectionFactor(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;const e=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,s=e*e+i*i;return s<=0?n.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*i)/s}closestPoints(t){const e=this.intersection(t);if(null!==e)return[e,e];const i=new Array(2).fill(null);let s=n.MAX_VALUE,a=null;const o=this.closestPoint(t.p0);s=o.distance(t.p0),i[0]=o,i[1]=t.p0;const r=this.closestPoint(t.p1);a=r.distance(t.p1),a<s&&(s=a,i[0]=r,i[1]=t.p1);const l=t.closestPoint(this.p0);a=l.distance(this.p0),a<s&&(s=a,i[0]=this.p0,i[1]=l);const h=t.closestPoint(this.p1);return a=h.distance(this.p1),a<s&&(s=a,i[0]=this.p1,i[1]=h),i}closestPoint(t){const e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1}maxX(){return Math.max(this.p0.x,this.p1.x)}getLength(){return this.p0.distance(this.p1)}compareTo(t){const e=t,i=this.p0.compareTo(e.p0);return 0!==i?i:this.p1.compareTo(e.p1)}reverse(){const t=this.p0;this.p0=this.p1,this.p1=t}equalsTopo(t){return this.p0.equals(t.p0)&&this.p1.equals(t.p1)||this.p0.equals(t.p1)&&this.p1.equals(t.p0)}lineIntersection(t){return B.intersection(this.p0,this.p1,t.p0,t.p1)}maxY(){return Math.max(this.p0.y,this.p1.y)}pointAlongOffset(t,e){const i=this.p0.x+t*(this.p1.x-this.p0.x),s=this.p0.y+t*(this.p1.y-this.p0.y),a=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,o=Math.sqrt(a*a+n*n);let r=0,l=0;if(0!==e){if(o<=0)throw new IllegalStateException("Cannot compute offset from zero-length line segment");r=e*a/o,l=e*n/o}return new y(i-l,s+r)}setCoordinates(){if(1===arguments.length){const t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=e.x,this.p1.y=e.y}}segmentFraction(t){let e=this.projectionFactor(t);return e<0?e=0:(e>1||n.isNaN(e))&&(e=1),e}toString(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}isHorizontal(){return this.p0.y===this.p1.y}reflect(t){const e=this.p1.getY()-this.p0.getY(),i=this.p0.getX()-this.p1.getX(),s=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),a=e*e+i*i,n=e*e-i*i,o=t.getX(),r=t.getY();return new y((-n*o-2*e*i*r-2*e*s)/a,(n*r-2*e*i*o-2*i*s)/a)}distance(){if(arguments[0]instanceof Yt){const t=arguments[0];return j.segmentToSegment(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof y){const t=arguments[0];return j.pointToSegment(t,this.p0,this.p1)}}pointAlong(t){const e=new y;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e}hashCode(){let t=n.doubleToLongBits(this.p0.x);t^=31*n.doubleToLongBits(this.p0.y);const e=Math.trunc(t)^Math.trunc(t>>32);let i=n.doubleToLongBits(this.p1.x);return i^=31*n.doubleToLongBits(this.p1.y),e^Math.trunc(i)^Math.trunc(i>>32)}get interfaces_(){return[o,h]}}class Jt{static toLocationSymbol(t){switch(t){case Jt.EXTERIOR:return"e";case Jt.BOUNDARY:return"b";case Jt.INTERIOR:return"i";case Jt.NONE:return"-"}throw new s("Unknown location value: "+t)}}Jt.INTERIOR=0,Jt.BOUNDARY=1,Jt.EXTERIOR=2,Jt.NONE=-1;class Xt{constructor(){Xt.constructor_.apply(this,arguments)}static constructor_(){if(this._matrix=null,0===arguments.length)this._matrix=Array(3).fill().map((()=>Array(3))),this.setAll(J.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){const t=arguments[0];Xt.constructor_.call(this),this.set(t)}else if(arguments[0]instanceof Xt){const t=arguments[0];Xt.constructor_.call(this),this._matrix[Jt.INTERIOR][Jt.INTERIOR]=t._matrix[Jt.INTERIOR][Jt.INTERIOR],this._matrix[Jt.INTERIOR][Jt.BOUNDARY]=t._matrix[Jt.INTERIOR][Jt.BOUNDARY],this._matrix[Jt.INTERIOR][Jt.EXTERIOR]=t._matrix[Jt.INTERIOR][Jt.EXTERIOR],this._matrix[Jt.BOUNDARY][Jt.INTERIOR]=t._matrix[Jt.BOUNDARY][Jt.INTERIOR],this._matrix[Jt.BOUNDARY][Jt.BOUNDARY]=t._matrix[Jt.BOUNDARY][Jt.BOUNDARY],this._matrix[Jt.BOUNDARY][Jt.EXTERIOR]=t._matrix[Jt.BOUNDARY][Jt.EXTERIOR],this._matrix[Jt.EXTERIOR][Jt.INTERIOR]=t._matrix[Jt.EXTERIOR][Jt.INTERIOR],this._matrix[Jt.EXTERIOR][Jt.BOUNDARY]=t._matrix[Jt.EXTERIOR][Jt.BOUNDARY],this._matrix[Jt.EXTERIOR][Jt.EXTERIOR]=t._matrix[Jt.EXTERIOR][Jt.EXTERIOR]}}static matches(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){const t=arguments[0],e=arguments[1];return e===J.SYM_DONTCARE||e===J.SYM_TRUE&&(t>=0||t===J.TRUE)||e===J.SYM_FALSE&&t===J.FALSE||e===J.SYM_P&&t===J.P||e===J.SYM_L&&t===J.L||e===J.SYM_A&&t===J.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){const t=arguments[1];return new Xt(arguments[0]).matches(t)}}static isTrue(t){return t>=0||t===J.TRUE}isIntersects(){return!this.isDisjoint()}isCovers(){return(Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.INTERIOR])||Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.BOUNDARY])||Xt.isTrue(this._matrix[Jt.BOUNDARY][Jt.INTERIOR])||Xt.isTrue(this._matrix[Jt.BOUNDARY][Jt.BOUNDARY]))&&this._matrix[Jt.EXTERIOR][Jt.INTERIOR]===J.FALSE&&this._matrix[Jt.EXTERIOR][Jt.BOUNDARY]===J.FALSE}isCoveredBy(){return(Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.INTERIOR])||Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.BOUNDARY])||Xt.isTrue(this._matrix[Jt.BOUNDARY][Jt.INTERIOR])||Xt.isTrue(this._matrix[Jt.BOUNDARY][Jt.BOUNDARY]))&&this._matrix[Jt.INTERIOR][Jt.EXTERIOR]===J.FALSE&&this._matrix[Jt.BOUNDARY][Jt.EXTERIOR]===J.FALSE}set(){if(1===arguments.length){const t=arguments[0];for(let e=0;e<t.length;e++){const i=Math.trunc(e/3),s=e%3;this._matrix[i][s]=J.toDimensionValue(t.charAt(e))}}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._matrix[t][e]=i}}isContains(){return Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.INTERIOR])&&this._matrix[Jt.EXTERIOR][Jt.INTERIOR]===J.FALSE&&this._matrix[Jt.EXTERIOR][Jt.BOUNDARY]===J.FALSE}setAtLeast(){if(1===arguments.length){const t=arguments[0];for(let e=0;e<t.length;e++){const i=Math.trunc(e/3),s=e%3;this.setAtLeast(i,s,J.toDimensionValue(t.charAt(e)))}}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._matrix[t][e]<i&&(this._matrix[t][e]=i)}}setAtLeastIfValid(t,e,i){t>=0&&e>=0&&this.setAtLeast(t,e,i)}isWithin(){return Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.INTERIOR])&&this._matrix[Jt.INTERIOR][Jt.EXTERIOR]===J.FALSE&&this._matrix[Jt.BOUNDARY][Jt.EXTERIOR]===J.FALSE}isTouches(t,e){return t>e?this.isTouches(e,t):(t===J.A&&e===J.A||t===J.L&&e===J.L||t===J.L&&e===J.A||t===J.P&&e===J.A||t===J.P&&e===J.L)&&this._matrix[Jt.INTERIOR][Jt.INTERIOR]===J.FALSE&&(Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.BOUNDARY])||Xt.isTrue(this._matrix[Jt.BOUNDARY][Jt.INTERIOR])||Xt.isTrue(this._matrix[Jt.BOUNDARY][Jt.BOUNDARY]))}isOverlaps(t,e){return t===J.P&&e===J.P||t===J.A&&e===J.A?Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.INTERIOR])&&Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.EXTERIOR])&&Xt.isTrue(this._matrix[Jt.EXTERIOR][Jt.INTERIOR]):t===J.L&&e===J.L&&1===this._matrix[Jt.INTERIOR][Jt.INTERIOR]&&Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.EXTERIOR])&&Xt.isTrue(this._matrix[Jt.EXTERIOR][Jt.INTERIOR])}isEquals(t,e){return t===e&&Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.INTERIOR])&&this._matrix[Jt.INTERIOR][Jt.EXTERIOR]===J.FALSE&&this._matrix[Jt.BOUNDARY][Jt.EXTERIOR]===J.FALSE&&this._matrix[Jt.EXTERIOR][Jt.INTERIOR]===J.FALSE&&this._matrix[Jt.EXTERIOR][Jt.BOUNDARY]===J.FALSE}toString(){const t=new mt("123456789");for(let e=0;e<3;e++)for(let i=0;i<3;i++)t.setCharAt(3*e+i,J.toDimensionSymbol(this._matrix[e][i]));return t.toString()}setAll(t){for(let e=0;e<3;e++)for(let i=0;i<3;i++)this._matrix[e][i]=t}get(t,e){return this._matrix[t][e]}transpose(){let t=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=t,t=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=t,t=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=t,this}matches(t){if(9!==t.length)throw new s("Should be length 9: "+t);for(let e=0;e<3;e++)for(let i=0;i<3;i++)if(!Xt.matches(this._matrix[e][i],t.charAt(3*e+i)))return!1;return!0}add(t){for(let e=0;e<3;e++)for(let i=0;i<3;i++)this.setAtLeast(e,i,t.get(e,i))}isDisjoint(){return this._matrix[Jt.INTERIOR][Jt.INTERIOR]===J.FALSE&&this._matrix[Jt.INTERIOR][Jt.BOUNDARY]===J.FALSE&&this._matrix[Jt.BOUNDARY][Jt.INTERIOR]===J.FALSE&&this._matrix[Jt.BOUNDARY][Jt.BOUNDARY]===J.FALSE}isCrosses(t,e){return t===J.P&&e===J.L||t===J.P&&e===J.A||t===J.L&&e===J.A?Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.INTERIOR])&&Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.EXTERIOR]):t===J.L&&e===J.P||t===J.A&&e===J.P||t===J.A&&e===J.L?Xt.isTrue(this._matrix[Jt.INTERIOR][Jt.INTERIOR])&&Xt.isTrue(this._matrix[Jt.EXTERIOR][Jt.INTERIOR]):t===J.L&&e===J.L&&0===this._matrix[Jt.INTERIOR][Jt.INTERIOR]}get interfaces_(){return[r]}}class Qt{static toDegrees(t){return 180*t/Math.PI}static normalize(t){for(;t>Math.PI;)t-=Qt.PI_TIMES_2;for(;t<=-Math.PI;)t+=Qt.PI_TIMES_2;return t}static angle(){if(1===arguments.length){const t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){const t=arguments[0],e=arguments[1],i=e.x-t.x,s=e.y-t.y;return Math.atan2(s,i)}}static isAcute(t,e,i){const s=t.x-e.x,a=t.y-e.y;return s*(i.x-e.x)+a*(i.y-e.y)>0}static isObtuse(t,e,i){const s=t.x-e.x,a=t.y-e.y;return s*(i.x-e.x)+a*(i.y-e.y)<0}static interiorAngle(t,e,i){const s=Qt.angle(e,t),a=Qt.angle(e,i);return Math.abs(a-s)}static normalizePositive(t){if(t<0){for(;t<0;)t+=Qt.PI_TIMES_2;t>=Qt.PI_TIMES_2&&(t=0)}else{for(;t>=Qt.PI_TIMES_2;)t-=Qt.PI_TIMES_2;t<0&&(t=0)}return t}static angleBetween(t,e,i){const s=Qt.angle(e,t),a=Qt.angle(e,i);return Qt.diff(s,a)}static diff(t,e){let i=null;return i=t<e?e-t:t-e,i>Math.PI&&(i=2*Math.PI-i),i}static toRadians(t){return t*Math.PI/180}static getTurn(t,e){const i=Math.sin(e-t);return i>0?Qt.COUNTERCLOCKWISE:i<0?Qt.CLOCKWISE:Qt.NONE}static angleBetweenOriented(t,e,i){const s=Qt.angle(e,t),a=Qt.angle(e,i)-s;return a<=-Math.PI?a+Qt.PI_TIMES_2:a>Math.PI?a-Qt.PI_TIMES_2:a}}Qt.PI_TIMES_2=2*Math.PI,Qt.PI_OVER_2=Math.PI/2,Qt.PI_OVER_4=Math.PI/4,Qt.COUNTERCLOCKWISE=F.COUNTERCLOCKWISE,Qt.CLOCKWISE=F.CLOCKWISE,Qt.NONE=F.COLLINEAR;class Zt extends i{constructor(){super(),Zt.constructor_.apply(this,arguments)}static constructor_(){i.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}class te{constructor(){te.constructor_.apply(this,arguments)}static constructor_(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){const t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1];this.x=t,this.y=e,this.w=1}else if(arguments[0]instanceof te&&arguments[1]instanceof te){const t=arguments[0],e=arguments[1];this.x=t.y*e.w-e.y*t.w,this.y=e.x*t.w-t.x*e.w,this.w=t.x*e.y-e.x*t.y}else if(arguments[0]instanceof y&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1];this.x=t.y-e.y,this.y=e.x-t.x,this.w=t.x*e.y-e.x*t.y}}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this.x=t,this.y=e,this.w=i}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=t.y-e.y,n=e.x-t.x,o=t.x*e.y-e.x*t.y,r=i.y-s.y,l=s.x-i.x,h=i.x*s.y-s.x*i.y;this.x=n*h-l*o,this.y=r*o-a*h,this.w=a*l-r*n}}getY(){const t=this.y/this.w;if(n.isNaN(t)||n.isInfinite(t))throw new Zt;return t}getX(){const t=this.x/this.w;if(n.isNaN(t)||n.isInfinite(t))throw new Zt;return t}getCoordinate(){const t=new y;return t.x=this.getX(),t.y=this.getY(),t}}class ee{constructor(){ee.constructor_.apply(this,arguments)}static constructor_(){this.p0=null,this.p1=null,this.p2=null;const t=arguments[0],e=arguments[1],i=arguments[2];this.p0=t,this.p1=e,this.p2=i}static area(t,e,i){return Math.abs(((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2)}static signedArea(t,e,i){return((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2}static det(t,e,i,s){return t*s-e*i}static interpolateZ(t,e,i,s){const a=e.x,n=e.y,o=i.x-a,r=s.x-a,l=i.y-n,h=s.y-n,c=o*h-r*l,p=t.x-a,u=t.y-n,d=(h*p-r*u)/c,m=(-l*p+o*u)/c;return e.getZ()+d*(i.getZ()-e.getZ())+m*(s.getZ()-e.getZ())}static longestSideLength(t,e,i){const s=t.distance(e),a=e.distance(i),n=i.distance(t);let o=s;return a>o&&(o=a),n>o&&(o=n),o}static circumcentreDD(t,e,i){const s=N.valueOf(t.x).subtract(i.x),a=N.valueOf(t.y).subtract(i.y),n=N.valueOf(e.x).subtract(i.x),o=N.valueOf(e.y).subtract(i.y),r=N.determinant(s,a,n,o).multiply(2),l=s.sqr().add(a.sqr()),h=n.sqr().add(o.sqr()),c=N.determinant(a,l,o,h),p=N.determinant(s,l,n,h),u=N.valueOf(i.x).subtract(c.divide(r)).doubleValue(),d=N.valueOf(i.y).add(p.divide(r)).doubleValue();return new y(u,d)}static isAcute(t,e,i){return!!Qt.isAcute(t,e,i)&&!!Qt.isAcute(e,i,t)&&!!Qt.isAcute(i,t,e)}static circumcentre(t,e,i){const s=i.x,a=i.y,n=t.x-s,o=t.y-a,r=e.x-s,l=e.y-a,h=2*ee.det(n,o,r,l),c=ee.det(o,n*n+o*o,l,r*r+l*l),p=ee.det(n,n*n+o*o,r,r*r+l*l);return new y(s-c/h,a+p/h)}static perpendicularBisector(t,e){const i=e.x-t.x,s=e.y-t.y,a=new te(t.x+i/2,t.y+s/2,1),n=new te(t.x-s+i/2,t.y+i+s/2,1);return new te(a,n)}static angleBisector(t,e,i){const s=e.distance(t),a=s/(s+e.distance(i)),n=i.x-t.x,o=i.y-t.y;return new y(t.x+a*n,t.y+a*o)}static area3D(t,e,i){const s=e.x-t.x,a=e.y-t.y,n=e.getZ()-t.getZ(),o=i.x-t.x,r=i.y-t.y,l=i.getZ()-t.getZ(),h=a*l-n*r,c=n*o-s*l,p=s*r-a*o,u=h*h+c*c+p*p;return Math.sqrt(u)/2}static centroid(t,e,i){const s=(t.x+e.x+i.x)/3,a=(t.y+e.y+i.y)/3;return new y(s,a)}static inCentre(t,e,i){const s=e.distance(i),a=t.distance(i),n=t.distance(e),o=s+a+n,r=(s*t.x+a*e.x+n*i.x)/o,l=(s*t.y+a*e.y+n*i.y)/o;return new y(r,l)}area(){return ee.area(this.p0,this.p1,this.p2)}signedArea(){return ee.signedArea(this.p0,this.p1,this.p2)}interpolateZ(t){if(null===t)throw new s("Supplied point is null.");return ee.interpolateZ(t,this.p0,this.p1,this.p2)}longestSideLength(){return ee.longestSideLength(this.p0,this.p1,this.p2)}isAcute(){return ee.isAcute(this.p0,this.p1,this.p2)}circumcentre(){return ee.circumcentre(this.p0,this.p1,this.p2)}area3D(){return ee.area3D(this.p0,this.p1,this.p2)}centroid(){return ee.centroid(this.p0,this.p1,this.p2)}inCentre(){return ee.inCentre(this.p0,this.p1,this.p2)}}class ie extends i{constructor(){super(),ie.constructor_.apply(this,arguments)}static constructor_(){if(0===arguments.length)i.constructor_.call(this);else if(1===arguments.length){const t=arguments[0];i.constructor_.call(this,t)}}}class se{constructor(){se.constructor_.apply(this,arguments)}static constructor_(){if(this._m00=null,this._m01=null,this._m02=null,this._m10=null,this._m11=null,this._m12=null,0===arguments.length)this.setToIdentity();else if(1===arguments.length){if(arguments[0]instanceof Array){const t=arguments[0];this._m00=t[0],this._m01=t[1],this._m02=t[2],this._m10=t[3],this._m11=t[4],this._m12=t[5]}else if(arguments[0]instanceof se){const t=arguments[0];this.setTransformation(t)}}else if(6===arguments.length&&"number"==typeof arguments[5]&&"number"==typeof arguments[4]&&"number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4],n=arguments[5];this.setTransformation(t,e,i,s,a,n)}}static translationInstance(t,e){const i=new se;return i.setToTranslation(t,e),i}static shearInstance(t,e){const i=new se;return i.setToShear(t,e),i}static reflectionInstance(){if(2===arguments.length){const t=arguments[0],e=arguments[1],i=new se;return i.setToReflection(t,e),i}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=new se;return a.setToReflection(t,e,i,s),a}}static rotationInstance(){if(1===arguments.length){const t=arguments[0];return se.rotationInstance(Math.sin(t),Math.cos(t))}if(2===arguments.length){const t=arguments[0],e=arguments[1],i=new se;return i.setToRotation(t,e),i}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return se.rotationInstance(Math.sin(t),Math.cos(t),e,i)}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=new se;return a.setToRotation(t,e,i,s),a}}static scaleInstance(){if(2===arguments.length){const t=arguments[0],e=arguments[1],i=new se;return i.setToScale(t,e),i}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=new se;return a.translate(-i,-s),a.scale(t,e),a.translate(i,s),a}}setToReflectionBasic(t,e,i,a){if(t===i&&e===a)throw new s("Reflection line points must be distinct");const n=i-t,o=a-e,r=Math.sqrt(n*n+o*o),l=o/r,h=n/r,c=2*l*h,p=h*h-l*l;return this._m00=p,this._m01=c,this._m02=0,this._m10=c,this._m11=-p,this._m12=0,this}getInverse(){const t=this.getDeterminant();if(0===t)throw new ie("Transformation is non-invertible");const e=this._m11/t,i=-this._m10/t,s=-this._m01/t,a=this._m00/t,n=(this._m01*this._m12-this._m02*this._m11)/t,o=(-this._m00*this._m12+this._m10*this._m02)/t;return new se(e,s,n,i,a,o)}compose(t){const e=t._m00*this._m00+t._m01*this._m10,i=t._m00*this._m01+t._m01*this._m11,s=t._m00*this._m02+t._m01*this._m12+t._m02,a=t._m10*this._m00+t._m11*this._m10,n=t._m10*this._m01+t._m11*this._m11,o=t._m10*this._m02+t._m11*this._m12+t._m12;return this._m00=e,this._m01=i,this._m02=s,this._m10=a,this._m11=n,this._m12=o,this}equals(t){if(null===t)return!1;if(!(t instanceof se))return!1;const e=t;return this._m00===e._m00&&this._m01===e._m01&&this._m02===e._m02&&this._m10===e._m10&&this._m11===e._m11&&this._m12===e._m12}setToScale(t,e){return this._m00=t,this._m01=0,this._m02=0,this._m10=0,this._m11=e,this._m12=0,this}isIdentity(){return 1===this._m00&&0===this._m01&&0===this._m02&&0===this._m10&&1===this._m11&&0===this._m12}scale(t,e){return this.compose(se.scaleInstance(t,e)),this}setToIdentity(){return this._m00=1,this._m01=0,this._m02=0,this._m10=0,this._m11=1,this._m12=0,this}isGeometryChanged(){return!0}setTransformation(){if(1===arguments.length){const t=arguments[0];return this._m00=t._m00,this._m01=t._m01,this._m02=t._m02,this._m10=t._m10,this._m11=t._m11,this._m12=t._m12,this}if(6===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4],n=arguments[5];return this._m00=t,this._m01=e,this._m02=i,this._m10=s,this._m11=a,this._m12=n,this}}setToRotation(){if(1===arguments.length){const t=arguments[0];return this.setToRotation(Math.sin(t),Math.cos(t)),this}if(2===arguments.length){const t=arguments[0],e=arguments[1];return this._m00=e,this._m01=-t,this._m02=0,this._m10=t,this._m11=e,this._m12=0,this}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return this.setToRotation(Math.sin(t),Math.cos(t),e,i),this}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];return this._m00=e,this._m01=-t,this._m02=i-i*e+s*t,this._m10=t,this._m11=e,this._m12=s-i*t-s*e,this}}getMatrixEntries(){return[this._m00,this._m01,this._m02,this._m10,this._m11,this._m12]}filter(t,e){this.transform(t,e)}rotate(){if(1===arguments.length){const t=arguments[0];return this.compose(se.rotationInstance(t)),this}if(2===arguments.length){const t=arguments[0],e=arguments[1];return this.compose(se.rotationInstance(t,e)),this}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return this.compose(se.rotationInstance(t,e,i)),this}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];return this.compose(se.rotationInstance(t,e,i,s)),this}}getDeterminant(){return this._m00*this._m11-this._m01*this._m10}composeBefore(t){const e=this._m00*t._m00+this._m01*t._m10,i=this._m00*t._m01+this._m01*t._m11,s=this._m00*t._m02+this._m01*t._m12+this._m02,a=this._m10*t._m00+this._m11*t._m10,n=this._m10*t._m01+this._m11*t._m11,o=this._m10*t._m02+this._m11*t._m12+this._m12;return this._m00=e,this._m01=i,this._m02=s,this._m10=a,this._m11=n,this._m12=o,this}setToShear(t,e){return this._m00=1,this._m01=t,this._m02=0,this._m10=e,this._m11=1,this._m12=0,this}isDone(){return!1}clone(){try{return null}catch(t){if(!(t instanceof i))throw t;u.shouldNeverReachHere()}return null}translate(t,e){return this.compose(se.translationInstance(t,e)),this}setToReflection(){if(2===arguments.length){const t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new s("Reflection vector must be non-zero");if(t===e)return this._m00=0,this._m01=1,this._m02=0,this._m10=1,this._m11=0,this._m12=0,this;const i=Math.sqrt(t*t+e*e),a=e/i,n=t/i;return this.rotate(-a,n),this.scale(1,-1),this.rotate(a,n),this}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],a=arguments[3];if(t===i&&e===a)throw new s("Reflection line points must be distinct");this.setToTranslation(-t,-e);const n=i-t,o=a-e,r=Math.sqrt(n*n+o*o),l=o/r,h=n/r;return this.rotate(-l,h),this.scale(1,-1),this.rotate(l,h),this.translate(t,e),this}}toString(){return"AffineTransformation[["+this._m00+", "+this._m01+", "+this._m02+"], ["+this._m10+", "+this._m11+", "+this._m12+"]]"}setToTranslation(t,e){return this._m00=1,this._m01=0,this._m02=t,this._m10=0,this._m11=1,this._m12=e,this}shear(t,e){return this.compose(se.shearInstance(t,e)),this}transform(){if(1===arguments.length){const t=arguments[0].copy();return t.apply(this),t}if(2===arguments.length){if(arguments[0]instanceof y&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1],i=this._m00*t.x+this._m01*t.y+this._m02,s=this._m10*t.x+this._m11*t.y+this._m12;return e.x=i,e.y=s,e}if(C(arguments[0],R)&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1],i=this._m00*t.getOrdinate(e,0)+this._m01*t.getOrdinate(e,1)+this._m02,s=this._m10*t.getOrdinate(e,0)+this._m11*t.getOrdinate(e,1)+this._m12;t.setOrdinate(e,0,i),t.setOrdinate(e,1,s)}}}reflect(){if(2===arguments.length){const t=arguments[0],e=arguments[1];return this.compose(se.reflectionInstance(t,e)),this}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];return this.compose(se.reflectionInstance(t,e,i,s)),this}}get interfaces_(){return[r,T]}}class ae{static solve(t,e){const i=e.length;if(t.length!==i||t[0].length!==i)throw new s("Matrix A is incorrectly sized");for(let s=0;s<i;s++){let a=s;for(let e=s+1;e<i;e++)Math.abs(t[e][s])>Math.abs(t[a][s])&&(a=e);if(0===t[a][s])return null;ae.swapRows(t,s,a),ae.swapRows(e,s,a);for(let a=s+1;a<i;a++){const n=t[a][s]/t[s][s];for(let e=i-1;e>=s;e--)t[a][e]-=t[s][e]*n;e[a]-=e[s]*n}}const a=new Array(i).fill(null);for(let s=i-1;s>=0;s--){let n=0;for(let e=s+1;e<i;e++)n+=t[s][e]*a[e];a[s]=(e[s]-n)/t[s][s]}return a}static swapRows(){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1],i=arguments[2];if(e===i)return null;for(let s=0;s<t[0].length;s++){const a=t[e][s];t[e][s]=t[i][s],t[i][s]=a}}else if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1],i=arguments[2];if(e===i)return null;const s=t[e];t[e]=t[i],t[i]=s}}}class ne{constructor(){ne.constructor_.apply(this,arguments)}static constructor_(){this._src0=null,this._src1=null,this._src2=null,this._dest0=null,this._dest1=null,this._dest2=null,this._m00=null,this._m01=null,this._m02=null,this._m10=null,this._m11=null,this._m12=null;const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4],n=arguments[5];this._src0=t,this._src1=e,this._src2=i,this._dest0=s,this._dest1=a,this._dest2=n}solve(t){const e=[[this._src0.x,this._src0.y,1],[this._src1.x,this._src1.y,1],[this._src2.x,this._src2.y,1]];return ae.solve(e,t)}compute(){const t=[this._dest0.x,this._dest1.x,this._dest2.x],e=this.solve(t);if(null===e)return!1;this._m00=e[0],this._m01=e[1],this._m02=e[2];const i=[this._dest0.y,this._dest1.y,this._dest2.y],s=this.solve(i);return null!==s&&(this._m10=s[0],this._m11=s[1],this._m12=s[2],!0)}getTransformation(){return this.compute()?new se(this._m00,this._m01,this._m02,this._m10,this._m11,this._m12):null}}class oe{static createFromBaseLines(t,e,i,s){const a=new y(t.x+s.x-i.x,t.y+s.y-i.y),n=Qt.angleBetweenOriented(e,t,a),o=e.distance(t),r=s.distance(i);if(0===o)return new se;const l=r/o,h=se.translationInstance(-t.x,-t.y);return h.rotate(n),h.scale(l,l),h.translate(i.x,i.y),h}static createFromControlVectors(){if(2===arguments.length){if(arguments[0]instanceof y&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1],i=e.x-t.x,s=e.y-t.y;return se.translationInstance(i,s)}if(arguments[0]instanceof Array&&arguments[1]instanceof Array){const t=arguments[0],e=arguments[1];if(t.length!==e.length)throw new s("Src and Dest arrays are not the same length");if(t.length<=0)throw new s("Too few control points");if(t.length>3)throw new s("Too many control points");return 1===t.length?oe.createFromControlVectors(t[0],e[0]):2===t.length?oe.createFromControlVectors(t[0],t[1],e[0],e[1]):oe.createFromControlVectors(t[0],t[1],t[2],e[0],e[1],e[2])}}else{if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=new y(s.x-i.x,s.y-i.y),n=Qt.angleBetweenOriented(e,t,a),o=e.distance(t),r=s.distance(i);if(0===o)return null;const l=r/o,h=se.translationInstance(-t.x,-t.y);return h.rotate(n),h.scale(l,l),h.translate(i.x,i.y),h}if(6===arguments.length)return new ne(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]).getTransformation()}}}class re{constructor(){re.constructor_.apply(this,arguments)}static constructor_(){this._coords=null;const t=arguments[0];this._coords=t}static getCoordinates(t){const e=new S;return t.apply(new re(e)),e}filter(t){(t instanceof Q||t instanceof tt)&&this._coords.add(t.getCoordinate())}get interfaces_(){return[V]}}class le{constructor(){le.constructor_.apply(this,arguments)}static constructor_(){this._mapOp=null;const t=arguments[0];this._mapOp=t}static map(t,e){return new le(e).map(t)}map(t){const e=new S;for(let i=0;i<t.getNumGeometries();i++){const s=this._mapOp.map(t.getGeometryN(i));s.isEmpty()||e.add(s)}return t.getFactory().createGeometryCollection(wt.toGeometryArray(e))}}class he{constructor(){he.constructor_.apply(this,arguments)}static constructor_(){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null;const t=arguments[0];this._geomFactory=he.extractFactory(t),this._inputGeoms=t}static combine(){if(1===arguments.length)return new he(arguments[0]).combine();if(2===arguments.length){const t=arguments[0],e=arguments[1];return new he(he.createList(t,e)).combine()}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return new he(he.createList(t,e,i)).combine()}}static extractFactory(t){return t.isEmpty()?null:t.iterator().next().getFactory()}static createList(){if(2===arguments.length){const t=arguments[0],e=arguments[1],i=new S;return i.add(t),i.add(e),i}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=new S;return s.add(t),s.add(e),s.add(i),s}}extractElements(t,e){if(null===t)return null;for(let i=0;i<t.getNumGeometries();i++){const s=t.getGeometryN(i);this._skipEmpty&&s.isEmpty()||e.add(s)}}combine(){const t=new S;for(let e=this._inputGeoms.iterator();e.hasNext();){const i=e.next();this.extractElements(i,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection():null:this._geomFactory.buildGeometry(t)}}class ce{constructor(){ce.constructor_.apply(this,arguments)}static constructor_(){if(this._factory=null,this._isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){const t=arguments[0];this._factory=t}}setCopyUserData(t){this._isUserDataCopied=t}edit(t,e){if(null===t)return null;const i=this.editInternal(t,e);return this._isUserDataCopied&&i.setUserData(t.getUserData()),i}editInternal(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof ht?this.editGeometryCollection(t,e):t instanceof at?this.editPolygon(t,e):t instanceof tt||t instanceof Q?e.edit(t,this._factory):(u.shouldNeverReachHere("Unsupported Geometry type: "+t.getGeometryType()),null)}editGeometryCollection(t,e){const i=e.edit(t,this._factory),s=new S;for(let t=0;t<i.getNumGeometries();t++){const a=this.edit(i.getGeometryN(t),e);null===a||a.isEmpty()||s.add(a)}return i.getGeometryType()===q.TYPENAME_MULTIPOINT?this._factory.createMultiPoint(s.toArray([])):i.getGeometryType()===q.TYPENAME_MULTILINESTRING?this._factory.createMultiLineString(s.toArray([])):i.getGeometryType()===q.TYPENAME_MULTIPOLYGON?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))}editPolygon(t,e){let i=e.edit(t,this._factory);if(null===i&&(i=this._factory.createPolygon()),i.isEmpty())return i;const s=this.edit(i.getExteriorRing(),e);if(null===s||s.isEmpty())return this._factory.createPolygon();const a=new S;for(let t=0;t<i.getNumInteriorRing();t++){const s=this.edit(i.getInteriorRingN(t),e);null===s||s.isEmpty()||a.add(s)}return this._factory.createPolygon(s,a.toArray([]))}}function pe(){}ce.GeometryEditorOperation=pe,ce.NoOpGeometryOperation=class{edit(t,e){return t}get interfaces_(){return[pe]}},ce.CoordinateOperation=class{edit(t,e){const i=this.edit(t.getCoordinates(),t);return t instanceof pt?null===i?e.createLinearRing():e.createLinearRing(i):t instanceof Q?null===i?e.createLineString():e.createLineString(i):t instanceof tt?null===i||0===i.length?e.createPoint():e.createPoint(i[0]):t}get interfaces_(){return[pe]}},ce.CoordinateSequenceOperation=class{edit(t,e){return t instanceof pt?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Q?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof tt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t}get interfaces_(){return[pe]}};class ue{constructor(){ue.constructor_.apply(this,arguments)}static constructor_(){this._geometryType=null,this._comps=null;const t=arguments[0],e=arguments[1];this._geometryType=t,this._comps=e}static isOfType(t,e){return t.getGeometryType()===e||e===q.TYPENAME_LINESTRING&&t.getGeometryType()===q.TYPENAME_LINEARRING}static extract(){if(2===arguments.length){const t=arguments[0],e=arguments[1];return ue.extract(t,e,new S)}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return t.getGeometryType()===e?i.add(t):t instanceof ht&&t.apply(new ue(e,i)),i}}filter(t){(null===this._geometryType||ue.isOfType(t,this._geometryType))&&this._comps.add(t)}get interfaces_(){return[X]}}class de{static map(){if(arguments[0]instanceof q&&C(arguments[1],me)){const t=arguments[0],e=arguments[1],i=new S;for(let s=0;s<t.getNumGeometries();s++){const a=e.map(t.getGeometryN(s));null!==a&&i.add(a)}return t.getFactory().buildGeometry(i)}if(C(arguments[0],L)&&C(arguments[1],me)){const t=arguments[0],e=arguments[1],i=new S;for(let s=t.iterator();s.hasNext();){const t=s.next(),a=e.map(t);null!==a&&i.add(a)}return i}}}function me(){}de.MapOp=me;class ge{constructor(){ge.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}transformPoint(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))}transformPolygon(t,e){let i=!0;const s=this.transformLinearRing(t.getExteriorRing(),t);null!==s&&s instanceof pt&&!s.isEmpty()||(i=!1);const a=new S;for(let e=0;e<t.getNumInteriorRing();e++){const s=this.transformLinearRing(t.getInteriorRingN(e),t);null===s||s.isEmpty()||(s instanceof pt||(i=!1),a.add(s))}if(i)return this._factory.createPolygon(s,a.toArray([]));{const t=new S;return null!==s&&t.add(s),t.addAll(a),this._factory.buildGeometry(t)}}createCoordinateSequence(t){return this._factory.getCoordinateSequenceFactory().create(t)}getInputGeometry(){return this._inputGeom}transformMultiLineString(t,e){const i=new S;for(let e=0;e<t.getNumGeometries();e++){const s=this.transformLineString(t.getGeometryN(e),t);null!==s&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)}transformCoordinates(t,e){return this.copy(t)}transformLineString(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))}transformMultiPoint(t,e){const i=new S;for(let e=0;e<t.getNumGeometries();e++){const s=this.transformPoint(t.getGeometryN(e),t);null!==s&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)}transformMultiPolygon(t,e){const i=new S;for(let e=0;e<t.getNumGeometries();e++){const s=this.transformPolygon(t.getGeometryN(e),t);null!==s&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)}copy(t){return t.copy()}transformGeometryCollection(t,e){const i=new S;for(let e=0;e<t.getNumGeometries();e++){const s=this.transform(t.getGeometryN(e));null!==s&&(this._pruneEmptyGeometry&&s.isEmpty()||i.add(s))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(wt.toGeometryArray(i)):this._factory.buildGeometry(i)}transform(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof tt)return this.transformPoint(t,null);if(t instanceof ct)return this.transformMultiPoint(t,null);if(t instanceof pt)return this.transformLinearRing(t,null);if(t instanceof Q)return this.transformLineString(t,null);if(t instanceof bt)return this.transformMultiLineString(t,null);if(t instanceof at)return this.transformPolygon(t,null);if(t instanceof ft)return this.transformMultiPolygon(t,null);if(t instanceof ht)return this.transformGeometryCollection(t,null);throw new s("Unknown Geometry subtype: "+t.getGeometryType())}transformLinearRing(t,e){const i=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===i)return this._factory.createLinearRing(null);const s=i.size();return s>0&&s<4&&!this._preserveType?this._factory.createLineString(i):this._factory.createLinearRing(i)}}class ye{constructor(){ye.constructor_.apply(this,arguments)}static constructor_(){this._comps=null;const t=arguments[0];this._comps=t}static getGeometry(t){return t.getFactory().buildGeometry(ye.getLines(t))}static getLines(){if(1===arguments.length){const t=arguments[0];return ye.getLines(t,new S)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return t instanceof Q?e.add(t):t instanceof ht&&t.apply(new ye(e)),e}}filter(t){t instanceof Q&&this._comps.add(t)}get interfaces_(){return[X]}}class fe{constructor(){fe.constructor_.apply(this,arguments)}static constructor_(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){const t=arguments[0];this._lines=t}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._lines=t,this._isForcedToLineString=e}}static getGeometry(){if(1===arguments.length){const t=arguments[0];return t.getFactory().buildGeometry(fe.getLines(t))}if(2===arguments.length){const t=arguments[0],e=arguments[1];return t.getFactory().buildGeometry(fe.getLines(t,e))}}static getLines(){if(1===arguments.length){const t=arguments[0];return fe.getLines(t,!1)}if(2===arguments.length){if(C(arguments[0],L)&&C(arguments[1],L)){const t=arguments[1];for(let e=arguments[0].iterator();e.hasNext();){const i=e.next();fe.getLines(i,t)}return t}if(arguments[0]instanceof q&&"boolean"==typeof arguments[1]){const t=arguments[0],e=arguments[1],i=new S;return t.apply(new fe(i,e)),i}if(arguments[0]instanceof q&&C(arguments[1],L)){const t=arguments[0],e=arguments[1];return t instanceof Q?e.add(t):t.apply(new fe(e)),e}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&C(arguments[0],L)&&C(arguments[1],L)){const t=arguments[1],e=arguments[2];for(let i=arguments[0].iterator();i.hasNext();){const s=i.next();fe.getLines(s,t,e)}return t}if("boolean"==typeof arguments[2]&&arguments[0]instanceof q&&C(arguments[1],L)){const t=arguments[1],e=arguments[2];return arguments[0].apply(new fe(t,e)),t}}}filter(t){if(this._isForcedToLineString&&t instanceof pt){const e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Q&&this._lines.add(t)}setForceToLineString(t){this._isForcedToLineString=t}get interfaces_(){return[V]}}const _e={reverseOrder:function(){return{compare:(t,e)=>e.compareTo(t)}},min:function(t){return _e.sort(t),t.get(0)},sort:function(t,e){const i=t.toArray();e?it.sort(i,e):it.sort(i);const s=t.iterator();for(let t=0,e=i.length;t<e;t++)s.next(),s.set(i[t])},singletonList:function(t){const e=new S;return e.add(t),e}};class ve{constructor(){ve.constructor_.apply(this,arguments)}static constructor_(){this._pts=null;const t=arguments[0];this._pts=t}static getPoints(){if(1===arguments.length){const t=arguments[0];return t instanceof tt?_e.singletonList(t):ve.getPoints(t,new S)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return t instanceof tt?e.add(t):t instanceof ht&&t.apply(new ve(e)),e}}filter(t){t instanceof tt&&this._pts.add(t)}get interfaces_(){return[X]}}class xe{constructor(){xe.constructor_.apply(this,arguments)}static constructor_(){this._comps=null;const t=arguments[0];this._comps=t}static getPolygons(){if(1===arguments.length){const t=arguments[0];return xe.getPolygons(t,new S)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return t instanceof at?e.add(t):t instanceof ht&&t.apply(new xe(e)),e}}filter(t){t instanceof at&&this._comps.add(t)}get interfaces_(){return[X]}}class Ce{constructor(){Ce.constructor_.apply(this,arguments)}static constructor_(){this._isDone=!1}applyTo(t){for(let e=0;e<t.getNumGeometries()&&!this._isDone;e++){const i=t.getGeometryN(e);if(i instanceof ht)this.applyTo(i);else if(this.visit(i),this.isDone())return this._isDone=!0,null}}}class Le{constructor(){Le.constructor_.apply(this,arguments)}static constructor_(){if(this._geomFact=null,this._precModel=null,this._dim=new Me,this._nPts=100,this._rotationAngle=0,0===arguments.length)Le.constructor_.call(this,new wt);else if(1===arguments.length){const t=arguments[0];this._geomFact=t,this._precModel=t.getPrecisionModel()}}createSupercircle(t){const e=1/t,i=this._dim.getMinSize()/2,s=this._dim.getCentre(),a=Math.pow(i,t),n=i,o=Math.pow(a/2,e),r=Math.trunc(this._nPts/8),l=new Array(8*r+1).fill(null),h=o/r;for(let i=0;i<=r;i++){let o=0,c=n;if(0!==i){o=h*i;const s=Math.pow(o,t);c=Math.pow(a-s,e)}l[i]=this.coordTrans(o,c,s),l[2*r-i]=this.coordTrans(c,o,s),l[2*r+i]=this.coordTrans(c,-o,s),l[4*r-i]=this.coordTrans(o,-c,s),l[4*r+i]=this.coordTrans(-o,-c,s),l[6*r-i]=this.coordTrans(-c,-o,s),l[6*r+i]=this.coordTrans(-c,o,s),l[8*r-i]=this.coordTrans(-o,c,s)}l[l.length-1]=new y(l[0]);const c=this._geomFact.createLinearRing(l),p=this._geomFact.createPolygon(c);return this.rotate(p)}setNumPoints(t){this._nPts=t}setBase(t){this._dim.setBase(t)}setRotation(t){this._rotationAngle=t}setWidth(t){this._dim.setWidth(t)}createEllipse(){const t=this._dim.getEnvelope(),e=t.getWidth()/2,i=t.getHeight()/2,s=t.getMinX()+e,a=t.getMinY()+i,n=new Array(this._nPts+1).fill(null);let o=0;for(let t=0;t<this._nPts;t++){const r=t*(2*Math.PI/this._nPts),l=e*Math.cos(r)+s,h=i*Math.sin(r)+a;n[o++]=this.coord(l,h)}n[o]=new y(n[0]);const r=this._geomFact.createLinearRing(n),l=this._geomFact.createPolygon(r);return this.rotate(l)}coordTrans(t,e,i){return this.coord(t+i.x,e+i.y)}createSquircle(){return this.createSupercircle(4)}setEnvelope(t){this._dim.setEnvelope(t)}setCentre(t){this._dim.setCentre(t)}createArc(t,e){const i=this._dim.getEnvelope(),s=i.getWidth()/2,a=i.getHeight()/2,n=i.getMinX()+s,o=i.getMinY()+a;let r=e;(r<=0||r>2*Math.PI)&&(r=2*Math.PI);const l=r/(this._nPts-1),h=new Array(this._nPts).fill(null);let c=0;for(let e=0;e<this._nPts;e++){const i=t+e*l,r=s*Math.cos(i)+n,p=a*Math.sin(i)+o;h[c++]=this.coord(r,p)}const p=this._geomFact.createLineString(h);return this.rotate(p)}rotate(t){if(0!==this._rotationAngle){const e=se.rotationInstance(this._rotationAngle,this._dim.getCentre().x,this._dim.getCentre().y);t.apply(e)}return t}coord(t,e){const i=new y(t,e);return this._precModel.makePrecise(i),i}createArcPolygon(t,e){const i=this._dim.getEnvelope(),s=i.getWidth()/2,a=i.getHeight()/2,n=i.getMinX()+s,o=i.getMinY()+a;let r=e;(r<=0||r>2*Math.PI)&&(r=2*Math.PI);const l=r/(this._nPts-1),h=new Array(this._nPts+2).fill(null);let c=0;h[c++]=this.coord(n,o);for(let e=0;e<this._nPts;e++){const i=t+l*e,r=s*Math.cos(i)+n,p=a*Math.sin(i)+o;h[c++]=this.coord(r,p)}h[c++]=this.coord(n,o);const p=this._geomFact.createLinearRing(h),u=this._geomFact.createPolygon(p);return this.rotate(u)}createRectangle(){let t=null,e=0,i=Math.trunc(this._nPts/4);i<1&&(i=1);const s=this._dim.getEnvelope().getWidth()/i,a=this._dim.getEnvelope().getHeight()/i,n=new Array(4*i+1).fill(null),o=this._dim.getEnvelope();for(t=0;t<i;t++){const i=o.getMinX()+t*s,a=o.getMinY();n[e++]=this.coord(i,a)}for(t=0;t<i;t++){const i=o.getMaxX(),s=o.getMinY()+t*a;n[e++]=this.coord(i,s)}for(t=0;t<i;t++){const i=o.getMaxX()-t*s,a=o.getMaxY();n[e++]=this.coord(i,a)}for(t=0;t<i;t++){const i=o.getMinX(),s=o.getMaxY()-t*a;n[e++]=this.coord(i,s)}n[e++]=new y(n[0]);const r=this._geomFact.createLinearRing(n),l=this._geomFact.createPolygon(r);return this.rotate(l)}createCircle(){return this.createEllipse()}setHeight(t){this._dim.setHeight(t)}setSize(t){this._dim.setSize(t)}}class Me{constructor(){Me.constructor_.apply(this,arguments)}static constructor_(){this.base=null,this.centre=null,this.width=null,this.height=null}setBase(t){this.base=t}setWidth(t){this.width=t}getBase(){return this.base}getWidth(){return this.width}setEnvelope(t){this.width=t.getWidth(),this.height=t.getHeight(),this.base=new y(t.getMinX(),t.getMinY()),this.centre=new y(t.centre())}setCentre(t){this.centre=t}getMinSize(){return Math.min(this.width,this.height)}getEnvelope(){return null!==this.base?new D(this.base.x,this.base.x+this.width,this.base.y,this.base.y+this.height):null!==this.centre?new D(this.centre.x-this.width/2,this.centre.x+this.width/2,this.centre.y-this.height/2,this.centre.y+this.height/2):new D(0,this.width,0,this.height)}getCentre(){return null===this.centre&&(this.centre=new y(this.base.x+this.width/2,this.base.y+this.height/2)),this.centre}getHeight(){return this.height}setHeight(t){this.height=t}setSize(t){this.height=t,this.width=t}}Le.Dimensions=Me;class be extends Le{constructor(){super(),be.constructor_.apply(this,arguments)}static constructor_(){if(this._numArms=8,this._armLengthRatio=.5,0===arguments.length)Le.constructor_.call(this);else if(1===arguments.length){const t=arguments[0];Le.constructor_.call(this,t)}}static create(t,e,i,s,a){const n=new be;return n.setCentre(t),n.setSize(e),n.setNumPoints(i),n.setArmLengthRatio(a),n.setNumArms(s),n.createSineStar()}setNumArms(t){this._numArms=t}setArmLengthRatio(t){this._armLengthRatio=t}createSineStar(){const t=this._dim.getEnvelope(),e=t.getWidth()/2;let i=this._armLengthRatio;i<0&&(i=0),i>1&&(i=1);const s=i*e,a=(1-i)*e,n=t.getMinX()+e,o=t.getMinY()+e,r=new Array(this._nPts+1).fill(null);let l=0;for(let t=0;t<this._nPts;t++){const e=t/this._nPts*this._numArms,i=e-Math.floor(e),h=2*Math.PI*i,c=a+s*((Math.cos(h)+1)/2),p=t*(2*Math.PI/this._nPts),u=c*Math.cos(p)+n,d=c*Math.sin(p)+o;r[l++]=this.coord(u,d)}r[l]=new y(r[0]);const h=this._geomFact.createLinearRing(r);return this._geomFact.createPolygon(h)}}var we=Object.freeze({__proto__:null,AffineTransformation:se,AffineTransformationBuilder:ne,AffineTransformationFactory:oe,ComponentCoordinateExtracter:re,GeometryCollectionMapper:le,GeometryCombiner:he,GeometryEditor:ce,GeometryExtracter:ue,GeometryMapper:de,GeometryTransformer:ge,LineStringExtracter:ye,LinearComponentExtracter:fe,PointExtracter:ve,PolygonExtracter:xe,ShortCircuitedGeometryVisitor:Ce,SineStarFactory:be}),Se=Object.freeze({__proto__:null,Coordinate:y,CoordinateXY:_,CoordinateXYM:v,CoordinateXYZM:x,CoordinateList:E,CoordinateSequenceFilter:T,Envelope:D,LineSegment:Yt,GeometryFactory:wt,Geometry:q,Point:tt,LineString:Q,LinearRing:pt,Polygon:at,GeometryCollection:ht,MultiPoint:ct,MultiLineString:bt,MultiPolygon:ft,Dimension:J,IntersectionMatrix:Xt,PrecisionModel:Lt,Location:Jt,Triangle:ee,util:we});class Ie{constructor(){Ie.constructor_.apply(this,arguments)}static constructor_(){this._pt=[new y,new y],this._distance=n.NaN,this._isNull=!0}getCoordinates(){return this._pt}getCoordinate(t){return this._pt[t]}setMinimum(){if(1===arguments.length){const t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){const t=arguments[0],e=arguments[1];if(this._isNull)return this.initialize(t,e),null;const i=t.distance(e);i<this._distance&&this.initialize(t,e,i)}}initialize(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=i,this._isNull=!1}}toString(){return $t.toLineString(this._pt[0],this._pt[1])}getDistance(){return this._distance}setMaximum(){if(1===arguments.length){const t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){const t=arguments[0],e=arguments[1];if(this._isNull)return this.initialize(t,e),null;const i=t.distance(e);i>this._distance&&this.initialize(t,e,i)}}}class Ee{static computeDistance(){if(arguments[2]instanceof Ie&&arguments[0]instanceof Q&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1],i=arguments[2],s=new Yt,a=t.getCoordinates();for(let t=0;t<a.length-1;t++){s.setCoordinates(a[t],a[t+1]);const n=s.closestPoint(e);i.setMinimum(n,e)}}else if(arguments[2]instanceof Ie&&arguments[0]instanceof at&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1],i=arguments[2];Ee.computeDistance(t.getExteriorRing(),e,i);for(let s=0;s<t.getNumInteriorRing();s++)Ee.computeDistance(t.getInteriorRingN(s),e,i)}else if(arguments[2]instanceof Ie&&arguments[0]instanceof q&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1],i=arguments[2];if(t instanceof Q)Ee.computeDistance(t,e,i);else if(t instanceof at)Ee.computeDistance(t,e,i);else if(t instanceof ht){const s=t;for(let t=0;t<s.getNumGeometries();t++){const a=s.getGeometryN(t);Ee.computeDistance(a,e,i)}}else i.setMinimum(t.getCoordinate(),e)}else if(arguments[2]instanceof Ie&&arguments[0]instanceof Yt&&arguments[1]instanceof y){const t=arguments[1],e=arguments[2],i=arguments[0].closestPoint(t);e.setMinimum(i,t)}}}class Te{constructor(){Te.constructor_.apply(this,arguments)}static constructor_(){this._g0=null,this._g1=null,this._ptDist=new Ie,this._densifyFrac=0;const t=arguments[0],e=arguments[1];this._g0=t,this._g1=e}static distance(){if(2===arguments.length)return new Te(arguments[0],arguments[1]).distance();if(3===arguments.length){const t=arguments[2],e=new Te(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}}getCoordinates(){return this._ptDist.getCoordinates()}setDensifyFraction(t){if(t>1||t<=0)throw new s("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t}compute(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)}distance(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()}computeOrientedDistance(t,e,i){const s=new De(e);if(t.apply(s),i.setMaximum(s.getMaxPointDistance()),this._densifyFrac>0){const s=new Pe(e,this._densifyFrac);t.apply(s),i.setMaximum(s.getMaxPointDistance())}}orientedDistance(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()}}class De{constructor(){De.constructor_.apply(this,arguments)}static constructor_(){this._maxPtDist=new Ie,this._minPtDist=new Ie,this._euclideanDist=new Ee,this._geom=null;const t=arguments[0];this._geom=t}filter(t){this._minPtDist.initialize(),Ee.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}getMaxPointDistance(){return this._maxPtDist}get interfaces_(){return[H]}}class Pe{constructor(){Pe.constructor_.apply(this,arguments)}static constructor_(){this._maxPtDist=new Ie,this._minPtDist=new Ie,this._geom=null,this._numSubSegs=0;const t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))}filter(t,e){if(0===e)return null;const i=t.getCoordinate(e-1),s=t.getCoordinate(e),a=(s.x-i.x)/this._numSubSegs,n=(s.y-i.y)/this._numSubSegs;for(let t=0;t<this._numSubSegs;t++){const e=i.x+t*a,s=i.y+t*n,o=new y(e,s);this._minPtDist.initialize(),Ee.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}}isDone(){return!1}isGeometryChanged(){return!1}getMaxPointDistance(){return this._maxPtDist}get interfaces_(){return[T]}}Te.MaxPointDistanceFilter=De,Te.MaxDensifiedByFractionDistanceFilter=Pe;var Oe=Object.freeze({__proto__:null,DiscreteHausdorffDistance:Te,DistanceToPoint:Ee,PointPairDistance:Ie});class ke{visitItem(t){}}class Ne{locate(t){}}class Ae{constructor(){Ae.constructor_.apply(this,arguments)}static constructor_(){this._min=n.POSITIVE_INFINITY,this._max=n.NEGATIVE_INFINITY}getMin(){return this._min}intersects(t,e){return!(this._min>e||this._max<t)}getMax(){return this._max}toString(){return $t.toLineString(new y(this._min,0),new y(this._max,0))}}Ae.NodeComparator=class{compare(t,e){const i=t,s=e,a=(i._min+i._max)/2,n=(s._min+s._max)/2;return a<n?-1:a>n?1:0}get interfaces_(){return[l]}};class Re extends Ae{constructor(){super(),Re.constructor_.apply(this,arguments)}static constructor_(){this._item=null;const t=arguments[0],e=arguments[1],i=arguments[2];this._min=t,this._max=e,this._item=i}query(t,e,i){if(!this.intersects(t,e))return null;i.visitItem(this._item)}}class Fe extends Ae{constructor(){super(),Fe.constructor_.apply(this,arguments)}static constructor_(){this._node1=null,this._node2=null;const t=arguments[0],e=arguments[1];this._node1=t,this._node2=e,this.buildExtent(this._node1,this._node2)}buildExtent(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)}query(t,e,i){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,i),null!==this._node2&&this._node2.query(t,e,i)}}class Be{constructor(){Be.constructor_.apply(this,arguments)}static constructor_(){this._leaves=new S,this._root=null,this._level=0}buildTree(){_e.sort(this._leaves,new Ae.NodeComparator);let t=this._leaves,e=null,i=new S;for(;;){if(this.buildLevel(t,i),1===i.size())return i.get(0);e=t,t=i,i=e}}insert(t,e,i){if(null!==this._root)throw new IllegalStateException("Index cannot be added to once it has been queried");this._leaves.add(new Re(t,e,i))}query(t,e,i){if(this.init(),null===this._root)return null;this._root.query(t,e,i)}buildRoot(){if(null!==this._root)return null;this._root=this.buildTree()}printNode(t){G.out.println($t.toLineString(new y(t._min,this._level),new y(t._max,this._level)))}init(){return null!==this._root||0===this._leaves.size()?null:void this.buildRoot()}buildLevel(t,e){this._level++,e.clear();for(let i=0;i<t.size();i+=2){const s=t.get(i);if(null===(i+1<t.size()?t.get(i):null))e.add(s);else{const s=new Fe(t.get(i),t.get(i+1));e.add(s)}}}}class Ge{constructor(){Ge.constructor_.apply(this,arguments)}static constructor_(){this._items=new S}visitItem(t){this._items.add(t)}getItems(){return this._items}get interfaces_(){return[ke]}}class ze{constructor(){ze.constructor_.apply(this,arguments)}static constructor_(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;const t=arguments[0];this._p=t}static locatePointInRing(){if(arguments[0]instanceof y&&C(arguments[1],R)){const t=arguments[1],e=new ze(arguments[0]),i=new y,s=new y;for(let a=1;a<t.size();a++)if(t.getCoordinate(a,i),t.getCoordinate(a-1,s),e.countSegment(i,s),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof y&&arguments[1]instanceof Array){const t=arguments[1],e=new ze(arguments[0]);for(let i=1;i<t.length;i++){const s=t[i],a=t[i-1];if(e.countSegment(s,a),e.isOnSegment())return e.getLocation()}return e.getLocation()}}countSegment(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){let i=t.x,s=e.x;return i>s&&(i=e.x,s=t.x),this._p.x>=i&&this._p.x<=s&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){let i=F.index(t,e,this._p);if(i===F.COLLINEAR)return this._isPointOnSegment=!0,null;e.y<t.y&&(i=-i),i===F.LEFT&&this._crossingCount++}}isPointInPolygon(){return this.getLocation()!==Jt.EXTERIOR}getLocation(){return this._isPointOnSegment?Jt.BOUNDARY:this._crossingCount%2==1?Jt.INTERIOR:Jt.EXTERIOR}isOnSegment(){return this._isPointOnSegment}}class je{constructor(){je.constructor_.apply(this,arguments)}static constructor_(){this._geom=null,this._index=null;const t=arguments[0];if(!(C(t,st)||t instanceof pt))throw new s("Argument must be Polygonal or LinearRing");this._geom=t}locate(t){null===this._index&&(this._index=new Ve(this._geom),this._geom=null);const e=new ze(t),i=new Ue(e);return this._index.query(t.y,t.y,i),e.getLocation()}get interfaces_(){return[Ne]}}class Ue{constructor(){Ue.constructor_.apply(this,arguments)}static constructor_(){this._counter=null;const t=arguments[0];this._counter=t}visitItem(t){const e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))}get interfaces_(){return[ke]}}class Ve{constructor(){Ve.constructor_.apply(this,arguments)}static constructor_(){this._isEmpty=!1,this._index=new Be;const t=arguments[0];t.isEmpty()?this._isEmpty=!0:this.init(t)}init(t){for(let e=fe.getLines(t).iterator();e.hasNext();){const t=e.next().getCoordinates();this.addLine(t)}}addLine(t){for(let e=1;e<t.length;e++){const i=new Yt(t[e-1],t[e]),s=Math.min(i.p0.y,i.p1.y),a=Math.max(i.p0.y,i.p1.y);this._index.insert(s,a,i)}}query(){if(2===arguments.length){const t=arguments[0],e=arguments[1];if(this._isEmpty)return new S;const i=new Ge;return this._index.query(t,e,i),i.getItems()}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];if(this._isEmpty)return null;this._index.query(t,e,i)}}}je.SegmentVisitor=Ue,je.IntervalIndexedGeometry=Ve;class qe{static isOnLine(){if(arguments[0]instanceof y&&C(arguments[1],R)){const t=arguments[0],e=arguments[1],i=new Kt,s=new y,a=new y,n=e.size();for(let o=1;o<n;o++)if(e.getCoordinate(o-1,s),e.getCoordinate(o,a),i.computeIntersection(t,s,a),i.hasIntersection())return!0;return!1}if(arguments[0]instanceof y&&arguments[1]instanceof Array){const t=arguments[0],e=arguments[1],i=new Kt;for(let s=1;s<e.length;s++){const a=e[s-1],n=e[s];if(i.computeIntersection(t,a,n),i.hasIntersection())return!0}return!1}}static locateInRing(t,e){return ze.locatePointInRing(t,e)}static isInRing(t,e){return qe.locateInRing(t,e)!==Jt.EXTERIOR}}class He{hasNext(){}next(){}remove(){}}class $e{constructor(){$e.constructor_.apply(this,arguments)}static constructor_(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;const t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()}static isAtomic(t){return!(t instanceof ht)}next(){if(this._atStart)return this._atStart=!1,$e.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new w;const t=this._parent.getGeometryN(this._index++);return t instanceof ht?(this._subcollectionIterator=new $e(t),this._subcollectionIterator.next()):t}remove(){throw new Y(this.getClass().getName())}hasNext(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}get interfaces_(){return[He]}}class We{constructor(){We.constructor_.apply(this,arguments)}static constructor_(){this._geom=null;const t=arguments[0];this._geom=t}static locatePointInPolygon(t,e){if(e.isEmpty())return Jt.EXTERIOR;const i=e.getExteriorRing(),s=We.locatePointInRing(t,i);if(s!==Jt.INTERIOR)return s;for(let i=0;i<e.getNumInteriorRing();i++){const s=e.getInteriorRingN(i),a=We.locatePointInRing(t,s);if(a===Jt.BOUNDARY)return Jt.BOUNDARY;if(a===Jt.INTERIOR)return Jt.EXTERIOR}return Jt.INTERIOR}static locatePointInRing(t,e){return e.getEnvelopeInternal().intersects(t)?qe.locateInRing(t,e.getCoordinates()):Jt.EXTERIOR}static containsPointInPolygon(t,e){return Jt.EXTERIOR!==We.locatePointInPolygon(t,e)}static locateInGeometry(t,e){if(e instanceof at)return We.locatePointInPolygon(t,e);if(e instanceof ht){const i=new $e(e);for(;i.hasNext();){const s=i.next();if(s!==e){const e=We.locateInGeometry(t,s);if(e!==Jt.EXTERIOR)return e}}}return Jt.EXTERIOR}static isContained(t,e){return Jt.EXTERIOR!==We.locate(t,e)}static locate(t,e){return e.isEmpty()?Jt.EXTERIOR:e.getEnvelopeInternal().intersects(t)?We.locateInGeometry(t,e):Jt.EXTERIOR}locate(t){return We.locate(t,this._geom)}get interfaces_(){return[Ne]}}var Ke=Object.freeze({__proto__:null,IndexedPointInAreaLocator:je,PointOnGeometryLocator:Ne,SimplePointInAreaLocator:We});class Ye{measure(t,e){}}class Je{static diagonalSize(t){if(t.isNull())return 0;const e=t.getWidth(),i=t.getHeight();return Math.sqrt(e*e+i*i)}measure(t,e){const i=Te.distance(t,e,Je.DENSIFY_FRACTION),s=new D(t.getEnvelopeInternal());return s.expandToInclude(e.getEnvelopeInternal()),1-i/Je.diagonalSize(s)}get interfaces_(){return[Ye]}}Je.DENSIFY_FRACTION=.25;var Xe=Object.freeze({__proto__:null,AreaSimilarityMeasure:class{measure(t,e){return t.intersection(e).getArea()/t.union(e).getArea()}get interfaces_(){return[Ye]}},HausdorffSimilarityMeasure:Je,SimilarityMeasure:Ye,SimilarityMeasureCombiner:class{static combine(t,e){return Math.min(t,e)}}});class Qe{constructor(){Qe.constructor_.apply(this,arguments)}static constructor_(){this._areaBasePt=null,this._triangleCent3=new y,this._areasum2=0,this._cg3=new y,this._lineCentSum=new y,this._totalLength=0,this._ptCount=0,this._ptCentSum=new y;const t=arguments[0];this._areaBasePt=null,this.add(t)}static area2(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)}static centroid3(t,e,i,s){return s.x=t.x+e.x+i.x,s.y=t.y+e.y+i.y,null}static getCentroid(t){return new Qe(t).getCentroid()}setAreaBasePoint(t){this._areaBasePt=t}addPoint(t){this._ptCount+=1,this._ptCentSum.x+=t.x,this._ptCentSum.y+=t.y}addLineSegments(t){let e=0;for(let i=0;i<t.length-1;i++){const s=t[i].distance(t[i+1]);if(0===s)continue;e+=s;const a=(t[i].x+t[i+1].x)/2;this._lineCentSum.x+=s*a;const n=(t[i].y+t[i+1].y)/2;this._lineCentSum.y+=s*n}this._totalLength+=e,0===e&&t.length>0&&this.addPoint(t[0])}addHole(t){const e=F.isCCW(t);for(let i=0;i<t.length-1;i++)this.addTriangle(this._areaBasePt,t[i],t[i+1],e);this.addLineSegments(t)}getCentroid(){const t=new y;if(Math.abs(this._areasum2)>0)t.x=this._cg3.x/3/this._areasum2,t.y=this._cg3.y/3/this._areasum2;else if(this._totalLength>0)t.x=this._lineCentSum.x/this._totalLength,t.y=this._lineCentSum.y/this._totalLength;else{if(!(this._ptCount>0))return null;t.x=this._ptCentSum.x/this._ptCount,t.y=this._ptCentSum.y/this._ptCount}return t}addShell(t){t.length>0&&this.setAreaBasePoint(t[0]);const e=!F.isCCW(t);for(let i=0;i<t.length-1;i++)this.addTriangle(this._areaBasePt,t[i],t[i+1],e);this.addLineSegments(t)}addTriangle(t,e,i,s){const a=s?1:-1;Qe.centroid3(t,e,i,this._triangleCent3);const n=Qe.area2(t,e,i);this._cg3.x+=a*n*this._triangleCent3.x,this._cg3.y+=a*n*this._triangleCent3.y,this._areasum2+=a*n}add(){if(arguments[0]instanceof at){const t=arguments[0];this.addShell(t.getExteriorRing().getCoordinates());for(let e=0;e<t.getNumInteriorRing();e++)this.addHole(t.getInteriorRingN(e).getCoordinates())}else if(arguments[0]instanceof q){const t=arguments[0];if(t.isEmpty())return null;if(t instanceof tt)this.addPoint(t.getCoordinate());else if(t instanceof Q)this.addLineSegments(t.getCoordinates());else if(t instanceof at){const e=t;this.add(e)}else if(t instanceof ht){const e=t;for(let t=0;t<e.getNumGeometries();t++)this.add(e.getGeometryN(t))}}}}class Ze extends i{constructor(t){super(t),this.name=Object.keys({EmptyStackException:Ze})[0]}}class ti extends b{constructor(){super(),this.array=[]}add(t){return this.array.push(t),!0}get(t){if(t<0||t>=this.size())throw new M;return this.array[t]}push(t){return this.array.push(t),t}pop(){if(0===this.array.length)throw new Ze;return this.array.pop()}peek(){if(0===this.array.length)throw new Ze;return this.array[this.array.length-1]}empty(){return 0===this.array.length}isEmpty(){return this.empty()}search(t){return this.array.indexOf(t)}size(){return this.array.length}toArray(){return this.array.slice()}}class ei{constructor(){ei.constructor_.apply(this,arguments)}static constructor_(){this._coordSet=new vt,this._list=new S}static filterCoordinates(t){const e=new ei;for(let i=0;i<t.length;i++)e.filter(t[i]);return e.getCoordinates()}filter(t){this._coordSet.add(t)&&this._list.add(t)}getCoordinates(){const t=new Array(this._list.size()).fill(null);return this._list.toArray(t)}get interfaces_(){return[H]}}class ii{constructor(){ii.constructor_.apply(this,arguments)}static constructor_(){if(this._geomFactory=null,this._inputPts=null,1===arguments.length){const t=arguments[0];ii.constructor_.call(this,ii.extractCoordinates(t),t.getFactory())}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._inputPts=ei.filterCoordinates(t),this._geomFactory=e}}static extractCoordinates(t){const e=new ei;return t.apply(e),e.getCoordinates()}preSort(t){let e=null;for(let i=1;i<t.length;i++)(t[i].y<t[0].y||t[i].y===t[0].y&&t[i].x<t[0].x)&&(e=t[0],t[0]=t[i],t[i]=e);return it.sort(t,1,t.length,new si(t[0])),t}computeOctRing(t){const e=this.computeOctPts(t),i=new E;return i.add(e,!1),i.size()<3?null:(i.closeRing(),i.toCoordinateArray())}lineOrPolygon(t){if(3===(t=this.cleanRing(t)).length)return this._geomFactory.createLineString([t[0],t[1]]);const e=this._geomFactory.createLinearRing(t);return this._geomFactory.createPolygon(e)}cleanRing(t){u.equals(t[0],t[t.length-1]);const e=new S;let i=null;for(let s=0;s<=t.length-2;s++){const a=t[s],n=t[s+1];a.equals(n)||null!==i&&this.isBetween(i,a,n)||(e.add(a),i=a)}e.add(t[t.length-1]);const s=new Array(e.size()).fill(null);return e.toArray(s)}isBetween(t,e,i){if(0!==F.index(t,e,i))return!1;if(t.x!==i.x){if(t.x<=e.x&&e.x<=i.x)return!0;if(i.x<=e.x&&e.x<=t.x)return!0}if(t.y!==i.y){if(t.y<=e.y&&e.y<=i.y)return!0;if(i.y<=e.y&&e.y<=t.y)return!0}return!1}reduce(t){const e=this.computeOctRing(t);if(null===e)return t;const i=new rt;for(let t=0;t<e.length;t++)i.add(e[t]);for(let s=0;s<t.length;s++)qe.isInRing(t[s],e)||i.add(t[s]);const s=dt.toCoordinateArray(i);return s.length<3?this.padArray3(s):s}getConvexHull(){if(0===this._inputPts.length)return this._geomFactory.createGeometryCollection();if(1===this._inputPts.length)return this._geomFactory.createPoint(this._inputPts[0]);if(2===this._inputPts.length)return this._geomFactory.createLineString(this._inputPts);let t=this._inputPts;this._inputPts.length>50&&(t=this.reduce(this._inputPts));const e=this.preSort(t),i=this.grahamScan(e),s=this.toCoordinateArray(i);return this.lineOrPolygon(s)}padArray3(t){const e=new Array(3).fill(null);for(let i=0;i<e.length;i++)i<t.length?e[i]=t[i]:e[i]=t[0];return e}computeOctPts(t){const e=new Array(8).fill(null);for(let i=0;i<e.length;i++)e[i]=t[0];for(let i=1;i<t.length;i++)t[i].x<e[0].x&&(e[0]=t[i]),t[i].x-t[i].y<e[1].x-e[1].y&&(e[1]=t[i]),t[i].y>e[2].y&&(e[2]=t[i]),t[i].x+t[i].y>e[3].x+e[3].y&&(e[3]=t[i]),t[i].x>e[4].x&&(e[4]=t[i]),t[i].x-t[i].y>e[5].x-e[5].y&&(e[5]=t[i]),t[i].y<e[6].y&&(e[6]=t[i]),t[i].x+t[i].y<e[7].x+e[7].y&&(e[7]=t[i]);return e}toCoordinateArray(t){const e=new Array(t.size()).fill(null);for(let i=0;i<t.size();i++){const s=t.get(i);e[i]=s}return e}grahamScan(t){let e=null;const i=new ti;i.push(t[0]),i.push(t[1]),i.push(t[2]);for(let s=3;s<t.length;s++){for(e=i.pop();!i.empty()&&F.index(i.peek(),e,t[s])>0;)e=i.pop();i.push(e),i.push(t[s])}return i.push(t[0]),i}}class si{constructor(){si.constructor_.apply(this,arguments)}static constructor_(){this._origin=null;const t=arguments[0];this._origin=t}static polarCompare(t,e,i){const s=e.x-t.x,a=e.y-t.y,n=i.x-t.x,o=i.y-t.y,r=F.index(t,e,i);if(r===F.COUNTERCLOCKWISE)return 1;if(r===F.CLOCKWISE)return-1;const l=s*s+a*a,h=n*n+o*o;return l<h?-1:l>h?1:0}compare(t,e){const i=t,s=e;return si.polarCompare(this._origin,i,s)}get interfaces_(){return[l]}}ii.RadialComparator=si;class ai{constructor(){ai.constructor_.apply(this,arguments)}static constructor_(){this._interiorPoint=null,this._maxWidth=-1;const t=arguments[0];this.process(t)}static getInteriorPoint(t){return new ai(t).getInteriorPoint()}static avg(t,e){return(t+e)/2}getInteriorPoint(){return this._interiorPoint}process(t){if(t.isEmpty())return null;if(t instanceof at)this.processPolygon(t);else if(t instanceof ht){const e=t;for(let t=0;t<e.getNumGeometries();t++)this.process(e.getGeometryN(t))}}processPolygon(t){const e=new ni(t);e.process();const i=e.getWidth();i>this._maxWidth&&(this._maxWidth=i,this._interiorPoint=e.getInteriorPoint())}}class ni{constructor(){ni.constructor_.apply(this,arguments)}static constructor_(){this._polygon=null,this._interiorPointY=null,this._interiorSectionWidth=0,this._interiorPoint=null;const t=arguments[0];this._polygon=t,this._interiorPointY=ri.getScanLineY(t)}static isEdgeCrossingCounted(t,e,i){const s=t.getY(),a=e.getY();return!(s===a||s===i&&a<i||a===i&&s<i)}static intersectsHorizontalLine(){if(2===arguments.length){const t=arguments[0],e=arguments[1];return!(e<t.getMinY()||e>t.getMaxY())}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return!(t.getY()>i&&e.getY()>i||t.getY()<i&&e.getY()<i)}}static intersection(t,e,i){const s=t.getX(),a=e.getX();if(s===a)return s;const n=a-s,o=(e.getY()-t.getY())/n;return s+(i-t.getY())/o}findBestMidpoint(t){if(0===t.size())return null;u.isTrue(0==t.size()%2,"Interior Point robustness failure: odd number of scanline crossings"),t.sort(new oi);for(let e=0;e<t.size();e+=2){const i=t.get(e),s=t.get(e+1),a=s-i;if(a>this._interiorSectionWidth){this._interiorSectionWidth=a;const t=ai.avg(i,s);this._interiorPoint=new y(t,this._interiorPointY)}}}process(){if(this._polygon.isEmpty())return null;this._interiorPoint=new y(this._polygon.getCoordinate());const t=new S;this.scanRing(this._polygon.getExteriorRing(),t);for(let e=0;e<this._polygon.getNumInteriorRing();e++)this.scanRing(this._polygon.getInteriorRingN(e),t);this.findBestMidpoint(t)}scanRing(t,e){if(!ni.intersectsHorizontalLine(t.getEnvelopeInternal(),this._interiorPointY))return null;const i=t.getCoordinateSequence();for(let t=1;t<i.size();t++){const s=i.getCoordinate(t-1),a=i.getCoordinate(t);this.addEdgeCrossing(s,a,this._interiorPointY,e)}}getWidth(){return this._interiorSectionWidth}getInteriorPoint(){return this._interiorPoint}addEdgeCrossing(t,e,i,s){if(!ni.intersectsHorizontalLine(t,e,i))return null;if(!ni.isEdgeCrossingCounted(t,e,i))return null;const a=ni.intersection(t,e,i);s.add(a)}}class oi{compare(t,e){return t<e?-1:t>e?1:0}get interfaces_(){return[l]}}ni.DoubleComparator=oi;class ri{constructor(){ri.constructor_.apply(this,arguments)}static constructor_(){this._poly=null,this._centreY=null,this._hiY=n.MAX_VALUE,this._loY=-n.MAX_VALUE;const t=arguments[0];this._poly=t,this._hiY=t.getEnvelopeInternal().getMaxY(),this._loY=t.getEnvelopeInternal().getMinY(),this._centreY=ai.avg(this._loY,this._hiY)}static getScanLineY(t){return new ri(t).getScanLineY()}updateInterval(t){t<=this._centreY?t>this._loY&&(this._loY=t):t>this._centreY&&t<this._hiY&&(this._hiY=t)}getScanLineY(){this.process(this._poly.getExteriorRing());for(let t=0;t<this._poly.getNumInteriorRing();t++)this.process(this._poly.getInteriorRingN(t));return ai.avg(this._hiY,this._loY)}process(t){const e=t.getCoordinateSequence();for(let t=0;t<e.size();t++){const i=e.getY(t);this.updateInterval(i)}}}ai.InteriorPointPolygon=ni,ai.ScanLineYOrdinateFinder=ri;class li{constructor(){li.constructor_.apply(this,arguments)}static constructor_(){this._centroid=null,this._minDistance=n.MAX_VALUE,this._interiorPoint=null;const t=arguments[0];t.isEmpty()?this._centroid=null:(this._centroid=Qe.getCentroid(t),t.getPrecisionModel().makePrecise(this._centroid)),this.addInterior(t),null===this._interiorPoint&&this.addEndpoints(t)}static getInteriorPoint(t){return new li(t).getInteriorPoint()}addEndpoints(){if(arguments[0]instanceof q){const t=arguments[0];if(t instanceof Q)this.addEndpoints(t.getCoordinates());else if(t instanceof ht){const e=t;for(let t=0;t<e.getNumGeometries();t++)this.addEndpoints(e.getGeometryN(t))}}else if(arguments[0]instanceof Array){const t=arguments[0];this.add(t[0]),this.add(t[t.length-1])}}getInteriorPoint(){return this._interiorPoint}addInterior(){if(arguments[0]instanceof q){const t=arguments[0];if(t instanceof Q)this.addInterior(t.getCoordinates());else if(t instanceof ht){const e=t;for(let t=0;t<e.getNumGeometries();t++)this.addInterior(e.getGeometryN(t))}}else if(arguments[0]instanceof Array){const t=arguments[0];for(let e=1;e<t.length-1;e++)this.add(t[e])}}add(t){const e=t.distance(this._centroid);e<this._minDistance&&(this._interiorPoint=new y(t),this._minDistance=e)}}class hi{constructor(){hi.constructor_.apply(this,arguments)}static constructor_(){this._centroid=null,this._minDistance=n.MAX_VALUE,this._interiorPoint=null;const t=arguments[0];this._centroid=Qe.getCentroid(t),this.add(t)}static getInteriorPoint(t){return new hi(t).getInteriorPoint()}getInteriorPoint(){return this._interiorPoint}add(){if(arguments[0]instanceof q){const t=arguments[0];if(t instanceof tt)this.add(t.getCoordinate());else if(t instanceof ht){const e=t;for(let t=0;t<e.getNumGeometries();t++)this.add(e.getGeometryN(t))}}else if(arguments[0]instanceof y){const t=arguments[0],e=t.distance(this._centroid);e<this._minDistance&&(this._interiorPoint=new y(t),this._minDistance=e)}}}class ci{isInBoundary(t){}}class pi{isInBoundary(t){return t%2==1}get interfaces_(){return[ci]}}class ui{isInBoundary(t){return t>0}get interfaces_(){return[ci]}}class di{isInBoundary(t){return t>1}get interfaces_(){return[ci]}}class mi{isInBoundary(t){return 1===t}get interfaces_(){return[ci]}}ci.Mod2BoundaryNodeRule=pi,ci.EndPointBoundaryNodeRule=ui,ci.MultiValentEndPointBoundaryNodeRule=di,ci.MonoValentEndPointBoundaryNodeRule=mi,ci.MOD2_BOUNDARY_RULE=new pi,ci.ENDPOINT_BOUNDARY_RULE=new ui,ci.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new di,ci.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new mi,ci.OGC_SFS_BOUNDARY_RULE=ci.MOD2_BOUNDARY_RULE;class gi{constructor(){gi.constructor_.apply(this,arguments)}static constructor_(){if(this._boundaryRule=ci.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){const t=arguments[0];if(null===t)throw new s("Rule must be non-null");this._boundaryRule=t}}locateInPolygonRing(t,e){return e.getEnvelopeInternal().intersects(t)?qe.locateInRing(t,e.getCoordinates()):Jt.EXTERIOR}intersects(t,e){return this.locate(t,e)!==Jt.EXTERIOR}updateLocationInfo(t){t===Jt.INTERIOR&&(this._isIn=!0),t===Jt.BOUNDARY&&this._numBoundaries++}computeLocation(t,e){if(e instanceof tt&&this.updateLocationInfo(this.locateOnPoint(t,e)),e instanceof Q)this.updateLocationInfo(this.locateOnLineString(t,e));else if(e instanceof at)this.updateLocationInfo(this.locateInPolygon(t,e));else if(e instanceof bt){const i=e;for(let e=0;e<i.getNumGeometries();e++){const s=i.getGeometryN(e);this.updateLocationInfo(this.locateOnLineString(t,s))}}else if(e instanceof ft){const i=e;for(let e=0;e<i.getNumGeometries();e++){const s=i.getGeometryN(e);this.updateLocationInfo(this.locateInPolygon(t,s))}}else if(e instanceof ht){const i=new $e(e);for(;i.hasNext();){const s=i.next();s!==e&&this.computeLocation(t,s)}}}locateOnPoint(t,e){return e.getCoordinate().equals2D(t)?Jt.INTERIOR:Jt.EXTERIOR}locateOnLineString(t,e){if(!e.getEnvelopeInternal().intersects(t))return Jt.EXTERIOR;const i=e.getCoordinateSequence();return e.isClosed()||!t.equals(i.getCoordinate(0))&&!t.equals(i.getCoordinate(i.size()-1))?qe.isOnLine(t,i)?Jt.INTERIOR:Jt.EXTERIOR:Jt.BOUNDARY}locateInPolygon(t,e){if(e.isEmpty())return Jt.EXTERIOR;const i=e.getExteriorRing(),s=this.locateInPolygonRing(t,i);if(s===Jt.EXTERIOR)return Jt.EXTERIOR;if(s===Jt.BOUNDARY)return Jt.BOUNDARY;for(let i=0;i<e.getNumInteriorRing();i++){const s=e.getInteriorRingN(i),a=this.locateInPolygonRing(t,s);if(a===Jt.INTERIOR)return Jt.EXTERIOR;if(a===Jt.BOUNDARY)return Jt.BOUNDARY}return Jt.INTERIOR}locate(t,e){return e.isEmpty()?Jt.EXTERIOR:e instanceof Q?this.locateOnLineString(t,e):e instanceof at?this.locateInPolygon(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?Jt.BOUNDARY:this._numBoundaries>0||this._isIn?Jt.INTERIOR:Jt.EXTERIOR)}}class yi{constructor(){yi.constructor_.apply(this,arguments)}static constructor_(){this._input=null,this._extremalPts=null,this._centre=null,this._radius=0;const t=arguments[0];this._input=t}static farthestPoints(t){const e=t[0].distance(t[1]),i=t[1].distance(t[2]),s=t[2].distance(t[0]);return e>=i&&e>=s?[t[0],t[1]]:i>=e&&i>=s?[t[1],t[2]]:[t[2],t[0]]}static pointWitMinAngleWithX(t,e){let i=n.MAX_VALUE,s=null;for(let a=0;a<t.length;a++){const n=t[a];if(n===e)continue;const o=n.x-e.x;let r=n.y-e.y;r<0&&(r=-r);const l=r/Math.sqrt(o*o+r*r);l<i&&(i=l,s=n)}return s}static lowestPoint(t){let e=t[0];for(let i=1;i<t.length;i++)t[i].y<e.y&&(e=t[i]);return e}static pointWithMinAngleWithSegment(t,e,i){let s=n.MAX_VALUE,a=null;for(let n=0;n<t.length;n++){const o=t[n];if(o===e)continue;if(o===i)continue;const r=Qt.angleBetween(e,o,i);r<s&&(s=r,a=o)}return a}getRadius(){return this.compute(),this._radius}getDiameter(){switch(this.compute(),this._extremalPts.length){case 0:return this._input.getFactory().createLineString();case 1:return this._input.getFactory().createPoint(this._centre)}const t=this._extremalPts[0],e=this._extremalPts[1];return this._input.getFactory().createLineString([t,e])}getExtremalPoints(){return this.compute(),this._extremalPts}computeCirclePoints(){if(this._input.isEmpty())return this._extremalPts=new Array(0).fill(null),null;if(1===this._input.getNumPoints()){const t=this._input.getCoordinates();return this._extremalPts=[new y(t[0])],null}const t=this._input.convexHull().getCoordinates();let e=t;if(t[0].equals2D(t[t.length-1])&&(e=new Array(t.length-1).fill(null),dt.copyDeep(t,0,e,0,t.length-1)),e.length<=2)return this._extremalPts=dt.copyDeep(e),null;let i=yi.lowestPoint(e),s=yi.pointWitMinAngleWithX(e,i);for(let t=0;t<e.length;t++){const t=yi.pointWithMinAngleWithSegment(e,i,s);if(Qt.isObtuse(i,t,s))return this._extremalPts=[new y(i),new y(s)],null;if(Qt.isObtuse(t,i,s))i=t;else{if(!Qt.isObtuse(t,s,i))return this._extremalPts=[new y(i),new y(s),new y(t)],null;s=t}}u.shouldNeverReachHere("Logic failure in Minimum Bounding Circle algorithm!")}compute(){if(null!==this._extremalPts)return null;this.computeCirclePoints(),this.computeCentre(),null!==this._centre&&(this._radius=this._centre.distance(this._extremalPts[0]))}getCircle(){if(this.compute(),null===this._centre)return this._input.getFactory().createPolygon();const t=this._input.getFactory().createPoint(this._centre);return 0===this._radius?t:t.buffer(this._radius)}getCentre(){return this.compute(),this._centre}getMaximumDiameter(){switch(this.compute(),this._extremalPts.length){case 0:return this._input.getFactory().createLineString();case 1:return this._input.getFactory().createPoint(this._centre);case 2:return this._input.getFactory().createLineString([this._extremalPts[0],this._extremalPts[1]]);default:const t=yi.farthestPoints(this._extremalPts);return this._input.getFactory().createLineString(t)}}computeCentre(){switch(this._extremalPts.length){case 0:this._centre=null;break;case 1:this._centre=this._extremalPts[0];break;case 2:this._centre=new y((this._extremalPts[0].x+this._extremalPts[1].x)/2,(this._extremalPts[0].y+this._extremalPts[1].y)/2);break;case 3:this._centre=ee.circumcentre(this._extremalPts[0],this._extremalPts[1],this._extremalPts[2])}}}class fi{constructor(){fi.constructor_.apply(this,arguments)}static constructor_(){if(this._inputGeom=null,this._isConvex=null,this._convexHullPts=null,this._minBaseSeg=new Yt,this._minWidthPt=null,this._minPtIndex=null,this._minWidth=0,1===arguments.length){const t=arguments[0];fi.constructor_.call(this,t,!1)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._inputGeom=t,this._isConvex=e}}static nextIndex(t,e){return++e>=t.length&&(e=0),e}static computeC(t,e,i){return t*i.y-e*i.x}static getMinimumDiameter(t){return new fi(t).getDiameter()}static getMinimumRectangle(t){return new fi(t).getMinimumRectangle()}static computeSegmentForLine(t,e,i){let s=null,a=null;return Math.abs(e)>Math.abs(t)?(s=new y(0,i/e),a=new y(1,i/e-t/e)):(s=new y(i/t,0),a=new y(i/t-e/t,1)),new Yt(s,a)}getWidthCoordinate(){return this.computeMinimumDiameter(),this._minWidthPt}getSupportingSegment(){return this.computeMinimumDiameter(),this._inputGeom.getFactory().createLineString([this._minBaseSeg.p0,this._minBaseSeg.p1])}getDiameter(){if(this.computeMinimumDiameter(),null===this._minWidthPt)return this._inputGeom.getFactory().createLineString();const t=this._minBaseSeg.project(this._minWidthPt);return this._inputGeom.getFactory().createLineString([t,this._minWidthPt])}computeWidthConvex(t){this._convexHullPts=t instanceof at?t.getExteriorRing().getCoordinates():t.getCoordinates(),0===this._convexHullPts.length?(this._minWidth=0,this._minWidthPt=null,this._minBaseSeg=null):1===this._convexHullPts.length?(this._minWidth=0,this._minWidthPt=this._convexHullPts[0],this._minBaseSeg.p0=this._convexHullPts[0],this._minBaseSeg.p1=this._convexHullPts[0]):2===this._convexHullPts.length||3===this._convexHullPts.length?(this._minWidth=0,this._minWidthPt=this._convexHullPts[0],this._minBaseSeg.p0=this._convexHullPts[0],this._minBaseSeg.p1=this._convexHullPts[1]):this.computeConvexRingMinDiameter(this._convexHullPts)}computeConvexRingMinDiameter(t){this._minWidth=n.MAX_VALUE;let e=1;const i=new Yt;for(let s=0;s<t.length-1;s++)i.p0=t[s],i.p1=t[s+1],e=this.findMaxPerpDistance(t,i,e)}computeMinimumDiameter(){if(null!==this._minWidthPt)return null;if(this._isConvex)this.computeWidthConvex(this._inputGeom);else{const t=new ii(this._inputGeom).getConvexHull();this.computeWidthConvex(t)}}getLength(){return this.computeMinimumDiameter(),this._minWidth}findMaxPerpDistance(t,e,i){let s=e.distancePerpendicular(t[i]),a=s,n=i,o=n;for(;a>=s;)s=a,n=o,o=fi.nextIndex(t,n),a=e.distancePerpendicular(t[o]);return s<this._minWidth&&(this._minPtIndex=n,this._minWidth=s,this._minWidthPt=t[this._minPtIndex],this._minBaseSeg=new Yt(e)),n}getMinimumRectangle(){if(this.computeMinimumDiameter(),0===this._minWidth)return this._minBaseSeg.p0.equals2D(this._minBaseSeg.p1)?this._inputGeom.getFactory().createPoint(this._minBaseSeg.p0):this._minBaseSeg.toGeometry(this._inputGeom.getFactory());const t=this._minBaseSeg.p1.x-this._minBaseSeg.p0.x,e=this._minBaseSeg.p1.y-this._minBaseSeg.p0.y;let i=n.MAX_VALUE,s=-n.MAX_VALUE,a=n.MAX_VALUE,o=-n.MAX_VALUE;for(let n=0;n<this._convexHullPts.length;n++){const r=fi.computeC(t,e,this._convexHullPts[n]);r>s&&(s=r),r<i&&(i=r);const l=fi.computeC(-e,t,this._convexHullPts[n]);l>o&&(o=l),l<a&&(a=l)}const r=fi.computeSegmentForLine(-t,-e,o),l=fi.computeSegmentForLine(-t,-e,a),h=fi.computeSegmentForLine(-e,t,s),c=fi.computeSegmentForLine(-e,t,i),p=h.lineIntersection(r),u=c.lineIntersection(r),d=c.lineIntersection(l),m=h.lineIntersection(l),g=this._inputGeom.getFactory().createLinearRing([p,u,d,m,p]);return this._inputGeom.getFactory().createPolygon(g)}}var _i=Object.freeze({__proto__:null,distance:Oe,locate:Ke,match:Xe,Angle:Qt,Area:et,Centroid:Qe,ConvexHull:ii,Distance:j,InteriorPointArea:ai,InteriorPointLine:li,InteriorPointPoint:hi,Length:$,Orientation:F,PointLocation:qe,PointLocator:gi,RobustLineIntersector:Kt,MinimumBoundingCircle:yi,MinimumDiameter:fi});class vi{constructor(){vi.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._distanceTolerance=null;const t=arguments[0];this._inputGeom=t}static densifyPoints(t,e,i){const s=new Yt,a=new E;for(let n=0;n<t.length-1;n++){s.p0=t[n],s.p1=t[n+1],a.add(s.p0,!1);const o=s.getLength(),r=Math.trunc(o/e)+1;if(r>1){const t=o/r;for(let e=1;e<r;e++){const n=e*t/o,r=s.pointAlong(n);i.makePrecise(r),a.add(r,!1)}}}return a.add(t[t.length-1],!1),a.toCoordinateArray()}static densify(t,e){const i=new vi(t);return i.setDistanceTolerance(e),i.getResultGeometry()}getResultGeometry(){return new xi(this._distanceTolerance).transform(this._inputGeom)}setDistanceTolerance(t){if(t<=0)throw new s("Tolerance must be positive");this._distanceTolerance=t}}class xi extends ge{constructor(){super(),xi.constructor_.apply(this,arguments)}static constructor_(){this.distanceTolerance=null;const t=arguments[0];this.distanceTolerance=t}transformMultiPolygon(t,e){const i=super.transformMultiPolygon.call(this,t,e);return this.createValidArea(i)}transformPolygon(t,e){const i=super.transformPolygon.call(this,t,e);return e instanceof ft?i:this.createValidArea(i)}transformCoordinates(t,e){const i=t.toCoordinateArray();let s=vi.densifyPoints(i,this.distanceTolerance,e.getPrecisionModel());return e instanceof Q&&1===s.length&&(s=new Array(0).fill(null)),this._factory.getCoordinateSequenceFactory().create(s)}createValidArea(t){return t.buffer(0)}}vi.DensifyTransformer=xi;var Ci=Object.freeze({__proto__:null,Densifier:vi});class Li{static isNorthern(t){return t===Li.NE||t===Li.NW}static isOpposite(t,e){return t!==e&&2==(t-e+4)%4}static commonHalfPlane(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;const i=t<e?t:e;return 0===i&&3===(t>e?t:e)?3:i}static isInHalfPlane(t,e){return e===Li.SE?t===Li.SE||t===Li.SW:t===e||t===e+1}static quadrant(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new s("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Li.NE:Li.SE:e>=0?Li.NW:Li.SW}if(arguments[0]instanceof y&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1];if(e.x===t.x&&e.y===t.y)throw new s("Cannot compute the quadrant for two identical points "+t);return e.x>=t.x?e.y>=t.y?Li.NE:Li.SE:e.y>=t.y?Li.NW:Li.SW}}}Li.NE=0,Li.NW=1,Li.SW=2,Li.SE=3;class Mi{constructor(){Mi.constructor_.apply(this,arguments)}static constructor_(){this._orig=null,this._sym=null,this._next=null;const t=arguments[0];this._orig=t}static create(t,e){const i=new Mi(t),s=new Mi(e);return i.link(s),i}find(t){let e=this;do{if(null===e)return null;if(e.dest().equals2D(t))return e;e=e.oNext()}while(e!==this);return null}dest(){return this._sym._orig}isEdgesSorted(){const t=this.findLowest();let e=t;do{const i=e.oNext();if(i===t)break;if(!(i.compareTo(e)>0))return!1;e=i}while(e!==t);return!0}oNext(){return this._sym._next}directionY(){return this.directionPt().getY()-this._orig.getY()}insert(t){if(this.oNext()===this)return this.insertAfter(t),null;this.insertionEdge(t).insertAfter(t)}insertAfter(t){u.equals(this._orig,t.orig());const e=this.oNext();this._sym.setNext(t),t.sym().setNext(e)}degree(){let t=0,e=this;do{t++,e=e.oNext()}while(e!==this);return t}equals(){if(2===arguments.length&&arguments[1]instanceof y&&arguments[0]instanceof y){const t=arguments[0],e=arguments[1];return this._orig.equals2D(t)&&this._sym._orig.equals(e)}}findLowest(){let t=this,e=this.oNext();do{e.compareTo(t)<0&&(t=e),e=e.oNext()}while(e!==this);return t}directionPt(){return this.dest()}sym(){return this._sym}prev(){return this._sym.next()._sym}compareAngularDirection(t){const e=this.directionX(),i=this.directionY(),s=t.directionX(),a=t.directionY();if(e===s&&i===a)return 0;const n=Li.quadrant(e,i),o=Li.quadrant(s,a);if(n>o)return 1;if(n<o)return-1;const r=this.directionPt(),l=t.directionPt();return F.index(t._orig,l,r)}prevNode(){let t=this;for(;2===t.degree();)if(t=t.prev(),t===this)return null;return t}directionX(){return this.directionPt().getX()-this._orig.getX()}insertionEdge(t){let e=this;do{const i=e.oNext();if(i.compareTo(e)>0&&t.compareTo(e)>=0&&t.compareTo(i)<=0)return e;if(i.compareTo(e)<=0&&(t.compareTo(i)<=0||t.compareTo(e)>=0))return e;e=i}while(e!==this);return u.shouldNeverReachHere(),null}compareTo(t){const e=t;return this.compareAngularDirection(e)}toStringNode(){const t=this.orig();this.dest();const e=new mt;e.append("Node( "+$t.format(t)+" )\n");let i=this;do{e.append(" -> "+i),e.append("\n"),i=i.oNext()}while(i!==this);return e.toString()}link(t){this.setSym(t),t.setSym(this),this.setNext(t),t.setNext(this)}next(){return this._next}setSym(t){this._sym=t}orig(){return this._orig}toString(){return"HE("+this._orig.x+" "+this._orig.y+", "+this._sym._orig.x+" "+this._sym._orig.y+")"}toStringNodeEdge(){return" -> ("+$t.format(this.dest())}setNext(t){this._next=t}}class bi extends Mi{constructor(){super(),bi.constructor_.apply(this,arguments)}static constructor_(){this._isMarked=!1;const t=arguments[0];Mi.constructor_.call(this,t)}static setMarkBoth(t,e){t.setMark(e),t.sym().setMark(e)}static isMarked(t){return t.isMarked()}static setMark(t,e){t.setMark(e)}static markBoth(t){t.mark(),t.sym().mark()}static mark(t){t.mark()}mark(){this._isMarked=!0}setMark(t){this._isMarked=t}isMarked(){return this._isMarked}}class wi{constructor(){wi.constructor_.apply(this,arguments)}static constructor_(){this._vertexMap=new Ct}static isValidEdge(t,e){return 0!==e.compareTo(t)}insert(t,e,i){const s=this.create(t,e);null!==i?i.insert(s):this._vertexMap.put(t,s);const a=this._vertexMap.get(e);return null!==a?a.insert(s.sym()):this._vertexMap.put(e,s.sym()),s}create(t,e){const i=this.createEdge(t),s=this.createEdge(e);return i.link(s),i}createEdge(t){return new Mi(t)}addEdge(t,e){if(!wi.isValidEdge(t,e))return null;const i=this._vertexMap.get(t);let s=null;return null!==i&&(s=i.find(e)),null!==s?s:this.insert(t,e,i)}getVertexEdges(){return this._vertexMap.values()}findEdge(t,e){const i=this._vertexMap.get(t);return null===i?null:i.find(e)}}class Si extends bi{constructor(){super(),Si.constructor_.apply(this,arguments)}static constructor_(){this._isStart=!1;const t=arguments[0];bi.constructor_.call(this,t)}setStart(){this._isStart=!0}isStart(){return this._isStart}}class Ii extends wi{constructor(){super()}createEdge(t){return new Si(t)}}class Ei{constructor(){Ei.constructor_.apply(this,arguments)}static constructor_(){this._result=null,this._factory=null,this._graph=null,this._lines=new S,this._nodeEdgeStack=new ti,this._ringStartEdge=null,this._graph=new Ii}static dissolve(t){const e=new Ei;return e.add(t),e.getResult()}addLine(t){this._lines.add(this._factory.createLineString(t.toCoordinateArray()))}updateRingStartEdge(t){return t.isStart()||(t=t.sym()).isStart()?null===this._ringStartEdge?(this._ringStartEdge=t,null):void(t.orig().compareTo(this._ringStartEdge.orig())<0&&(this._ringStartEdge=t)):null}getResult(){return null===this._result&&this.computeResult(),this._result}process(t){let e=t.prevNode();null===e&&(e=t),this.stackEdges(e),this.buildLines()}buildRing(t){const e=new E;let i=t;for(e.add(i.orig().copy(),!1);2===i.sym().degree();){const s=i.next();if(s===t)break;e.add(s.orig().copy(),!1),i=s}e.add(i.dest().copy(),!1),this.addLine(e)}buildLine(t){const e=new E;let i=t;for(this._ringStartEdge=null,bi.markBoth(i),e.add(i.orig().copy(),!1);2===i.sym().degree();){this.updateRingStartEdge(i);const s=i.next();if(s===t)return this.buildRing(this._ringStartEdge),null;e.add(s.orig().copy(),!1),i=s,bi.markBoth(i)}e.add(i.dest().clone(),!1),this.stackEdges(i.sym()),this.addLine(e)}stackEdges(t){let e=t;do{bi.isMarked(e)||this._nodeEdgeStack.add(e),e=e.oNext()}while(e!==t)}computeResult(){for(let t=this._graph.getVertexEdges().iterator();t.hasNext();){const e=t.next();bi.isMarked(e)||this.process(e)}this._result=this._factory.buildGeometry(this._lines)}buildLines(){for(;!this._nodeEdgeStack.empty();){const t=this._nodeEdgeStack.pop();bi.isMarked(t)||this.buildLine(t)}}add(){if(arguments[0]instanceof q)arguments[0].apply(new class{get interfaces_(){return[V]}filter(t){t instanceof Q&&this.add(t)}});else if(C(arguments[0],L))for(let t=arguments[0].iterator();t.hasNext();){const e=t.next();this.add(e)}else if(arguments[0]instanceof Q){const t=arguments[0];null===this._factory&&(this._factory=t.getFactory());const e=t.getCoordinateSequence();let i=!1;for(let t=1;t<e.size();t++){const s=this._graph.addEdge(e.getCoordinate(t-1),e.getCoordinate(t));null!==s&&(i||(s.setStart(),i=!0))}}}}var Ti=Object.freeze({__proto__:null,LineDissolver:Ei});class Di{static opposite(t){return t===Di.LEFT?Di.RIGHT:t===Di.RIGHT?Di.LEFT:t}}Di.ON=0,Di.LEFT=1,Di.RIGHT=2;class Pi{constructor(){Pi.constructor_.apply(this,arguments)}static constructor_(){this.mce=null,this.chainIndex=null;const t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}computeIntersections(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)}}class Oi{constructor(){Oi.constructor_.apply(this,arguments)}static constructor_(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){const t=arguments[0],e=arguments[1];this._eventType=Oi.DELETE,this._xValue=t,this._insertEvent=e}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._eventType=Oi.INSERT,this._label=t,this._xValue=e,this._obj=i}}isDelete(){return this._eventType===Oi.DELETE}setDeleteEventIndex(t){this._deleteEventIndex=t}getObject(){return this._obj}compareTo(t){const e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0}getInsertEvent(){return this._insertEvent}isInsert(){return this._eventType===Oi.INSERT}isSameLabel(t){return null!==this._label&&this._label===t._label}getDeleteEventIndex(){return this._deleteEventIndex}get interfaces_(){return[o]}}Oi.INSERT=1,Oi.DELETE=2;class ki{constructor(){ki.constructor_.apply(this,arguments)}static constructor_(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;const t=arguments[0],e=arguments[1],i=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=i}static isAdjacentSegments(t,e){return 1===Math.abs(t-e)}isTrivialIntersection(t,e,i,s){if(t===i&&1===this._li.getIntersectionNum()){if(ki.isAdjacentSegments(e,s))return!0;if(t.isClosed()){const i=t.getNumPoints()-1;if(0===e&&s===i||0===s&&e===i)return!0}}return!1}getProperIntersectionPoint(){return this._properIntersectionPoint}setIsDoneIfProperInt(t){this._isDoneWhenProperInt=t}hasProperInteriorIntersection(){return this._hasProperInterior}isBoundaryPointInternal(t,e){for(let i=e.iterator();i.hasNext();){const e=i.next().getCoordinate();if(t.isIntersection(e))return!0}return!1}hasProperIntersection(){return this._hasProper}hasIntersection(){return this._hasIntersection}isDone(){return this._isDone}isBoundaryPoint(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))}setBoundaryNodes(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e}addIntersections(t,e,i,s){if(t===i&&e===s)return null;this.numTests++;const a=t.getCoordinates()[e],n=t.getCoordinates()[e+1],o=i.getCoordinates()[s],r=i.getCoordinates()[s+1];this._li.computeIntersection(a,n,o,r),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,i,s)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),i.addIntersections(this._li,s,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))}}class Ni extends class{}{constructor(){super(),Ni.constructor_.apply(this,arguments)}static constructor_(){this.events=new S,this.nOverlaps=null}prepareEvents(){_e.sort(this.events);for(let t=0;t<this.events.size();t++){const e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}}computeIntersections(){if(1===arguments.length){const t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(let e=0;e<this.events.size();e++){const i=this.events.get(e);if(i.isInsert()&&this.processOverlaps(e,i.getDeleteEventIndex(),i,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof ki&&C(arguments[0],b)&&C(arguments[1],b)){const t=arguments[0],e=arguments[1],i=arguments[2];this.addEdges(t,t),this.addEdges(e,e),this.computeIntersections(i)}else if("boolean"==typeof arguments[2]&&C(arguments[0],b)&&arguments[1]instanceof ki){const t=arguments[0],e=arguments[1];arguments[2]?this.addEdges(t,null):this.addEdges(t),this.computeIntersections(e)}}addEdge(t,e){const i=t.getMonotoneChainEdge(),s=i.getStartIndexes();for(let t=0;t<s.length-1;t++){const s=new Pi(i,t),a=new Oi(e,i.getMinX(t),s);this.events.add(a),this.events.add(new Oi(i.getMaxX(t),a))}}processOverlaps(t,e,i,s){const a=i.getObject();for(let n=t;n<e;n++){const t=this.events.get(n);if(t.isInsert()){const e=t.getObject();i.isSameLabel(t)||(a.computeIntersections(e,s),this.nOverlaps++)}}}addEdges(){if(1===arguments.length)for(let t=arguments[0].iterator();t.hasNext();){const e=t.next();this.addEdge(e,e)}else if(2===arguments.length){const t=arguments[1];for(let e=arguments[0].iterator();e.hasNext();){const i=e.next();this.addEdge(i,t)}}}}class Ai{constructor(){Ai.constructor_.apply(this,arguments)}static constructor_(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){const t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){const t=arguments[0];this.init(1),this.location[Di.ON]=t}else if(arguments[0]instanceof Ai){const t=arguments[0];if(this.init(t.location.length),null!==t)for(let e=0;e<this.location.length;e++)this.location[e]=t.location[e]}}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this.init(3),this.location[Di.ON]=t,this.location[Di.LEFT]=e,this.location[Di.RIGHT]=i}}setAllLocations(t){for(let e=0;e<this.location.length;e++)this.location[e]=t}isNull(){for(let t=0;t<this.location.length;t++)if(this.location[t]!==Jt.NONE)return!1;return!0}setAllLocationsIfNull(t){for(let e=0;e<this.location.length;e++)this.location[e]===Jt.NONE&&(this.location[e]=t)}isLine(){return 1===this.location.length}merge(t){if(t.location.length>this.location.length){const t=new Array(3).fill(null);t[Di.ON]=this.location[Di.ON],t[Di.LEFT]=Jt.NONE,t[Di.RIGHT]=Jt.NONE,this.location=t}for(let e=0;e<this.location.length;e++)this.location[e]===Jt.NONE&&e<t.location.length&&(this.location[e]=t.location[e])}getLocations(){return this.location}flip(){if(this.location.length<=1)return null;const t=this.location[Di.LEFT];this.location[Di.LEFT]=this.location[Di.RIGHT],this.location[Di.RIGHT]=t}toString(){const t=new P;return this.location.length>1&&t.append(Jt.toLocationSymbol(this.location[Di.LEFT])),t.append(Jt.toLocationSymbol(this.location[Di.ON])),this.location.length>1&&t.append(Jt.toLocationSymbol(this.location[Di.RIGHT])),t.toString()}setLocations(t,e,i){this.location[Di.ON]=t,this.location[Di.LEFT]=e,this.location[Di.RIGHT]=i}get(t){return t<this.location.length?this.location[t]:Jt.NONE}isArea(){return this.location.length>1}isAnyNull(){for(let t=0;t<this.location.length;t++)if(this.location[t]===Jt.NONE)return!0;return!1}setLocation(){if(1===arguments.length){const t=arguments[0];this.setLocation(Di.ON,t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.location[t]=e}}init(t){this.location=new Array(t).fill(null),this.setAllLocations(Jt.NONE)}isEqualOnSide(t,e){return this.location[e]===t.location[e]}allPositionsEqual(t){for(let e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0}}class Ri{constructor(){Ri.constructor_.apply(this,arguments)}static constructor_(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){const t=arguments[0];this.elt[0]=new Ai(t),this.elt[1]=new Ai(t)}else if(arguments[0]instanceof Ri){const t=arguments[0];this.elt[0]=new Ai(t.elt[0]),this.elt[1]=new Ai(t.elt[1])}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.elt[0]=new Ai(Jt.NONE),this.elt[1]=new Ai(Jt.NONE),this.elt[t].setLocation(e)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this.elt[0]=new Ai(t,e,i),this.elt[1]=new Ai(t,e,i)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this.elt[0]=new Ai(Jt.NONE,Jt.NONE,Jt.NONE),this.elt[1]=new Ai(Jt.NONE,Jt.NONE,Jt.NONE),this.elt[t].setLocations(e,i,s)}}static toLineLabel(t){const e=new Ri(Jt.NONE);for(let i=0;i<2;i++)e.setLocation(i,t.getLocation(i));return e}getGeometryCount(){let t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t}setAllLocations(t,e){this.elt[t].setAllLocations(e)}isNull(t){return this.elt[t].isNull()}setAllLocationsIfNull(){if(1===arguments.length){const t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.elt[t].setAllLocationsIfNull(e)}}isLine(t){return this.elt[t].isLine()}merge(t){for(let e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Ai(t.elt[e]):this.elt[e].merge(t.elt[e])}flip(){this.elt[0].flip(),this.elt[1].flip()}getLocation(){if(1===arguments.length){const t=arguments[0];return this.elt[t].get(Di.ON)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return this.elt[t].get(e)}}toString(){const t=new P;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()}isArea(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){const t=arguments[0];return this.elt[t].isArea()}}isAnyNull(t){return this.elt[t].isAnyNull()}setLocation(){if(2===arguments.length){const t=arguments[0],e=arguments[1];this.elt[t].setLocation(Di.ON,e)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this.elt[t].setLocation(e,i)}}isEqualOnSide(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)}allPositionsEqual(t,e){return this.elt[t].allPositionsEqual(e)}toLine(t){this.elt[t].isArea()&&(this.elt[t]=new Ai(this.elt[t].location[0]))}}class Fi{constructor(){Fi.constructor_.apply(this,arguments)}static constructor_(){this.coord=null,this.segmentIndex=null,this.dist=null;const t=arguments[0],e=arguments[1],i=arguments[2];this.coord=new y(t),this.segmentIndex=e,this.dist=i}getSegmentIndex(){return this.segmentIndex}getCoordinate(){return this.coord}print(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)}compareTo(t){const e=t;return this.compare(e.segmentIndex,e.dist)}isEndPoint(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t}toString(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist}getDistance(){return this.dist}compare(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0}get interfaces_(){return[o]}}class Bi extends _t{}function Gi(t){return null==t?0:t.color}function zi(t){return null==t?null:t.parent}function ji(t,e){null!==t&&(t.color=e)}function Ui(t){return null==t?null:t.left}function Vi(t){return null==t?null:t.right}class qi extends Bi{constructor(){super(),this.root_=null,this.size_=0}get(t){let e=this.root_;for(;null!==e;){const i=t.compareTo(e.key);if(i<0)e=e.left;else{if(!(i>0))return e.value;e=e.right}}return null}put(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue(){return this.value},getKey(){return this.key}},this.size_=1,null;let i,s,a=this.root_;do{if(i=a,s=t.compareTo(a.key),s<0)a=a.left;else{if(!(s>0)){const t=a.value;return a.value=e,t}a=a.right}}while(null!==a);const n={key:t,left:null,right:null,value:e,parent:i,color:0,getValue(){return this.value},getKey(){return this.key}};return s<0?i.left=n:i.right=n,this.fixAfterInsertion(n),this.size_++,null}fixAfterInsertion(t){let e;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)zi(t)===Ui(zi(zi(t)))?(e=Vi(zi(zi(t))),1===Gi(e)?(ji(zi(t),0),ji(e,0),ji(zi(zi(t)),1),t=zi(zi(t))):(t===Vi(zi(t))&&(t=zi(t),this.rotateLeft(t)),ji(zi(t),0),ji(zi(zi(t)),1),this.rotateRight(zi(zi(t))))):(e=Ui(zi(zi(t))),1===Gi(e)?(ji(zi(t),0),ji(e,0),ji(zi(zi(t)),1),t=zi(zi(t))):(t===Ui(zi(t))&&(t=zi(t),this.rotateRight(t)),ji(zi(t),0),ji(zi(zi(t)),1),this.rotateLeft(zi(zi(t)))));this.root_.color=0}values(){const t=new S;let e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=qi.successor(e));)t.add(e.value);return t}entrySet(){const t=new vt;let e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=qi.successor(e));)t.add(e);return t}rotateLeft(t){if(null!=t){const e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}}rotateRight(t){if(null!=t){const e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}}getFirstEntry(){let t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t}static successor(t){let e;if(null===t)return null;if(null!==t.right){for(e=t.right;null!==e.left;)e=e.left;return e}{e=t.parent;let i=t;for(;null!==e&&i===e.right;)i=e,e=e.parent;return e}}size(){return this.size_}containsKey(t){let e=this.root_;for(;null!==e;){const i=t.compareTo(e.key);if(i<0)e=e.left;else{if(!(i>0))return!0;e=e.right}}return!1}}class Hi{constructor(){Hi.constructor_.apply(this,arguments)}static constructor_(){this._nodeMap=new qi,this.edge=null;const t=arguments[0];this.edge=t}print(t){t.println("Intersections:");for(let e=this.iterator();e.hasNext();)e.next().print(t)}iterator(){return this._nodeMap.values().iterator()}addSplitEdges(t){this.addEndpoints();const e=this.iterator();let i=e.next();for(;e.hasNext();){const s=e.next(),a=this.createSplitEdge(i,s);t.add(a),i=s}}addEndpoints(){const t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)}createSplitEdge(t,e){let i=e.segmentIndex-t.segmentIndex+2;const s=this.edge.pts[e.segmentIndex],a=e.dist>0||!e.coord.equals2D(s);a||i--;const n=new Array(i).fill(null);let o=0;n[o++]=new y(t.coord);for(let i=t.segmentIndex+1;i<=e.segmentIndex;i++)n[o++]=this.edge.pts[i];return a&&(n[o]=e.coord),new Xi(n,new Ri(this.edge._label))}add(t,e,i){const s=new Fi(t,e,i),a=this._nodeMap.get(s);return null!==a?a:(this._nodeMap.put(s,s),s)}isIntersection(t){for(let e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1}}class $i{constructor(){$i.constructor_.apply(this,arguments)}static constructor_(){if(this._data=null,this._size=0,0===arguments.length)$i.constructor_.call(this,10);else if(1===arguments.length){const t=arguments[0];this._data=new Array(t).fill(null)}}size(){return this._size}addAll(t){return null===t||0===t.length?null:(this.ensureCapacity(this._size+t.length),G.arraycopy(t,0,this._data,this._size,t.length),void(this._size+=t.length))}ensureCapacity(t){if(t<=this._data.length)return null;const e=Math.max(t,2*this._data.length);this._data=it.copyOf(this._data,e)}toArray(){const t=new Array(this._size).fill(null);return G.arraycopy(this._data,0,t,0,this._size),t}add(t){this.ensureCapacity(this._size+1),this._data[this._size]=t,++this._size}}class Wi{static toIntArray(t){const e=new Array(t.size()).fill(null);for(let i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e}getChainStartIndices(t){let e=0;const i=new $i(Math.trunc(t.length/2));i.add(e);do{const s=this.findChainEnd(t,e);i.add(s),e=s}while(e<t.length-1);return i.toArray()}findChainEnd(t,e){const i=Li.quadrant(t[e],t[e+1]);let s=e+1;for(;s<t.length&&Li.quadrant(t[s-1],t[s])===i;)s++;return s-1}OLDgetChainStartIndices(t){let e=0;const i=new S;i.add(e);do{const s=this.findChainEnd(t,e);i.add(s),e=s}while(e<t.length-1);return Wi.toIntArray(i)}}class Ki{constructor(){Ki.constructor_.apply(this,arguments)}static constructor_(){this.e=null,this.pts=null,this.startIndex=null;const t=arguments[0];this.e=t,this.pts=t.getCoordinates();const e=new Wi;this.startIndex=e.getChainStartIndices(this.pts)}getCoordinates(){return this.pts}getMaxX(t){const e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e>i?e:i}getMinX(t){const e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e<i?e:i}computeIntersectsForChain(){if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[i],e.startIndex[i+1],s)}else if(6===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4],n=arguments[5];if(e-t==1&&a-s==1)return n.addIntersections(this.e,t,i.e,s),null;if(!this.overlaps(t,e,i,s,a))return null;const o=Math.trunc((t+e)/2),r=Math.trunc((s+a)/2);t<o&&(s<r&&this.computeIntersectsForChain(t,o,i,s,r,n),r<a&&this.computeIntersectsForChain(t,o,i,r,a,n)),o<e&&(s<r&&this.computeIntersectsForChain(o,e,i,s,r,n),r<a&&this.computeIntersectsForChain(o,e,i,r,a,n))}}overlaps(t,e,i,s,a){return D.intersects(this.pts[t],this.pts[e],i.pts[s],i.pts[a])}getStartIndexes(){return this.startIndex}computeIntersects(t,e){for(let i=0;i<this.startIndex.length-1;i++)for(let s=0;s<t.startIndex.length-1;s++)this.computeIntersectsForChain(i,t,s,e)}}class Yi{constructor(){Yi.constructor_.apply(this,arguments)}static constructor_(){this._depth=Array(2).fill().map((()=>Array(3)));for(let t=0;t<2;t++)for(let e=0;e<3;e++)this._depth[t][e]=Yi.NULL_VALUE}static depthAtLocation(t){return t===Jt.EXTERIOR?0:t===Jt.INTERIOR?1:Yi.NULL_VALUE}getDepth(t,e){return this._depth[t][e]}setDepth(t,e,i){this._depth[t][e]=i}isNull(){if(0===arguments.length){for(let t=0;t<2;t++)for(let e=0;e<3;e++)if(this._depth[t][e]!==Yi.NULL_VALUE)return!1;return!0}if(1===arguments.length){const t=arguments[0];return this._depth[t][1]===Yi.NULL_VALUE}if(2===arguments.length){const t=arguments[0],e=arguments[1];return this._depth[t][e]===Yi.NULL_VALUE}}normalize(){for(let t=0;t<2;t++)if(!this.isNull(t)){let e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(let i=1;i<3;i++){let s=0;this._depth[t][i]>e&&(s=1),this._depth[t][i]=s}}}getDelta(t){return this._depth[t][Di.RIGHT]-this._depth[t][Di.LEFT]}getLocation(t,e){return this._depth[t][e]<=0?Jt.EXTERIOR:Jt.INTERIOR}toString(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}add(){if(1===arguments.length){const t=arguments[0];for(let e=0;e<2;e++)for(let i=1;i<3;i++){const s=t.getLocation(e,i);s!==Jt.EXTERIOR&&s!==Jt.INTERIOR||(this.isNull(e,i)?this._depth[e][i]=Yi.depthAtLocation(s):this._depth[e][i]+=Yi.depthAtLocation(s))}}else if(3===arguments.length){const t=arguments[0],e=arguments[1];arguments[2]===Jt.INTERIOR&&this._depth[t][e]++}}}Yi.NULL_VALUE=-1;class Ji{constructor(){Ji.constructor_.apply(this,arguments)}static constructor_(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){const t=arguments[0];this._label=t}}setVisited(t){this._isVisited=t}setInResult(t){this._isInResult=t}isCovered(){return this._isCovered}isCoveredSet(){return this._isCoveredSet}setLabel(t){this._label=t}getLabel(){return this._label}setCovered(t){this._isCovered=t,this._isCoveredSet=!0}updateIM(t){u.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)}isInResult(){return this._isInResult}isVisited(){return this._isVisited}}class Xi extends Ji{constructor(){super(),Xi.constructor_.apply(this,arguments)}static constructor_(){if(this.pts=null,this._env=null,this.eiList=new Hi(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Yi,this._depthDelta=0,1===arguments.length){const t=arguments[0];Xi.constructor_.call(this,t,null)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.pts=t,this._label=e}}static updateIM(){if(!(2===arguments.length&&arguments[1]instanceof Xt&&arguments[0]instanceof Ri))return super.updateIM.apply(this,arguments);{const t=arguments[0],e=arguments[1];e.setAtLeastIfValid(t.getLocation(0,Di.ON),t.getLocation(1,Di.ON),1),t.isArea()&&(e.setAtLeastIfValid(t.getLocation(0,Di.LEFT),t.getLocation(1,Di.LEFT),2),e.setAtLeastIfValid(t.getLocation(0,Di.RIGHT),t.getLocation(1,Di.RIGHT),2))}}getDepth(){return this._depth}getCollapsedEdge(){const t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new Xi(t,Ri.toLineLabel(this._label))}isIsolated(){return this._isIsolated}getCoordinates(){return this.pts}setIsolated(t){this._isIsolated=t}setName(t){this._name=t}equals(t){if(!(t instanceof Xi))return!1;const e=t;if(this.pts.length!==e.pts.length)return!1;let i=!0,s=!0,a=this.pts.length;for(let t=0;t<this.pts.length;t++)if(this.pts[t].equals2D(e.pts[t])||(i=!1),this.pts[t].equals2D(e.pts[--a])||(s=!1),!i&&!s)return!1;return!0}getCoordinate(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){const t=arguments[0];return this.pts[t]}}print(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(let e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)}computeIM(t){Xi.updateIM(this._label,t)}isCollapsed(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])}isClosed(){return this.pts[0].equals(this.pts[this.pts.length-1])}getMaximumSegmentIndex(){return this.pts.length-1}getDepthDelta(){return this._depthDelta}getNumPoints(){return this.pts.length}printReverse(t){t.print("edge "+this._name+": ");for(let e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")}getMonotoneChainEdge(){return null===this._mce&&(this._mce=new Ki(this)),this._mce}getEnvelope(){if(null===this._env){this._env=new D;for(let t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env}addIntersection(t,e,i,s){const a=new y(t.getIntersection(s));let n=e,o=t.getEdgeDistance(i,s);const r=n+1;if(r<this.pts.length){const t=this.pts[r];a.equals2D(t)&&(n=r,o=0)}this.eiList.add(a,n,o)}toString(){const t=new mt;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(let e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()}isPointwiseEqual(t){if(this.pts.length!==t.pts.length)return!1;for(let e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0}setDepthDelta(t){this._depthDelta=t}getEdgeIntersectionList(){return this.eiList}addIntersections(t,e,i){for(let s=0;s<t.getIntersectionNum();s++)this.addIntersection(t,e,i,s)}}class Qi extends Ji{constructor(){super(),Qi.constructor_.apply(this,arguments)}static constructor_(){this._coord=null,this._edges=null;const t=arguments[0],e=arguments[1];this._coord=t,this._edges=e,this._label=new Ri(0,Jt.NONE)}isIncidentEdgeInResult(){for(let t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1}isIsolated(){return 1===this._label.getGeometryCount()}getCoordinate(){return this._coord}print(t){t.println("node "+this._coord+" lbl: "+this._label)}computeIM(t){}computeMergedLocation(t,e){let i=Jt.NONE;if(i=this._label.getLocation(e),!t.isNull(e)){const s=t.getLocation(e);i!==Jt.BOUNDARY&&(i=s)}return i}setLabel(){if(2!==arguments.length||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return super.setLabel.apply(this,arguments);{const t=arguments[0],e=arguments[1];null===this._label?this._label=new Ri(t,e):this._label.setLocation(t,e)}}getEdges(){return this._edges}mergeLabel(){if(arguments[0]instanceof Qi){const t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Ri){const t=arguments[0];for(let e=0;e<2;e++){const i=this.computeMergedLocation(t,e);this._label.getLocation(e)===Jt.NONE&&this._label.setLocation(e,i)}}}add(t){this._edges.insert(t),t.setNode(this)}setLabelBoundary(t){if(null===this._label)return null;let e=Jt.NONE;null!==this._label&&(e=this._label.getLocation(t));let i=null;switch(e){case Jt.BOUNDARY:i=Jt.INTERIOR;break;case Jt.INTERIOR:default:i=Jt.BOUNDARY}this._label.setLocation(t,i)}}class Zi{constructor(){Zi.constructor_.apply(this,arguments)}static constructor_(){this.nodeMap=new qi,this.nodeFact=null;const t=arguments[0];this.nodeFact=t}find(t){return this.nodeMap.get(t)}addNode(){if(arguments[0]instanceof y){const t=arguments[0];let e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Qi){const t=arguments[0],e=this.nodeMap.get(t.getCoordinate());return null===e?(this.nodeMap.put(t.getCoordinate(),t),t):(e.mergeLabel(t),e)}}print(t){for(let e=this.iterator();e.hasNext();)e.next().print(t)}iterator(){return this.nodeMap.values().iterator()}values(){return this.nodeMap.values()}getBoundaryNodes(t){const e=new S;for(let i=this.iterator();i.hasNext();){const s=i.next();s.getLabel().getLocation(t)===Jt.BOUNDARY&&e.add(s)}return e}add(t){const e=t.getCoordinate();this.addNode(e).add(t)}}class ts{constructor(){ts.constructor_.apply(this,arguments)}static constructor_(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){const t=arguments[0];this._edge=t}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];ts.constructor_.call(this,t,e,i,null)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];ts.constructor_.call(this,t),this.init(e,i),this._label=s}}compareDirection(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:F.index(t._p0,t._p1,this._p1)}getDy(){return this._dy}getCoordinate(){return this._p0}setNode(t){this._node=t}print(t){const e=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),s=i.lastIndexOf("."),a=i.substring(s+1);t.print(" "+a+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)}compareTo(t){const e=t;return this.compareDirection(e)}getDirectedCoordinate(){return this._p1}getDx(){return this._dx}getLabel(){return this._label}getEdge(){return this._edge}getQuadrant(){return this._quadrant}getNode(){return this._node}toString(){const t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),i=e.lastIndexOf(".");return" "+e.substring(i+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label}computeLabel(t){}init(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Li.quadrant(this._dx,this._dy),u.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")}get interfaces_(){return[o]}}class es extends c{constructor(t,e){super(e?t+" [ "+e+" ]":t),this.pt=e?new y(e):void 0,this.name=Object.keys({TopologyException:es})[0]}getCoordinate(){return this.pt}}class is extends ts{constructor(){super(),is.constructor_.apply(this,arguments)}static constructor_(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999];const t=arguments[0],e=arguments[1];if(ts.constructor_.call(this,t),this._isForward=e,e)this.init(t.getCoordinate(0),t.getCoordinate(1));else{const e=t.getNumPoints()-1;this.init(t.getCoordinate(e),t.getCoordinate(e-1))}this.computeDirectedLabel()}static depthFactor(t,e){return t===Jt.EXTERIOR&&e===Jt.INTERIOR?1:t===Jt.INTERIOR&&e===Jt.EXTERIOR?-1:0}getNextMin(){return this._nextMin}getDepth(t){return this._depth[t]}setVisited(t){this._isVisited=t}computeDirectedLabel(){this._label=new Ri(this._edge.getLabel()),this._isForward||this._label.flip()}getNext(){return this._next}setDepth(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new es("assigned depths do not match",this.getCoordinate());this._depth[t]=e}isInteriorAreaEdge(){let t=!0;for(let e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Di.LEFT)===Jt.INTERIOR&&this._label.getLocation(e,Di.RIGHT)===Jt.INTERIOR||(t=!1);return t}setNextMin(t){this._nextMin=t}print(t){super.print.call(this,t),t.print(" "+this._depth[Di.LEFT]+"/"+this._depth[Di.RIGHT]),t.print(" ("+this.getDepthDelta()+")"),this._isInResult&&t.print(" inResult")}setMinEdgeRing(t){this._minEdgeRing=t}isLineEdge(){const t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,Jt.EXTERIOR),i=!this._label.isArea(1)||this._label.allPositionsEqual(1,Jt.EXTERIOR);return t&&e&&i}setEdgeRing(t){this._edgeRing=t}getMinEdgeRing(){return this._minEdgeRing}getDepthDelta(){let t=this._edge.getDepthDelta();return this._isForward||(t=-t),t}setInResult(t){this._isInResult=t}getSym(){return this._sym}isForward(){return this._isForward}getEdge(){return this._edge}printEdge(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)}setSym(t){this._sym=t}setVisitedEdge(t){this.setVisited(t),this._sym.setVisited(t)}setEdgeDepths(t,e){let i=this.getEdge().getDepthDelta();this._isForward||(i=-i);let s=1;t===Di.LEFT&&(s=-1);const a=Di.opposite(t),n=e+i*s;this.setDepth(t,e),this.setDepth(a,n)}getEdgeRing(){return this._edgeRing}isInResult(){return this._isInResult}setNext(t){this._next=t}isVisited(){return this._isVisited}}class ss{createNode(t){return new Qi(t,null)}}class as{constructor(){as.constructor_.apply(this,arguments)}static constructor_(){if(this._edges=new S,this._nodes=null,this._edgeEndList=new S,0===arguments.length)this._nodes=new Zi(new ss);else if(1===arguments.length){const t=arguments[0];this._nodes=new Zi(t)}}static linkResultDirectedEdges(t){for(let e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()}printEdges(t){t.println("Edges:");for(let e=0;e<this._edges.size();e++){t.println("edge "+e+":");const i=this._edges.get(e);i.print(t),i.eiList.print(t)}}find(t){return this._nodes.find(t)}addNode(){if(arguments[0]instanceof Qi){const t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof y){const t=arguments[0];return this._nodes.addNode(t)}}getNodeIterator(){return this._nodes.iterator()}linkResultDirectedEdges(){for(let t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()}debugPrintln(t){G.out.println(t)}isBoundaryNode(t,e){const i=this._nodes.find(e);if(null===i)return!1;const s=i.getLabel();return null!==s&&s.getLocation(t)===Jt.BOUNDARY}linkAllDirectedEdges(){for(let t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()}matchInSameDirection(t,e,i,s){return!!t.equals(i)&&F.index(t,e,s)===F.COLLINEAR&&Li.quadrant(t,e)===Li.quadrant(i,s)}getEdgeEnds(){return this._edgeEndList}debugPrint(t){G.out.print(t)}getEdgeIterator(){return this._edges.iterator()}findEdgeInSameDirection(t,e){for(let i=0;i<this._edges.size();i++){const s=this._edges.get(i),a=s.getCoordinates();if(this.matchInSameDirection(t,e,a[0],a[1]))return s;if(this.matchInSameDirection(t,e,a[a.length-1],a[a.length-2]))return s}return null}insertEdge(t){this._edges.add(t)}findEdgeEnd(t){for(let e=this.getEdgeEnds().iterator();e.hasNext();){const i=e.next();if(i.getEdge()===t)return i}return null}addEdges(t){for(let e=t.iterator();e.hasNext();){const t=e.next();this._edges.add(t);const i=new is(t,!0),s=new is(t,!1);i.setSym(s),s.setSym(i),this.add(i),this.add(s)}}add(t){this._nodes.add(t),this._edgeEndList.add(t)}getNodes(){return this._nodes.values()}findEdge(t,e){for(let i=0;i<this._edges.size();i++){const s=this._edges.get(i),a=s.getCoordinates();if(t.equals(a[0])&&e.equals(a[1]))return s}return null}}class ns extends as{constructor(){super(),ns.constructor_.apply(this,arguments)}static constructor_(){if(this._parentGeom=null,this._lineEdgeMap=new Ct,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new gi,2===arguments.length){const t=arguments[0],e=arguments[1];ns.constructor_.call(this,t,e,ci.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._argIndex=t,this._parentGeom=e,this._boundaryNodeRule=i,null!==e&&this.add(e)}}static determineBoundary(t,e){return t.isInBoundary(e)?Jt.BOUNDARY:Jt.INTERIOR}insertBoundaryPoint(t,e){const i=this._nodes.addNode(e).getLabel();let s=1,a=Jt.NONE;a=i.getLocation(t,Di.ON),a===Jt.BOUNDARY&&s++;const n=ns.determineBoundary(this._boundaryNodeRule,s);i.setLocation(t,n)}computeSelfNodes(){if(2===arguments.length){const t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){const t=arguments[1],e=arguments[2],i=new ki(arguments[0],!0,!1);i.setIsDoneIfProperInt(e);const s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof pt||this._parentGeom instanceof at||this._parentGeom instanceof ft,n=t||!a;return s.computeIntersections(this._edges,i,n),this.addSelfIntersectionNodes(this._argIndex),i}}computeSplitEdges(t){for(let e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)}computeEdgeIntersections(t,e,i){const s=new ki(e,i,!0);return s.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,s),s}getGeometry(){return this._parentGeom}getBoundaryNodeRule(){return this._boundaryNodeRule}hasTooFewPoints(){return this._hasTooFewPoints}addPoint(){if(arguments[0]instanceof tt){const t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,Jt.INTERIOR)}else if(arguments[0]instanceof y){const t=arguments[0];this.insertPoint(this._argIndex,t,Jt.INTERIOR)}}addPolygon(t){this.addPolygonRing(t.getExteriorRing(),Jt.EXTERIOR,Jt.INTERIOR);for(let e=0;e<t.getNumInteriorRing();e++){const i=t.getInteriorRingN(e);this.addPolygonRing(i,Jt.INTERIOR,Jt.EXTERIOR)}}addEdge(t){this.insertEdge(t);const e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],Jt.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],Jt.BOUNDARY)}addLineString(t){const e=dt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;const i=new Xi(e,new Ri(this._argIndex,Jt.INTERIOR));this._lineEdgeMap.put(t,i),this.insertEdge(i),u.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])}getInvalidPoint(){return this._invalidPoint}getBoundaryPoints(){const t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null);let i=0;for(let s=t.iterator();s.hasNext();){const t=s.next();e[i++]=t.getCoordinate().copy()}return e}getBoundaryNodes(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes}addSelfIntersectionNode(t,e,i){if(this.isBoundaryNode(t,e))return null;i===Jt.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,i)}addPolygonRing(t,e,i){if(t.isEmpty())return null;const s=dt.removeRepeatedPoints(t.getCoordinates());if(s.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=s[0],null;let a=e,n=i;F.isCCW(s)&&(a=i,n=e);const o=new Xi(s,new Ri(this._argIndex,Jt.BOUNDARY,a,n));this._lineEdgeMap.put(t,o),this.insertEdge(o),this.insertPoint(this._argIndex,s[0],Jt.BOUNDARY)}insertPoint(t,e,i){const s=this._nodes.addNode(e),a=s.getLabel();null===a?s._label=new Ri(t,i):a.setLocation(t,i)}createEdgeSetIntersector(){return new Ni}addSelfIntersectionNodes(t){for(let e=this._edges.iterator();e.hasNext();){const i=e.next(),s=i.getLabel().getLocation(t);for(let e=i.eiList.iterator();e.hasNext();){const i=e.next();this.addSelfIntersectionNode(t,i.coord,s)}}}add(){if(!(1===arguments.length&&arguments[0]instanceof q))return super.add.apply(this,arguments);{const t=arguments[0];if(t.isEmpty())return null;if(t instanceof ft&&(this._useBoundaryDeterminationRule=!1),t instanceof at)this.addPolygon(t);else if(t instanceof Q)this.addLineString(t);else if(t instanceof tt)this.addPoint(t);else if(t instanceof ct)this.addCollection(t);else if(t instanceof bt)this.addCollection(t);else if(t instanceof ft)this.addCollection(t);else{if(!(t instanceof ht))throw new Y(t.getGeometryType());this.addCollection(t)}}}addCollection(t){for(let e=0;e<t.getNumGeometries();e++){const i=t.getGeometryN(e);this.add(i)}}locate(t){return C(this._parentGeom,st)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new je(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)}findEdge(){if(1===arguments.length&&arguments[0]instanceof Q){const t=arguments[0];return this._lineEdgeMap.get(t)}return super.findEdge.apply(this,arguments)}}var os=Object.freeze({__proto__:null,GeometryGraph:ns});class rs{visit(t){}}class ls{constructor(){ls.constructor_.apply(this,arguments)}static constructor_(){if(this._p=null,this._data=null,this._left=null,this._right=null,this._count=null,2===arguments.length){const t=arguments[0],e=arguments[1];this._p=new y(t),this._left=null,this._right=null,this._count=1,this._data=e}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._p=new y(t,e),this._left=null,this._right=null,this._count=1,this._data=i}}isRepeated(){return this._count>1}getRight(){return this._right}getCoordinate(){return this._p}setLeft(t){this._left=t}getX(){return this._p.x}getData(){return this._data}getCount(){return this._count}getLeft(){return this._left}getY(){return this._p.y}increment(){this._count=this._count+1}setRight(t){this._right=t}}class hs{constructor(){hs.constructor_.apply(this,arguments)}static constructor_(){if(this._root=null,this._numberOfNodes=null,this._tolerance=null,0===arguments.length)hs.constructor_.call(this,0);else if(1===arguments.length){const t=arguments[0];this._tolerance=t}}static toCoordinates(){if(1===arguments.length){const t=arguments[0];return hs.toCoordinates(t,!1)}if(2===arguments.length){const t=arguments[0],e=arguments[1],i=new E;for(let s=t.iterator();s.hasNext();){const t=s.next(),a=e?t.getCount():1;for(let e=0;e<a;e++)i.add(t.getCoordinate(),!0)}return i.toCoordinateArray()}}insert(){if(1===arguments.length){const t=arguments[0];return this.insert(t,null)}if(2===arguments.length){const t=arguments[0],e=arguments[1];if(null===this._root)return this._root=new ls(t,e),this._root;if(this._tolerance>0){const e=this.findBestMatchNode(t);if(null!==e)return e.increment(),e}return this.insertExact(t,e)}}query(){if(1===arguments.length){const t=arguments[0],e=new S;return this.query(t,e),e}if(2===arguments.length)if(arguments[0]instanceof D&&C(arguments[1],b)){const t=arguments[0],e=arguments[1];this.queryNode(this._root,t,!0,new class{get interfaces_(){return[rs]}visit(t){e.add(t)}})}else if(arguments[0]instanceof D&&C(arguments[1],rs)){const t=arguments[0],e=arguments[1];this.queryNode(this._root,t,!0,e)}}queryNode(t,e,i,s){if(null===t)return null;let a=null,n=null,o=null;i?(a=e.getMinX(),n=e.getMaxX(),o=t.getX()):(a=e.getMinY(),n=e.getMaxY(),o=t.getY());const r=o<=n;a<o&&this.queryNode(t.getLeft(),e,!i,s),e.contains(t.getCoordinate())&&s.visit(t),r&&this.queryNode(t.getRight(),e,!i,s)}findBestMatchNode(t){const e=new cs(t,this._tolerance);return this.query(e.queryEnvelope(),e),e.getNode()}isEmpty(){return null===this._root}insertExact(t,e){let i=this._root,s=this._root,a=!0,n=!0;for(;null!==i;){if(null!==i&&t.distance(i.getCoordinate())<=this._tolerance)return i.increment(),i;n=a?t.x<i.getX():t.y<i.getY(),s=i,i=n?i.getLeft():i.getRight(),a=!a}this._numberOfNodes=this._numberOfNodes+1;const o=new ls(t,e);return n?s.setLeft(o):s.setRight(o),o}}class cs{constructor(){cs.constructor_.apply(this,arguments)}static constructor_(){this._tolerance=null,this._matchNode=null,this._matchDist=0,this._p=null;const t=arguments[0],e=arguments[1];this._p=t,this._tolerance=e}visit(t){const e=this._p.distance(t.getCoordinate());if(!(e<=this._tolerance))return null;let i=!1;(null===this._matchNode||e<this._matchDist||null!==this._matchNode&&e===this._matchDist&&t.getCoordinate().compareTo(this._matchNode.getCoordinate())<1)&&(i=!0),i&&(this._matchNode=t,this._matchDist=e)}queryEnvelope(){const t=new D(this._p);return t.expandBy(this._tolerance),t}getNode(){return this._matchNode}get interfaces_(){return[rs]}}hs.BestMatchVisitor=cs;var ps=Object.freeze({__proto__:null,KdTree:hs});class us{constructor(){us.constructor_.apply(this,arguments)}static constructor_(){this._items=new S,this._subnode=new Array(4).fill(null)}static getSubnodeIndex(t,e,i){let s=-1;return t.getMinX()>=e&&(t.getMinY()>=i&&(s=3),t.getMaxY()<=i&&(s=1)),t.getMaxX()<=e&&(t.getMinY()>=i&&(s=2),t.getMaxY()<=i&&(s=0)),s}hasChildren(){for(let t=0;t<4;t++)if(null!==this._subnode[t])return!0;return!1}isPrunable(){return!(this.hasChildren()||this.hasItems())}addAllItems(t){t.addAll(this._items);for(let e=0;e<4;e++)null!==this._subnode[e]&&this._subnode[e].addAllItems(t);return t}getNodeCount(){let t=0;for(let e=0;e<4;e++)null!==this._subnode[e]&&(t+=this._subnode[e].size());return t+1}size(){let t=0;for(let e=0;e<4;e++)null!==this._subnode[e]&&(t+=this._subnode[e].size());return t+this._items.size()}addAllItemsFromOverlapping(t,e){if(!this.isSearchMatch(t))return null;e.addAll(this._items);for(let i=0;i<4;i++)null!==this._subnode[i]&&this._subnode[i].addAllItemsFromOverlapping(t,e)}visitItems(t,e){for(let t=this._items.iterator();t.hasNext();)e.visitItem(t.next())}hasItems(){return!this._items.isEmpty()}remove(t,e){if(!this.isSearchMatch(t))return!1;let i=!1;for(let s=0;s<4;s++)if(null!==this._subnode[s]&&(i=this._subnode[s].remove(t,e),i)){this._subnode[s].isPrunable()&&(this._subnode[s]=null);break}return i||(i=this._items.remove(e),i)}visit(t,e){if(!this.isSearchMatch(t))return null;this.visitItems(t,e);for(let i=0;i<4;i++)null!==this._subnode[i]&&this._subnode[i].visit(t,e)}getItems(){return this._items}depth(){let t=0;for(let e=0;e<4;e++)if(null!==this._subnode[e]){const i=this._subnode[e].depth();i>t&&(t=i)}return t+1}isEmpty(){let t=!0;if(this._items.isEmpty()){for(let e=0;e<4;e++)if(null!==this._subnode[e]&&!this._subnode[e].isEmpty()){t=!1;break}}else t=!1;return t}add(t){this._items.add(t)}get interfaces_(){return[h]}}function ds(){}ds.exponent=function(t){return function(t,e){let i,s,a,n;const o={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}},r={32:8,64:11}[t];if(n||(i=e<0||1/e<0,isFinite(e)||(n=o[t],i&&(n.d+=1<<t/4-1),s=Math.pow(2,r)-1,a=0)),!n){for(s={32:127,64:1023}[t],a=Math.abs(e);a>=2;)s++,a/=2;for(;a<1&&s>0;)s--,a*=2;s<=0&&(a/=2),32===t&&s>254&&(n={d:i?255:127,c:128,b:0,a:0},s=Math.pow(2,r)-1,a=0)}return s}(64,t)-1023},ds.powerOf2=function(t){return Math.pow(2,t)};class ms{constructor(){ms.constructor_.apply(this,arguments)}static constructor_(){this._pt=new y,this._level=0,this._env=null;const t=arguments[0];this.computeKey(t)}static computeQuadLevel(t){const e=t.getWidth(),i=t.getHeight(),s=e>i?e:i;return ds.exponent(s)+1}getLevel(){return this._level}computeKey(){if(1===arguments.length){const t=arguments[0];for(this._level=ms.computeQuadLevel(t),this._env=new D,this.computeKey(this._level,t);!this._env.contains(t);)this._level+=1,this.computeKey(this._level,t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1],i=ds.powerOf2(t);this._pt.x=Math.floor(e.getMinX()/i)*i,this._pt.y=Math.floor(e.getMinY()/i)*i,this._env.init(this._pt.x,this._pt.x+i,this._pt.y,this._pt.y+i)}}getEnvelope(){return this._env}getCentre(){return new y((this._env.getMinX()+this._env.getMaxX())/2,(this._env.getMinY()+this._env.getMaxY())/2)}getPoint(){return this._pt}}class gs extends us{constructor(){super(),gs.constructor_.apply(this,arguments)}static constructor_(){this._env=null,this._centrex=null,this._centrey=null,this._level=null;const t=arguments[0],e=arguments[1];this._env=t,this._level=e,this._centrex=(t.getMinX()+t.getMaxX())/2,this._centrey=(t.getMinY()+t.getMaxY())/2}static createNode(t){const e=new ms(t);return new gs(e.getEnvelope(),e.getLevel())}static createExpanded(t,e){const i=new D(e);null!==t&&i.expandToInclude(t._env);const s=gs.createNode(i);return null!==t&&s.insertNode(t),s}find(t){const e=us.getSubnodeIndex(t,this._centrex,this._centrey);return-1===e?this:null!==this._subnode[e]?this._subnode[e].find(t):this}isSearchMatch(t){return null!==t&&this._env.intersects(t)}getSubnode(t){return null===this._subnode[t]&&(this._subnode[t]=this.createSubnode(t)),this._subnode[t]}getEnvelope(){return this._env}getNode(t){const e=us.getSubnodeIndex(t,this._centrex,this._centrey);return-1!==e?this.getSubnode(e).getNode(t):this}createSubnode(t){let e=0,i=0,s=0,a=0;switch(t){case 0:e=this._env.getMinX(),i=this._centrex,s=this._env.getMinY(),a=this._centrey;break;case 1:e=this._centrex,i=this._env.getMaxX(),s=this._env.getMinY(),a=this._centrey;break;case 2:e=this._env.getMinX(),i=this._centrex,s=this._centrey,a=this._env.getMaxY();break;case 3:e=this._centrex,i=this._env.getMaxX(),s=this._centrey,a=this._env.getMaxY()}const n=new D(e,i,s,a);return new gs(n,this._level-1)}insertNode(t){u.isTrue(null===this._env||this._env.contains(t._env));const e=us.getSubnodeIndex(t._env,this._centrex,this._centrey);if(t._level===this._level-1)this._subnode[e]=t;else{const i=this.createSubnode(e);i.insertNode(t),this._subnode[e]=i}}}class ys{static isZeroWidth(t,e){const i=e-t;if(0===i)return!0;const s=i/Math.max(Math.abs(t),Math.abs(e));return ds.exponent(s)<=ys.MIN_BINARY_EXPONENT}}ys.MIN_BINARY_EXPONENT=-50;class fs extends us{constructor(){super()}insert(t,e){const i=us.getSubnodeIndex(t,fs.origin.x,fs.origin.y);if(-1===i)return this.add(e),null;const s=this._subnode[i];if(null===s||!s.getEnvelope().contains(t)){const e=gs.createExpanded(s,t);this._subnode[i]=e}this.insertContained(this._subnode[i],t,e)}isSearchMatch(t){return!0}insertContained(t,e,i){u.isTrue(t.getEnvelope().contains(e));const s=ys.isZeroWidth(e.getMinX(),e.getMaxX()),a=ys.isZeroWidth(e.getMinY(),e.getMaxY());let n=null;n=s||a?t.find(e):t.getNode(e),n.add(i)}}fs.origin=new y(0,0);class _s{insert(t,e){}remove(t,e){}query(){}}class vs{constructor(){vs.constructor_.apply(this,arguments)}static constructor_(){this._root=null,this._minExtent=1,this._root=new fs}static ensureExtent(t,e){let i=t.getMinX(),s=t.getMaxX(),a=t.getMinY(),n=t.getMaxY();return i!==s&&a!==n?t:(i===s&&(i-=e/2,s+=e/2),a===n&&(a-=e/2,n+=e/2),new D(i,s,a,n))}size(){return null!==this._root?this._root.size():0}insert(t,e){this.collectStats(t);const i=vs.ensureExtent(t,this._minExtent);this._root.insert(i,e)}query(){if(1===arguments.length){const t=arguments[0],e=new Ge;return this.query(t,e),e.getItems()}if(2===arguments.length){const t=arguments[0],e=arguments[1];this._root.visit(t,e)}}queryAll(){const t=new S;return this._root.addAllItems(t),t}remove(t,e){const i=vs.ensureExtent(t,this._minExtent);return this._root.remove(i,e)}collectStats(t){const e=t.getWidth();e<this._minExtent&&e>0&&(this._minExtent=e);const i=t.getHeight();i<this._minExtent&&i>0&&(this._minExtent=i)}depth(){return null!==this._root?this._root.depth():0}isEmpty(){return null===this._root||this._root.isEmpty()}get interfaces_(){return[_s,h]}}var xs=Object.freeze({__proto__:null,Quadtree:vs});class Cs{getBounds(){}}class Ls{constructor(){Ls.constructor_.apply(this,arguments)}static constructor_(){this._bounds=null,this._item=null;const t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}getItem(){return this._item}getBounds(){return this._bounds}get interfaces_(){return[Cs,h]}}class Ms{constructor(){Ms.constructor_.apply(this,arguments)}static constructor_(){this._size=null,this._items=null,this._size=0,this._items=new S,this._items.add(null)}poll(){if(this.isEmpty())return null;const t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t}size(){return this._size}reorder(t){let e=null;const i=this._items.get(t);for(;2*t<=this._size&&(e=2*t,e!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(i)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,i)}clear(){this._size=0,this._items.clear()}peek(){return this.isEmpty()?null:this._items.get(1)}isEmpty(){return 0===this._size}add(t){this._items.add(null),this._size+=1;let e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)}}class bs{constructor(){bs.constructor_.apply(this,arguments)}static constructor_(){if(this._childBoundables=new S,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){const t=arguments[0];this._level=t}}getLevel(){return this._level}size(){return this._childBoundables.size()}getChildBoundables(){return this._childBoundables}addChildBoundable(t){u.isTrue(null===this._bounds),this._childBoundables.add(t)}isEmpty(){return this._childBoundables.isEmpty()}getBounds(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds}get interfaces_(){return[Cs,h]}}class ws{static maxDistance(t,e,i,s,a,n,o,r){let l=ws.distance(t,e,a,n);return l=Math.max(l,ws.distance(t,e,o,r)),l=Math.max(l,ws.distance(i,s,a,n)),l=Math.max(l,ws.distance(i,s,o,r)),l}static distance(t,e,i,s){const a=i-t,n=s-e;return Math.sqrt(a*a+n*n)}static maximumDistance(t,e){const i=Math.min(t.getMinX(),e.getMinX()),s=Math.min(t.getMinY(),e.getMinY()),a=Math.max(t.getMaxX(),e.getMaxX()),n=Math.max(t.getMaxY(),e.getMaxY());return ws.distance(i,s,a,n)}static minMaxDistance(t,e){const i=t.getMinX(),s=t.getMinY(),a=t.getMaxX(),n=t.getMaxY(),o=e.getMinX(),r=e.getMinY(),l=e.getMaxX(),h=e.getMaxY();let c=ws.maxDistance(i,s,i,n,o,r,o,h);return c=Math.min(c,ws.maxDistance(i,s,i,n,o,r,l,r)),c=Math.min(c,ws.maxDistance(i,s,i,n,l,h,o,h)),c=Math.min(c,ws.maxDistance(i,s,i,n,l,h,l,r)),c=Math.min(c,ws.maxDistance(i,s,a,s,o,r,o,h)),c=Math.min(c,ws.maxDistance(i,s,a,s,o,r,l,r)),c=Math.min(c,ws.maxDistance(i,s,a,s,l,h,o,h)),c=Math.min(c,ws.maxDistance(i,s,a,s,l,h,l,r)),c=Math.min(c,ws.maxDistance(a,n,i,n,o,r,o,h)),c=Math.min(c,ws.maxDistance(a,n,i,n,o,r,l,r)),c=Math.min(c,ws.maxDistance(a,n,i,n,l,h,o,h)),c=Math.min(c,ws.maxDistance(a,n,i,n,l,h,l,r)),c=Math.min(c,ws.maxDistance(a,n,a,s,o,r,o,h)),c=Math.min(c,ws.maxDistance(a,n,a,s,o,r,l,r)),c=Math.min(c,ws.maxDistance(a,n,a,s,l,h,o,h)),c=Math.min(c,ws.maxDistance(a,n,a,s,l,h,l,r)),c}}class Ss{constructor(){Ss.constructor_.apply(this,arguments)}static constructor_(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;const t=arguments[0],e=arguments[1],i=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=i,this._distance=this.distance()}static area(t){return t.getBounds().getArea()}static isComposite(t){return t instanceof bs}maximumDistance(){return ws.maximumDistance(this._boundable1.getBounds(),this._boundable2.getBounds())}expandToQueue(t,e){const i=Ss.isComposite(this._boundable1),a=Ss.isComposite(this._boundable2);if(i&&a)return Ss.area(this._boundable1)>Ss.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,!1,t,e),null):(this.expand(this._boundable2,this._boundable1,!0,t,e),null);if(i)return this.expand(this._boundable1,this._boundable2,!1,t,e),null;if(a)return this.expand(this._boundable2,this._boundable1,!0,t,e),null;throw new s("neither boundable is composite")}isLeaves(){return!(Ss.isComposite(this._boundable1)||Ss.isComposite(this._boundable2))}compareTo(t){const e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0}expand(t,e,i,s,a){for(let n=t.getChildBoundables().iterator();n.hasNext();){const t=n.next();let o=null;o=i?new Ss(e,t,this._itemDistance):new Ss(t,e,this._itemDistance),o.getDistance()<a&&s.add(o)}}getBoundable(t){return 0===t?this._boundable1:this._boundable2}getDistance(){return this._distance}distance(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())}get interfaces_(){return[o]}}class Is{constructor(){Is.constructor_.apply(this,arguments)}static constructor_(){if(this._root=null,this._built=!1,this._itemBoundables=new S,this._nodeCapacity=null,0===arguments.length)Is.constructor_.call(this,Is.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){const t=arguments[0];u.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}}static compareDoubles(t,e){return t>e?1:t<e?-1:0}queryInternal(){if(C(arguments[2],ke)&&arguments[0]instanceof Object&&arguments[1]instanceof bs){const t=arguments[0],e=arguments[2],i=arguments[1].getChildBoundables();for(let s=0;s<i.size();s++){const a=i.get(s);this.getIntersectsOp().intersects(a.getBounds(),t)&&(a instanceof bs?this.queryInternal(t,a,e):a instanceof Ls?e.visitItem(a.getItem()):u.shouldNeverReachHere())}}else if(C(arguments[2],b)&&arguments[0]instanceof Object&&arguments[1]instanceof bs){const t=arguments[0],e=arguments[2],i=arguments[1].getChildBoundables();for(let s=0;s<i.size();s++){const a=i.get(s);this.getIntersectsOp().intersects(a.getBounds(),t)&&(a instanceof bs?this.queryInternal(t,a,e):a instanceof Ls?e.add(a.getItem()):u.shouldNeverReachHere())}}}getNodeCapacity(){return this._nodeCapacity}lastNode(t){return t.get(t.size()-1)}size(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){let t=0;for(let e=arguments[0].getChildBoundables().iterator();e.hasNext();){const i=e.next();i instanceof bs?t+=this.size(i):i instanceof Ls&&(t+=1)}return t}}removeItem(t,e){let i=null;for(let s=t.getChildBoundables().iterator();s.hasNext();){const t=s.next();t instanceof Ls&&t.getItem()===e&&(i=t)}return null!==i&&(t.getChildBoundables().remove(i),!0)}itemsTree(){if(0===arguments.length){this.build();const t=this.itemsTree(this._root);return null===t?new S:t}if(1===arguments.length){const t=arguments[0],e=new S;for(let i=t.getChildBoundables().iterator();i.hasNext();){const t=i.next();if(t instanceof bs){const i=this.itemsTree(t);null!==i&&e.add(i)}else t instanceof Ls?e.add(t.getItem()):u.shouldNeverReachHere()}return e.size()<=0?null:e}}insert(t,e){u.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ls(t,e))}boundablesAtLevel(){if(1===arguments.length){const t=arguments[0],e=new S;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];if(u.isTrue(t>-2),e.getLevel()===t)return i.add(e),null;for(let s=e.getChildBoundables().iterator();s.hasNext();){const e=s.next();e instanceof bs?this.boundablesAtLevel(t,e,i):(u.isTrue(e instanceof Ls),-1===t&&i.add(e))}return null}}query(){if(1===arguments.length){const t=arguments[0];this.build();const e=new S;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.queryInternal(t,this._root,e),e}if(2===arguments.length){const t=arguments[0],e=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.queryInternal(t,this._root,e)}}build(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0}getRoot(){return this.build(),this._root}remove(){if(2===arguments.length){const t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];let s=this.removeItem(e,i);if(s)return!0;let a=null;for(let n=e.getChildBoundables().iterator();n.hasNext();){const e=n.next();if(this.getIntersectsOp().intersects(e.getBounds(),t)&&e instanceof bs&&(s=this.remove(t,e,i),s)){a=e;break}}return null!==a&&a.getChildBoundables().isEmpty()&&e.getChildBoundables().remove(a),s}}createHigherLevels(t,e){u.isTrue(!t.isEmpty());const i=this.createParentBoundables(t,e+1);return 1===i.size()?i.get(0):this.createHigherLevels(i,e+1)}depth(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){let t=0;for(let e=arguments[0].getChildBoundables().iterator();e.hasNext();){const i=e.next();if(i instanceof bs){const e=this.depth(i);e>t&&(t=e)}}return t+1}}createParentBoundables(t,e){u.isTrue(!t.isEmpty());const i=new S;i.add(this.createNode(e));const s=new S(t);_e.sort(s,this.getComparator());for(let t=s.iterator();t.hasNext();){const s=t.next();this.lastNode(i).getChildBoundables().size()===this.getNodeCapacity()&&i.add(this.createNode(e)),this.lastNode(i).addChildBoundable(s)}return i}isEmpty(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}get interfaces_(){return[h]}}Is.IntersectsOp=function(){},Is.DEFAULT_NODE_CAPACITY=10;class Es{distance(t,e){}}class Ts extends Is{constructor(){super(),Ts.constructor_.apply(this,arguments)}static constructor_(){if(0===arguments.length)Ts.constructor_.call(this,Ts.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){const t=arguments[0];Is.constructor_.call(this,t)}}static centreX(t){return Ts.avg(t.getMinX(),t.getMaxX())}static avg(t,e){return(t+e)/2}static getItems(t){const e=new Array(t.size()).fill(null);let i=0;for(;!t.isEmpty();){const s=t.poll();e[i]=s.getBoundable(0).getItem(),i++}return e}static centreY(t){return Ts.avg(t.getMinY(),t.getMaxY())}createParentBoundablesFromVerticalSlices(t,e){u.isTrue(t.length>0);const i=new S;for(let s=0;s<t.length;s++)i.addAll(this.createParentBoundablesFromVerticalSlice(t[s],e));return i}nearestNeighbourK(){if(2===arguments.length){const t=arguments[0],e=arguments[1];return this.nearestNeighbourK(t,n.POSITIVE_INFINITY,e)}if(3===arguments.length){const t=arguments[0],e=arguments[2];let i=arguments[1];const s=new Ms;s.add(t);const a=new Ms;for(;!s.isEmpty()&&i>=0;){const t=s.poll(),n=t.getDistance();if(n>=i)break;t.isLeaves()?a.size()<e?a.add(t):(a.peek().getDistance()>n&&(a.poll(),a.add(t)),i=a.peek().getDistance()):t.expandToQueue(s,i)}return Ts.getItems(a)}}createNode(t){return new Ds(t)}size(){return 0===arguments.length?super.size.call(this):super.size.apply(this,arguments)}insert(){if(!(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof D))return super.insert.apply(this,arguments);{const t=arguments[0],e=arguments[1];if(t.isNull())return null;super.insert.call(this,t,e)}}getIntersectsOp(){return Ts.intersectsOp}verticalSlices(t,e){const i=Math.trunc(Math.ceil(t.size()/e)),s=new Array(e).fill(null),a=t.iterator();for(let t=0;t<e;t++){s[t]=new S;let e=0;for(;a.hasNext()&&e<i;){const i=a.next();s[t].add(i),e++}}return s}query(){if(1===arguments.length){const t=arguments[0];return super.query.call(this,t)}if(2===arguments.length){const t=arguments[0],e=arguments[1];super.query.call(this,t,e)}}getComparator(){return Ts.yComparator}createParentBoundablesFromVerticalSlice(t,e){return super.createParentBoundables.call(this,t,e)}remove(){if(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof D){const t=arguments[0],e=arguments[1];return super.remove.call(this,t,e)}return super.remove.apply(this,arguments)}depth(){return 0===arguments.length?super.depth.call(this):super.depth.apply(this,arguments)}createParentBoundables(t,e){u.isTrue(!t.isEmpty());const i=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),s=new S(t);_e.sort(s,Ts.xComparator);const a=this.verticalSlices(s,Math.trunc(Math.ceil(Math.sqrt(i))));return this.createParentBoundablesFromVerticalSlices(a,e)}nearestNeighbour(){if(1===arguments.length){if(C(arguments[0],Es)){const t=arguments[0];if(this.isEmpty())return null;const e=new Ss(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof Ss){const t=arguments[0];let e=n.POSITIVE_INFINITY,i=null;const s=new Ms;for(s.add(t);!s.isEmpty()&&e>0;){const t=s.poll(),a=t.getDistance();if(a>=e)break;t.isLeaves()?(e=a,i=t):t.expandToQueue(s,e)}return null===i?null:[i.getBoundable(0).getItem(),i.getBoundable(1).getItem()]}}else{if(2===arguments.length){const t=arguments[0],e=arguments[1];if(this.isEmpty()||t.isEmpty())return null;const i=new Ss(this.getRoot(),t.getRoot(),e);return this.nearestNeighbour(i)}if(3===arguments.length){const t=arguments[2],e=new Ls(arguments[0],arguments[1]),i=new Ss(this.getRoot(),e,t);return this.nearestNeighbour(i)[0]}if(4===arguments.length){const t=arguments[2],e=arguments[3],i=new Ls(arguments[0],arguments[1]),s=new Ss(this.getRoot(),i,t);return this.nearestNeighbourK(s,e)}}}isWithinDistance(){if(2===arguments.length){const t=arguments[0],e=arguments[1];let i=n.POSITIVE_INFINITY;const s=new Ms;for(s.add(t);!s.isEmpty();){const t=s.poll(),a=t.getDistance();if(a>e)return!1;if(t.maximumDistance()<=e)return!0;if(t.isLeaves()){if(i=a,i<=e)return!0}else t.expandToQueue(s,i)}return!1}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=new Ss(this.getRoot(),t.getRoot(),e);return this.isWithinDistance(s,i)}}get interfaces_(){return[_s,h]}}class Ds extends bs{constructor(){super(),Ds.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0];bs.constructor_.call(this,t)}computeBounds(){let t=null;for(let e=this.getChildBoundables().iterator();e.hasNext();){const i=e.next();null===t?t=new D(i.getBounds()):t.expandToInclude(i.getBounds())}return t}}Ts.STRtreeNode=Ds,Ts.xComparator=new class{get interfaces_(){return[l]}compare(t,e){return Is.compareDoubles(Ts.centreX(t.getBounds()),Ts.centreX(e.getBounds()))}},Ts.yComparator=new class{get interfaces_(){return[l]}compare(t,e){return Is.compareDoubles(Ts.centreY(t.getBounds()),Ts.centreY(e.getBounds()))}},Ts.intersectsOp=new class{get interfaces_(){return[IntersectsOp]}intersects(t,e){return t.intersects(e)}},Ts.DEFAULT_NODE_CAPACITY=10;var Ps=Object.freeze({__proto__:null,STRtree:Ts}),Os=Object.freeze({__proto__:null,kdtree:ps,quadtree:xs,strtree:Ps});const ks=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];class Ns{constructor(t){this.geometryFactory=t||new wt}read(t){let e;e="string"==typeof t?JSON.parse(t):t;const i=e.type;if(!As[i])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==ks.indexOf(i)?As[i].call(this,e.coordinates):"GeometryCollection"===i?As[i].call(this,e.geometries):As[i].call(this,e)}write(t){const e=t.getGeometryType();if(!Rs[e])throw new Error("Geometry is not supported");return Rs[e].call(this,t)}}const As={Feature:function(t){const e={};for(const i in t)e[i]=t[i];if(t.geometry){const i=t.geometry.type;if(!As[i])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=As.bbox.call(this,t.bbox)),e},FeatureCollection:function(t){const e={};if(t.features){e.features=[];for(let i=0;i<t.features.length;++i)e.features.push(this.read(t.features[i]))}return t.bbox&&(e.bbox=this.parse.bbox.call(this,t.bbox)),e},coordinates:function(t){const e=[];for(let i=0;i<t.length;++i){const s=t[i];e.push(new y(...s))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new y(t[0],t[1]),new y(t[2],t[1]),new y(t[2],t[3]),new y(t[0],t[3]),new y(t[0],t[1])])},Point:function(t){const e=new y(...t);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){const e=[];for(let i=0;i<t.length;++i)e.push(As.Point.call(this,t[i]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){const e=As.coordinates.call(this,t);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){const e=[];for(let i=0;i<t.length;++i)e.push(As.LineString.call(this,t[i]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){const e=As.coordinates.call(this,t[0]),i=this.geometryFactory.createLinearRing(e),s=[];for(let e=1;e<t.length;++e){const i=t[e],a=As.coordinates.call(this,i),n=this.geometryFactory.createLinearRing(a);s.push(n)}return this.geometryFactory.createPolygon(i,s)},MultiPolygon:function(t){const e=[];for(let i=0;i<t.length;++i){const s=t[i];e.push(As.Polygon.call(this,s))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){const e=[];for(let i=0;i<t.length;++i){const s=t[i];e.push(this.read(s))}return this.geometryFactory.createGeometryCollection(e)}},Rs={coordinate:function(t){const e=[t.x,t.y];return t.z&&e.push(t.z),t.m&&e.push(t.m),e},Point:function(t){return{type:"Point",coordinates:Rs.coordinate.call(this,t.getCoordinate())}},MultiPoint:function(t){const e=[];for(let i=0;i<t._geometries.length;++i){const s=t._geometries[i],a=Rs.Point.call(this,s);e.push(a.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){const e=[],i=t.getCoordinates();for(let t=0;t<i.length;++t){const s=i[t];e.push(Rs.coordinate.call(this,s))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){const e=[];for(let i=0;i<t._geometries.length;++i){const s=t._geometries[i],a=Rs.LineString.call(this,s);e.push(a.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){const e=[],i=Rs.LineString.call(this,t._shell);e.push(i.coordinates);for(let i=0;i<t._holes.length;++i){const s=t._holes[i],a=Rs.LineString.call(this,s);e.push(a.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){const e=[];for(let i=0;i<t._geometries.length;++i){const s=t._geometries[i],a=Rs.Polygon.call(this,s);e.push(a.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){const e=[];for(let i=0;i<t._geometries.length;++i){const s=t._geometries[i],a=s.getGeometryType();e.push(Rs[a].call(this,s))}return{type:"GeometryCollection",geometries:e}}};function Fs(t){return[t.x,t.y]}var Bs=Object.freeze({__proto__:null,GeoJSONReader:class{constructor(t){this.parser=new Ns(t||new wt)}read(t){return this.parser.read(t)}},GeoJSONWriter:class{constructor(){this.parser=new Ns(this.geometryFactory)}write(t){return this.parser.write(t)}},OL3Parser:class{constructor(t,e){this.geometryFactory=t||new wt,this.ol=e||"undefined"!=typeof ol&&ol}inject(t,e,i,s,a,n,o,r){this.ol={geom:{Point:t,LineString:e,LinearRing:i,Polygon:s,MultiPoint:a,MultiLineString:n,MultiPolygon:o,GeometryCollection:r}}}read(t){const e=this.ol;return t instanceof e.geom.Point?this.convertFromPoint(t):t instanceof e.geom.LineString?this.convertFromLineString(t):t instanceof e.geom.LinearRing?this.convertFromLinearRing(t):t instanceof e.geom.Polygon?this.convertFromPolygon(t):t instanceof e.geom.MultiPoint?this.convertFromMultiPoint(t):t instanceof e.geom.MultiLineString?this.convertFromMultiLineString(t):t instanceof e.geom.MultiPolygon?this.convertFromMultiPolygon(t):t instanceof e.geom.GeometryCollection?this.convertFromCollection(t):void 0}convertFromPoint(t){const e=t.getCoordinates();return this.geometryFactory.createPoint(new y(e[0],e[1]))}convertFromLineString(t){return this.geometryFactory.createLineString(t.getCoordinates().map((function(t){return new y(t[0],t[1])})))}convertFromLinearRing(t){return this.geometryFactory.createLinearRing(t.getCoordinates().map((function(t){return new y(t[0],t[1])})))}convertFromPolygon(t){const e=t.getLinearRings();let i=null;const s=[];for(let t=0;t<e.length;t++){const a=this.convertFromLinearRing(e[t]);0===t?i=a:s.push(a)}return this.geometryFactory.createPolygon(i,s)}convertFromMultiPoint(t){const e=t.getPoints().map((function(t){return this.convertFromPoint(t)}),this);return this.geometryFactory.createMultiPoint(e)}convertFromMultiLineString(t){const e=t.getLineStrings().map((function(t){return this.convertFromLineString(t)}),this);return this.geometryFactory.createMultiLineString(e)}convertFromMultiPolygon(t){const e=t.getPolygons().map((function(t){return this.convertFromPolygon(t)}),this);return this.geometryFactory.createMultiPolygon(e)}convertFromCollection(t){const e=t.getGeometries().map((function(t){return this.read(t)}),this);return this.geometryFactory.createGeometryCollection(e)}write(t){return"Point"===t.getGeometryType()?this.convertToPoint(t.getCoordinate()):"LineString"===t.getGeometryType()?this.convertToLineString(t):"LinearRing"===t.getGeometryType()?this.convertToLinearRing(t):"Polygon"===t.getGeometryType()?this.convertToPolygon(t):"MultiPoint"===t.getGeometryType()?this.convertToMultiPoint(t):"MultiLineString"===t.getGeometryType()?this.convertToMultiLineString(t):"MultiPolygon"===t.getGeometryType()?this.convertToMultiPolygon(t):"GeometryCollection"===t.getGeometryType()?this.convertToCollection(t):void 0}convertToPoint(t){return new this.ol.geom.Point([t.x,t.y])}convertToLineString(t){const e=t._points._coordinates.map(Fs);return new this.ol.geom.LineString(e)}convertToLinearRing(t){const e=t._points._coordinates.map(Fs);return new this.ol.geom.LinearRing(e)}convertToPolygon(t){const e=[t._shell._points._coordinates.map(Fs)];for(let i=0;i<t._holes.length;i++)e.push(t._holes[i]._points._coordinates.map(Fs));return new this.ol.geom.Polygon(e)}convertToMultiPoint(t){return new this.ol.geom.MultiPoint(t.getCoordinates().map(Fs))}convertToMultiLineString(t){const e=[];for(let i=0;i<t._geometries.length;i++)e.push(this.convertToLineString(t._geometries[i]).getCoordinates());return new this.ol.geom.MultiLineString(e)}convertToMultiPolygon(t){const e=[];for(let i=0;i<t._geometries.length;i++)e.push(this.convertToPolygon(t._geometries[i]).getCoordinates());return new this.ol.geom.MultiPolygon(e)}convertToCollection(t){const e=[];for(let i=0;i<t._geometries.length;i++){const s=t._geometries[i];e.push(this.write(s))}return new this.ol.geom.GeometryCollection(e)}},WKTReader:class{constructor(t){this.parser=new Ht(t||new wt)}read(t){return this.parser.read(t)}},WKTWriter:$t});class Gs{static relativeSign(t,e){return t<e?-1:t>e?1:0}static compare(t,e,i){if(e.equals2D(i))return 0;const s=Gs.relativeSign(e.x,i.x),a=Gs.relativeSign(e.y,i.y);switch(t){case 0:return Gs.compareValue(s,a);case 1:return Gs.compareValue(a,s);case 2:return Gs.compareValue(a,-s);case 3:return Gs.compareValue(-s,a);case 4:return Gs.compareValue(-s,-a);case 5:return Gs.compareValue(-a,-s);case 6:return Gs.compareValue(-a,s);case 7:return Gs.compareValue(s,-a)}return u.shouldNeverReachHere("invalid octant value"),0}static compareValue(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0}}class zs{constructor(){zs.constructor_.apply(this,arguments)}static constructor_(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this._segString=t,this.coord=new y(e),this.segmentIndex=i,this._segmentOctant=s,this._isInterior=!e.equals2D(t.getCoordinate(i))}getCoordinate(){return this.coord}print(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)}compareTo(t){const e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:this._isInterior?e._isInterior?Gs.compare(this._segmentOctant,this.coord,e.coord):1:-1}isEndPoint(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t}toString(){return this.segmentIndex+":"+this.coord.toString()}isInterior(){return this._isInterior}get interfaces_(){return[o]}}class js{constructor(){js.constructor_.apply(this,arguments)}static constructor_(){this._nodeMap=new qi,this._edge=null;const t=arguments[0];this._edge=t}getSplitCoordinates(){const t=new E;this.addEndpoints();const e=this.iterator();let i=e.next();for(;e.hasNext();){const s=e.next();this.addEdgeCoordinates(i,s,t),i=s}return t.toCoordinateArray()}addCollapsedNodes(){const t=new S;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(let e=t.iterator();e.hasNext();){const t=e.next().intValue();this.add(this._edge.getCoordinate(t),t)}}createSplitEdgePts(t,e){let i=e.segmentIndex-t.segmentIndex+2;if(2===i)return[new y(t.coord),new y(e.coord)];const s=this._edge.getCoordinate(e.segmentIndex),a=e.isInterior()||!e.coord.equals2D(s);a||i--;const n=new Array(i).fill(null);let o=0;n[o++]=new y(t.coord);for(let i=t.segmentIndex+1;i<=e.segmentIndex;i++)n[o++]=this._edge.getCoordinate(i);return a&&(n[o]=new y(e.coord)),n}print(t){t.println("Intersections:");for(let e=this.iterator();e.hasNext();)e.next().print(t)}findCollapsesFromExistingVertices(t){for(let e=0;e<this._edge.size()-2;e++){const i=this._edge.getCoordinate(e);this._edge.getCoordinate(e+1);const s=this._edge.getCoordinate(e+2);i.equals2D(s)&&t.add(O.valueOf(e+1))}}addEdgeCoordinates(t,e,i){const s=this.createSplitEdgePts(t,e);i.add(s,!1)}iterator(){return this._nodeMap.values().iterator()}addSplitEdges(t){this.addEndpoints(),this.addCollapsedNodes();const e=this.iterator();let i=e.next();for(;e.hasNext();){const s=e.next(),a=this.createSplitEdge(i,s);t.add(a),i=s}}findCollapseIndex(t,e,i){if(!t.coord.equals2D(e.coord))return!1;let s=e.segmentIndex-t.segmentIndex;return e.isInterior()||s--,1===s&&(i[0]=t.segmentIndex+1,!0)}findCollapsesFromInsertedNodes(t){const e=new Array(1).fill(null),i=this.iterator();let s=i.next();for(;i.hasNext();){const a=i.next();this.findCollapseIndex(s,a,e)&&t.add(O.valueOf(e[0])),s=a}}getEdge(){return this._edge}addEndpoints(){const t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)}createSplitEdge(t,e){const i=this.createSplitEdgePts(t,e);return new Hs(i,this._edge.getData())}add(t,e){const i=new zs(this._edge,t,e,this._edge.getSegmentOctant(e)),s=this._nodeMap.get(i);return null!==s?(u.isTrue(s.coord.equals2D(t),"Found equal nodes with different coordinates"),s):(this._nodeMap.put(i,i),i)}checkSplitEdgesCorrectness(t){const e=this._edge.getCoordinates(),i=t.get(0).getCoordinate(0);if(!i.equals2D(e[0]))throw new c("bad split edge start point at "+i);const s=t.get(t.size()-1).getCoordinates(),a=s[s.length-1];if(!a.equals2D(e[e.length-1]))throw new c("bad split edge end point at "+a)}}class Us{static octant(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new s("Cannot compute the octant for point ( "+t+", "+e+" )");const i=Math.abs(t),a=Math.abs(e);return t>=0?e>=0?i>=a?0:1:i>=a?7:6:e>=0?i>=a?3:2:i>=a?4:5}if(arguments[0]instanceof y&&arguments[1]instanceof y){const t=arguments[0],e=arguments[1],i=e.x-t.x,a=e.y-t.y;if(0===i&&0===a)throw new s("Cannot compute the octant for two identical points "+t);return Us.octant(i,a)}}}class Vs{getCoordinates(){}size(){}getCoordinate(t){}isClosed(){}setData(t){}getData(){}}class qs{addIntersection(t,e){}get interfaces_(){return[Vs]}}class Hs{constructor(){Hs.constructor_.apply(this,arguments)}static constructor_(){this._nodeList=new js(this),this._pts=null,this._data=null;const t=arguments[0],e=arguments[1];this._pts=t,this._data=e}static getNodedSubstrings(){if(1===arguments.length){const t=arguments[0],e=new S;return Hs.getNodedSubstrings(t,e),e}if(2===arguments.length){const t=arguments[1];for(let e=arguments[0].iterator();e.hasNext();)e.next().getNodeList().addSplitEdges(t)}}getCoordinates(){return this._pts}size(){return this._pts.length}getCoordinate(t){return this._pts[t]}isClosed(){return this._pts[0].equals(this._pts[this._pts.length-1])}getSegmentOctant(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))}setData(t){this._data=t}safeOctant(t,e){return t.equals2D(e)?0:Us.octant(t,e)}getData(){return this._data}addIntersection(){if(2===arguments.length){const t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){const t=arguments[1],e=arguments[3],i=new y(arguments[0].getIntersection(e));this.addIntersection(i,t)}}toString(){return $t.toLineString(new gt(this._pts))}getNodeList(){return this._nodeList}addIntersectionNode(t,e){let i=e;const s=i+1;if(s<this._pts.length){const e=this._pts[s];t.equals2D(e)&&(i=s)}return this._nodeList.add(t,i)}addIntersections(t,e,i){for(let s=0;s<t.getIntersectionNum();s++)this.addIntersection(t,e,i,s)}get interfaces_(){return[qs]}}class $s{constructor(){$s.constructor_.apply(this,arguments)}static constructor_(){this._overlapSeg1=new Yt,this._overlapSeg2=new Yt}overlap(){if(2===arguments.length);else if(4===arguments.length){const t=arguments[1],e=arguments[2],i=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}class Ws{constructor(){Ws.constructor_.apply(this,arguments)}static constructor_(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this._pts=t,this._start=e,this._end=i,this._context=s}getLineSegment(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]}computeSelect(t,e,i,s){const a=this._pts[e],n=this._pts[i];if(i-e==1)return s.select(this,e),null;if(!t.intersects(a,n))return null;const o=Math.trunc((e+i)/2);e<o&&this.computeSelect(t,e,o,s),o<i&&this.computeSelect(t,o,i,s)}getCoordinates(){const t=new Array(this._end-this._start+1).fill(null);let e=0;for(let i=this._start;i<=this._end;i++)t[e++]=this._pts[i];return t}computeOverlaps(){if(2===arguments.length){const t=arguments[0],e=arguments[1];this.computeOverlaps(this._start,this._end,t,t._start,t._end,e)}else if(6===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4],n=arguments[5];if(e-t==1&&a-s==1)return n.overlap(this,t,i,s),null;if(!this.overlaps(t,e,i,s,a))return null;const o=Math.trunc((t+e)/2),r=Math.trunc((s+a)/2);t<o&&(s<r&&this.computeOverlaps(t,o,i,s,r,n),r<a&&this.computeOverlaps(t,o,i,r,a,n)),o<e&&(s<r&&this.computeOverlaps(o,e,i,s,r,n),r<a&&this.computeOverlaps(o,e,i,r,a,n))}}setId(t){this._id=t}select(t,e){this.computeSelect(t,this._start,this._end,e)}getEnvelope(){if(null===this._env){const t=this._pts[this._start],e=this._pts[this._end];this._env=new D(t,e)}return this._env}overlaps(t,e,i,s,a){return D.intersects(this._pts[t],this._pts[e],i._pts[s],i._pts[a])}getEndIndex(){return this._end}getStartIndex(){return this._start}getContext(){return this._context}getId(){return this._id}}class Ks{static findChainEnd(t,e){let i=e;for(;i<t.length-1&&t[i].equals2D(t[i+1]);)i++;if(i>=t.length-1)return t.length-1;const s=Li.quadrant(t[i],t[i+1]);let a=e+1;for(;a<t.length&&(t[a-1].equals2D(t[a])||Li.quadrant(t[a-1],t[a])===s);)a++;return a-1}static getChains(){if(1===arguments.length){const t=arguments[0];return Ks.getChains(t,null)}if(2===arguments.length){const t=arguments[0],e=arguments[1],i=new S;let s=0;do{const a=Ks.findChainEnd(t,s),n=new Ws(t,s,a,e);i.add(n),s=a}while(s<t.length-1);return i}}}class Ys{computeNodes(t){}getNodedSubstrings(){}}class Js{constructor(){Js.constructor_.apply(this,arguments)}static constructor_(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){const t=arguments[0];this.setSegmentIntersector(t)}}setSegmentIntersector(t){this._segInt=t}get interfaces_(){return[Ys]}}class Xs extends Js{constructor(){super(),Xs.constructor_.apply(this,arguments)}static constructor_(){if(this._monoChains=new S,this._index=new Ts,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0===arguments.length);else if(1===arguments.length){const t=arguments[0];Js.constructor_.call(this,t)}}getMonotoneChains(){return this._monoChains}getNodedSubstrings(){return Hs.getNodedSubstrings(this._nodedSegStrings)}getIndex(){return this._index}add(t){for(let e=Ks.getChains(t.getCoordinates(),t).iterator();e.hasNext();){const t=e.next();t.setId(this._idCounter++),this._index.insert(t.getEnvelope(),t),this._monoChains.add(t)}}computeNodes(t){this._nodedSegStrings=t;for(let e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()}intersectChains(){const t=new Qs(this._segInt);for(let e=this._monoChains.iterator();e.hasNext();){const i=e.next();for(let e=this._index.query(i.getEnvelope()).iterator();e.hasNext();){const s=e.next();if(s.getId()>i.getId()&&(i.computeOverlaps(s,t),this._nOverlaps++),this._segInt.isDone())return null}}}}class Qs extends $s{constructor(){super(),Qs.constructor_.apply(this,arguments)}static constructor_(){this._si=null;const t=arguments[0];this._si=t}overlap(){if(4!==arguments.length)return super.overlap.apply(this,arguments);{const t=arguments[1],e=arguments[2],i=arguments[3],s=arguments[0].getContext(),a=e.getContext();this._si.processIntersections(s,t,a,i)}}}Xs.SegmentOverlapAction=Qs;class Zs{constructor(){Zs.constructor_.apply(this,arguments)}static constructor_(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){const t=arguments[0],e=arguments[1];Zs.constructor_.call(this,t,e,0,0)}else if(4===arguments.length){const t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._isScaled=!this.isIntegerPrecision()}}rescale(){if(C(arguments[0],L))for(let t=arguments[0].iterator();t.hasNext();){const e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){const t=arguments[0];for(let e=0;e<t.length;e++)t[e].x=t[e].x/this._scaleFactor+this._offsetX,t[e].y=t[e].y/this._scaleFactor+this._offsetY;2===t.length&&t[0].equals2D(t[1])&&G.out.println(t)}}scale(){if(C(arguments[0],L)){const t=arguments[0],e=new S(t.size());for(let i=t.iterator();i.hasNext();){const t=i.next();e.add(new Hs(this.scale(t.getCoordinates()),t.getData()))}return e}if(arguments[0]instanceof Array){const t=arguments[0],e=new Array(t.length).fill(null);for(let i=0;i<t.length;i++)e[i]=new y(Math.round((t[i].x-this._offsetX)*this._scaleFactor),Math.round((t[i].y-this._offsetY)*this._scaleFactor),t[i].getZ());return dt.removeRepeatedPoints(e)}}isIntegerPrecision(){return 1===this._scaleFactor}getNodedSubstrings(){const t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t}computeNodes(t){let e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)}get interfaces_(){return[Ys]}}var ta=Object.freeze({__proto__:null,MCIndexNoder:Xs,ScaledNoder:Zs,SegmentString:Vs});class ea{constructor(){ea.constructor_.apply(this,arguments)}static constructor_(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){const t=arguments[0];ea.constructor_.call(this,t,ci.MOD2_BOUNDARY_RULE)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}}static getBoundary(){return 1===arguments.length?new ea(arguments[0]).getBoundary():2===arguments.length?new ea(arguments[0],arguments[1]).getBoundary():void 0}boundaryMultiLineString(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();const e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)}getBoundary(){return this._geom instanceof Q?this.boundaryLineString(this._geom):this._geom instanceof bt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()}boundaryLineString(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])}getEmptyMultiPoint(){return this._geomFact.createMultiPoint()}computeBoundaryCoordinates(t){const e=new S;this._endpointMap=new qi;for(let e=0;e<t.getNumGeometries();e++){const i=t.getGeometryN(e);0!==i.getNumPoints()&&(this.addEndpoint(i.getCoordinateN(0)),this.addEndpoint(i.getCoordinateN(i.getNumPoints()-1)))}for(let t=this._endpointMap.entrySet().iterator();t.hasNext();){const i=t.next(),s=i.getValue().count;this._bnRule.isInBoundary(s)&&e.add(i.getKey())}return dt.toCoordinateArray(e)}addEndpoint(t){let e=this._endpointMap.get(t);null===e&&(e=new ia,this._endpointMap.put(t,e)),e.count++}}class ia{constructor(){ia.constructor_.apply(this,arguments)}static constructor_(){this.count=null}}class sa{constructor(){sa.constructor_.apply(this,arguments)}static constructor_(){if(this._inputGeom=null,this._isClosedEndpointsInInterior=!0,this._nonSimpleLocation=null,1===arguments.length){const t=arguments[0];this._inputGeom=t}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._inputGeom=t,this._isClosedEndpointsInInterior=!e.isInBoundary(2)}}static isSimple(){return 1===arguments.length?new sa(arguments[0]).isSimple():2===arguments.length?new sa(arguments[0],arguments[1]).isSimple():void 0}isSimpleMultiPoint(t){if(t.isEmpty())return!0;const e=new rt;for(let i=0;i<t.getNumGeometries();i++){const s=t.getGeometryN(i).getCoordinate();if(e.contains(s))return this._nonSimpleLocation=s,!1;e.add(s)}return!0}isSimplePolygonal(t){for(let e=fe.getLines(t).iterator();e.hasNext();){const t=e.next();if(!this.isSimpleLinearGeometry(t))return!1}return!0}hasClosedEndpointIntersection(t){const e=new qi;for(let i=t.getEdgeIterator();i.hasNext();){const t=i.next(),s=t.isClosed(),a=t.getCoordinate(0);this.addEndpoint(e,a,s);const n=t.getCoordinate(t.getNumPoints()-1);this.addEndpoint(e,n,s)}for(let t=e.values().iterator();t.hasNext();){const e=t.next();if(e.isClosed&&2!==e.degree)return this._nonSimpleLocation=e.getCoordinate(),!0}return!1}getNonSimpleLocation(){return this._nonSimpleLocation}isSimpleLinearGeometry(t){if(t.isEmpty())return!0;const e=new ns(0,t),i=new Kt,s=e.computeSelfNodes(i,!0);return!(s.hasIntersection()&&(s.hasProperIntersection()?(this._nonSimpleLocation=s.getProperIntersectionPoint(),1):this.hasNonEndpointIntersection(e)||this._isClosedEndpointsInInterior&&this.hasClosedEndpointIntersection(e)))}hasNonEndpointIntersection(t){for(let e=t.getEdgeIterator();e.hasNext();){const t=e.next(),i=t.getMaximumSegmentIndex();for(let e=t.getEdgeIntersectionList().iterator();e.hasNext();){const t=e.next();if(!t.isEndPoint(i))return this._nonSimpleLocation=t.getCoordinate(),!0}}return!1}addEndpoint(t,e,i){let s=t.get(e);null===s&&(s=new aa(e),t.put(e,s)),s.addEndpoint(i)}computeSimple(t){return this._nonSimpleLocation=null,!!t.isEmpty()||(t instanceof Q||t instanceof bt?this.isSimpleLinearGeometry(t):t instanceof ct?this.isSimpleMultiPoint(t):C(t,st)?this.isSimplePolygonal(t):!(t instanceof ht)||this.isSimpleGeometryCollection(t))}isSimple(){return this._nonSimpleLocation=null,this.computeSimple(this._inputGeom)}isSimpleGeometryCollection(t){for(let e=0;e<t.getNumGeometries();e++){const i=t.getGeometryN(e);if(!this.computeSimple(i))return!1}return!0}}class aa{constructor(){aa.constructor_.apply(this,arguments)}static constructor_(){this.pt=null,this.isClosed=null,this.degree=null;const t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}addEndpoint(t){this.degree++,this.isClosed|=t}getCoordinate(){return this.pt}}sa.EndpointInfo=aa;class na{constructor(){na.constructor_.apply(this,arguments)}static constructor_(){if(this._quadrantSegments=na.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=na.CAP_ROUND,this._joinStyle=na.JOIN_ROUND,this._mitreLimit=na.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=na.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){const t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(e)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this.setQuadrantSegments(t),this.setEndCapStyle(e),this.setJoinStyle(i),this.setMitreLimit(s)}}static bufferDistanceError(t){const e=Math.PI/2/t;return 1-Math.cos(e/2)}getEndCapStyle(){return this._endCapStyle}isSingleSided(){return this._isSingleSided}setQuadrantSegments(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=na.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=na.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==na.JOIN_ROUND&&(this._quadrantSegments=na.DEFAULT_QUADRANT_SEGMENTS)}getJoinStyle(){return this._joinStyle}setJoinStyle(t){this._joinStyle=t}setSimplifyFactor(t){this._simplifyFactor=t<0?0:t}getSimplifyFactor(){return this._simplifyFactor}getQuadrantSegments(){return this._quadrantSegments}setEndCapStyle(t){this._endCapStyle=t}getMitreLimit(){return this._mitreLimit}setMitreLimit(t){this._mitreLimit=t}setSingleSided(t){this._isSingleSided=t}}na.CAP_ROUND=1,na.CAP_FLAT=2,na.CAP_SQUARE=3,na.JOIN_ROUND=1,na.JOIN_MITRE=2,na.JOIN_BEVEL=3,na.DEFAULT_QUADRANT_SEGMENTS=8,na.DEFAULT_MITRE_LIMIT=5,na.DEFAULT_SIMPLIFY_FACTOR=.01;class oa{constructor(){oa.constructor_.apply(this,arguments)}static constructor_(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}getCoordinate(){return this._minCoord}getRightmostSide(t,e){let i=this.getRightmostSideOfSegment(t,e);return i<0&&(i=this.getRightmostSideOfSegment(t,e-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),i}findRightmostEdgeAtVertex(){const t=this._minDe.getEdge().getCoordinates();u.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");const e=t[this._minIndex-1],i=t[this._minIndex+1],s=F.index(this._minCoord,i,e);let a=!1;(e.y<this._minCoord.y&&i.y<this._minCoord.y&&s===F.COUNTERCLOCKWISE||e.y>this._minCoord.y&&i.y>this._minCoord.y&&s===F.CLOCKWISE)&&(a=!0),a&&(this._minIndex=this._minIndex-1)}getRightmostSideOfSegment(t,e){const i=t.getEdge().getCoordinates();if(e<0||e+1>=i.length)return-1;if(i[e].y===i[e+1].y)return-1;let s=Di.LEFT;return i[e].y<i[e+1].y&&(s=Di.RIGHT),s}getEdge(){return this._orientedDe}checkForRightmostCoordinate(t){const e=t.getEdge().getCoordinates();for(let i=0;i<e.length-1;i++)(null===this._minCoord||e[i].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=i,this._minCoord=e[i])}findRightmostEdgeAtNode(){const t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}findEdge(t){for(let e=t.iterator();e.hasNext();){const t=e.next();t.isForward()&&this.checkForRightmostCoordinate(t)}u.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Di.LEFT&&(this._orientedDe=this._minDe.getSym())}}class ra{constructor(){this.array=[]}addLast(t){this.array.push(t)}removeFirst(){return this.array.shift()}isEmpty(){return 0===this.array.length}}class la{constructor(){la.constructor_.apply(this,arguments)}static constructor_(){this._finder=null,this._dirEdgeList=new S,this._nodes=new S,this._rightMostCoord=null,this._env=null,this._finder=new oa}clearVisitedEdges(){for(let t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)}getRightmostCoordinate(){return this._rightMostCoord}computeNodeDepth(t){let e=null;for(let i=t.getEdges().iterator();i.hasNext();){const t=i.next();if(t.isVisited()||t.getSym().isVisited()){e=t;break}}if(null===e)throw new es("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(let e=t.getEdges().iterator();e.hasNext();){const t=e.next();t.setVisited(!0),this.copySymDepths(t)}}computeDepth(t){this.clearVisitedEdges();const e=this._finder.getEdge();e.getNode(),e.getLabel(),e.setEdgeDepths(Di.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)}create(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()}findResultEdges(){for(let t=this._dirEdgeList.iterator();t.hasNext();){const e=t.next();e.getDepth(Di.RIGHT)>=1&&e.getDepth(Di.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}}computeDepths(t){const e=new vt,i=new ra,s=t.getNode();for(i.addLast(s),e.add(s),t.setVisited(!0);!i.isEmpty();){const t=i.removeFirst();e.add(t),this.computeNodeDepth(t);for(let s=t.getEdges().iterator();s.hasNext();){const t=s.next().getSym();if(t.isVisited())continue;const a=t.getNode();e.contains(a)||(i.addLast(a),e.add(a))}}}compareTo(t){const e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0}getEnvelope(){if(null===this._env){const t=new D;for(let e=this._dirEdgeList.iterator();e.hasNext();){const i=e.next().getEdge().getCoordinates();for(let e=0;e<i.length-1;e++)t.expandToInclude(i[e])}this._env=t}return this._env}addReachable(t){const e=new ti;for(e.add(t);!e.empty();){const t=e.pop();this.add(t,e)}}copySymDepths(t){const e=t.getSym();e.setDepth(Di.LEFT,t.getDepth(Di.RIGHT)),e.setDepth(Di.RIGHT,t.getDepth(Di.LEFT))}add(t,e){t.setVisited(!0),this._nodes.add(t);for(let i=t.getEdges().iterator();i.hasNext();){const t=i.next();this._dirEdgeList.add(t);const s=t.getSym().getNode();s.isVisited()||e.push(s)}}getNodes(){return this._nodes}getDirectedEdges(){return this._dirEdgeList}get interfaces_(){return[o]}}class ha{constructor(){ha.constructor_.apply(this,arguments)}static constructor_(){if(this._startDe=null,this._maxNodeDegree=-1,this._edges=new S,this._pts=new S,this._label=new Ri(Jt.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new S,this._geometryFactory=null,0===arguments.length);else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}}computeRing(){if(null!==this._ring)return null;const t=new Array(this._pts.size()).fill(null);for(let e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=F.isCCW(this._ring.getCoordinates())}isIsolated(){return 1===this._label.getGeometryCount()}computePoints(t){this._startDe=t;let e=t,i=!0;do{if(null===e)throw new es("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new es("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);const t=e.getLabel();u.isTrue(t.isArea()),this.mergeLabel(t),this.addPoints(e.getEdge(),e.isForward(),i),i=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)}getLinearRing(){return this._ring}getCoordinate(t){return this._pts.get(t)}computeMaxNodeDegree(){this._maxNodeDegree=0;let t=this._startDe;do{const e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2}addPoints(t,e,i){const s=t.getCoordinates();if(e){let t=1;i&&(t=0);for(let e=t;e<s.length;e++)this._pts.add(s[e])}else{let t=s.length-2;i&&(t=s.length-1);for(let e=t;e>=0;e--)this._pts.add(s[e])}}isHole(){return this._isHole}setInResult(){let t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)}containsPoint(t){const e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!qe.isInRing(t,e.getCoordinates()))return!1;for(let e=this._holes.iterator();e.hasNext();)if(e.next().containsPoint(t))return!1;return!0}addHole(t){this._holes.add(t)}isShell(){return null===this._shell}getLabel(){return this._label}getEdges(){return this._edges}getMaxNodeDegree(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}getShell(){return this._shell}mergeLabel(){if(1===arguments.length){const t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){const t=arguments[1],e=arguments[0].getLocation(t,Di.RIGHT);if(e===Jt.NONE)return null;if(this._label.getLocation(t)===Jt.NONE)return this._label.setLocation(t,e),null}}setShell(t){this._shell=t,null!==t&&t.addHole(this)}toPolygon(t){const e=new Array(this._holes.size()).fill(null);for(let t=0;t<this._holes.size();t++)e[t]=this._holes.get(t).getLinearRing();return t.createPolygon(this.getLinearRing(),e)}}class ca extends ha{constructor(){super(),ca.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0],e=arguments[1];ha.constructor_.call(this,t,e)}setEdgeRing(t,e){t.setMinEdgeRing(e)}getNext(t){return t.getNextMin()}}class pa extends ha{constructor(){super(),pa.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0],e=arguments[1];ha.constructor_.call(this,t,e)}buildMinimalRings(){const t=new S;let e=this._startDe;do{if(null===e.getMinEdgeRing()){const i=new ca(e,this._geometryFactory);t.add(i)}e=e.getNext()}while(e!==this._startDe);return t}setEdgeRing(t,e){t.setEdgeRing(e)}linkDirectedEdgesForMinimalEdgeRings(){let t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)}getNext(t){return t.getNext()}}class ua{constructor(){ua.constructor_.apply(this,arguments)}static constructor_(){this._geometryFactory=null,this._shellList=new S;const t=arguments[0];this._geometryFactory=t}static findEdgeRingContaining(t,e){const i=t.getLinearRing(),s=i.getEnvelopeInternal();let a=i.getCoordinateN(0),n=null,o=null;for(let t=e.iterator();t.hasNext();){const e=t.next(),r=e.getLinearRing(),l=r.getEnvelopeInternal();if(l.equals(s))continue;if(!l.contains(s))continue;a=dt.ptNotInList(i.getCoordinates(),r.getCoordinates());let h=!1;qe.isInRing(a,r.getCoordinates())&&(h=!0),h&&(null===n||o.contains(l))&&(n=e,o=n.getLinearRing().getEnvelopeInternal())}return n}sortShellsAndHoles(t,e,i){for(let s=t.iterator();s.hasNext();){const t=s.next();t.isHole()?i.add(t):e.add(t)}}computePolygons(t){const e=new S;for(let i=t.iterator();i.hasNext();){const t=i.next().toPolygon(this._geometryFactory);e.add(t)}return e}placeFreeHoles(t,e){for(let i=e.iterator();i.hasNext();){const e=i.next();if(null===e.getShell()){const i=ua.findEdgeRingContaining(e,t);if(null===i)throw new es("unable to assign hole to a shell",e.getCoordinate(0));e.setShell(i)}}}buildMinimalEdgeRings(t,e,i){const s=new S;for(let a=t.iterator();a.hasNext();){const t=a.next();if(t.getMaxNodeDegree()>2){t.linkDirectedEdgesForMinimalEdgeRings();const s=t.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):i.addAll(s)}else s.add(t)}return s}buildMaximalEdgeRings(t){const e=new S;for(let i=t.iterator();i.hasNext();){const t=i.next();if(t.isInResult()&&t.getLabel().isArea()&&null===t.getEdgeRing()){const i=new pa(t,this._geometryFactory);e.add(i),i.setInResult()}}return e}placePolygonHoles(t,e){for(let i=e.iterator();i.hasNext();){const e=i.next();e.isHole()&&e.setShell(t)}}getPolygons(){return this.computePolygons(this._shellList)}findShell(t){let e=0,i=null;for(let s=t.iterator();s.hasNext();){const t=s.next();t.isHole()||(i=t,e++)}return u.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),i}add(){if(1===arguments.length){const t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){const t=arguments[0],e=arguments[1];as.linkResultDirectedEdges(e);const i=this.buildMaximalEdgeRings(t),s=new S,a=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(a,this._shellList,s),this.placeFreeHoles(this._shellList,s)}}}class da{constructor(){da.constructor_.apply(this,arguments)}static constructor_(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=F.COUNTERCLOCKWISE;const t=arguments[0];this._inputLine=t}static simplify(t,e){return new da(t).simplify(e)}isDeletable(t,e,i,s){const a=this._inputLine[t],n=this._inputLine[e],o=this._inputLine[i];return!!this.isConcave(a,n,o)&&!!this.isShallow(a,n,o,s)&&this.isShallowSampled(a,n,t,i,s)}deleteShallowConcavities(){let t=1,e=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(e),s=!1;for(;i<this._inputLine.length;){let a=!1;this.isDeletable(t,e,i,this._distanceTol)&&(this._isDeleted[e]=da.DELETE,a=!0,s=!0),t=a?i:e,e=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(e)}return s}isShallowConcavity(t,e,i,s){return F.index(t,e,i)===this._angleOrientation&&j.pointToSegment(e,t,i)<s}isShallowSampled(t,e,i,s,a){let n=Math.trunc((s-i)/da.NUM_PTS_TO_CHECK);n<=0&&(n=1);for(let o=i;o<s;o+=n)if(!this.isShallow(t,e,this._inputLine[o],a))return!1;return!0}isConcave(t,e,i){return F.index(t,e,i)===this._angleOrientation}simplify(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=F.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);let e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()}findNextNonDeletedIndex(t){let e=t+1;for(;e<this._inputLine.length&&this._isDeleted[e]===da.DELETE;)e++;return e}isShallow(t,e,i,s){return j.pointToSegment(e,t,i)<s}collapseLine(){const t=new E;for(let e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==da.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()}}da.INIT=0,da.DELETE=1,da.KEEP=1,da.NUM_PTS_TO_CHECK=10;class ma{constructor(){ma.constructor_.apply(this,arguments)}static constructor_(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new S}getCoordinates(){return this._ptList.toArray(ma.COORDINATE_ARRAY_TYPE)}setPrecisionModel(t){this._precisionModel=t}addPt(t){const e=new y(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)}reverse(){}addPts(t,e){if(e)for(let e=0;e<t.length;e++)this.addPt(t[e]);else for(let e=t.length-1;e>=0;e--)this.addPt(t[e])}isRedundant(t){if(this._ptList.size()<1)return!1;const e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance}toString(){return(new wt).createLineString(this.getCoordinates()).toString()}closeRing(){if(this._ptList.size()<1)return null;const t=new y(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)}setMinimumVertexDistance(t){this._minimimVertexDistance=t}}ma.COORDINATE_ARRAY_TYPE=new Array(0).fill(null);class ga{constructor(){ga.constructor_.apply(this,arguments)}static constructor_(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Yt,this._seg1=new Yt,this._offset0=new Yt,this._offset1=new Yt,this._side=0,this._hasNarrowConcaveAngle=!1;const t=arguments[0],e=arguments[1],i=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Kt,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===na.JOIN_ROUND&&(this._closingSegLengthFactor=ga.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)}addNextSegment(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;const i=F.index(this._s0,this._s1,this._s2),s=i===F.CLOCKWISE&&this._side===Di.LEFT||i===F.COUNTERCLOCKWISE&&this._side===Di.RIGHT;0===i?this.addCollinear(e):s?this.addOutsideTurn(i,e):this.addInsideTurn(i,e)}addLineEndCap(t,e){const i=new Yt(t,e),s=new Yt;this.computeOffsetSegment(i,Di.LEFT,this._distance,s);const a=new Yt;this.computeOffsetSegment(i,Di.RIGHT,this._distance,a);const n=e.x-t.x,o=e.y-t.y,r=Math.atan2(o,n);switch(this._bufParams.getEndCapStyle()){case na.CAP_ROUND:this._segList.addPt(s.p1),this.addDirectedFillet(e,r+Math.PI/2,r-Math.PI/2,F.CLOCKWISE,this._distance),this._segList.addPt(a.p1);break;case na.CAP_FLAT:this._segList.addPt(s.p1),this._segList.addPt(a.p1);break;case na.CAP_SQUARE:const t=new y;t.x=Math.abs(this._distance)*Math.cos(r),t.y=Math.abs(this._distance)*Math.sin(r);const i=new y(s.p1.x+t.x,s.p1.y+t.y),n=new y(a.p1.x+t.x,a.p1.y+t.y);this._segList.addPt(i),this._segList.addPt(n)}}getCoordinates(){return this._segList.getCoordinates()}addMitreJoin(t,e,i,s){const a=B.intersection(e.p0,e.p1,i.p0,i.p1);if(null!==a&&(s<=0?1:a.distance(t)/Math.abs(s))<=this._bufParams.getMitreLimit())return this._segList.addPt(a),null;this.addLimitedMitreJoin(e,i,s,this._bufParams.getMitreLimit())}addOutsideTurn(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ga.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===na.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===na.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))}createSquare(t){this._segList.addPt(new y(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new y(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new y(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new y(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()}addSegments(t,e){this._segList.addPts(t,e)}addFirstSegment(){this._segList.addPt(this._offset1.p0)}addCornerFillet(t,e,i,s,a){const n=e.x-t.x,o=e.y-t.y;let r=Math.atan2(o,n);const l=i.x-t.x,h=i.y-t.y,c=Math.atan2(h,l);s===F.CLOCKWISE?r<=c&&(r+=2*Math.PI):r>=c&&(r-=2*Math.PI),this._segList.addPt(e),this.addDirectedFillet(t,r,c,s,a),this._segList.addPt(i)}addLastSegment(){this._segList.addPt(this._offset1.p1)}initSideSegments(t,e,i){this._s1=t,this._s2=e,this._side=i,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)}addLimitedMitreJoin(t,e,i,s){const a=this._seg0.p1,n=Qt.angle(a,this._seg0.p0),o=Qt.angleBetweenOriented(this._seg0.p0,a,this._seg1.p1)/2,r=Qt.normalize(n+o),l=Qt.normalize(r+Math.PI),h=s*i,c=i-h*Math.abs(Math.sin(o)),p=a.x+h*Math.cos(l),u=a.y+h*Math.sin(l),d=new y(p,u),m=new Yt(a,d),g=m.pointAlongOffset(1,c),f=m.pointAlongOffset(1,-c);this._side===Di.LEFT?(this._segList.addPt(g),this._segList.addPt(f)):(this._segList.addPt(f),this._segList.addPt(g))}addDirectedFillet(t,e,i,s,a){const n=s===F.CLOCKWISE?-1:1,o=Math.abs(e-i),r=Math.trunc(o/this._filletAngleQuantum+.5);if(r<1)return null;const l=o/r,h=new y;for(let i=0;i<r;i++){const s=e+n*i*l;h.x=t.x+a*Math.cos(s),h.y=t.y+a*Math.sin(s),this._segList.addPt(h)}}computeOffsetSegment(t,e,i,s){const a=e===Di.LEFT?1:-1,n=t.p1.x-t.p0.x,o=t.p1.y-t.p0.y,r=Math.sqrt(n*n+o*o),l=a*i*n/r,h=a*i*o/r;s.p0.x=t.p0.x-h,s.p0.y=t.p0.y+l,s.p1.x=t.p1.x-h,s.p1.y=t.p1.y+l}addInsideTurn(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*ga.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){const t=new y((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(t);const e=new y((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(e)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}createCircle(t){const e=new y(t.x+this._distance,t.y);this._segList.addPt(e),this.addDirectedFillet(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}addBevelJoin(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)}init(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new ma,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ga.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}addCollinear(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===na.JOIN_BEVEL||this._bufParams.getJoinStyle()===na.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,F.CLOCKWISE,this._distance))}closeRing(){this._segList.closeRing()}hasNarrowConcaveAngle(){return this._hasNarrowConcaveAngle}}ga.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,ga.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,ga.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,ga.MAX_CLOSING_SEG_LEN_FACTOR=80;class ya{constructor(){ya.constructor_.apply(this,arguments)}static constructor_(){this._distance=0,this._precisionModel=null,this._bufParams=null;const t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}static copyCoordinates(t){const e=new Array(t.length).fill(null);for(let i=0;i<e.length;i++)e[i]=new y(t[i]);return e}getOffsetCurve(t,e){if(this._distance=e,0===e)return null;const i=e<0,s=Math.abs(e),a=this.getSegGen(s);t.length<=1?this.computePointCurve(t[0],a):this.computeOffsetCurve(t,i,a);const n=a.getCoordinates();return i&&dt.reverse(n),n}computeSingleSidedBufferCurve(t,e,i){const s=this.simplifyTolerance(this._distance);if(e){i.addSegments(t,!0);const e=da.simplify(t,-s),a=e.length-1;i.initSideSegments(e[a],e[a-1],Di.LEFT),i.addFirstSegment();for(let t=a-2;t>=0;t--)i.addNextSegment(e[t],!0)}else{i.addSegments(t,!1);const e=da.simplify(t,s),a=e.length-1;i.initSideSegments(e[0],e[1],Di.LEFT),i.addFirstSegment();for(let t=2;t<=a;t++)i.addNextSegment(e[t],!0)}i.addLastSegment(),i.closeRing()}computeRingBufferCurve(t,e,i){let s=this.simplifyTolerance(this._distance);e===Di.RIGHT&&(s=-s);const a=da.simplify(t,s),n=a.length-1;i.initSideSegments(a[n-1],a[0],e);for(let t=1;t<=n;t++){const e=1!==t;i.addNextSegment(a[t],e)}i.closeRing()}computeLineBufferCurve(t,e){const i=this.simplifyTolerance(this._distance),s=da.simplify(t,i),a=s.length-1;e.initSideSegments(s[0],s[1],Di.LEFT);for(let t=2;t<=a;t++)e.addNextSegment(s[t],!0);e.addLastSegment(),e.addLineEndCap(s[a-1],s[a]);const n=da.simplify(t,-i),o=n.length-1;e.initSideSegments(n[o],n[o-1],Di.LEFT);for(let t=o-2;t>=0;t--)e.addNextSegment(n[t],!0);e.addLastSegment(),e.addLineEndCap(n[1],n[0]),e.closeRing()}computePointCurve(t,e){switch(this._bufParams.getEndCapStyle()){case na.CAP_ROUND:e.createCircle(t);break;case na.CAP_SQUARE:e.createSquare(t)}}getLineCurve(t,e){if(this._distance=e,this.isLineOffsetEmpty(e))return null;const i=Math.abs(e),s=this.getSegGen(i);if(t.length<=1)this.computePointCurve(t[0],s);else if(this._bufParams.isSingleSided()){const i=e<0;this.computeSingleSidedBufferCurve(t,i,s)}else this.computeLineBufferCurve(t,s);return s.getCoordinates()}getBufferParameters(){return this._bufParams}simplifyTolerance(t){return t*this._bufParams.getSimplifyFactor()}getRingCurve(t,e,i){if(this._distance=i,t.length<=2)return this.getLineCurve(t,i);if(0===i)return ya.copyCoordinates(t);const s=this.getSegGen(i);return this.computeRingBufferCurve(t,e,s),s.getCoordinates()}computeOffsetCurve(t,e,i){const s=this.simplifyTolerance(this._distance);if(e){const e=da.simplify(t,-s),a=e.length-1;i.initSideSegments(e[a],e[a-1],Di.LEFT),i.addFirstSegment();for(let t=a-2;t>=0;t--)i.addNextSegment(e[t],!0)}else{const e=da.simplify(t,s),a=e.length-1;i.initSideSegments(e[0],e[1],Di.LEFT),i.addFirstSegment();for(let t=2;t<=a;t++)i.addNextSegment(e[t],!0)}i.addLastSegment()}isLineOffsetEmpty(t){return 0===t||t<0&&!this._bufParams.isSingleSided()}getSegGen(t){return new ga(this._precisionModel,this._bufParams,t)}}class fa{constructor(){fa.constructor_.apply(this,arguments)}static constructor_(){this._subgraphs=null,this._seg=new Yt;const t=arguments[0];this._subgraphs=t}findStabbedSegments(){if(1===arguments.length){const t=arguments[0],e=new S;for(let i=this._subgraphs.iterator();i.hasNext();){const s=i.next(),a=s.getEnvelope();t.y<a.getMinY()||t.y>a.getMaxY()||this.findStabbedSegments(t,s.getDirectedEdges(),e)}return e}if(3===arguments.length)if(C(arguments[2],b)&&arguments[0]instanceof y&&arguments[1]instanceof is){const t=arguments[0],e=arguments[1],i=arguments[2],s=e.getEdge().getCoordinates();for(let a=0;a<s.length-1;a++){if(this._seg.p0=s[a],this._seg.p1=s[a+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),Math.max(this._seg.p0.x,this._seg.p1.x)<t.x)continue;if(this._seg.isHorizontal())continue;if(t.y<this._seg.p0.y||t.y>this._seg.p1.y)continue;if(F.index(this._seg.p0,this._seg.p1,t)===F.RIGHT)continue;let n=e.getDepth(Di.LEFT);this._seg.p0.equals(s[a])||(n=e.getDepth(Di.RIGHT));const o=new _a(this._seg,n);i.add(o)}}else if(C(arguments[2],b)&&arguments[0]instanceof y&&C(arguments[1],b)){const t=arguments[0],e=arguments[2];for(let i=arguments[1].iterator();i.hasNext();){const s=i.next();s.isForward()&&this.findStabbedSegments(t,s,e)}}}getDepth(t){const e=this.findStabbedSegments(t);return 0===e.size()?0:_e.min(e)._leftDepth}}class _a{constructor(){_a.constructor_.apply(this,arguments)}static constructor_(){this._upwardSeg=null,this._leftDepth=null;const t=arguments[0],e=arguments[1];this._upwardSeg=new Yt(t),this._leftDepth=e}compareTo(t){const e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;let i=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==i?i:(i=-1*e._upwardSeg.orientationIndex(this._upwardSeg),0!==i?i:this._upwardSeg.compareTo(e._upwardSeg))}compareX(t,e){const i=t.p0.compareTo(e.p0);return 0!==i?i:t.p1.compareTo(e.p1)}toString(){return this._upwardSeg.toString()}get interfaces_(){return[o]}}fa.DepthSegment=_a;class va{constructor(){va.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new S;const t=arguments[0],e=arguments[1],i=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=i}addRingSide(t,e,i,s,a){if(0===e&&t.length<pt.MINIMUM_VALID_SIZE)return null;let n=s,o=a;t.length>=pt.MINIMUM_VALID_SIZE&&F.isCCW(t)&&(n=a,o=s,i=Di.opposite(i));const r=this._curveBuilder.getRingCurve(t,i,e);this.addCurve(r,n,o)}addRingBothSides(t,e){this.addRingSide(t,e,Di.LEFT,Jt.EXTERIOR,Jt.INTERIOR),this.addRingSide(t,e,Di.RIGHT,Jt.INTERIOR,Jt.EXTERIOR)}addPoint(t){if(this._distance<=0)return null;const e=t.getCoordinates(),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,Jt.EXTERIOR,Jt.INTERIOR)}addPolygon(t){let e=this._distance,i=Di.LEFT;this._distance<0&&(e=-this._distance,i=Di.RIGHT);const s=t.getExteriorRing(),a=dt.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance))return null;if(this._distance<=0&&a.length<3)return null;this.addRingSide(a,e,i,Jt.EXTERIOR,Jt.INTERIOR);for(let s=0;s<t.getNumInteriorRing();s++){const a=t.getInteriorRingN(s),n=dt.removeRepeatedPoints(a.getCoordinates());this._distance>0&&this.isErodedCompletely(a,-this._distance)||this.addRingSide(n,e,Di.opposite(i),Jt.INTERIOR,Jt.EXTERIOR)}}isTriangleErodedCompletely(t,e){const i=new ee(t[0],t[1],t[2]),s=i.inCentre();return j.pointToSegment(s,i.p0,i.p1)<Math.abs(e)}addLineString(t){if(this._curveBuilder.isLineOffsetEmpty(this._distance))return null;const e=dt.removeRepeatedPoints(t.getCoordinates());if(dt.isRing(e)&&!this._curveBuilder.getBufferParameters().isSingleSided())this.addRingBothSides(e,this._distance);else{const t=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(t,Jt.EXTERIOR,Jt.INTERIOR)}}addCurve(t,e,i){if(null===t||t.length<2)return null;const s=new Hs(t,new Ri(0,Jt.BOUNDARY,e,i));this._curveList.add(s)}getCurves(){return this.add(this._inputGeom),this._curveList}add(t){if(t.isEmpty())return null;if(t instanceof at)this.addPolygon(t);else if(t instanceof Q)this.addLineString(t);else if(t instanceof tt)this.addPoint(t);else if(t instanceof ct)this.addCollection(t);else if(t instanceof bt)this.addCollection(t);else if(t instanceof ft)this.addCollection(t);else{if(!(t instanceof ht))throw new Y(t.getGeometryType());this.addCollection(t)}}isErodedCompletely(t,e){const i=t.getCoordinates();if(i.length<4)return e<0;if(4===i.length)return this.isTriangleErodedCompletely(i,e);const s=t.getEnvelopeInternal(),a=Math.min(s.getHeight(),s.getWidth());return e<0&&2*Math.abs(e)>a}addCollection(t){for(let e=0;e<t.getNumGeometries();e++){const i=t.getGeometryN(e);this.add(i)}}}class xa{constructor(){xa.constructor_.apply(this,arguments)}static constructor_(){this._edgeMap=new qi,this._edgeList=null,this._ptInAreaLocation=[Jt.NONE,Jt.NONE]}getNextCW(t){this.getEdges();const e=this._edgeList.indexOf(t);let i=e-1;return 0===e&&(i=this._edgeList.size()-1),this._edgeList.get(i)}propagateSideLabels(t){let e=Jt.NONE;for(let i=this.iterator();i.hasNext();){const s=i.next().getLabel();s.isArea(t)&&s.getLocation(t,Di.LEFT)!==Jt.NONE&&(e=s.getLocation(t,Di.LEFT))}if(e===Jt.NONE)return null;let i=e;for(let e=this.iterator();e.hasNext();){const s=e.next(),a=s.getLabel();if(a.getLocation(t,Di.ON)===Jt.NONE&&a.setLocation(t,Di.ON,i),a.isArea(t)){const e=a.getLocation(t,Di.LEFT),n=a.getLocation(t,Di.RIGHT);if(n!==Jt.NONE){if(n!==i)throw new es("side location conflict",s.getCoordinate());e===Jt.NONE&&u.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=e}else u.isTrue(a.getLocation(t,Di.LEFT)===Jt.NONE,"found single null side"),a.setLocation(t,Di.RIGHT,i),a.setLocation(t,Di.LEFT,i)}}}getCoordinate(){const t=this.iterator();return t.hasNext()?t.next().getCoordinate():null}print(t){G.out.println("EdgeEndStar: "+this.getCoordinate());for(let e=this.iterator();e.hasNext();)e.next().print(t)}isAreaLabelsConsistent(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)}checkAreaLabelsConsistent(t){const e=this.getEdges();if(e.size()<=0)return!0;const i=e.size()-1,s=e.get(i).getLabel().getLocation(t,Di.LEFT);u.isTrue(s!==Jt.NONE,"Found unlabelled area edge");let a=s;for(let e=this.iterator();e.hasNext();){const i=e.next().getLabel();u.isTrue(i.isArea(t),"Found non-area edge");const s=i.getLocation(t,Di.LEFT),n=i.getLocation(t,Di.RIGHT);if(s===n)return!1;if(n!==a)return!1;a=s}return!0}findIndex(t){this.iterator();for(let e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1}iterator(){return this.getEdges().iterator()}getEdges(){return null===this._edgeList&&(this._edgeList=new S(this._edgeMap.values())),this._edgeList}getLocation(t,e,i){return this._ptInAreaLocation[t]===Jt.NONE&&(this._ptInAreaLocation[t]=We.locate(e,i[t].getGeometry())),this._ptInAreaLocation[t]}toString(){const t=new P;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(let e=this.iterator();e.hasNext();){const i=e.next();t.append(i),t.append("\n")}return t.toString()}computeEdgeEndLabels(t){for(let e=this.iterator();e.hasNext();)e.next().computeLabel(t)}computeLabelling(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);const e=[!1,!1];for(let t=this.iterator();t.hasNext();){const i=t.next().getLabel();for(let t=0;t<2;t++)i.isLine(t)&&i.getLocation(t)===Jt.BOUNDARY&&(e[t]=!0)}for(let i=this.iterator();i.hasNext();){const s=i.next(),a=s.getLabel();for(let i=0;i<2;i++)if(a.isAnyNull(i)){let n=Jt.NONE;if(e[i])n=Jt.EXTERIOR;else{const e=s.getCoordinate();n=this.getLocation(i,e,t)}a.setAllLocationsIfNull(i,n)}}}getDegree(){return this._edgeMap.size()}insertEdgeEnd(t,e){this._edgeMap.put(t,e),this._edgeList=null}}class Ca extends xa{constructor(){super(),Ca.constructor_.apply(this,arguments)}static constructor_(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}linkResultDirectedEdges(){this.getResultAreaEdges();let t=null,e=null,i=this._SCANNING_FOR_INCOMING;for(let s=0;s<this._resultAreaEdgeList.size();s++){const a=this._resultAreaEdgeList.get(s),n=a.getSym();if(a.getLabel().isArea())switch(null===t&&a.isInResult()&&(t=a),i){case this._SCANNING_FOR_INCOMING:if(!n.isInResult())continue;e=n,i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!a.isInResult())continue;e.setNext(a),i=this._SCANNING_FOR_INCOMING}}if(i===this._LINKING_TO_OUTGOING){if(null===t)throw new es("no outgoing dirEdge found",this.getCoordinate());u.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}}insert(t){const e=t;this.insertEdgeEnd(e,e)}getRightmostEdge(){const t=this.getEdges(),e=t.size();if(e<1)return null;const i=t.get(0);if(1===e)return i;const s=t.get(e-1),a=i.getQuadrant(),n=s.getQuadrant();return Li.isNorthern(a)&&Li.isNorthern(n)?i:Li.isNorthern(a)||Li.isNorthern(n)?0!==i.getDy()?i:0!==s.getDy()?s:(u.shouldNeverReachHere("found two horizontal edges incident on node"),null):s}print(t){G.out.println("DirectedEdgeStar: "+this.getCoordinate());for(let e=this.iterator();e.hasNext();){const i=e.next();t.print("out "),i.print(t),t.println(),t.print("in "),i.getSym().print(t),t.println()}}getResultAreaEdges(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new S;for(let t=this.iterator();t.hasNext();){const e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList}updateLabelling(t){for(let e=this.iterator();e.hasNext();){const i=e.next().getLabel();i.setAllLocationsIfNull(0,t.getLocation(0)),i.setAllLocationsIfNull(1,t.getLocation(1))}}linkAllDirectedEdges(){this.getEdges();let t=null,e=null;for(let i=this._edgeList.size()-1;i>=0;i--){const s=this._edgeList.get(i),a=s.getSym();null===e&&(e=a),null!==t&&a.setNext(t),t=s}e.setNext(t)}computeDepths(){if(1===arguments.length){const t=arguments[0],e=this.findIndex(t),i=t.getDepth(Di.LEFT),s=t.getDepth(Di.RIGHT),a=this.computeDepths(e+1,this._edgeList.size(),i);if(this.computeDepths(0,e,a)!==s)throw new es("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){const t=arguments[1];let e=arguments[2];for(let i=arguments[0];i<t;i++){const t=this._edgeList.get(i);t.setEdgeDepths(Di.RIGHT,e),e=t.getDepth(Di.LEFT)}return e}}mergeSymLabels(){for(let t=this.iterator();t.hasNext();){const e=t.next();e.getLabel().merge(e.getSym().getLabel())}}linkMinimalDirectedEdges(t){let e=null,i=null,s=this._SCANNING_FOR_INCOMING;for(let a=this._resultAreaEdgeList.size()-1;a>=0;a--){const n=this._resultAreaEdgeList.get(a),o=n.getSym();switch(null===e&&n.getEdgeRing()===t&&(e=n),s){case this._SCANNING_FOR_INCOMING:if(o.getEdgeRing()!==t)continue;i=o,s=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(n.getEdgeRing()!==t)continue;i.setNextMin(n),s=this._SCANNING_FOR_INCOMING}}s===this._LINKING_TO_OUTGOING&&(u.isTrue(null!==e,"found null for first outgoing dirEdge"),u.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),i.setNextMin(e))}getOutgoingDegree(){if(0===arguments.length){let t=0;for(let e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){const t=arguments[0];let e=0;for(let i=this.iterator();i.hasNext();)i.next().getEdgeRing()===t&&e++;return e}}getLabel(){return this._label}findCoveredLineEdges(){let t=Jt.NONE;for(let e=this.iterator();e.hasNext();){const i=e.next(),s=i.getSym();if(!i.isLineEdge()){if(i.isInResult()){t=Jt.INTERIOR;break}if(s.isInResult()){t=Jt.EXTERIOR;break}}}if(t===Jt.NONE)return null;let e=t;for(let t=this.iterator();t.hasNext();){const i=t.next(),s=i.getSym();i.isLineEdge()?i.getEdge().setCovered(e===Jt.INTERIOR):(i.isInResult()&&(e=Jt.EXTERIOR),s.isInResult()&&(e=Jt.INTERIOR))}}computeLabelling(t){super.computeLabelling.call(this,t),this._label=new Ri(Jt.NONE);for(let t=this.iterator();t.hasNext();){const e=t.next().getEdge().getLabel();for(let t=0;t<2;t++){const i=e.getLocation(t);i!==Jt.INTERIOR&&i!==Jt.BOUNDARY||this._label.setLocation(t,Jt.INTERIOR)}}}}class La extends ss{constructor(){super()}createNode(t){return new Qi(t,new Ca)}}class Ma{constructor(){Ma.constructor_.apply(this,arguments)}static constructor_(){this._pts=null,this._orientation=null;const t=arguments[0];this._pts=t,this._orientation=Ma.orientation(t)}static orientation(t){return 1===dt.increasingDirection(t)}static compareOriented(t,e,i,s){const a=e?1:-1,n=s?1:-1,o=e?t.length:-1,r=s?i.length:-1;let l=e?0:t.length-1,h=s?0:i.length-1;for(;;){const e=t[l].compareTo(i[h]);if(0!==e)return e;l+=a,h+=n;const s=l===o,c=h===r;if(s&&!c)return-1;if(!s&&c)return 1;if(s&&c)return 0}}compareTo(t){const e=t;return Ma.compareOriented(this._pts,this._orientation,e._pts,e._orientation)}get interfaces_(){return[o]}}class ba{constructor(){ba.constructor_.apply(this,arguments)}static constructor_(){this._edges=new S,this._ocaMap=new qi}print(t){t.print("MULTILINESTRING ( ");for(let e=0;e<this._edges.size();e++){const i=this._edges.get(e);e>0&&t.print(","),t.print("(");const s=i.getCoordinates();for(let e=0;e<s.length;e++)e>0&&t.print(","),t.print(s[e].x+" "+s[e].y);t.println(")")}t.print(") ")}addAll(t){for(let e=t.iterator();e.hasNext();)this.add(e.next())}findEdgeIndex(t){for(let e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1}iterator(){return this._edges.iterator()}getEdges(){return this._edges}get(t){return this._edges.get(t)}findEqualEdge(t){const e=new Ma(t.getCoordinates());return this._ocaMap.get(e)}add(t){this._edges.add(t);const e=new Ma(t.getCoordinates());this._ocaMap.put(e,t)}}class wa{processIntersections(t,e,i,s){}isDone(){}}class Sa{constructor(){Sa.constructor_.apply(this,arguments)}static constructor_(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;const t=arguments[0];this._li=t}static isAdjacentSegments(t,e){return 1===Math.abs(t-e)}isTrivialIntersection(t,e,i,s){if(t===i&&1===this._li.getIntersectionNum()){if(Sa.isAdjacentSegments(e,s))return!0;if(t.isClosed()){const i=t.size()-1;if(0===e&&s===i||0===s&&e===i)return!0}}return!1}getProperIntersectionPoint(){return this._properIntersectionPoint}hasProperInteriorIntersection(){return this._hasProperInterior}getLineIntersector(){return this._li}hasProperIntersection(){return this._hasProper}processIntersections(t,e,i,s){if(t===i&&e===s)return null;this.numTests++;const a=t.getCoordinates()[e],n=t.getCoordinates()[e+1],o=i.getCoordinates()[s],r=i.getCoordinates()[s+1];this._li.computeIntersection(a,n,o,r),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,i,s)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),i.addIntersections(this._li,s,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))}hasIntersection(){return this._hasIntersection}isDone(){return!1}hasInteriorIntersection(){return this._hasInterior}get interfaces_(){return[wa]}}class Ia{constructor(){Ia.constructor_.apply(this,arguments)}static constructor_(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new ba;const t=arguments[0];this._bufParams=t}static depthDelta(t){const e=t.getLocation(0,Di.LEFT),i=t.getLocation(0,Di.RIGHT);return e===Jt.INTERIOR&&i===Jt.EXTERIOR?1:e===Jt.EXTERIOR&&i===Jt.INTERIOR?-1:0}static convertSegStrings(t){const e=new wt,i=new S;for(;t.hasNext();){const s=t.next(),a=e.createLineString(s.getCoordinates());i.add(a)}return e.buildGeometry(i)}setWorkingPrecisionModel(t){this._workingPrecisionModel=t}insertUniqueEdge(t){const e=this._edgeList.findEqualEdge(t);if(null!==e){const i=e.getLabel();let s=t.getLabel();e.isPointwiseEqual(t)||(s=new Ri(t.getLabel()),s.flip()),i.merge(s);const a=Ia.depthDelta(s),n=e.getDepthDelta()+a;e.setDepthDelta(n)}else this._edgeList.add(t),t.setDepthDelta(Ia.depthDelta(t.getLabel()))}buildSubgraphs(t,e){const i=new S;for(let s=t.iterator();s.hasNext();){const t=s.next(),a=t.getRightmostCoordinate(),n=new fa(i).getDepth(a);t.computeDepth(n),t.findResultEdges(),i.add(t),e.add(t.getDirectedEdges(),t.getNodes())}}createSubgraphs(t){const e=new S;for(let i=t.getNodes().iterator();i.hasNext();){const t=i.next();if(!t.isVisited()){const i=new la;i.create(t),e.add(i)}}return _e.sort(e,_e.reverseOrder()),e}createEmptyResultGeometry(){return this._geomFact.createPolygon()}getNoder(t){if(null!==this._workingNoder)return this._workingNoder;const e=new Xs,i=new Kt;return i.setPrecisionModel(t),e.setSegmentIntersector(new Sa(i)),e}buffer(t,e){let i=this._workingPrecisionModel;null===i&&(i=t.getPrecisionModel()),this._geomFact=t.getFactory();const s=new ya(i,this._bufParams),a=new va(t,e,s).getCurves();if(a.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(a,i),this._graph=new as(new La),this._graph.addEdges(this._edgeList.getEdges());const n=this.createSubgraphs(this._graph),o=new ua(this._geomFact);this.buildSubgraphs(n,o);const r=o.getPolygons();return r.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(r)}computeNodedEdges(t,e){const i=this.getNoder(e);i.computeNodes(t);for(let t=i.getNodedSubstrings().iterator();t.hasNext();){const e=t.next(),i=e.getCoordinates();if(2===i.length&&i[0].equals2D(i[1]))continue;const s=e.getData(),a=new Xi(e.getCoordinates(),new Ri(s));this.insertUniqueEdge(a)}}setNoder(t){this._workingNoder=t}}class Ea{constructor(){Ea.constructor_.apply(this,arguments)}static constructor_(){this._li=new Kt,this._segStrings=null;const t=arguments[0];this._segStrings=t}checkEndPtVertexIntersections(){if(0===arguments.length)for(let t=this._segStrings.iterator();t.hasNext();){const e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length){const t=arguments[0];for(let e=arguments[1].iterator();e.hasNext();){const i=e.next().getCoordinates();for(let e=1;e<i.length-1;e++)if(i[e].equals(t))throw new c("found endpt/interior pt intersection at index "+e+" :pt "+t)}}}checkInteriorIntersections(){if(0===arguments.length)for(let t=this._segStrings.iterator();t.hasNext();){const e=t.next();for(let t=this._segStrings.iterator();t.hasNext();){const i=t.next();this.checkInteriorIntersections(e,i)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1],i=t.getCoordinates(),s=e.getCoordinates();for(let a=0;a<i.length-1;a++)for(let i=0;i<s.length-1;i++)this.checkInteriorIntersections(t,a,e,i)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];if(t===i&&e===s)return null;const a=t.getCoordinates()[e],n=t.getCoordinates()[e+1],o=i.getCoordinates()[s],r=i.getCoordinates()[s+1];if(this._li.computeIntersection(a,n,o,r),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,a,n)||this.hasInteriorIntersection(this._li,o,r)))throw new c("found non-noded intersection at "+a+"-"+n+" and "+o+"-"+r)}}checkValid(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()}checkCollapses(){if(0===arguments.length)for(let t=this._segStrings.iterator();t.hasNext();){const e=t.next();this.checkCollapses(e)}else if(1===arguments.length){const t=arguments[0].getCoordinates();for(let e=0;e<t.length-2;e++)this.checkCollapse(t[e],t[e+1],t[e+2])}}hasInteriorIntersection(t,e,i){for(let s=0;s<t.getIntersectionNum();s++){const a=t.getIntersection(s);if(!a.equals(e)&&!a.equals(i))return!0}return!1}checkCollapse(t,e,i){if(t.equals(i))throw new c("found non-noded collapse at "+Ea.fact.createLineString([t,e,i]))}}Ea.fact=new wt;class Ta{constructor(){Ta.constructor_.apply(this,arguments)}static constructor_(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;const t=arguments[0],e=arguments[1],i=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=i,e<=0)throw new s("Scale factor must be non-zero");1!==e&&(this._pt=new y(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new y,this._p1Scaled=new y),this.initCorners(this._pt)}intersectsScaled(t,e){const i=Math.min(t.x,e.x),s=Math.max(t.x,e.x),a=Math.min(t.y,e.y),n=Math.max(t.y,e.y),o=this._maxx<i||this._minx>s||this._maxy<a||this._miny>n;if(o)return!1;const r=this.intersectsToleranceSquare(t,e);return u.isTrue(!(o&&r),"Found bad envelope test"),r}initCorners(t){const e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new y(this._maxx,this._maxy),this._corner[1]=new y(this._minx,this._maxy),this._corner[2]=new y(this._minx,this._miny),this._corner[3]=new y(this._maxx,this._miny)}intersects(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}scale(t){return Math.round(t*this._scaleFactor)}getCoordinate(){return this._originalPt}copyScaled(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)}getSafeEnvelope(){if(null===this._safeEnv){const t=Ta.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new D(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv}intersectsPixelClosure(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))}intersectsToleranceSquare(t,e){let i=!1,s=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(s=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||i&&s||t.equals(this._pt)||e.equals(this._pt)))))}addSnappedNode(t,e){const i=t.getCoordinate(e),s=t.getCoordinate(e+1);return!!this.intersects(i,s)&&(t.addIntersection(this.getCoordinate(),e),!0)}}Ta.SAFE_ENV_EXPANSION_FACTOR=.75;class Da{constructor(){Da.constructor_.apply(this,arguments)}static constructor_(){this.selectedSegment=new Yt}select(){if(1===arguments.length);else if(2===arguments.length){const t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}}class Pa{constructor(){Pa.constructor_.apply(this,arguments)}static constructor_(){this._index=null;const t=arguments[0];this._index=t}snap(){if(1===arguments.length){const t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=t.getSafeEnvelope(),a=new Oa(t,e,i);return this._index.query(s,new class{get interfaces_(){return[ke]}visitItem(t){t.select(s,a)}}),a.isNodeAdded()}}}class Oa extends Da{constructor(){super(),Oa.constructor_.apply(this,arguments)}static constructor_(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;const t=arguments[0],e=arguments[1],i=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=i}isNodeAdded(){return this._isNodeAdded}select(){if(!(2===arguments.length&&Number.isInteger(arguments[1])&&arguments[0]instanceof Ws))return super.select.apply(this,arguments);{const t=arguments[1],e=arguments[0].getContext();if(this._parentEdge===e&&(t===this._hotPixelVertexIndex||t+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(e,t)}}}Pa.HotPixelSnapAction=Oa;class ka{constructor(){ka.constructor_.apply(this,arguments)}static constructor_(){this._li=null,this._interiorIntersections=null;const t=arguments[0];this._li=t,this._interiorIntersections=new S}processIntersections(t,e,i,s){if(t===i&&e===s)return null;const a=t.getCoordinates()[e],n=t.getCoordinates()[e+1],o=i.getCoordinates()[s],r=i.getCoordinates()[s+1];if(this._li.computeIntersection(a,n,o,r),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(let t=0;t<this._li.getIntersectionNum();t++)this._interiorIntersections.add(this._li.getIntersection(t));t.addIntersections(this._li,e,0),i.addIntersections(this._li,s,1)}}isDone(){return!1}getInteriorIntersections(){return this._interiorIntersections}get interfaces_(){return[wa]}}class Na{constructor(){Na.constructor_.apply(this,arguments)}static constructor_(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;const t=arguments[0];this._pm=t,this._li=new Kt,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}checkCorrectness(t){const e=Hs.getNodedSubstrings(t),s=new Ea(e);try{s.checkValid()}catch(t){if(!(t instanceof i))throw t;t.printStackTrace()}}getNodedSubstrings(){return Hs.getNodedSubstrings(this._nodedSegStrings)}snapRound(t,e){const i=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(i),this.computeVertexSnaps(t)}findInteriorIntersections(t,e){const i=new ka(e);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(t),i.getInteriorIntersections()}computeVertexSnaps(){if(C(arguments[0],L))for(let t=arguments[0].iterator();t.hasNext();){const e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof Hs){const t=arguments[0],e=t.getCoordinates();for(let i=0;i<e.length;i++){const s=new Ta(e[i],this._scaleFactor,this._li);this._pointSnapper.snap(s,t,i)&&t.addIntersection(e[i],i)}}}computeNodes(t){this._nodedSegStrings=t,this._noder=new Xs,this._pointSnapper=new Pa(this._noder.getIndex()),this.snapRound(t,this._li)}computeIntersectionSnaps(t){for(let e=t.iterator();e.hasNext();){const t=e.next(),i=new Ta(t,this._scaleFactor,this._li);this._pointSnapper.snap(i)}}get interfaces_(){return[Ys]}}class Aa{constructor(){Aa.constructor_.apply(this,arguments)}static constructor_(){if(this._argGeom=null,this._distance=null,this._bufParams=new na,this._resultGeometry=null,this._saveException=null,1===arguments.length){const t=arguments[0];this._argGeom=t}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._argGeom=t,this._bufParams=e}}static bufferOp(){if(2===arguments.length){const t=arguments[1];return new Aa(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof q&&"number"==typeof arguments[1]){const t=arguments[1],e=arguments[2],i=new Aa(arguments[0]);return i.setQuadrantSegments(e),i.getResultGeometry(t)}if(arguments[2]instanceof na&&arguments[0]instanceof q&&"number"==typeof arguments[1]){const t=arguments[1];return new Aa(arguments[0],arguments[2]).getResultGeometry(t)}}else if(4===arguments.length){const t=arguments[1],e=arguments[2],i=arguments[3],s=new Aa(arguments[0]);return s.setQuadrantSegments(e),s.setEndCapStyle(i),s.getResultGeometry(t)}}static precisionScaleFactor(t,e,i){const s=t.getEnvelopeInternal(),a=z.max(Math.abs(s.getMaxX()),Math.abs(s.getMaxY()),Math.abs(s.getMinX()),Math.abs(s.getMinY()))+2*(e>0?e:0),n=i-Math.trunc(Math.log(a)/Math.log(10)+1);return Math.pow(10,n)}bufferFixedPrecision(t){const e=new Zs(new Na(new Lt(1)),t.getScale()),i=new Ia(this._bufParams);i.setWorkingPrecisionModel(t),i.setNoder(e),this._resultGeometry=i.buffer(this._argGeom,this._distance)}bufferReducedPrecision(){if(0===arguments.length){for(let t=Aa.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof es))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1===arguments.length){const t=arguments[0],e=Aa.precisionScaleFactor(this._argGeom,this._distance,t),i=new Lt(e);this.bufferFixedPrecision(i)}}computeGeometry(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;const t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Lt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()}setQuadrantSegments(t){this._bufParams.setQuadrantSegments(t)}bufferOriginalPrecision(){try{const t=new Ia(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof c))throw t;this._saveException=t}}getResultGeometry(t){return this._distance=t,this.computeGeometry(),this._resultGeometry}setEndCapStyle(t){this._bufParams.setEndCapStyle(t)}}Aa.CAP_ROUND=na.CAP_ROUND,Aa.CAP_BUTT=na.CAP_FLAT,Aa.CAP_FLAT=na.CAP_FLAT,Aa.CAP_SQUARE=na.CAP_SQUARE,Aa.MAX_PRECISION_DIGITS=12;var Ra=Object.freeze({__proto__:null,BufferOp:Aa,BufferParameters:na});class Fa{constructor(){Fa.constructor_.apply(this,arguments)}static constructor_(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){const t=arguments[0],e=arguments[1];Fa.constructor_.call(this,t,Fa.INSIDE_AREA,e)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._component=t,this._segIndex=e,this._pt=i}}getSegmentIndex(){return this._segIndex}getCoordinate(){return this._pt}isInsideArea(){return this._segIndex===Fa.INSIDE_AREA}toString(){return this._component.getGeometryType()+"["+this._segIndex+"]-"+$t.toPoint(this._pt)}getGeometryComponent(){return this._component}}Fa.INSIDE_AREA=-1;class Ba{constructor(){Ba.constructor_.apply(this,arguments)}static constructor_(){this._locations=null;const t=arguments[0];this._locations=t}static getLocations(t){const e=new S;return t.apply(new Ba(e)),e}filter(t){if(t.isEmpty())return null;(t instanceof tt||t instanceof Q||t instanceof at)&&this._locations.add(new Fa(t,0,t.getCoordinate()))}get interfaces_(){return[X]}}class Ga{constructor(){Ga.constructor_.apply(this,arguments)}static constructor_(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new gi,this._minDistanceLocation=null,this._minDistance=n.MAX_VALUE,2===arguments.length){const t=arguments[0],e=arguments[1];Ga.constructor_.call(this,t,e,0)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e,this._terminateDistance=i}}static distance(t,e){return new Ga(t,e).distance()}static isWithinDistance(t,e,i){return!(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>i)&&new Ga(t,e,i).distance()<=i}static nearestPoints(t,e){return new Ga(t,e).nearestPoints()}computeContainmentDistance(){if(0===arguments.length){const t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1],i=this._geom[t];if(i.getDimension()<2)return null;const s=1-t,a=xe.getPolygons(i);if(a.size()>0){const i=Ba.getLocations(this._geom[s]);if(this.computeContainmentDistance(i,a,e),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=e[0],this._minDistanceLocation[t]=e[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&C(arguments[0],b)&&C(arguments[1],b)){const t=arguments[0],e=arguments[1],i=arguments[2];for(let s=0;s<t.size();s++){const a=t.get(s);for(let t=0;t<e.size();t++)if(this.computeContainmentDistance(a,e.get(t),i),this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Fa&&arguments[1]instanceof at){const t=arguments[0],e=arguments[1],i=arguments[2],s=t.getCoordinate();if(Jt.EXTERIOR!==this._ptLocator.locate(s,e))return this._minDistance=0,i[0]=t,i[1]=new Fa(e,s),null}}computeMinDistanceLinesPoints(t,e,i){for(let s=0;s<t.size();s++){const a=t.get(s);for(let t=0;t<e.size();t++){const s=e.get(t);if(this.computeMinDistance(a,s,i),this._minDistance<=this._terminateDistance)return null}}}computeFacetDistance(){const t=new Array(2).fill(null),e=fe.getLines(this._geom[0]),i=fe.getLines(this._geom[1]),s=ve.getPoints(this._geom[0]),a=ve.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,a,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(i,s,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(s,a,t),void this.updateMinDistance(t,!1))))}nearestLocations(){return this.computeMinDistance(),this._minDistanceLocation}updateMinDistance(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])}nearestPoints(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]}computeMinDistance(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Q&&arguments[1]instanceof tt){const t=arguments[0],e=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;const s=t.getCoordinates(),a=e.getCoordinate();for(let n=0;n<s.length-1;n++){const o=j.pointToSegment(a,s[n],s[n+1]);if(o<this._minDistance){this._minDistance=o;const r=new Yt(s[n],s[n+1]).closestPoint(a);i[0]=new Fa(t,n,r),i[1]=new Fa(e,0,a)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Q&&arguments[1]instanceof Q){const t=arguments[0],e=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;const s=t.getCoordinates(),a=e.getCoordinates();for(let n=0;n<s.length-1;n++){const o=new D(s[n],s[n+1]);if(!(o.distance(e.getEnvelopeInternal())>this._minDistance))for(let r=0;r<a.length-1;r++){const l=new D(a[r],a[r+1]);if(o.distance(l)>this._minDistance)continue;const h=j.segmentToSegment(s[n],s[n+1],a[r],a[r+1]);if(h<this._minDistance){this._minDistance=h;const o=new Yt(s[n],s[n+1]),l=new Yt(a[r],a[r+1]),c=o.closestPoints(l);i[0]=new Fa(t,n,c[0]),i[1]=new Fa(e,r,c[1])}if(this._minDistance<=this._terminateDistance)return null}}}}computeMinDistancePoints(t,e,i){for(let s=0;s<t.size();s++){const a=t.get(s);for(let t=0;t<e.size();t++){const s=e.get(t),n=a.getCoordinate().distance(s.getCoordinate());if(n<this._minDistance&&(this._minDistance=n,i[0]=new Fa(a,0,a.getCoordinate()),i[1]=new Fa(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}}}distance(){if(null===this._geom[0]||null===this._geom[1])throw new s("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)}computeMinDistanceLines(t,e,i){for(let s=0;s<t.size();s++){const a=t.get(s);for(let t=0;t<e.size();t++){const s=e.get(t);if(this.computeMinDistance(a,s,i),this._minDistance<=this._terminateDistance)return null}}}}var za=Object.freeze({__proto__:null,DistanceOp:Ga});class ja{constructor(){ja.constructor_.apply(this,arguments)}static constructor_(){this._factory=null,this._directedEdges=new S,this._coordinates=null;const t=arguments[0];this._factory=t}getCoordinates(){if(null===this._coordinates){let t=0,e=0;const i=new E;for(let s=this._directedEdges.iterator();s.hasNext();){const a=s.next();a.getEdgeDirection()?t++:e++,i.add(a.getEdge().getLine().getCoordinates(),!1,a.getEdgeDirection())}this._coordinates=i.toCoordinateArray(),e>t&&dt.reverse(this._coordinates)}return this._coordinates}toLineString(){return this._factory.createLineString(this.getCoordinates())}add(t){this._directedEdges.add(t)}}class Ua{constructor(){Ua.constructor_.apply(this,arguments)}static constructor_(){this._isMarked=!1,this._isVisited=!1,this._data=null}static getComponentWithVisitedState(t,e){for(;t.hasNext();){const i=t.next();if(i.isVisited()===e)return i}return null}static setVisited(t,e){for(;t.hasNext();)t.next().setVisited(e)}static setMarked(t,e){for(;t.hasNext();)t.next().setMarked(e)}setVisited(t){this._isVisited=t}isMarked(){return this._isMarked}setData(t){this._data=t}getData(){return this._data}setMarked(t){this._isMarked=t}getContext(){return this._data}isVisited(){return this._isVisited}setContext(t){this._data=t}}class Va extends Ua{constructor(){super(),Va.constructor_.apply(this,arguments)}static constructor_(){if(this._parentEdge=null,this._from=null,this._to=null,this._p0=null,this._p1=null,this._sym=null,this._edgeDirection=null,this._quadrant=null,this._angle=null,0===arguments.length);else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this._from=t,this._to=e,this._edgeDirection=s,this._p0=t.getCoordinate(),this._p1=i;const a=this._p1.x-this._p0.x,n=this._p1.y-this._p0.y;this._quadrant=Li.quadrant(a,n),this._angle=Math.atan2(n,a)}}static toEdges(t){const e=new S;for(let i=t.iterator();i.hasNext();)e.add(i.next()._parentEdge);return e}isRemoved(){return null===this._parentEdge}compareDirection(t){return this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:F.index(t._p0,t._p1,this._p1)}getCoordinate(){return this._from.getCoordinate()}print(t){const e=this.getClass().getName(),i=e.lastIndexOf("."),s=e.substring(i+1);t.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+this._angle)}getDirectionPt(){return this._p1}getAngle(){return this._angle}compareTo(t){const e=t;return this.compareDirection(e)}getFromNode(){return this._from}getSym(){return this._sym}setEdge(t){this._parentEdge=t}remove(){this._sym=null,this._parentEdge=null}getEdge(){return this._parentEdge}getQuadrant(){return this._quadrant}setSym(t){this._sym=t}getToNode(){return this._to}getEdgeDirection(){return this._edgeDirection}get interfaces_(){return[o]}}class qa extends Va{constructor(){super(),qa.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];Va.constructor_.call(this,t,e,i,s)}getNext(){return 2!==this.getToNode().getDegree()?null:this.getToNode().getOutEdges().getEdges().get(0)===this.getSym()?this.getToNode().getOutEdges().getEdges().get(1):(u.isTrue(this.getToNode().getOutEdges().getEdges().get(1)===this.getSym()),this.getToNode().getOutEdges().getEdges().get(0))}}class Ha extends Ua{constructor(){super(),Ha.constructor_.apply(this,arguments)}static constructor_(){if(this._dirEdge=null,0===arguments.length);else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.setDirectedEdges(t,e)}}isRemoved(){return null===this._dirEdge}setDirectedEdges(t,e){this._dirEdge=[t,e],t.setEdge(this),e.setEdge(this),t.setSym(e),e.setSym(t),t.getFromNode().addOutEdge(t),e.getFromNode().addOutEdge(e)}getDirEdge(){if(Number.isInteger(arguments[0])){const t=arguments[0];return this._dirEdge[t]}if(arguments[0]instanceof Wa){const t=arguments[0];return this._dirEdge[0].getFromNode()===t?this._dirEdge[0]:this._dirEdge[1].getFromNode()===t?this._dirEdge[1]:null}}remove(){this._dirEdge=null}getOppositeNode(t){return this._dirEdge[0].getFromNode()===t?this._dirEdge[0].getToNode():this._dirEdge[1].getFromNode()===t?this._dirEdge[1].getToNode():null}}class $a{constructor(){$a.constructor_.apply(this,arguments)}static constructor_(){this._outEdges=new S,this._sorted=!1}getNextEdge(t){const e=this.getIndex(t);return this._outEdges.get(this.getIndex(e+1))}getCoordinate(){const t=this.iterator();return t.hasNext()?t.next().getCoordinate():null}iterator(){return this.sortEdges(),this._outEdges.iterator()}sortEdges(){this._sorted||(_e.sort(this._outEdges),this._sorted=!0)}remove(t){this._outEdges.remove(t)}getEdges(){return this.sortEdges(),this._outEdges}getNextCWEdge(t){const e=this.getIndex(t);return this._outEdges.get(this.getIndex(e-1))}getIndex(){if(arguments[0]instanceof Ha){const t=arguments[0];this.sortEdges();for(let e=0;e<this._outEdges.size();e++)if(this._outEdges.get(e).getEdge()===t)return e;return-1}if(arguments[0]instanceof Va){const t=arguments[0];this.sortEdges();for(let e=0;e<this._outEdges.size();e++)if(this._outEdges.get(e)===t)return e;return-1}if(Number.isInteger(arguments[0])){let t=arguments[0]%this._outEdges.size();return t<0&&(t+=this._outEdges.size()),t}}add(t){this._outEdges.add(t),this._sorted=!1}getDegree(){return this._outEdges.size()}}class Wa extends Ua{constructor(){super(),Wa.constructor_.apply(this,arguments)}static constructor_(){if(this._pt=null,this._deStar=null,1===arguments.length){const t=arguments[0];Wa.constructor_.call(this,t,new $a)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._pt=t,this._deStar=e}}static getEdgesBetween(t,e){const i=Va.toEdges(t.getOutEdges().getEdges()),s=new vt(i),a=Va.toEdges(e.getOutEdges().getEdges());return s.retainAll(a),s}isRemoved(){return null===this._pt}addOutEdge(t){this._deStar.add(t)}getCoordinate(){return this._pt}getOutEdges(){return this._deStar}remove(){if(0===arguments.length)this._pt=null;else if(1===arguments.length){const t=arguments[0];this._deStar.remove(t)}}getIndex(t){return this._deStar.getIndex(t)}getDegree(){return this._deStar.getDegree()}}class Ka extends Ha{constructor(){super(),Ka.constructor_.apply(this,arguments)}static constructor_(){this._line=null;const t=arguments[0];this._line=t}getLine(){return this._line}}class Ya{constructor(){Ya.constructor_.apply(this,arguments)}static constructor_(){this._nodeMap=new qi}find(t){return this._nodeMap.get(t)}iterator(){return this._nodeMap.values().iterator()}remove(t){return this._nodeMap.remove(t)}values(){return this._nodeMap.values()}add(t){return this._nodeMap.put(t.getCoordinate(),t),t}}class Ja{constructor(){Ja.constructor_.apply(this,arguments)}static constructor_(){this._edges=new vt,this._dirEdges=new vt,this._nodeMap=new Ya}findNodesOfDegree(t){const e=new S;for(let i=this.nodeIterator();i.hasNext();){const s=i.next();s.getDegree()===t&&e.add(s)}return e}dirEdgeIterator(){return this._dirEdges.iterator()}edgeIterator(){return this._edges.iterator()}remove(){if(arguments[0]instanceof Ha){const t=arguments[0];this.remove(t.getDirEdge(0)),this.remove(t.getDirEdge(1)),this._edges.remove(t),t.remove()}else if(arguments[0]instanceof Va){const t=arguments[0],e=t.getSym();null!==e&&e.setSym(null),t.getFromNode().remove(t),t.remove(),this._dirEdges.remove(t)}else if(arguments[0]instanceof Wa){const t=arguments[0];for(let e=t.getOutEdges().getEdges().iterator();e.hasNext();){const t=e.next(),i=t.getSym();null!==i&&this.remove(i),this._dirEdges.remove(t);const s=t.getEdge();null!==s&&this._edges.remove(s)}this._nodeMap.remove(t.getCoordinate()),t.remove()}}findNode(t){return this._nodeMap.find(t)}getEdges(){return this._edges}nodeIterator(){return this._nodeMap.iterator()}contains(){if(arguments[0]instanceof Ha){const t=arguments[0];return this._edges.contains(t)}if(arguments[0]instanceof Va){const t=arguments[0];return this._dirEdges.contains(t)}}add(){if(arguments[0]instanceof Wa){const t=arguments[0];this._nodeMap.add(t)}else if(arguments[0]instanceof Ha){const t=arguments[0];this._edges.add(t),this.add(t.getDirEdge(0)),this.add(t.getDirEdge(1))}else if(arguments[0]instanceof Va){const t=arguments[0];this._dirEdges.add(t)}}getNodes(){return this._nodeMap.values()}}class Xa extends Ja{constructor(){super()}addEdge(t){if(t.isEmpty())return null;const e=dt.removeRepeatedPoints(t.getCoordinates());if(e.length<=1)return null;const i=e[0],s=e[e.length-1],a=this.getNode(i),n=this.getNode(s),o=new qa(a,n,e[1],!0),r=new qa(n,a,e[e.length-2],!1),l=new Ka(t);l.setDirectedEdges(o,r),this.add(l)}getNode(t){let e=this.findNode(t);return null===e&&(e=new Wa(t),this.add(e)),e}}class Qa{constructor(){Qa.constructor_.apply(this,arguments)}static constructor_(){this._graph=new Xa,this._mergedLineStrings=null,this._factory=null,this._edgeStrings=null}buildEdgeStringsForUnprocessedNodes(){for(let t=this._graph.getNodes().iterator();t.hasNext();){const e=t.next();e.isMarked()||(u.isTrue(2===e.getDegree()),this.buildEdgeStringsStartingAt(e),e.setMarked(!0))}}buildEdgeStringsForNonDegree2Nodes(){for(let t=this._graph.getNodes().iterator();t.hasNext();){const e=t.next();2!==e.getDegree()&&(this.buildEdgeStringsStartingAt(e),e.setMarked(!0))}}buildEdgeStringsForObviousStartNodes(){this.buildEdgeStringsForNonDegree2Nodes()}getMergedLineStrings(){return this.merge(),this._mergedLineStrings}buildEdgeStringsStartingAt(t){for(let e=t.getOutEdges().iterator();e.hasNext();){const t=e.next();t.getEdge().isMarked()||this._edgeStrings.add(this.buildEdgeStringStartingWith(t))}}merge(){if(null!==this._mergedLineStrings)return null;Ua.setMarked(this._graph.nodeIterator(),!1),Ua.setMarked(this._graph.edgeIterator(),!1),this._edgeStrings=new S,this.buildEdgeStringsForObviousStartNodes(),this.buildEdgeStringsForIsolatedLoops(),this._mergedLineStrings=new S;for(let t=this._edgeStrings.iterator();t.hasNext();){const e=t.next();this._mergedLineStrings.add(e.toLineString())}}addLineString(t){null===this._factory&&(this._factory=t.getFactory()),this._graph.addEdge(t)}buildEdgeStringStartingWith(t){const e=new ja(this._factory);let i=t;do{e.add(i),i.getEdge().setMarked(!0),i=i.getNext()}while(null!==i&&i!==t);return e}add(){if(arguments[0]instanceof q){const t=arguments[0];for(let e=0;e<t.getNumGeometries();e++){const i=t.getGeometryN(e);i instanceof Q&&this.addLineString(i)}}else if(C(arguments[0],L)){const t=arguments[0];this._mergedLineStrings=null;for(let e=t.iterator();e.hasNext();){const t=e.next();this.add(t)}}}buildEdgeStringsForIsolatedLoops(){this.buildEdgeStringsForUnprocessedNodes()}}class Za{constructor(){Za.constructor_.apply(this,arguments)}static constructor_(){this._parentGraph=null,this._edges=new vt,this._dirEdges=new S,this._nodeMap=new Ya;const t=arguments[0];this._parentGraph=t}dirEdgeIterator(){return this._dirEdges.iterator()}edgeIterator(){return this._edges.iterator()}getParent(){return this._parentGraph}nodeIterator(){return this._nodeMap.iterator()}contains(t){return this._edges.contains(t)}add(t){if(this._edges.contains(t))return null;this._edges.add(t),this._dirEdges.add(t.getDirEdge(0)),this._dirEdges.add(t.getDirEdge(1)),this._nodeMap.add(t.getDirEdge(0).getFromNode()),this._nodeMap.add(t.getDirEdge(1).getFromNode())}}class tn{constructor(){tn.constructor_.apply(this,arguments)}static constructor_(){this._graph=null;const t=arguments[0];this._graph=t}addReachable(t,e){const i=new ti;for(i.add(t);!i.empty();){const t=i.pop();this.addEdges(t,i,e)}}findSubgraph(t){const e=new Za(this._graph);return this.addReachable(t,e),e}getConnectedSubgraphs(){const t=new S;Ua.setVisited(this._graph.nodeIterator(),!1);for(let e=this._graph.edgeIterator();e.hasNext();){const i=e.next().getDirEdge(0).getFromNode();i.isVisited()||t.add(this.findSubgraph(i))}return t}addEdges(t,e,i){t.setVisited(!0);for(let s=t.getOutEdges().iterator();s.hasNext();){const t=s.next();i.add(t.getEdge());const a=t.getToNode();a.isVisited()||e.push(a)}}}class en{constructor(){en.constructor_.apply(this,arguments)}static constructor_(){this._graph=new Xa,this._factory=new wt,this._lineCount=0,this._isRun=!1,this._sequencedGeometry=null,this._isSequenceable=!1}static findUnvisitedBestOrientedDE(t){let e=null,i=null;for(let s=t.getOutEdges().iterator();s.hasNext();){const t=s.next();t.getEdge().isVisited()||(i=t,t.getEdgeDirection()&&(e=t))}return null!==e?e:i}static findLowestDegreeNode(t){let e=O.MAX_VALUE,i=null;for(let s=t.nodeIterator();s.hasNext();){const t=s.next();(null===i||t.getDegree()<e)&&(e=t.getDegree(),i=t)}return i}static isSequenced(t){if(!(t instanceof bt))return!0;const e=t,i=new rt;let s=null;const a=new S;for(let t=0;t<e.getNumGeometries();t++){const n=e.getGeometryN(t),o=n.getCoordinateN(0),r=n.getCoordinateN(n.getNumPoints()-1);if(i.contains(o))return!1;if(i.contains(r))return!1;null!==s&&(o.equals(s)||(i.addAll(a),a.clear())),a.add(o),a.add(r),s=r}return!0}static reverse(t){const e=t.getCoordinates(),i=new Array(e.length).fill(null),s=e.length;for(let t=0;t<s;t++)i[s-1-t]=new y(e[t]);return t.getFactory().createLineString(i)}static sequence(t){const e=new en;return e.add(t),e.getSequencedLineStrings()}addLine(t){null===this._factory&&(this._factory=t.getFactory()),this._graph.addEdge(t),this._lineCount++}hasSequence(t){let e=0;for(let i=t.nodeIterator();i.hasNext();)i.next().getDegree()%2==1&&e++;return e<=2}computeSequence(){if(this._isRun)return null;this._isRun=!0;const t=this.findSequences();if(null===t)return null;this._sequencedGeometry=this.buildSequencedGeometry(t),this._isSequenceable=!0;const e=this._sequencedGeometry.getNumGeometries();u.isTrue(this._lineCount===e,"Lines were missing from result"),u.isTrue(this._sequencedGeometry instanceof Q||this._sequencedGeometry instanceof bt,"Result is not lineal")}findSequences(){const t=new S;for(let e=new tn(this._graph).getConnectedSubgraphs().iterator();e.hasNext();){const i=e.next();if(!this.hasSequence(i))return null;{const e=this.findSequence(i);t.add(e)}}return t}addReverseSubpath(t,e,i){const s=t.getToNode();let a=null;for(;;){e.add(t.getSym()),t.getEdge().setVisited(!0),a=t.getFromNode();const i=en.findUnvisitedBestOrientedDE(a);if(null===i)break;t=i.getSym()}i&&u.isTrue(a===s,"path not contiguous")}findSequence(t){Ua.setVisited(t.edgeIterator(),!1);const e=en.findLowestDegreeNode(t).getOutEdges().iterator().next().getSym(),i=new ra,s=i.listIterator();for(this.addReverseSubpath(e,s,!1);s.hasPrevious();){const t=s.previous(),e=en.findUnvisitedBestOrientedDE(t.getFromNode());null!==e&&this.addReverseSubpath(e.getSym(),s,!0)}return this.orient(i)}reverse(t){const e=new ra;for(let i=t.iterator();i.hasNext();){const t=i.next();e.addFirst(t.getSym())}return e}orient(t){const e=t.get(0),i=t.get(t.size()-1),s=e.getFromNode(),a=i.getToNode();let n=!1;if(1===s.getDegree()||1===a.getDegree()){let t=!1;1===i.getToNode().getDegree()&&!1===i.getEdgeDirection()&&(t=!0,n=!0),1===e.getFromNode().getDegree()&&!0===e.getEdgeDirection()&&(t=!0,n=!1),t||1===e.getFromNode().getDegree()&&(n=!0)}return n?this.reverse(t):t}buildSequencedGeometry(t){const e=new S;for(let i=t.iterator();i.hasNext();)for(let t=i.next().iterator();t.hasNext();){const i=t.next(),s=i.getEdge().getLine();let a=s;i.getEdgeDirection()||s.isClosed()||(a=en.reverse(s)),e.add(a)}return 0===e.size()?this._factory.createMultiLineString(new Array(0).fill(null)):this._factory.buildGeometry(e)}getSequencedLineStrings(){return this.computeSequence(),this._sequencedGeometry}isSequenceable(){return this.computeSequence(),this._isSequenceable}add(){if(C(arguments[0],L))for(let t=arguments[0].iterator();t.hasNext();){const e=t.next();this.add(e)}else arguments[0]instanceof q&&arguments[0].apply(new class{get interfaces_(){return[V]}filter(t){t instanceof Q&&this.addLine(t)}})}}var sn=Object.freeze({__proto__:null,LineMerger:Qa,LineSequencer:en});class an{constructor(){an.constructor_.apply(this,arguments)}static constructor_(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Yt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Q&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1];an.constructor_.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1];this._srcPts=t,this._isClosed=an.isClosed(t),this._snapTolerance=e}}static isClosed(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])}snapVertices(t,e){const i=this._isClosed?t.size()-1:t.size();for(let s=0;s<i;s++){const i=t.get(s),a=this.findSnapForVertex(i,e);null!==a&&(t.set(s,new y(a)),0===s&&this._isClosed&&t.set(t.size()-1,new y(a)))}}findSnapForVertex(t,e){for(let i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<this._snapTolerance)return e[i]}return null}snapTo(t){const e=new E(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()}snapSegments(t,e){if(0===e.length)return null;let i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(let s=0;s<i;s++){const i=e[s],a=this.findSegmentIndexToSnap(i,t);a>=0&&t.add(a+1,new y(i),!1)}}findSegmentIndexToSnap(t,e){let i=n.MAX_VALUE,s=-1;for(let a=0;a<e.size()-1;a++){if(this._seg.p0=e.get(a),this._seg.p1=e.get(a+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}const n=this._seg.distance(t);n<this._snapTolerance&&n<i&&(i=n,s=a)}return s}setAllowSnappingToSourceVertices(t){this._allowSnappingToSourceVertices=t}}class nn{constructor(){nn.constructor_.apply(this,arguments)}static constructor_(){this._srcGeom=null;const t=arguments[0];this._srcGeom=t}static snap(t,e,i){const s=new Array(2).fill(null),a=new nn(t);s[0]=a.snapTo(e,i);const n=new nn(e);return s[1]=n.snapTo(s[0],i),s}static computeOverlaySnapTolerance(){if(1===arguments.length){const t=arguments[0];let e=nn.computeSizeBasedSnapTolerance(t);const i=t.getPrecisionModel();if(i.getType()===Lt.FIXED){const t=1/i.getScale()*2/1.415;t>e&&(e=t)}return e}if(2===arguments.length){const t=arguments[0],e=arguments[1];return Math.min(nn.computeOverlaySnapTolerance(t),nn.computeOverlaySnapTolerance(e))}}static computeSizeBasedSnapTolerance(t){const e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*nn.SNAP_PRECISION_FACTOR}static snapToSelf(t,e,i){return new nn(t).snapToSelf(e,i)}snapTo(t,e){const i=this.extractTargetCoordinates(t);return new on(e,i).transform(this._srcGeom)}snapToSelf(t,e){const i=this.extractTargetCoordinates(this._srcGeom),s=new on(t,i,!0).transform(this._srcGeom);let a=s;return e&&C(a,st)&&(a=s.buffer(0)),a}computeSnapTolerance(t){return this.computeMinimumSegmentLength(t)/10}extractTargetCoordinates(t){const e=new rt,i=t.getCoordinates();for(let t=0;t<i.length;t++)e.add(i[t]);return e.toArray(new Array(0).fill(null))}computeMinimumSegmentLength(t){let e=n.MAX_VALUE;for(let i=0;i<t.length-1;i++){const s=t[i].distance(t[i+1]);s<e&&(e=s)}return e}}nn.SNAP_PRECISION_FACTOR=1e-9;class on extends ge{constructor(){super(),on.constructor_.apply(this,arguments)}static constructor_(){if(this._snapTolerance=null,this._snapPts=null,this._isSelfSnap=!1,2===arguments.length){const t=arguments[0],e=arguments[1];this._snapTolerance=t,this._snapPts=e}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._snapTolerance=t,this._snapPts=e,this._isSelfSnap=i}}snapLine(t,e){const i=new an(t,this._snapTolerance);return i.setAllowSnappingToSourceVertices(this._isSelfSnap),i.snapTo(e)}transformCoordinates(t,e){const i=t.toCoordinateArray(),s=this.snapLine(i,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(s)}}var rn=Object.freeze({__proto__:null,GeometrySnapper:nn,LineStringSnapper:an});class ln{constructor(){ln.constructor_.apply(this,arguments)}static constructor_(){this._pts=null,this._data=null;const t=arguments[0],e=arguments[1];this._pts=t,this._data=e}getCoordinates(){return this._pts}size(){return this._pts.length}getCoordinate(t){return this._pts[t]}isClosed(){return this._pts[0].equals(this._pts[this._pts.length-1])}getSegmentOctant(t){return t===this._pts.length-1?-1:Us.octant(this.getCoordinate(t),this.getCoordinate(t+1))}setData(t){this._data=t}getData(){return this._data}toString(){return $t.toLineString(new gt(this._pts))}get interfaces_(){return[Vs]}}class hn{constructor(){hn.constructor_.apply(this,arguments)}static constructor_(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._keepIntersections=!0,this._isInteriorIntersectionsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new S,this._intersectionCount=0;const t=arguments[0];this._li=t,this._interiorIntersection=null}static createAllIntersectionsFinder(t){const e=new hn(t);return e.setFindAllIntersections(!0),e}static isInteriorVertexIntersection(){if(4===arguments.length){const t=arguments[1];return!(arguments[2]&&arguments[3]||!arguments[0].equals2D(t))}if(8===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4],n=arguments[5],o=arguments[6],r=arguments[7];return!!(hn.isInteriorVertexIntersection(t,i,a,o)||hn.isInteriorVertexIntersection(t,s,a,r)||hn.isInteriorVertexIntersection(e,i,n,o)||hn.isInteriorVertexIntersection(e,s,n,r))}}static createInteriorIntersectionCounter(t){const e=new hn(t);return e.setInteriorIntersectionsOnly(!0),e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e}static createIntersectionCounter(t){const e=new hn(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e}static isEndSegment(t,e){return 0===e||e>=t.size()-2}static createAnyIntersectionFinder(t){return new hn(t)}static createInteriorIntersectionsFinder(t){const e=new hn(t);return e.setFindAllIntersections(!0),e.setInteriorIntersectionsOnly(!0),e}setCheckEndSegmentsOnly(t){this._isCheckEndSegmentsOnly=t}getIntersectionSegments(){return this._intSegments}count(){return this._intersectionCount}getIntersections(){return this._intersections}setFindAllIntersections(t){this._findAllIntersections=t}setKeepIntersections(t){this._keepIntersections=t}getIntersection(){return this._interiorIntersection}processIntersections(t,e,i,s){if(!this._findAllIntersections&&this.hasIntersection())return null;const a=t===i;if(a&&e===s)return null;if(this._isCheckEndSegmentsOnly&&!hn.isEndSegment(t,e)&&!hn.isEndSegment(i,s))return null;const n=t.getCoordinate(e),o=t.getCoordinate(e+1),r=i.getCoordinate(s),l=i.getCoordinate(s+1),h=0===e,c=e+2===t.size(),p=0===s,u=s+2===i.size();this._li.computeIntersection(n,o,r,l);const d=this._li.hasIntersection()&&this._li.isInteriorIntersection();let m=!1;this._isInteriorIntersectionsOnly||(m=!(a&&Math.abs(s-e)<=1)&&hn.isInteriorVertexIntersection(n,o,r,l,h,c,p,u)),(d||m)&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=n,this._intSegments[1]=o,this._intSegments[2]=r,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)}hasIntersection(){return null!==this._interiorIntersection}isDone(){return!this._findAllIntersections&&null!==this._interiorIntersection}setInteriorIntersectionsOnly(t){this._isInteriorIntersectionsOnly=t}get interfaces_(){return[wa]}}class cn{constructor(){cn.constructor_.apply(this,arguments)}static constructor_(){this._li=new Kt,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;const t=arguments[0];this._segStrings=t}static computeIntersections(t){const e=new cn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()}execute(){if(null!==this._segInt)return null;this.checkInteriorIntersections()}getIntersections(){return this._segInt.getIntersections()}isValid(){return this.execute(),this._isValid}setFindAllIntersections(t){this._findAllIntersections=t}checkInteriorIntersections(){this._isValid=!0,this._segInt=new hn(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);const t=new Xs;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null}checkValid(){if(this.execute(),!this._isValid)throw new es(this.getErrorMessage(),this._segInt.getIntersection())}getErrorMessage(){if(this._isValid)return"no intersections found";const t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+$t.toLineString(t[0],t[1])+" and "+$t.toLineString(t[2],t[3])}}class pn{constructor(){pn.constructor_.apply(this,arguments)}static constructor_(){this._nv=null;const t=arguments[0];this._nv=new cn(pn.toSegmentStrings(t))}static toSegmentStrings(t){const e=new S;for(let i=t.iterator();i.hasNext();){const t=i.next();e.add(new ln(t.getCoordinates(),t))}return e}static checkValid(t){new pn(t).checkValid()}checkValid(){this._nv.checkValid()}}class un{constructor(){un.constructor_.apply(this,arguments)}static constructor_(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new S,this._resultLineList=new S;const t=arguments[0],e=arguments[1],i=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=i}collectLines(t){for(let e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){const i=e.next();this.collectLineEdge(i,t,this._lineEdgesList),this.collectBoundaryTouchEdge(i,t,this._lineEdgesList)}}labelIsolatedLine(t,e){const i=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,i)}build(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList}collectLineEdge(t,e,i){const s=t.getLabel(),a=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Cn.isResultOfOp(s,e)||a.isCovered()||(i.add(a),t.setVisitedEdge(!0)))}findCoveredLineEdges(){for(let t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(let t=this._op.getGraph().getEdgeEnds().iterator();t.hasNext();){const e=t.next(),i=e.getEdge();if(e.isLineEdge()&&!i.isCoveredSet()){const t=this._op.isCoveredByA(e.getCoordinate());i.setCovered(t)}}}labelIsolatedLines(t){for(let e=t.iterator();e.hasNext();){const t=e.next(),i=t.getLabel();t.isIsolated()&&(i.isNull(0)?this.labelIsolatedLine(t,0):this.labelIsolatedLine(t,1))}}buildLines(t){for(let t=this._lineEdgesList.iterator();t.hasNext();){const e=t.next(),i=this._geometryFactory.createLineString(e.getCoordinates());this._resultLineList.add(i),e.setInResult(!0)}}collectBoundaryTouchEdge(t,e,i){const s=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(u.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Cn.isResultOfOp(s,e)&&e===Cn.INTERSECTION&&(i.add(t.getEdge()),t.setVisitedEdge(!0))))}}class dn{constructor(){dn.constructor_.apply(this,arguments)}static constructor_(){this._op=null,this._geometryFactory=null,this._resultPointList=new S;const t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e}filterCoveredNodeToPoint(t){const e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){const t=this._geometryFactory.createPoint(e);this._resultPointList.add(t)}}extractNonCoveredResultNodes(t){for(let e=this._op.getGraph().getNodes().iterator();e.hasNext();){const i=e.next();if(!(i.isInResult()||i.isIncidentEdgeInResult()||0!==i.getEdges().getDegree()&&t!==Cn.INTERSECTION)){const e=i.getLabel();Cn.isResultOfOp(e,t)&&this.filterCoveredNodeToPoint(i)}}}build(t){return this.extractNonCoveredResultNodes(t),this._resultPointList}}class mn{constructor(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=new a,this._commonSignExp=null}getCommon(){return n.longBitsToDouble(this._commonBits)}add(t){const e=n.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=mn.signExpBits(this._commonBits),this._isFirst=!1,null):mn.signExpBits(e)!==this._commonSignExp?(this._commonBits.high=0,this._commonBits.low=0,null):(this._commonMantissaBitsCount=mn.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=mn.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))}toString(){if(1===arguments.length){const t=arguments[0],e=n.longBitsToDouble(t),i="0000000000000000000000000000000000000000000000000000000000000000"+a.toBinaryString(t),s=i.substring(i.length-64);return s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]"}}getClass(){return mn}get interfaces_(){return[]}static getBit(t,e){const i=1<<e%32;return e<32?t.low&i?1:0:t.high&i?1:0}static signExpBits(t){return t.high>>>20}static zeroLowerBits(t,e){let i="low";if(e>32&&(t.low=0,e%=32,i="high"),e>0){const s=e<32?~((1<<e)-1):0;t[i]&=s}return t}static numCommonMostSigMantissaBits(t,e){let i=0;for(let s=52;s>=0;s--){if(mn.getBit(t,s)!==mn.getBit(e,s))return i;i++}return 52}}class gn{constructor(){gn.constructor_.apply(this,arguments)}static constructor_(){this._commonCoord=null,this._ccFilter=new yn}addCommonBits(t){const e=new fn(this._commonCoord);t.apply(e),t.geometryChanged()}removeCommonBits(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;const e=new y(this._commonCoord);e.x=-e.x,e.y=-e.y;const i=new fn(e);return t.apply(i),t.geometryChanged(),t}getCommonCoordinate(){return this._commonCoord}add(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()}}class yn{constructor(){yn.constructor_.apply(this,arguments)}static constructor_(){this._commonBitsX=new mn,this._commonBitsY=new mn}filter(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)}getCommonCoordinate(){return new y(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())}get interfaces_(){return[H]}}class fn{constructor(){fn.constructor_.apply(this,arguments)}static constructor_(){this.trans=null;const t=arguments[0];this.trans=t}filter(t,e){const i=t.getOrdinate(e,0)+this.trans.x,s=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,i),t.setOrdinate(e,1,s)}isDone(){return!1}isGeometryChanged(){return!0}get interfaces_(){return[T]}}gn.CommonCoordinateFilter=yn,gn.Translater=fn;class _n{constructor(){_n.constructor_.apply(this,arguments)}static constructor_(){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null;const t=arguments[0],e=arguments[1];this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()}static overlayOp(t,e,i){return new _n(t,e).getResultGeometry(i)}static union(t,e){return _n.overlayOp(t,e,Cn.UNION)}static intersection(t,e){return _n.overlayOp(t,e,Cn.INTERSECTION)}static symDifference(t,e){return _n.overlayOp(t,e,Cn.SYMDIFFERENCE)}static difference(t,e){return _n.overlayOp(t,e,Cn.DIFFERENCE)}selfSnap(t){return new nn(t).snapTo(t,this._snapTolerance)}removeCommonBits(t){this._cbr=new gn,this._cbr.add(t[0]),this._cbr.add(t[1]);const e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e}prepareResult(t){return this._cbr.addCommonBits(t),t}getResultGeometry(t){const e=this.snap(this._geom),i=Cn.overlayOp(e[0],e[1],t);return this.prepareResult(i)}checkValid(t){t.isValid()||G.out.println("Snapped geometry is invalid")}computeSnapTolerance(){this._snapTolerance=nn.computeOverlaySnapTolerance(this._geom[0],this._geom[1])}snap(t){const e=this.removeCommonBits(t);return nn.snap(e[0],e[1],this._snapTolerance)}}class vn{constructor(){vn.constructor_.apply(this,arguments)}static constructor_(){this._geom=new Array(2).fill(null);const t=arguments[0],e=arguments[1];this._geom[0]=t,this._geom[1]=e}static overlayOp(t,e,i){return new vn(t,e).getResultGeometry(i)}static union(t,e){return vn.overlayOp(t,e,Cn.UNION)}static intersection(t,e){return vn.overlayOp(t,e,Cn.INTERSECTION)}static symDifference(t,e){return vn.overlayOp(t,e,Cn.SYMDIFFERENCE)}static difference(t,e){return vn.overlayOp(t,e,Cn.DIFFERENCE)}getResultGeometry(t){let e=null,i=!1,s=null;try{e=Cn.overlayOp(this._geom[0],this._geom[1],t),i=!0}catch(t){if(!(t instanceof c))throw t;s=t}if(!i)try{e=_n.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof c?s:t}return e}}class xn{constructor(){xn.constructor_.apply(this,arguments)}static constructor_(){if(this._li=new Kt,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){const t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new ns(0,t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];xn.constructor_.call(this,t,e,ci.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];t.getPrecisionModel().compareTo(e.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new ns(0,t,i),this._arg[1]=new ns(1,e,i)}}getArgGeometry(t){return this._arg[t].getGeometry()}setComputationPrecision(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)}}class Cn extends xn{constructor(){super(),Cn.constructor_.apply(this,arguments)}static constructor_(){this._ptLocator=new gi,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new ba,this._resultPolyList=new S,this._resultLineList=new S,this._resultPointList=new S;const t=arguments[0],e=arguments[1];xn.constructor_.call(this,t,e),this._graph=new as(new La),this._geomFact=t.getFactory()}static overlayOp(t,e,i){return new Cn(t,e).getResultGeometry(i)}static union(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cn.createEmptyResult(Cn.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}if(t.isGeometryCollection()||e.isGeometryCollection())throw new s("This method does not support GeometryCollection arguments");return vn.overlayOp(t,e,Cn.UNION)}static intersection(t,e){if(t.isEmpty()||e.isEmpty())return Cn.createEmptyResult(Cn.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){const i=e;return le.map(t,new class{get interfaces_(){return[MapOp]}map(t){return Cn.intersection(t,i)}})}return vn.overlayOp(t,e,Cn.INTERSECTION)}static symDifference(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cn.createEmptyResult(Cn.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}if(t.isGeometryCollection()||e.isGeometryCollection())throw new s("This method does not support GeometryCollection arguments");return vn.overlayOp(t,e,Cn.SYMDIFFERENCE)}static resultDimension(t,e,i){const s=e.getDimension(),a=i.getDimension();let n=-1;switch(t){case Cn.INTERSECTION:n=Math.min(s,a);break;case Cn.UNION:n=Math.max(s,a);break;case Cn.DIFFERENCE:n=s;break;case Cn.SYMDIFFERENCE:n=Math.max(s,a)}return n}static createEmptyResult(t,e,i,s){const a=Cn.resultDimension(t,e,i);return s.createEmpty(a)}static difference(t,e){if(t.isEmpty())return Cn.createEmptyResult(Cn.DIFFERENCE,t,e,t.getFactory());if(e.isEmpty())return t.copy();if(t.isGeometryCollection()||e.isGeometryCollection())throw new s("This method does not support GeometryCollection arguments");return vn.overlayOp(t,e,Cn.DIFFERENCE)}static isResultOfOp(){if(2===arguments.length){const t=arguments[0],e=arguments[1],i=t.getLocation(0),s=t.getLocation(1);return Cn.isResultOfOp(i,s,e)}if(3===arguments.length){let t=arguments[0],e=arguments[1],i=arguments[2];switch(t===Jt.BOUNDARY&&(t=Jt.INTERIOR),e===Jt.BOUNDARY&&(e=Jt.INTERIOR),i){case Cn.INTERSECTION:return t===Jt.INTERIOR&&e===Jt.INTERIOR;case Cn.UNION:return t===Jt.INTERIOR||e===Jt.INTERIOR;case Cn.DIFFERENCE:return t===Jt.INTERIOR&&e!==Jt.INTERIOR;case Cn.SYMDIFFERENCE:return t===Jt.INTERIOR&&e!==Jt.INTERIOR||t!==Jt.INTERIOR&&e===Jt.INTERIOR}return!1}}insertUniqueEdge(t){const e=this._edgeList.findEqualEdge(t);if(null!==e){const i=e.getLabel();let s=t.getLabel();e.isPointwiseEqual(t)||(s=new Ri(t.getLabel()),s.flip());const a=e.getDepth();a.isNull()&&a.add(i),a.add(s),i.merge(s)}else this._edgeList.add(t)}getGraph(){return this._graph}cancelDuplicateResultEdges(){for(let t=this._graph.getEdgeEnds().iterator();t.hasNext();){const e=t.next(),i=e.getSym();e.isInResult()&&i.isInResult()&&(e.setInResult(!1),i.setInResult(!1))}}isCoveredByLA(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)}computeGeometry(t,e,i,s){const a=new S;return a.addAll(t),a.addAll(e),a.addAll(i),a.isEmpty()?Cn.createEmptyResult(s,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)}mergeSymLabels(){for(let t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()}isCovered(t,e){for(let i=e.iterator();i.hasNext();){const e=i.next();if(this._ptLocator.locate(t,e)!==Jt.EXTERIOR)return!0}return!1}replaceCollapsedEdges(){const t=new S;for(let e=this._edgeList.iterator();e.hasNext();){const i=e.next();i.isCollapsed()&&(e.remove(),t.add(i.getCollapsedEdge()))}this._edgeList.addAll(t)}updateNodeLabelling(){for(let t=this._graph.getNodes().iterator();t.hasNext();){const e=t.next(),i=e.getEdges().getLabel();e.getLabel().merge(i)}}getResultGeometry(t){return this.computeOverlay(t),this._resultGeom}insertUniqueEdges(t){for(let e=t.iterator();e.hasNext();){const t=e.next();this.insertUniqueEdge(t)}}computeOverlay(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);const e=new S;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),pn.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();const i=new ua(this._geomFact);i.add(this._graph),this._resultPolyList=i.getPolygons();const s=new un(this,this._geomFact,this._ptLocator);this._resultLineList=s.build(t);const a=new dn(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)}labelIncompleteNode(t,e){const i=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,i)}copyPoints(t){for(let e=this._arg[t].getNodeIterator();e.hasNext();){const i=e.next();this._graph.addNode(i.getCoordinate()).setLabel(t,i.getLabel().getLocation(t))}}findResultAreaEdges(t){for(let e=this._graph.getEdgeEnds().iterator();e.hasNext();){const i=e.next(),s=i.getLabel();s.isArea()&&!i.isInteriorAreaEdge()&&Cn.isResultOfOp(s.getLocation(0,Di.RIGHT),s.getLocation(1,Di.RIGHT),t)&&i.setInResult(!0)}}computeLabelsFromDepths(){for(let t=this._edgeList.iterator();t.hasNext();){const e=t.next(),i=e.getLabel(),s=e.getDepth();if(!s.isNull()){s.normalize();for(let t=0;t<2;t++)i.isNull(t)||!i.isArea()||s.isNull(t)||(0===s.getDelta(t)?i.toLine(t):(u.isTrue(!s.isNull(t,Di.LEFT),"depth of LEFT side has not been initialized"),i.setLocation(t,Di.LEFT,s.getLocation(t,Di.LEFT)),u.isTrue(!s.isNull(t,Di.RIGHT),"depth of RIGHT side has not been initialized"),i.setLocation(t,Di.RIGHT,s.getLocation(t,Di.RIGHT))))}}}computeLabelling(){for(let t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()}labelIncompleteNodes(){for(let t=this._graph.getNodes().iterator();t.hasNext();){const e=t.next(),i=e.getLabel();e.isIsolated()&&(i.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(i)}}isCoveredByA(t){return!!this.isCovered(t,this._resultPolyList)}}Cn.INTERSECTION=1,Cn.UNION=2,Cn.DIFFERENCE=3,Cn.SYMDIFFERENCE=4;var Ln=Object.freeze({__proto__:null,snap:rn,OverlayOp:Cn});class Mn extends Va{constructor(){super(),Mn.constructor_.apply(this,arguments)}static constructor_(){this._edgeRing=null,this._next=null,this._label=-1;const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];Va.constructor_.call(this,t,e,i,s)}getNext(){return this._next}isInRing(){return null!==this._edgeRing}setRing(t){this._edgeRing=t}setLabel(t){this._label=t}getLabel(){return this._label}setNext(t){this._next=t}getRing(){return this._edgeRing}}class bn extends Ha{constructor(){super(),bn.constructor_.apply(this,arguments)}static constructor_(){this._line=null;const t=arguments[0];this._line=t}getLine(){return this._line}}class wn{constructor(){wn.constructor_.apply(this,arguments)}static constructor_(){this._geometryFactory=new wt,this._geomGraph=null,this._disconnectedRingcoord=null;const t=arguments[0];this._geomGraph=t}static findDifferentPoint(t,e){for(let i=0;i<t.length;i++)if(!t[i].equals(e))return t[i];return null}visitInteriorRing(t,e){if(t.isEmpty())return null;const i=t.getCoordinates(),s=i[0],a=wn.findDifferentPoint(i,s),n=e.findEdgeInSameDirection(s,a),o=e.findEdgeEnd(n);let r=null;o.getLabel().getLocation(0,Di.RIGHT)===Jt.INTERIOR?r=o:o.getSym().getLabel().getLocation(0,Di.RIGHT)===Jt.INTERIOR&&(r=o.getSym()),u.isTrue(null!==r,"unable to find dirEdge with Interior on RHS"),this.visitLinkedDirectedEdges(r)}visitShellInteriors(t,e){if(t instanceof at){const i=t;this.visitInteriorRing(i.getExteriorRing(),e)}if(t instanceof ft){const i=t;for(let t=0;t<i.getNumGeometries();t++){const s=i.getGeometryN(t);this.visitInteriorRing(s.getExteriorRing(),e)}}}getCoordinate(){return this._disconnectedRingcoord}setInteriorEdgesInResult(t){for(let e=t.getEdgeEnds().iterator();e.hasNext();){const t=e.next();t.getLabel().getLocation(0,Di.RIGHT)===Jt.INTERIOR&&t.setInResult(!0)}}visitLinkedDirectedEdges(t){const e=t;let i=t;do{u.isTrue(null!==i,"found null Directed Edge"),i.setVisited(!0),i=i.getNext()}while(i!==e)}buildEdgeRings(t){const e=new S;for(let i=t.iterator();i.hasNext();){const t=i.next();if(t.isInResult()&&null===t.getEdgeRing()){const i=new pa(t,this._geometryFactory);i.linkDirectedEdgesForMinimalEdgeRings();const s=i.buildMinimalRings();e.addAll(s)}}return e}hasUnvisitedShellEdge(t){for(let e=0;e<t.size();e++){const i=t.get(e);if(i.isHole())continue;const s=i.getEdges();let a=s.get(0);if(a.getLabel().getLocation(0,Di.RIGHT)===Jt.INTERIOR)for(let t=0;t<s.size();t++)if(a=s.get(t),!a.isVisited())return this._disconnectedRingcoord=a.getCoordinate(),!0}return!1}isInteriorsConnected(){const t=new S;this._geomGraph.computeSplitEdges(t);const e=new as(new La);e.addEdges(t),this.setInteriorEdgesInResult(e),e.linkResultDirectedEdges();const i=this.buildEdgeRings(e.getEdgeEnds());return this.visitShellInteriors(this._geomGraph.getGeometry(),e),!this.hasUnvisitedShellEdge(i)}}class Sn{createEdgeEndForNext(t,e,i,s){const a=i.segmentIndex+1;if(a>=t.getNumPoints()&&null===s)return null;let n=t.getCoordinate(a);null!==s&&s.segmentIndex===i.segmentIndex&&(n=s.coord);const o=new ts(t,i.coord,n,new Ri(t.getLabel()));e.add(o)}createEdgeEndForPrev(t,e,i,s){let a=i.segmentIndex;if(0===i.dist){if(0===a)return null;a--}let n=t.getCoordinate(a);null!==s&&s.segmentIndex>=a&&(n=s.coord);const o=new Ri(t.getLabel());o.flip();const r=new ts(t,i.coord,n,o);e.add(r)}computeEdgeEnds(){if(1===arguments.length){const t=arguments[0],e=new S;for(let i=t;i.hasNext();){const t=i.next();this.computeEdgeEnds(t,e)}return e}if(2===arguments.length){const t=arguments[0],e=arguments[1],i=t.getEdgeIntersectionList();i.addEndpoints();const s=i.iterator();let a=null,n=null;if(!s.hasNext())return null;let o=s.next();do{a=n,n=o,o=null,s.hasNext()&&(o=s.next()),null!==n&&(this.createEdgeEndForPrev(t,e,n,a),this.createEdgeEndForNext(t,e,n,o))}while(null!==n)}}}class In extends ts{constructor(){super(),In.constructor_.apply(this,arguments)}static constructor_(){if(this._edgeEnds=new S,1===arguments.length){const t=arguments[0];In.constructor_.call(this,null,t)}else if(2===arguments.length){const t=arguments[1];ts.constructor_.call(this,t.getEdge(),t.getCoordinate(),t.getDirectedCoordinate(),new Ri(t.getLabel())),this.insert(t)}}insert(t){this._edgeEnds.add(t)}print(t){t.println("EdgeEndBundle--\x3e Label: "+this._label);for(let e=this.iterator();e.hasNext();)e.next().print(t),t.println()}iterator(){return this._edgeEnds.iterator()}getEdgeEnds(){return this._edgeEnds}computeLabelOn(t,e){let i=0,s=!1;for(let e=this.iterator();e.hasNext();){const a=e.next().getLabel().getLocation(t);a===Jt.BOUNDARY&&i++,a===Jt.INTERIOR&&(s=!0)}let a=Jt.NONE;s&&(a=Jt.INTERIOR),i>0&&(a=ns.determineBoundary(e,i)),this._label.setLocation(t,a)}computeLabelSide(t,e){for(let i=this.iterator();i.hasNext();){const s=i.next();if(s.getLabel().isArea()){const i=s.getLabel().getLocation(t,e);if(i===Jt.INTERIOR)return this._label.setLocation(t,e,Jt.INTERIOR),null;i===Jt.EXTERIOR&&this._label.setLocation(t,e,Jt.EXTERIOR)}}}getLabel(){return this._label}computeLabelSides(t){this.computeLabelSide(t,Di.LEFT),this.computeLabelSide(t,Di.RIGHT)}updateIM(t){Xi.updateIM(this._label,t)}computeLabel(t){let e=!1;for(let t=this.iterator();t.hasNext();)t.next().getLabel().isArea()&&(e=!0);this._label=e?new Ri(Jt.NONE,Jt.NONE,Jt.NONE):new Ri(Jt.NONE);for(let i=0;i<2;i++)this.computeLabelOn(i,t),e&&this.computeLabelSides(i)}}class En extends xa{constructor(){super()}updateIM(t){for(let e=this.iterator();e.hasNext();)e.next().updateIM(t)}insert(t){let e=this._edgeMap.get(t);null===e?(e=new In(t),this.insertEdgeEnd(t,e)):e.insert(t)}}class Tn extends Qi{constructor(){super(),Tn.constructor_.apply(this,arguments)}static constructor_(){const t=arguments[0],e=arguments[1];Qi.constructor_.call(this,t,e)}updateIMFromEdges(t){this._edges.updateIM(t)}computeIM(t){t.setAtLeastIfValid(this._label.getLocation(0),this._label.getLocation(1),0)}}class Dn extends ss{constructor(){super()}createNode(t){return new Tn(t,new En)}}class Pn{constructor(){Pn.constructor_.apply(this,arguments)}static constructor_(){this._nodes=new Zi(new Dn)}insertEdgeEnds(t){for(let e=t.iterator();e.hasNext();){const t=e.next();this._nodes.add(t)}}getNodeIterator(){return this._nodes.iterator()}copyNodesAndLabels(t,e){for(let i=t.getNodeIterator();i.hasNext();){const t=i.next();this._nodes.addNode(t.getCoordinate()).setLabel(e,t.getLabel().getLocation(e))}}build(t){this.computeIntersectionNodes(t,0),this.copyNodesAndLabels(t,0);const e=(new Sn).computeEdgeEnds(t.getEdgeIterator());this.insertEdgeEnds(e)}computeIntersectionNodes(t,e){for(let i=t.getEdgeIterator();i.hasNext();){const t=i.next(),s=t.getLabel().getLocation(e);for(let i=t.getEdgeIntersectionList().iterator();i.hasNext();){const t=i.next(),a=this._nodes.addNode(t.coord);s===Jt.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,Jt.INTERIOR)}}}}class On{constructor(){On.constructor_.apply(this,arguments)}static constructor_(){this._li=new Kt,this._geomGraph=null,this._nodeGraph=new Pn,this._invalidPoint=null;const t=arguments[0];this._geomGraph=t}isNodeEdgeAreaLabelsConsistent(){for(let t=this._nodeGraph.getNodeIterator();t.hasNext();){const e=t.next();if(!e.getEdges().isAreaLabelsConsistent(this._geomGraph))return this._invalidPoint=e.getCoordinate().copy(),!1}return!0}getInvalidPoint(){return this._invalidPoint}hasDuplicateRings(){for(let t=this._nodeGraph.getNodeIterator();t.hasNext();)for(let e=t.next().getEdges().iterator();e.hasNext();){const t=e.next();if(t.getEdgeEnds().size()>1)return this._invalidPoint=t.getEdge().getCoordinate(0),!0}return!1}isNodeConsistentArea(){const t=this._geomGraph.computeSelfNodes(this._li,!0,!0);return t.hasProperIntersection()?(this._invalidPoint=t.getProperIntersectionPoint(),!1):(this._nodeGraph.build(this._geomGraph),this.isNodeEdgeAreaLabelsConsistent())}}class kn{constructor(){kn.constructor_.apply(this,arguments)}static constructor_(){this._graph=null,this._rings=new S,this._totalEnv=new D,this._index=null,this._nestedPt=null;const t=arguments[0];this._graph=t}buildIndex(){this._index=new Ts;for(let t=0;t<this._rings.size();t++){const e=this._rings.get(t),i=e.getEnvelopeInternal();this._index.insert(i,e)}}getNestedPoint(){return this._nestedPt}isNonNested(){this.buildIndex();for(let t=0;t<this._rings.size();t++){const e=this._rings.get(t),i=e.getCoordinates(),s=this._index.query(e.getEnvelopeInternal());for(let t=0;t<s.size();t++){const a=s.get(t),n=a.getCoordinates();if(e===a)continue;if(!e.getEnvelopeInternal().intersects(a.getEnvelopeInternal()))continue;const o=An.findPtNotNode(i,a,this._graph);if(null!==o&&qe.isInRing(o,n))return this._nestedPt=o,!1}}return!0}add(t){this._rings.add(t),this._totalEnv.expandToInclude(t.getEnvelopeInternal())}}class Nn{constructor(){Nn.constructor_.apply(this,arguments)}static constructor_(){if(this._errorType=null,this._pt=null,1===arguments.length){const t=arguments[0];Nn.constructor_.call(this,t,null)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._errorType=t,null!==e&&(this._pt=e.copy())}}getErrorType(){return this._errorType}getMessage(){return Nn.errMsg[this._errorType]}getCoordinate(){return this._pt}toString(){let t="";return null!==this._pt&&(t=" at or near point "+this._pt),this.getMessage()+t}}Nn.ERROR=0,Nn.REPEATED_POINT=1,Nn.HOLE_OUTSIDE_SHELL=2,Nn.NESTED_HOLES=3,Nn.DISCONNECTED_INTERIOR=4,Nn.SELF_INTERSECTION=5,Nn.RING_SELF_INTERSECTION=6,Nn.NESTED_SHELLS=7,Nn.DUPLICATE_RINGS=8,Nn.TOO_FEW_POINTS=9,Nn.INVALID_COORDINATE=10,Nn.RING_NOT_CLOSED=11,Nn.errMsg=["Topology Validation Error","Repeated Point","Hole lies outside shell","Holes are nested","Interior is disconnected","Self-intersection","Ring Self-intersection","Nested shells","Duplicate Rings","Too few distinct points in geometry component","Invalid Coordinate","Ring is not closed"];class An{constructor(){An.constructor_.apply(this,arguments)}static constructor_(){this._parentGeometry=null,this._isSelfTouchingRingFormingHoleValid=!1,this._validErr=null;const t=arguments[0];this._parentGeometry=t}static findPtNotNode(t,e,i){const s=i.findEdge(e).getEdgeIntersectionList();for(let e=0;e<t.length;e++){const i=t[e];if(!s.isIntersection(i))return i}return null}static isValid(){if(arguments[0]instanceof q)return new An(arguments[0]).isValid();if(arguments[0]instanceof y){const t=arguments[0];return!(n.isNaN(t.x)||n.isInfinite(t.x)||n.isNaN(t.y)||n.isInfinite(t.y))}}checkInvalidCoordinates(){if(arguments[0]instanceof Array){const t=arguments[0];for(let e=0;e<t.length;e++)if(!An.isValid(t[e]))return this._validErr=new Nn(Nn.INVALID_COORDINATE,t[e]),null}else if(arguments[0]instanceof at){const t=arguments[0];if(this.checkInvalidCoordinates(t.getExteriorRing().getCoordinates()),null!==this._validErr)return null;for(let e=0;e<t.getNumInteriorRing();e++)if(this.checkInvalidCoordinates(t.getInteriorRingN(e).getCoordinates()),null!==this._validErr)return null}}checkHolesNotNested(t,e){if(t.getNumInteriorRing()<=0)return null;const i=new kn(e);for(let e=0;e<t.getNumInteriorRing();e++){const s=t.getInteriorRingN(e);s.isEmpty()||i.add(s)}i.isNonNested()||(this._validErr=new Nn(Nn.NESTED_HOLES,i.getNestedPoint()))}checkConsistentArea(t){const e=new On(t);if(!e.isNodeConsistentArea())return this._validErr=new Nn(Nn.SELF_INTERSECTION,e.getInvalidPoint()),null;e.hasDuplicateRings()&&(this._validErr=new Nn(Nn.DUPLICATE_RINGS,e.getInvalidPoint()))}isValid(){return this.checkValid(this._parentGeometry),null===this._validErr}checkShellInsideHole(t,e,i){const s=t.getCoordinates(),a=e.getCoordinates(),n=An.findPtNotNode(s,e,i);if(null!==n&&!qe.isInRing(n,a))return n;const o=An.findPtNotNode(a,t,i);return null!==o?qe.isInRing(o,s)?o:null:(u.shouldNeverReachHere("points in shell and hole appear to be equal"),null)}checkNoSelfIntersectingRings(t){for(let e=t.getEdgeIterator();e.hasNext();){const t=e.next();if(this.checkNoSelfIntersectingRing(t.getEdgeIntersectionList()),null!==this._validErr)return null}}checkConnectedInteriors(t){const e=new wn(t);e.isInteriorsConnected()||(this._validErr=new Nn(Nn.DISCONNECTED_INTERIOR,e.getCoordinate()))}checkNoSelfIntersectingRing(t){const e=new rt;let i=!0;for(let s=t.iterator();s.hasNext();){const t=s.next();if(i)i=!1;else{if(e.contains(t.coord))return this._validErr=new Nn(Nn.RING_SELF_INTERSECTION,t.coord),null;e.add(t.coord)}}}checkHolesInShell(t,e){if(t.getNumInteriorRing()<=0)return null;const i=t.getExteriorRing(),s=i.isEmpty(),a=new je(i);for(let n=0;n<t.getNumInteriorRing();n++){const o=t.getInteriorRingN(n);let r=null;if(!o.isEmpty()){if(r=An.findPtNotNode(o.getCoordinates(),i,e),null===r)return null;if(s||Jt.EXTERIOR===a.locate(r))return this._validErr=new Nn(Nn.HOLE_OUTSIDE_SHELL,r),null}}}checkTooFewPoints(t){if(t.hasTooFewPoints())return this._validErr=new Nn(Nn.TOO_FEW_POINTS,t.getInvalidPoint()),null}getValidationError(){return this.checkValid(this._parentGeometry),this._validErr}checkValid(){if(arguments[0]instanceof tt){const t=arguments[0];this.checkInvalidCoordinates(t.getCoordinates())}else if(arguments[0]instanceof ct){const t=arguments[0];this.checkInvalidCoordinates(t.getCoordinates())}else if(arguments[0]instanceof pt){const t=arguments[0];if(this.checkInvalidCoordinates(t.getCoordinates()),null!==this._validErr)return null;if(this.checkClosedRing(t),null!==this._validErr)return null;const e=new ns(0,t);if(this.checkTooFewPoints(e),null!==this._validErr)return null;const i=new Kt;e.computeSelfNodes(i,!0,!0),this.checkNoSelfIntersectingRings(e)}else if(arguments[0]instanceof Q){const t=arguments[0];if(this.checkInvalidCoordinates(t.getCoordinates()),null!==this._validErr)return null;const e=new ns(0,t);this.checkTooFewPoints(e)}else if(arguments[0]instanceof at){const t=arguments[0];if(this.checkInvalidCoordinates(t),null!==this._validErr)return null;if(this.checkClosedRings(t),null!==this._validErr)return null;const e=new ns(0,t);if(this.checkTooFewPoints(e),null!==this._validErr)return null;if(this.checkConsistentArea(e),null!==this._validErr)return null;if(!this._isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(e),null!==this._validErr))return null;if(this.checkHolesInShell(t,e),null!==this._validErr)return null;if(this.checkHolesNotNested(t,e),null!==this._validErr)return null;this.checkConnectedInteriors(e)}else if(arguments[0]instanceof ft){const t=arguments[0];for(let e=0;e<t.getNumGeometries();e++){const i=t.getGeometryN(e);if(this.checkInvalidCoordinates(i),null!==this._validErr)return null;if(this.checkClosedRings(i),null!==this._validErr)return null}const e=new ns(0,t);if(this.checkTooFewPoints(e),null!==this._validErr)return null;if(this.checkConsistentArea(e),null!==this._validErr)return null;if(!this._isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(e),null!==this._validErr))return null;for(let i=0;i<t.getNumGeometries();i++){const s=t.getGeometryN(i);if(this.checkHolesInShell(s,e),null!==this._validErr)return null}for(let i=0;i<t.getNumGeometries();i++){const s=t.getGeometryN(i);if(this.checkHolesNotNested(s,e),null!==this._validErr)return null}if(this.checkShellsNotNested(t,e),null!==this._validErr)return null;this.checkConnectedInteriors(e)}else if(arguments[0]instanceof ht){const t=arguments[0];for(let e=0;e<t.getNumGeometries();e++){const i=t.getGeometryN(e);if(this.checkValid(i),null!==this._validErr)return null}}else if(arguments[0]instanceof q){const t=arguments[0];if(this._validErr=null,t.isEmpty())return null;if(t instanceof tt)this.checkValid(t);else if(t instanceof ct)this.checkValid(t);else if(t instanceof pt)this.checkValid(t);else if(t instanceof Q)this.checkValid(t);else if(t instanceof at)this.checkValid(t);else if(t instanceof ft)this.checkValid(t);else{if(!(t instanceof ht))throw new Y(t.getGeometryType());this.checkValid(t)}}}setSelfTouchingRingFormingHoleValid(t){this._isSelfTouchingRingFormingHoleValid=t}checkShellNotNested(t,e,i){const s=t.getCoordinates(),a=e.getExteriorRing();if(a.isEmpty())return null;const n=a.getCoordinates(),o=An.findPtNotNode(s,a,i);if(null===o)return null;if(!qe.isInRing(o,n))return null;if(e.getNumInteriorRing()<=0)return this._validErr=new Nn(Nn.NESTED_SHELLS,o),null;let r=null;for(let s=0;s<e.getNumInteriorRing();s++){const a=e.getInteriorRingN(s);if(r=this.checkShellInsideHole(t,a,i),null===r)return null}this._validErr=new Nn(Nn.NESTED_SHELLS,r)}checkClosedRings(t){if(this.checkClosedRing(t.getExteriorRing()),null!==this._validErr)return null;for(let e=0;e<t.getNumInteriorRing();e++)if(this.checkClosedRing(t.getInteriorRingN(e)),null!==this._validErr)return null}checkClosedRing(t){if(t.isEmpty())return null;if(!t.isClosed()){let e=null;t.getNumPoints()>=1&&(e=t.getCoordinateN(0)),this._validErr=new Nn(Nn.RING_NOT_CLOSED,e)}}checkShellsNotNested(t,e){for(let i=0;i<t.getNumGeometries();i++){const s=t.getGeometryN(i).getExteriorRing();for(let a=0;a<t.getNumGeometries();a++){if(i===a)continue;const n=t.getGeometryN(a);if(this.checkShellNotNested(s,n,e),null!==this._validErr)return null}}}}class Rn{constructor(){Rn.constructor_.apply(this,arguments)}static constructor_(){this._factory=null,this._deList=new S,this._lowestEdge=null,this._ring=null,this._locator=null,this._ringPts=null,this._holes=null,this._shell=null,this._isHole=null,this._isProcessed=!1,this._isIncludedSet=!1,this._isIncluded=!1;const t=arguments[0];this._factory=t}static findDirEdgesInRing(t){let e=t;const i=new S;do{i.add(e),e=e.getNext(),u.isTrue(null!==e,"found null DE in ring"),u.isTrue(e===t||!e.isInRing(),"found DE already in ring")}while(e!==t);return i}static addEdge(t,e,i){if(e)for(let e=0;e<t.length;e++)i.add(t[e],!1);else for(let e=t.length-1;e>=0;e--)i.add(t[e],!1)}static findEdgeRingContaining(t,e){const i=t.getRing(),s=i.getEnvelopeInternal();let a=i.getCoordinateN(0),n=null,o=null;for(let t=e.iterator();t.hasNext();){const e=t.next(),r=e.getRing().getEnvelopeInternal();r.equals(s)||r.contains(s)&&(a=dt.ptNotInList(i.getCoordinates(),e.getCoordinates()),e.isInRing(a)&&(null===n||o.contains(r))&&(n=e,o=n.getRing().getEnvelopeInternal()))}return n}isIncluded(){return this._isIncluded}getCoordinates(){if(null===this._ringPts){const t=new E;for(let e=this._deList.iterator();e.hasNext();){const i=e.next(),s=i.getEdge();Rn.addEdge(s.getLine().getCoordinates(),i.getEdgeDirection(),t)}this._ringPts=t.toCoordinateArray()}return this._ringPts}isIncludedSet(){return this._isIncludedSet}isValid(){return this.getCoordinates(),!(this._ringPts.length<=3)&&(this.getRing(),An.isValid(this._ring))}build(t){let e=t;do{this.add(e),e.setRing(this),e=e.getNext(),u.isTrue(null!==e,"found null DE in ring"),u.isTrue(e===t||!e.isInRing(),"found DE already in ring")}while(e!==t)}isInRing(t){return Jt.EXTERIOR!==this.getLocator().locate(t)}isOuterHole(){return!!this._isHole&&!this.hasShell()}getPolygon(){let t=null;if(null!==this._holes){t=new Array(this._holes.size()).fill(null);for(let e=0;e<this._holes.size();e++)t[e]=this._holes.get(e)}return this._factory.createPolygon(this._ring,t)}isHole(){return this._isHole}isProcessed(){return this._isProcessed}addHole(){if(arguments[0]instanceof pt){const t=arguments[0];null===this._holes&&(this._holes=new S),this._holes.add(t)}else if(arguments[0]instanceof Rn){const t=arguments[0];t.setShell(this);const e=t.getRing();null===this._holes&&(this._holes=new S),this._holes.add(e)}}setIncluded(t){this._isIncluded=t,this._isIncludedSet=!0}getOuterHole(){if(this.isHole())return null;for(let t=0;t<this._deList.size();t++){const e=this._deList.get(t).getSym().getRing();if(e.isOuterHole())return e}return null}computeHole(){const t=this.getRing();this._isHole=F.isCCW(t.getCoordinates())}hasShell(){return null!==this._shell}isOuterShell(){return null!==this.getOuterHole()}getLineString(){return this.getCoordinates(),this._factory.createLineString(this._ringPts)}toString(){return $t.toLineString(new gt(this.getCoordinates()))}getLocator(){return null===this._locator&&(this._locator=new je(this.getRing())),this._locator}getShell(){return this.isHole()?this._shell:this}add(t){this._deList.add(t)}getRing(){if(null!==this._ring)return this._ring;this.getCoordinates(),this._ringPts.length<3&&G.out.println(this._ringPts);try{this._ring=this._factory.createLinearRing(this._ringPts)}catch(t){if(!(t instanceof i))throw t;G.out.println(this._ringPts)}return this._ring}updateIncluded(){if(this.isHole())return null;for(let t=0;t<this._deList.size();t++){const e=this._deList.get(t).getSym().getRing().getShell();if(null!==e&&e.isIncludedSet())return this.setIncluded(!e.isIncluded()),null}}setShell(t){this._shell=t}setProcessed(t){this._isProcessed=t}}Rn.EnvelopeComparator=class{compare(t,e){const i=e;return t.getRing().getEnvelope().compareTo(i.getRing().getEnvelope())}get interfaces_(){return[l]}};class Fn extends Ja{constructor(){super(),Fn.constructor_.apply(this,arguments)}static constructor_(){this._factory=null;const t=arguments[0];this._factory=t}static findLabeledEdgeRings(t){const e=new S;let i=1;for(let s=t.iterator();s.hasNext();){const t=s.next();if(t.isMarked())continue;if(t.getLabel()>=0)continue;e.add(t);const a=Rn.findDirEdgesInRing(t);Fn.label(a,i),i++}return e}static getDegreeNonDeleted(t){let e=0;for(let i=t.getOutEdges().getEdges().iterator();i.hasNext();)i.next().isMarked()||e++;return e}static deleteAllEdges(t){for(let e=t.getOutEdges().getEdges().iterator();e.hasNext();){const t=e.next();t.setMarked(!0);const i=t.getSym();null!==i&&i.setMarked(!0)}}static label(t,e){for(let i=t.iterator();i.hasNext();)i.next().setLabel(e)}static computeNextCWEdges(t){let e=null,i=null;for(let s=t.getOutEdges().getEdges().iterator();s.hasNext();){const t=s.next();t.isMarked()||(null===e&&(e=t),null!==i&&i.getSym().setNext(t),i=t)}null!==i&&i.getSym().setNext(e)}static computeNextCCWEdges(t,e){let i=null,s=null;const a=t.getOutEdges().getEdges();for(let t=a.size()-1;t>=0;t--){const n=a.get(t),o=n.getSym();let r=null;n.getLabel()===e&&(r=n);let l=null;o.getLabel()===e&&(l=o),null===r&&null===l||(null!==l&&(s=l),null!==r&&(null!==s&&(s.setNext(r),s=null),null===i&&(i=r)))}null!==s&&(u.isTrue(null!==i),s.setNext(i))}static getDegree(t,e){let i=0;for(let s=t.getOutEdges().getEdges().iterator();s.hasNext();)s.next().getLabel()===e&&i++;return i}static findIntersectionNodes(t,e){let i=t,s=null;do{const a=i.getFromNode();Fn.getDegree(a,e)>1&&(null===s&&(s=new S),s.add(a)),i=i.getNext(),u.isTrue(null!==i,"found null DE in ring"),u.isTrue(i===t||!i.isInRing(),"found DE already in ring")}while(i!==t);return s}findEdgeRing(t){const e=new Rn(this._factory);return e.build(t),e}computeDepthParity(){if(0===arguments.length)for(;;)return null}computeNextCWEdges(){for(let t=this.nodeIterator();t.hasNext();){const e=t.next();Fn.computeNextCWEdges(e)}}addEdge(t){if(t.isEmpty())return null;const e=dt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return null;const i=e[0],s=e[e.length-1],a=this.getNode(i),n=this.getNode(s),o=new Mn(a,n,e[1],!0),r=new Mn(n,a,e[e.length-2],!1),l=new bn(t);l.setDirectedEdges(o,r),this.add(l)}deleteCutEdges(){this.computeNextCWEdges(),Fn.findLabeledEdgeRings(this._dirEdges);const t=new S;for(let e=this._dirEdges.iterator();e.hasNext();){const i=e.next();if(i.isMarked())continue;const s=i.getSym();if(i.getLabel()===s.getLabel()){i.setMarked(!0),s.setMarked(!0);const e=i.getEdge();t.add(e.getLine())}}return t}getEdgeRings(){this.computeNextCWEdges(),Fn.label(this._dirEdges,-1);const t=Fn.findLabeledEdgeRings(this._dirEdges);this.convertMaximalToMinimalEdgeRings(t);const e=new S;for(let t=this._dirEdges.iterator();t.hasNext();){const i=t.next();if(i.isMarked())continue;if(i.isInRing())continue;const s=this.findEdgeRing(i);e.add(s)}return e}getNode(t){let e=this.findNode(t);return null===e&&(e=new Wa(t),this.add(e)),e}convertMaximalToMinimalEdgeRings(t){for(let e=t.iterator();e.hasNext();){const t=e.next(),i=t.getLabel(),s=Fn.findIntersectionNodes(t,i);if(null!==s)for(let t=s.iterator();t.hasNext();){const e=t.next();Fn.computeNextCCWEdges(e,i)}}}deleteDangles(){const t=this.findNodesOfDegree(1),e=new vt,i=new ti;for(let e=t.iterator();e.hasNext();)i.push(e.next());for(;!i.isEmpty();){const t=i.pop();Fn.deleteAllEdges(t);for(let s=t.getOutEdges().getEdges().iterator();s.hasNext();){const t=s.next();t.setMarked(!0);const a=t.getSym();null!==a&&a.setMarked(!0);const n=t.getEdge();e.add(n.getLine());const o=t.getToNode();1===Fn.getDegreeNonDeleted(o)&&i.push(o)}}return e}}class Bn{constructor(){Bn.constructor_.apply(this,arguments)}static constructor_(){this._shells=null,this._shellIndex=null;const t=arguments[0];this._shells=t,this.buildIndex()}static assignHolesToShells(t,e){new Bn(e).assignHolesToShells(t)}assignHolesToShells(t){for(let e=t.iterator();e.hasNext();){const t=e.next();this.assignHoleToShell(t)}}buildIndex(){this._shellIndex=new Ts;for(const t of this._shells)this._shellIndex.insert(t.getRing().getEnvelopeInternal(),t)}queryOverlappingShells(t){return this._shellIndex.query(t)}findShellContaining(t){const e=t.getRing().getEnvelopeInternal(),i=this.queryOverlappingShells(e);return Rn.findEdgeRingContaining(t,i)}assignHoleToShell(t){const e=this.findShellContaining(t);null!==e&&e.addHole(t)}}class Gn{constructor(){Gn.constructor_.apply(this,arguments)}static constructor_(){if(this._lineStringAdder=new zn(this),this._graph=null,this._dangles=new S,this._cutEdges=new S,this._invalidRingLines=new S,this._holeList=null,this._shellList=null,this._polyList=null,this._isCheckingRingsValid=!0,this._extractOnlyPolygonal=null,this._geomFactory=null,0===arguments.length)Gn.constructor_.call(this,!1);else if(1===arguments.length){const t=arguments[0];this._extractOnlyPolygonal=t}}static extractPolygons(t,e){const i=new S;for(let s=t.iterator();s.hasNext();){const t=s.next();(e||t.isIncluded())&&i.add(t.getPolygon())}return i}static findOuterShells(t){for(let e=t.iterator();e.hasNext();){const t=e.next(),i=t.getOuterHole();null===i||i.isProcessed()||(t.setIncluded(!0),i.setProcessed(!0))}}static findDisjointShells(t){Gn.findOuterShells(t);let e=null;do{e=!1;for(let i=t.iterator();i.hasNext();){const t=i.next();t.isIncludedSet()||(t.updateIncluded(),t.isIncludedSet()||(e=!0))}}while(e)}getGeometry(){return null===this._geomFactory&&(this._geomFactory=new wt),this.polygonize(),this._extractOnlyPolygonal?this._geomFactory.buildGeometry(this._polyList):this._geomFactory.createGeometryCollection(wt.toGeometryArray(this._polyList))}getInvalidRingLines(){return this.polygonize(),this._invalidRingLines}findValidRings(t,e,i){for(let s=t.iterator();s.hasNext();){const t=s.next();t.isValid()?e.add(t):i.add(t.getLineString())}}polygonize(){if(null!==this._polyList)return null;if(this._polyList=new S,null===this._graph)return null;this._dangles=this._graph.deleteDangles(),this._cutEdges=this._graph.deleteCutEdges();const t=this._graph.getEdgeRings();let e=new S;this._invalidRingLines=new S,this._isCheckingRingsValid?this.findValidRings(t,e,this._invalidRingLines):e=t,this.findShellsAndHoles(e),Bn.assignHolesToShells(this._holeList,this._shellList),_e.sort(this._shellList,new Rn.EnvelopeComparator);let i=!0;this._extractOnlyPolygonal&&(Gn.findDisjointShells(this._shellList),i=!1),this._polyList=Gn.extractPolygons(this._shellList,i)}getDangles(){return this.polygonize(),this._dangles}getCutEdges(){return this.polygonize(),this._cutEdges}getPolygons(){return this.polygonize(),this._polyList}add(){if(C(arguments[0],L))for(let t=arguments[0].iterator();t.hasNext();){const e=t.next();this.add(e)}else if(arguments[0]instanceof Q){const t=arguments[0];this._geomFactory=t.getFactory(),null===this._graph&&(this._graph=new Fn(this._geomFactory)),this._graph.addEdge(t)}else arguments[0]instanceof q&&arguments[0].apply(this._lineStringAdder)}setCheckRingsValid(t){this._isCheckingRingsValid=t}findShellsAndHoles(t){this._holeList=new S,this._shellList=new S;for(let e=t.iterator();e.hasNext();){const t=e.next();t.computeHole(),t.isHole()?this._holeList.add(t):this._shellList.add(t)}}}class zn{constructor(){zn.constructor_.apply(this,arguments)}static constructor_(){this.p=null;const t=arguments[0];this.p=t}filter(t){t instanceof Q&&this.p.add(t)}get interfaces_(){return[V]}}Gn.LineStringAdder=zn;var jn=Object.freeze({__proto__:null,Polygonizer:Gn});class Un{constructor(){Un.constructor_.apply(this,arguments)}static constructor_(){this._li=new Kt,this._ptLocator=new gi,this._arg=null,this._nodes=new Zi(new Dn),this._im=null,this._isolatedEdges=new S,this._invalidPoint=null;const t=arguments[0];this._arg=t}insertEdgeEnds(t){for(let e=t.iterator();e.hasNext();){const t=e.next();this._nodes.add(t)}}computeProperIntersectionIM(t,e){const i=this._arg[0].getGeometry().getDimension(),s=this._arg[1].getGeometry().getDimension(),a=t.hasProperIntersection(),n=t.hasProperInteriorIntersection();2===i&&2===s?a&&e.setAtLeast("212101212"):2===i&&1===s?(a&&e.setAtLeast("FFF0FFFF2"),n&&e.setAtLeast("1FFFFF1FF")):1===i&&2===s?(a&&e.setAtLeast("F0FFFFFF2"),n&&e.setAtLeast("1F1FFFFFF")):1===i&&1===s&&n&&e.setAtLeast("0FFFFFFFF")}labelIsolatedEdges(t,e){for(let i=this._arg[t].getEdgeIterator();i.hasNext();){const t=i.next();t.isIsolated()&&(this.labelIsolatedEdge(t,e,this._arg[e].getGeometry()),this._isolatedEdges.add(t))}}labelIsolatedEdge(t,e,i){if(i.getDimension()>0){const s=this._ptLocator.locate(t.getCoordinate(),i);t.getLabel().setAllLocations(e,s)}else t.getLabel().setAllLocations(e,Jt.EXTERIOR)}computeIM(){const t=new Xt;if(t.set(Jt.EXTERIOR,Jt.EXTERIOR,2),!this._arg[0].getGeometry().getEnvelopeInternal().intersects(this._arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(t),t;this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1);const e=this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!1);this.computeIntersectionNodes(0),this.computeIntersectionNodes(1),this.copyNodesAndLabels(0),this.copyNodesAndLabels(1),this.labelIsolatedNodes(),this.computeProperIntersectionIM(e,t);const i=new Sn,s=i.computeEdgeEnds(this._arg[0].getEdgeIterator());this.insertEdgeEnds(s);const a=i.computeEdgeEnds(this._arg[1].getEdgeIterator());return this.insertEdgeEnds(a),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(t),t}labelNodeEdges(){for(let t=this._nodes.iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg)}copyNodesAndLabels(t){for(let e=this._arg[t].getNodeIterator();e.hasNext();){const i=e.next();this._nodes.addNode(i.getCoordinate()).setLabel(t,i.getLabel().getLocation(t))}}labelIntersectionNodes(t){for(let e=this._arg[t].getEdgeIterator();e.hasNext();){const i=e.next(),s=i.getLabel().getLocation(t);for(let e=i.getEdgeIntersectionList().iterator();e.hasNext();){const i=e.next(),a=this._nodes.find(i.coord);a.getLabel().isNull(t)&&(s===Jt.BOUNDARY?a.setLabelBoundary(t):a.setLabel(t,Jt.INTERIOR))}}}labelIsolatedNode(t,e){const i=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setAllLocations(e,i)}computeIntersectionNodes(t){for(let e=this._arg[t].getEdgeIterator();e.hasNext();){const i=e.next(),s=i.getLabel().getLocation(t);for(let e=i.getEdgeIntersectionList().iterator();e.hasNext();){const i=e.next(),a=this._nodes.addNode(i.coord);s===Jt.BOUNDARY?a.setLabelBoundary(t):a.getLabel().isNull(t)&&a.setLabel(t,Jt.INTERIOR)}}}labelIsolatedNodes(){for(let t=this._nodes.iterator();t.hasNext();){const e=t.next(),i=e.getLabel();u.isTrue(i.getGeometryCount()>0,"node with empty label found"),e.isIsolated()&&(i.isNull(0)?this.labelIsolatedNode(e,0):this.labelIsolatedNode(e,1))}}updateIM(t){for(let e=this._isolatedEdges.iterator();e.hasNext();)e.next().updateIM(t);for(let e=this._nodes.iterator();e.hasNext();){const i=e.next();i.updateIM(t),i.updateIMFromEdges(t)}}computeDisjointIM(t){const e=this._arg[0].getGeometry();e.isEmpty()||(t.set(Jt.INTERIOR,Jt.EXTERIOR,e.getDimension()),t.set(Jt.BOUNDARY,Jt.EXTERIOR,e.getBoundaryDimension()));const i=this._arg[1].getGeometry();i.isEmpty()||(t.set(Jt.EXTERIOR,Jt.INTERIOR,i.getDimension()),t.set(Jt.EXTERIOR,Jt.BOUNDARY,i.getBoundaryDimension()))}}class Vn{constructor(){Vn.constructor_.apply(this,arguments)}static constructor_(){this._rectEnv=null;const t=arguments[0];this._rectEnv=t.getEnvelopeInternal()}static contains(t,e){return new Vn(t).contains(e)}isContainedInBoundary(t){if(t instanceof at)return!1;if(t instanceof tt)return this.isPointContainedInBoundary(t);if(t instanceof Q)return this.isLineStringContainedInBoundary(t);for(let e=0;e<t.getNumGeometries();e++){const i=t.getGeometryN(e);if(!this.isContainedInBoundary(i))return!1}return!0}isLineSegmentContainedInBoundary(t,e){if(t.equals(e))return this.isPointContainedInBoundary(t);if(t.x===e.x){if(t.x===this._rectEnv.getMinX()||t.x===this._rectEnv.getMaxX())return!0}else if(t.y===e.y&&(t.y===this._rectEnv.getMinY()||t.y===this._rectEnv.getMaxY()))return!0;return!1}isLineStringContainedInBoundary(t){const e=t.getCoordinateSequence(),i=new y,s=new y;for(let t=0;t<e.size()-1;t++)if(e.getCoordinate(t,i),e.getCoordinate(t+1,s),!this.isLineSegmentContainedInBoundary(i,s))return!1;return!0}isPointContainedInBoundary(){if(arguments[0]instanceof tt){const t=arguments[0];return this.isPointContainedInBoundary(t.getCoordinate())}if(arguments[0]instanceof y){const t=arguments[0];return t.x===this._rectEnv.getMinX()||t.x===this._rectEnv.getMaxX()||t.y===this._rectEnv.getMinY()||t.y===this._rectEnv.getMaxY()}}contains(t){return!!this._rectEnv.contains(t.getEnvelopeInternal())&&!this.isContainedInBoundary(t)}}class qn{constructor(){qn.constructor_.apply(this,arguments)}static constructor_(){this._li=new Kt,this._rectEnv=null,this._diagUp0=null,this._diagUp1=null,this._diagDown0=null,this._diagDown1=null;const t=arguments[0];this._rectEnv=t,this._diagUp0=new y(t.getMinX(),t.getMinY()),this._diagUp1=new y(t.getMaxX(),t.getMaxY()),this._diagDown0=new y(t.getMinX(),t.getMaxY()),this._diagDown1=new y(t.getMaxX(),t.getMinY())}intersects(t,e){const i=new D(t,e);if(!this._rectEnv.intersects(i))return!1;if(this._rectEnv.intersects(t))return!0;if(this._rectEnv.intersects(e))return!0;if(t.compareTo(e)>0){const i=t;t=e,e=i}let s=!1;return e.y>t.y&&(s=!0),s?this._li.computeIntersection(t,e,this._diagDown0,this._diagDown1):this._li.computeIntersection(t,e,this._diagUp0,this._diagUp1),!!this._li.hasIntersection()}}class Hn{constructor(){Hn.constructor_.apply(this,arguments)}static constructor_(){this._rectangle=null,this._rectEnv=null;const t=arguments[0];this._rectangle=t,this._rectEnv=t.getEnvelopeInternal()}static intersects(t,e){return new Hn(t).intersects(e)}intersects(t){if(!this._rectEnv.intersects(t.getEnvelopeInternal()))return!1;const e=new $n(this._rectEnv);if(e.applyTo(t),e.intersects())return!0;const i=new Wn(this._rectangle);if(i.applyTo(t),i.containsPoint())return!0;const s=new Kn(this._rectangle);return s.applyTo(t),!!s.intersects()}}class $n extends Ce{constructor(){super(),$n.constructor_.apply(this,arguments)}static constructor_(){this._rectEnv=null,this._intersects=!1;const t=arguments[0];this._rectEnv=t}isDone(){return!0===this._intersects}visit(t){const e=t.getEnvelopeInternal();return this._rectEnv.intersects(e)?this._rectEnv.contains(e)||e.getMinX()>=this._rectEnv.getMinX()&&e.getMaxX()<=this._rectEnv.getMaxX()||e.getMinY()>=this._rectEnv.getMinY()&&e.getMaxY()<=this._rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null}intersects(){return this._intersects}}class Wn extends Ce{constructor(){super(),Wn.constructor_.apply(this,arguments)}static constructor_(){this._rectSeq=null,this._rectEnv=null,this._containsPoint=!1;const t=arguments[0];this._rectSeq=t.getExteriorRing().getCoordinateSequence(),this._rectEnv=t.getEnvelopeInternal()}isDone(){return!0===this._containsPoint}visit(t){if(!(t instanceof at))return null;const e=t.getEnvelopeInternal();if(!this._rectEnv.intersects(e))return null;const i=new y;for(let s=0;s<4;s++)if(this._rectSeq.getCoordinate(s,i),e.contains(i)&&We.containsPointInPolygon(i,t))return this._containsPoint=!0,null}containsPoint(){return this._containsPoint}}class Kn extends Ce{constructor(){super(),Kn.constructor_.apply(this,arguments)}static constructor_(){this._rectEnv=null,this._rectIntersector=null,this._hasIntersection=!1,this._p0=new y,this._p1=new y;const t=arguments[0];this._rectEnv=t.getEnvelopeInternal(),this._rectIntersector=new qn(this._rectEnv)}intersects(){return this._hasIntersection}isDone(){return!0===this._hasIntersection}visit(t){const e=t.getEnvelopeInternal();if(!this._rectEnv.intersects(e))return null;const i=fe.getLines(t);this.checkIntersectionWithLineStrings(i)}checkIntersectionWithLineStrings(t){for(let e=t.iterator();e.hasNext();){const t=e.next();if(this.checkIntersectionWithSegments(t),this._hasIntersection)return null}}checkIntersectionWithSegments(t){const e=t.getCoordinateSequence();for(let t=1;t<e.size();t++)if(e.getCoordinate(t-1,this._p0),e.getCoordinate(t,this._p1),this._rectIntersector.intersects(this._p0,this._p1))return this._hasIntersection=!0,null}}class Yn extends xn{constructor(){super(),Yn.constructor_.apply(this,arguments)}static constructor_(){if(this._relate=null,2===arguments.length){const t=arguments[0],e=arguments[1];xn.constructor_.call(this,t,e),this._relate=new Un(this._arg)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];xn.constructor_.call(this,t,e,i),this._relate=new Un(this._arg)}}static covers(t,e){return!(2===e.getDimension()&&t.getDimension()<2)&&!(1===e.getDimension()&&t.getDimension()<1&&e.getLength()>0)&&!!t.getEnvelopeInternal().covers(e.getEnvelopeInternal())&&(!!t.isRectangle()||new Yn(t,e).getIntersectionMatrix().isCovers())}static intersects(t,e){if(!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal()))return!1;if(t.isRectangle())return Hn.intersects(t,e);if(e.isRectangle())return Hn.intersects(e,t);if(t.isGeometryCollection()||e.isGeometryCollection()){for(let i=0;i<t.getNumGeometries();i++)for(let s=0;s<e.getNumGeometries();s++)if(t.getGeometryN(i).intersects(e.getGeometryN(s)))return!0;return!1}return new Yn(t,e).getIntersectionMatrix().isIntersects()}static touches(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&new Yn(t,e).getIntersectionMatrix().isTouches(t.getDimension(),e.getDimension())}static equalsTopo(t,e){return!!t.getEnvelopeInternal().equals(e.getEnvelopeInternal())&&Yn.relate(t,e).isEquals(t.getDimension(),e.getDimension())}static relate(){return 2===arguments.length?new Yn(arguments[0],arguments[1]).getIntersectionMatrix():3===arguments.length?new Yn(arguments[0],arguments[1],arguments[2]).getIntersectionMatrix():void 0}static overlaps(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&new Yn(t,e).getIntersectionMatrix().isOverlaps(t.getDimension(),e.getDimension())}static crosses(t,e){return!!t.getEnvelopeInternal().intersects(e.getEnvelopeInternal())&&new Yn(t,e).getIntersectionMatrix().isCrosses(t.getDimension(),e.getDimension())}static contains(t,e){return!(2===e.getDimension()&&t.getDimension()<2)&&!(1===e.getDimension()&&t.getDimension()<1&&e.getLength()>0)&&!!t.getEnvelopeInternal().contains(e.getEnvelopeInternal())&&(t.isRectangle()?Vn.contains(t,e):new Yn(t,e).getIntersectionMatrix().isContains())}getIntersectionMatrix(){return this._relate.computeIM()}}var Jn=Object.freeze({__proto__:null,RelateOp:Yn});class Xn{constructor(){Xn.constructor_.apply(this,arguments)}static constructor_(){this._pointGeom=null,this._otherGeom=null,this._geomFact=null;const t=arguments[0],e=arguments[1];this._pointGeom=t,this._otherGeom=e,this._geomFact=e.getFactory()}static union(t,e){return new Xn(t,e).union()}union(){const t=new gi,e=new rt;for(let i=0;i<this._pointGeom.getNumGeometries();i++){const s=this._pointGeom.getGeometryN(i).getCoordinate();t.locate(s,this._otherGeom)===Jt.EXTERIOR&&e.add(s)}if(0===e.size())return this._otherGeom;let i=null;const s=dt.toCoordinateArray(e);return i=1===s.length?this._geomFact.createPoint(s[0]):this._geomFact.createMultiPointFromCoords(s),he.combine(i,this._otherGeom)}}class Qn{constructor(){Qn.constructor_.apply(this,arguments)}static constructor_(){this._geomFactory=null,this._polygons=new S,this._lines=new S,this._points=new S,this._dimension=J.FALSE}static extract(){if(C(arguments[0],L)){const t=arguments[0],e=new Qn;return e.add(t),e}if(arguments[0]instanceof q){const t=arguments[0],e=new Qn;return e.add(t),e}}getFactory(){return this._geomFactory}recordDimension(t){t>this._dimension&&(this._dimension=t)}getDimension(){return this._dimension}filter(t){return this.recordDimension(t.getDimension()),t instanceof ht||t.isEmpty()?null:t instanceof at?(this._polygons.add(t),null):t instanceof Q?(this._lines.add(t),null):t instanceof tt?(this._points.add(t),null):void u.shouldNeverReachHere("Unhandled geometry type: "+t.getGeometryType())}getExtract(t){switch(t){case 0:return this._points;case 1:return this._lines;case 2:return this._polygons}return u.shouldNeverReachHere("Invalid dimension: "+t),null}isEmpty(){return this._polygons.isEmpty()&&this._lines.isEmpty()&&this._points.isEmpty()}add(){if(C(arguments[0],L)){const t=arguments[0];for(const e of t)this.add(e)}else if(arguments[0]instanceof q){const t=arguments[0];null===this._geomFactory&&(this._geomFactory=t.getFactory()),t.apply(this)}}get interfaces_(){return[X]}}class Zn{constructor(){Zn.constructor_.apply(this,arguments)}static constructor_(){this._geomFactory=null,this._g0=null,this._g1=null,this._isUnionSafe=null;const t=arguments[0],e=arguments[1];this._g0=t,this._g1=e,this._geomFactory=t.getFactory()}static containsProperly(){if(2===arguments.length){const t=arguments[0],e=arguments[1];return!t.isNull()&&e.getX()>t.getMinX()&&e.getX()<t.getMaxX()&&e.getY()>t.getMinY()&&e.getY()<t.getMaxY()}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return Zn.containsProperly(t,e)&&Zn.containsProperly(t,i)}}static union(t,e){return new Zn(t,e).union()}static intersects(t,e,i){return t.intersects(e)||t.intersects(i)}static overlapEnvelope(t,e){const i=t.getEnvelopeInternal(),s=e.getEnvelopeInternal();return i.intersection(s)}static extractBorderSegments(t,e,i){t.apply(new class{get interfaces_(){return[T]}filter(t,s){if(s<=0)return null;const a=t.getCoordinate(s-1),n=t.getCoordinate(s);if(Zn.intersects(e,a,n)&&!Zn.containsProperly(e,a,n)){const t=new Yt(a,n);i.add(t)}}isDone(){return!1}isGeometryChanged(){return!1}})}static unionBuffer(t,e){return t.getFactory().createGeometryCollection([t,e]).buffer(0)}isBorderSegmentsSame(t,e){const i=this.extractBorderSegments(this._g0,this._g1,e),s=new S;return Zn.extractBorderSegments(t,e,s),this.isEqual(i,s)}extractByEnvelope(t,e,i){const s=new S;for(let a=0;a<e.getNumGeometries();a++){const n=e.getGeometryN(a);if(n.getEnvelopeInternal().intersects(t))s.add(n);else{const t=n.copy();i.add(t)}}return this._geomFactory.buildGeometry(s)}isEqual(t,e){if(t.size()!==e.size())return!1;const i=new vt(t);for(const t of e)if(!i.contains(t))return!1;return!0}union(){const t=Zn.overlapEnvelope(this._g0,this._g1);if(t.isNull()){const t=this._g0.copy(),e=this._g1.copy();return he.combine(t,e)}const e=new S,i=this.extractByEnvelope(t,this._g0,e),s=this.extractByEnvelope(t,this._g1,e),a=this.unionFull(i,s);let n=null;return this._isUnionSafe=this.isBorderSegmentsSame(a,t),n=this._isUnionSafe?this.combine(a,e):this.unionFull(this._g0,this._g1),n}combine(t,e){return e.size()<=0?t:(e.add(t),he.combine(e))}unionFull(t,e){try{return t.union(e)}catch(i){if(i instanceof es)return Zn.unionBuffer(t,e);throw i}}extractBorderSegments(t,e,i){const s=new S;return Zn.extractBorderSegments(t,i,s),null!==e&&Zn.extractBorderSegments(e,i,s),s}isUnionOptimized(){return this._isUnionSafe}}class to{constructor(){to.constructor_.apply(this,arguments)}static constructor_(){this._inputPolys=null,this._geomFactory=null;const t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new S)}static restrictToPolygons(t){if(C(t,st))return t;const e=xe.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(wt.toPolygonArray(e))}static getGeometry(t,e){return e>=t.size()?null:t.get(e)}static union(t){return new to(t).union()}reduceToGeometries(t){const e=new S;for(let i=t.iterator();i.hasNext();){const t=i.next();let s=null;C(t,b)?s=this.unionTree(t):t instanceof q&&(s=t),e.add(s)}return e}union(){if(null===this._inputPolys)throw new IllegalStateException("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();const t=new Ts(to.STRTREE_NODE_CAPACITY);for(let e=this._inputPolys.iterator();e.hasNext();){const i=e.next();t.insert(i.getEnvelopeInternal(),i)}this._inputPolys=null;const e=t.itemsTree();return this.unionTree(e)}binaryUnion(){if(1===arguments.length){const t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];if(i-e<=1){const i=to.getGeometry(t,e);return this.unionSafe(i,null)}if(i-e==2)return this.unionSafe(to.getGeometry(t,e),to.getGeometry(t,e+1));{const s=Math.trunc((i+e)/2),a=this.binaryUnion(t,e,s),n=this.binaryUnion(t,s,i);return this.unionSafe(a,n)}}}repeatedUnion(t){let e=null;for(let i=t.iterator();i.hasNext();){const t=i.next();e=null===e?t.copy():e.union(t)}return e}unionSafe(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionActual(t,e)}unionActual(t,e){const i=Zn.union(t,e);return to.restrictToPolygons(i)}unionTree(t){const e=this.reduceToGeometries(t);return this.binaryUnion(e)}bufferUnion(){if(1===arguments.length){const t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return t.getFactory().createGeometryCollection([t,e]).buffer(0)}}}to.STRTREE_NODE_CAPACITY=4;class eo{constructor(){eo.constructor_.apply(this,arguments)}static constructor_(){if(this._geomFact=null,this._extracter=null,1===arguments.length){if(C(arguments[0],L)){const t=arguments[0];this.extract(t)}else if(arguments[0]instanceof q){const t=arguments[0];this.extract(t)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._geomFact=e,this.extract(t)}}static union(){if(1===arguments.length){if(C(arguments[0],L))return new eo(arguments[0]).union();if(arguments[0]instanceof q)return new eo(arguments[0]).union()}else if(2===arguments.length)return new eo(arguments[0],arguments[1]).union()}unionNoOpt(t){const e=this._geomFact.createPoint();return vn.overlayOp(t,e,Cn.UNION)}unionWithNull(t,e){return null===t&&null===e?null:null===e?t:null===t?e:t.union(e)}extract(){if(C(arguments[0],L)){const t=arguments[0];this._extracter=Qn.extract(t)}else if(arguments[0]instanceof q){const t=arguments[0];this._extracter=Qn.extract(t)}}union(){if(null===this._geomFact&&(this._geomFact=this._extracter.getFactory()),null===this._geomFact)return null;if(this._extracter.isEmpty())return this._geomFact.createEmpty(this._extracter.getDimension());const t=this._extracter.getExtract(0),e=this._extracter.getExtract(1),i=this._extracter.getExtract(2);let s=null;if(t.size()>0){const e=this._geomFact.buildGeometry(t);s=this.unionNoOpt(e)}let a=null;if(e.size()>0){const t=this._geomFact.buildGeometry(e);a=this.unionNoOpt(t)}let n=null;i.size()>0&&(n=to.union(i));const o=this.unionWithNull(a,n);let r=null;return r=null===s?o:null===o?s:Xn.union(s,o),null===r?this._geomFact.createGeometryCollection():r}}var io=Object.freeze({__proto__:null,UnaryUnionOp:eo}),so=Object.freeze({__proto__:null,IsValidOp:An,ConsistentAreaTester:On}),ao=Object.freeze({__proto__:null,BoundaryOp:ea,IsSimpleOp:sa,buffer:Ra,distance:za,linemerge:sn,overlay:Ln,polygonize:jn,relate:Jn,union:io,valid:so});class no{constructor(){no.constructor_.apply(this,arguments)}static constructor_(){if(this._returnToOriginalPrecision=!0,this._cbr=null,0===arguments.length)no.constructor_.call(this,!0);else if(1===arguments.length){const t=arguments[0];this._returnToOriginalPrecision=t}}computeResultPrecision(t){return this._returnToOriginalPrecision&&this._cbr.addCommonBits(t),t}union(t,e){const i=this.removeCommonBits(t,e);return this.computeResultPrecision(i[0].union(i[1]))}intersection(t,e){const i=this.removeCommonBits(t,e);return this.computeResultPrecision(i[0].intersection(i[1]))}removeCommonBits(){if(1===arguments.length){const t=arguments[0];return this._cbr=new gn,this._cbr.add(t),this._cbr.removeCommonBits(t.copy())}if(2===arguments.length){const t=arguments[0],e=arguments[1];this._cbr=new gn,this._cbr.add(t),this._cbr.add(e);const i=new Array(2).fill(null);return i[0]=this._cbr.removeCommonBits(t.copy()),i[1]=this._cbr.removeCommonBits(e.copy()),i}}buffer(t,e){const i=this.removeCommonBits(t);return this.computeResultPrecision(i.buffer(e))}symDifference(t,e){const i=this.removeCommonBits(t,e);return this.computeResultPrecision(i[0].symDifference(i[1]))}difference(t,e){const i=this.removeCommonBits(t,e);return this.computeResultPrecision(i[0].difference(i[1]))}}class oo extends ce.CoordinateOperation{constructor(){super(),oo.constructor_.apply(this,arguments)}static constructor_(){this._targetPM=null,this._removeCollapsed=!0;const t=arguments[0],e=arguments[1];this._targetPM=t,this._removeCollapsed=e}edit(){if(2===arguments.length&&arguments[1]instanceof q&&arguments[0]instanceof Array){const t=arguments[0],e=arguments[1];if(0===t.length)return null;const i=new Array(t.length).fill(null);for(let e=0;e<t.length;e++){const s=new y(t[e]);this._targetPM.makePrecise(s),i[e]=s}const s=new E(i,!1).toCoordinateArray();let a=0;e instanceof Q&&(a=2),e instanceof pt&&(a=4);let n=i;return this._removeCollapsed&&(n=null),s.length<a?n:s}return super.edit.apply(this,arguments)}}class ro{constructor(){ro.constructor_.apply(this,arguments)}static constructor_(){this._targetPM=null,this._removeCollapsed=!0,this._changePrecisionModel=!1,this._isPointwise=!1;const t=arguments[0];this._targetPM=t}static reduce(t,e){return new ro(e).reduce(t)}static reducePointwise(t,e){const i=new ro(e);return i.setPointwise(!0),i.reduce(t)}fixPolygonalTopology(t){let e=t;return this._changePrecisionModel||(e=this.changePM(t,this._targetPM)),Aa.bufferOp(e,0)}reducePointwise(t){let e=null;if(this._changePrecisionModel){const i=this.createFactory(t.getFactory(),this._targetPM);e=new ce(i)}else e=new ce;let i=this._removeCollapsed;return t.getDimension()>=2&&(i=!0),e.edit(t,new oo(this._targetPM,i))}changePM(t,e){return this.createEditor(t.getFactory(),e).edit(t,new ce.NoOpGeometryOperation)}setRemoveCollapsedComponents(t){this._removeCollapsed=t}createFactory(t,e){return new wt(e,t.getSRID(),t.getCoordinateSequenceFactory())}setChangePrecisionModel(t){this._changePrecisionModel=t}reduce(t){const e=this.reducePointwise(t);return this._isPointwise?e:C(e,st)?An.isValid(e)?e:this.fixPolygonalTopology(e):e}setPointwise(t){this._isPointwise=t}createEditor(t,e){if(t.getPrecisionModel()===e)return new ce;const i=this.createFactory(t,e);return new ce(i)}}class lo{constructor(){lo.constructor_.apply(this,arguments)}static constructor_(){if(this._geom=null,this._pts=null,this._start=null,this._end=null,2===arguments.length){const t=arguments[0],e=arguments[1];this._pts=t,this._start=e,this._end=e+1}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._pts=t,this._start=e,this._end=i}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this._geom=t,this._pts=e,this._start=i,this._end=s}}computeDistanceLineLine(t,e){let i=n.MAX_VALUE;for(let s=this._start;s<this._end-1;s++){const a=this._pts.getCoordinate(s),n=this._pts.getCoordinate(s+1);for(let o=t._start;o<t._end-1;o++){const r=t._pts.getCoordinate(o),l=t._pts.getCoordinate(o+1),h=j.segmentToSegment(a,n,r,l);if(h<i&&(i=h,null!==e&&this.updateNearestLocationsLineLine(s,a,n,t,o,r,l,e),i<=0))return i}}return i}updateNearestLocationsPointLine(t,e,i,s,a,n){n[0]=new Fa(this._geom,this._start,new y(t));const o=new Yt(s,a).closestPoint(t);n[1]=new Fa(e._geom,i,new y(o))}size(){return this._end-this._start}getCoordinate(t){return this._pts.getCoordinate(this._start+t)}nearestLocations(t){const e=this.isPoint(),i=t.isPoint(),s=new Array(2).fill(null);if(e&&i){const e=this._pts.getCoordinate(this._start),i=t._pts.getCoordinate(t._start);s[0]=new Fa(this._geom,this._start,new y(e)),s[1]=new Fa(t._geom,t._start,new y(i))}else if(e){const e=this._pts.getCoordinate(this._start);this.computeDistancePointLine(e,t,s)}else if(i){const e=t._pts.getCoordinate(t._start);this.computeDistancePointLine(e,this,s);const i=s[0];s[0]=s[1],s[1]=i}else this.computeDistanceLineLine(t,s);return s}getEnvelope(){const t=new D;for(let e=this._start;e<this._end;e++)t.expandToInclude(this._pts.getX(e),this._pts.getY(e));return t}updateNearestLocationsLineLine(t,e,i,s,a,n,o,r){const l=new Yt(e,i),h=new Yt(n,o),c=l.closestPoints(h);r[0]=new Fa(this._geom,t,new y(c[0])),r[1]=new Fa(s._geom,a,new y(c[1]))}toString(){const t=new P;t.append("LINESTRING ( ");const e=new y;for(let i=this._start;i<this._end;i++)i>this._start&&t.append(", "),this._pts.getCoordinate(i,e),t.append(e.x+" "+e.y);return t.append(" )"),t.toString()}computeDistancePointLine(t,e,i){let s=n.MAX_VALUE;for(let a=e._start;a<e._end-1;a++){const n=e._pts.getCoordinate(a),o=e._pts.getCoordinate(a+1),r=j.pointToSegment(t,n,o);if(r<s&&(s=r,null!==i&&this.updateNearestLocationsPointLine(t,e,a,n,o,i),s<=0))return s}return s}isPoint(){return this._end-this._start==1}distance(t){const e=this.isPoint(),i=t.isPoint();let s=null;if(e&&i){const e=this._pts.getCoordinate(this._start),i=t._pts.getCoordinate(t._start);s=e.distance(i)}else if(e){const e=this._pts.getCoordinate(this._start);s=this.computeDistancePointLine(e,t,null)}else if(i){const e=t._pts.getCoordinate(t._start);s=this.computeDistancePointLine(e,this,null)}else s=this.computeDistanceLineLine(t,null);return s}}class ho{static addFacetSequences(t,e,i){let s=0;const a=e.size();for(;s<=a-1;){let n=s+ho.FACET_SEQUENCE_SIZE+1;n>=a-1&&(n=a);const o=new lo(t,e,s,n);i.add(o),s+=ho.FACET_SEQUENCE_SIZE}}static computeFacetSequences(t){const e=new S;return t.apply(new class{get interfaces_(){return[V]}filter(t){let i=null;(t instanceof Q||t instanceof tt)&&(i=t.getCoordinateSequence(),ho.addFacetSequences(t,i,e))}}),e}static build(t){const e=new Ts(ho.STR_TREE_NODE_CAPACITY);for(let i=ho.computeFacetSequences(t).iterator();i.hasNext();){const t=i.next();e.insert(t.getEnvelope(),t)}return e.build(),e}}ho.FACET_SEQUENCE_SIZE=6,ho.STR_TREE_NODE_CAPACITY=4;class co{constructor(){co.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._minClearance=null,this._minClearancePts=null;const t=arguments[0];this._inputGeom=t}static getLine(t){return new co(t).getLine()}static getDistance(t){return new co(t).getDistance()}getLine(){return this.compute(),null===this._minClearancePts||null===this._minClearancePts[0]?this._inputGeom.getFactory().createLineString():this._inputGeom.getFactory().createLineString(this._minClearancePts)}compute(){if(null!==this._minClearancePts)return null;if(this._minClearancePts=new Array(2).fill(null),this._minClearance=n.MAX_VALUE,this._inputGeom.isEmpty())return null;const t=ho.build(this._inputGeom).nearestNeighbour(new po),e=new po;this._minClearance=e.distance(t[0],t[1]),this._minClearancePts=e.getCoordinates()}getDistance(){return this.compute(),this._minClearance}}class po{constructor(){po.constructor_.apply(this,arguments)}static constructor_(){this._minDist=n.MAX_VALUE,this._minPts=new Array(2).fill(null)}vertexDistance(t,e){for(let i=0;i<t.size();i++)for(let s=0;s<e.size();s++){const a=t.getCoordinate(i),n=e.getCoordinate(s);if(!a.equals2D(n)){const t=a.distance(n);if(t<this._minDist&&(this._minDist=t,this._minPts[0]=a,this._minPts[1]=n,0===t))return t}}return this._minDist}getCoordinates(){return this._minPts}segmentDistance(t,e){for(let i=0;i<t.size();i++)for(let s=1;s<e.size();s++){const a=t.getCoordinate(i),n=e.getCoordinate(s-1),o=e.getCoordinate(s);if(!a.equals2D(n)&&!a.equals2D(o)){const t=j.pointToSegment(a,n,o);if(t<this._minDist&&(this._minDist=t,this.updatePts(a,n,o),0===t))return t}}return this._minDist}distance(){if(arguments[0]instanceof Ls&&arguments[1]instanceof Ls){const t=arguments[1],e=arguments[0].getItem(),i=t.getItem();return this._minDist=n.MAX_VALUE,this.distance(e,i)}if(arguments[0]instanceof lo&&arguments[1]instanceof lo){const t=arguments[0],e=arguments[1];return this.vertexDistance(t,e),1===t.size()&&1===e.size()||this._minDist<=0||(this.segmentDistance(t,e),this._minDist<=0||this.segmentDistance(e,t)),this._minDist}}updatePts(t,e,i){this._minPts[0]=t;const s=new Yt(e,i);this._minPts[1]=new y(s.closestPoint(t))}get interfaces_(){return[Es]}}co.MinClearanceDistance=po;class uo{constructor(){uo.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._minClearance=null,this._minClearancePts=null;const t=arguments[0];this._inputGeom=t}static getLine(t){return new uo(t).getLine()}static getDistance(t){return new uo(t).getDistance()}getLine(){return this.compute(),this._inputGeom.getFactory().createLineString(this._minClearancePts)}updateClearance(){if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];t<this._minClearance&&(this._minClearance=t,this._minClearancePts[0]=new y(e),this._minClearancePts[1]=new y(i))}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];if(t<this._minClearance){this._minClearance=t,this._minClearancePts[0]=new y(e);const a=new Yt(i,s);this._minClearancePts[1]=new y(a.closestPoint(e))}}}compute(){if(null!==this._minClearancePts)return null;this._minClearancePts=new Array(2).fill(null),this._minClearance=n.MAX_VALUE,this._inputGeom.apply(new mo(this))}getDistance(){return this.compute(),this._minClearance}}class mo{constructor(){mo.constructor_.apply(this,arguments)}static constructor_(){this.smc=null;const t=arguments[0];this.smc=t}filter(t){this.smc._inputGeom.apply(new go(this.smc,t))}get interfaces_(){return[H]}}class go{constructor(){go.constructor_.apply(this,arguments)}static constructor_(){this.smc=null,this._queryPt=null;const t=arguments[0],e=arguments[1];this.smc=t,this._queryPt=e}isGeometryChanged(){return!1}checkVertexDistance(t){const e=t.distance(this._queryPt);e>0&&this.smc.updateClearance(e,this._queryPt,t)}filter(t,e){this.checkVertexDistance(t.getCoordinate(e)),e>0&&this.checkSegmentDistance(t.getCoordinate(e-1),t.getCoordinate(e))}checkSegmentDistance(t,e){if(this._queryPt.equals2D(t)||this._queryPt.equals2D(e))return null;const i=j.pointToSegment(this._queryPt,e,t);i>0&&this.smc.updateClearance(i,this._queryPt,e,t)}isDone(){return!1}get interfaces_(){return[T]}}uo.VertexCoordinateFilter=mo,uo.ComputeMCCoordinateSequenceFilter=go;var yo=Object.freeze({__proto__:null,CommonBits:mn,CommonBitsOp:no,CommonBitsRemover:gn,EnhancedPrecisionOp:class{static union(t,e){let i=null;try{return t.union(e)}catch(t){if(!(t instanceof c))throw t;i=t}try{const s=new no(!0).union(t,e);if(!s.isValid())throw i;return s}catch(t){throw t instanceof c?i:t}}static intersection(t,e){let i=null;try{return t.intersection(e)}catch(t){if(!(t instanceof c))throw t;i=t}try{const s=new no(!0).intersection(t,e);if(!s.isValid())throw i;return s}catch(t){throw t instanceof c?i:t}}static buffer(t,e){let i=null;try{return t.buffer(e)}catch(t){if(!(t instanceof c))throw t;i=t}try{const s=new no(!0).buffer(t,e);if(!s.isValid())throw i;return s}catch(t){throw t instanceof c?i:t}}static symDifference(t,e){let i=null;try{return t.symDifference(e)}catch(t){if(!(t instanceof c))throw t;i=t}try{const s=new no(!0).symDifference(t,e);if(!s.isValid())throw i;return s}catch(t){throw t instanceof c?i:t}}static difference(t,e){let i=null;try{return t.difference(e)}catch(t){if(!(t instanceof c))throw t;i=t}try{const s=new no(!0).difference(t,e);if(!s.isValid())throw i;return s}catch(t){throw t instanceof c?i:t}}},GeometryPrecisionReducer:ro,MinimumClearance:co,SimpleMinimumClearance:uo});class fo{constructor(){fo.constructor_.apply(this,arguments)}static constructor_(){this._pts=null,this._usePt=null,this._distanceTolerance=null,this._seg=new Yt;const t=arguments[0];this._pts=t}static simplify(t,e){const i=new fo(t);return i.setDistanceTolerance(e),i.simplify()}simplifySection(t,e){if(t+1===e)return null;this._seg.p0=this._pts[t],this._seg.p1=this._pts[e];let i=-1,s=t;for(let a=t+1;a<e;a++){const t=this._seg.distance(this._pts[a]);t>i&&(i=t,s=a)}if(i<=this._distanceTolerance)for(let i=t+1;i<e;i++)this._usePt[i]=!1;else this.simplifySection(t,s),this.simplifySection(s,e)}setDistanceTolerance(t){this._distanceTolerance=t}simplify(){this._usePt=new Array(this._pts.length).fill(null);for(let t=0;t<this._pts.length;t++)this._usePt[t]=!0;this.simplifySection(0,this._pts.length-1);const t=new E;for(let e=0;e<this._pts.length;e++)this._usePt[e]&&t.add(new y(this._pts[e]));return t.toCoordinateArray()}}class _o{constructor(){_o.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._distanceTolerance=null,this._isEnsureValidTopology=!0;const t=arguments[0];this._inputGeom=t}static simplify(t,e){const i=new _o(t);return i.setDistanceTolerance(e),i.getResultGeometry()}setEnsureValid(t){this._isEnsureValidTopology=t}getResultGeometry(){return this._inputGeom.isEmpty()?this._inputGeom.copy():new vo(this._isEnsureValidTopology,this._distanceTolerance).transform(this._inputGeom)}setDistanceTolerance(t){if(t<0)throw new s("Tolerance must be non-negative");this._distanceTolerance=t}}class vo extends ge{constructor(){super(),vo.constructor_.apply(this,arguments)}static constructor_(){this._isEnsureValidTopology=!0,this._distanceTolerance=null;const t=arguments[0],e=arguments[1];this._isEnsureValidTopology=t,this._distanceTolerance=e}transformPolygon(t,e){if(t.isEmpty())return null;const i=super.transformPolygon.call(this,t,e);return e instanceof ft?i:this.createValidArea(i)}createValidArea(t){return this._isEnsureValidTopology?t.buffer(0):t}transformCoordinates(t,e){const i=t.toCoordinateArray();let s=null;return s=0===i.length?new Array(0).fill(null):fo.simplify(i,this._distanceTolerance),this._factory.getCoordinateSequenceFactory().create(s)}transformMultiPolygon(t,e){const i=super.transformMultiPolygon.call(this,t,e);return this.createValidArea(i)}transformLinearRing(t,e){const i=e instanceof at,s=super.transformLinearRing.call(this,t,e);return!i||s instanceof pt?s:null}}_o.DPTransformer=vo;class xo extends Yt{constructor(){super(),xo.constructor_.apply(this,arguments)}static constructor_(){if(this._parent=null,this._index=null,2===arguments.length){const t=arguments[0],e=arguments[1];xo.constructor_.call(this,t,e,null,-1)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];Yt.constructor_.call(this,t,e),this._parent=i,this._index=s}}getIndex(){return this._index}getParent(){return this._parent}}class Co{constructor(){Co.constructor_.apply(this,arguments)}static constructor_(){if(this._parentLine=null,this._segs=null,this._resultSegs=new S,this._minimumSize=null,1===arguments.length){const t=arguments[0];Co.constructor_.call(this,t,2)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._parentLine=t,this._minimumSize=e,this.init()}}static extractCoordinates(t){const e=new Array(t.size()+1).fill(null);let i=null;for(let s=0;s<t.size();s++)i=t.get(s),e[s]=i.p0;return e[e.length-1]=i.p1,e}addToResult(t){this._resultSegs.add(t)}asLineString(){return this._parentLine.getFactory().createLineString(Co.extractCoordinates(this._resultSegs))}getResultSize(){const t=this._resultSegs.size();return 0===t?0:t+1}getParent(){return this._parentLine}getSegment(t){return this._segs[t]}getParentCoordinates(){return this._parentLine.getCoordinates()}getMinimumSize(){return this._minimumSize}asLinearRing(){return this._parentLine.getFactory().createLinearRing(Co.extractCoordinates(this._resultSegs))}getSegments(){return this._segs}init(){const t=this._parentLine.getCoordinates();this._segs=new Array(t.length-1).fill(null);for(let e=0;e<t.length-1;e++){const i=new xo(t[e],t[e+1],this._parentLine,e);this._segs[e]=i}}getResultCoordinates(){return Co.extractCoordinates(this._resultSegs)}}class Lo{constructor(){Lo.constructor_.apply(this,arguments)}static constructor_(){this._index=new vs}remove(t){this._index.remove(new D(t.p0,t.p1),t)}add(){if(arguments[0]instanceof Co){const t=arguments[0].getSegments();for(let e=0;e<t.length;e++){const i=t[e];this.add(i)}}else if(arguments[0]instanceof Yt){const t=arguments[0];this._index.insert(new D(t.p0,t.p1),t)}}query(t){const e=new D(t.p0,t.p1),i=new Mo(t);return this._index.query(e,i),i.getItems()}}class Mo{constructor(){Mo.constructor_.apply(this,arguments)}static constructor_(){this._querySeg=null,this._items=new S;const t=arguments[0];this._querySeg=t}visitItem(t){const e=t;D.intersects(e.p0,e.p1,this._querySeg.p0,this._querySeg.p1)&&this._items.add(t)}getItems(){return this._items}get interfaces_(){return[ke]}}class bo{constructor(){bo.constructor_.apply(this,arguments)}static constructor_(){this._li=new Kt,this._inputIndex=new Lo,this._outputIndex=new Lo,this._line=null,this._linePts=null,this._distanceTolerance=0;const t=arguments[0],e=arguments[1];this._inputIndex=t,this._outputIndex=e}static isInLineSection(t,e,i){if(i.getParent()!==t.getParent())return!1;const s=i.getIndex();return s>=e[0]&&s<e[1]}flatten(t,e){const i=this._linePts[t],s=this._linePts[e],a=new Yt(i,s);return this.remove(this._line,t,e),this._outputIndex.add(a),a}hasBadIntersection(t,e,i){return!!this.hasBadOutputIntersection(i)||!!this.hasBadInputIntersection(t,e,i)}setDistanceTolerance(t){this._distanceTolerance=t}simplifySection(t,e,i){i+=1;const s=new Array(2).fill(null);if(t+1===e){const e=this._line.getSegment(t);return this._line.addToResult(e),null}let a=!0;this._line.getResultSize()<this._line.getMinimumSize()&&i+1<this._line.getMinimumSize()&&(a=!1);const n=new Array(1).fill(null),o=this.findFurthestPoint(this._linePts,t,e,n);n[0]>this._distanceTolerance&&(a=!1);const r=new Yt;if(r.p0=this._linePts[t],r.p1=this._linePts[e],s[0]=t,s[1]=e,this.hasBadIntersection(this._line,s,r)&&(a=!1),a){const i=this.flatten(t,e);return this._line.addToResult(i),null}this.simplifySection(t,o,i),this.simplifySection(o,e,i)}hasBadOutputIntersection(t){for(let e=this._outputIndex.query(t).iterator();e.hasNext();){const i=e.next();if(this.hasInteriorIntersection(i,t))return!0}return!1}findFurthestPoint(t,e,i,s){const a=new Yt;a.p0=t[e],a.p1=t[i];let n=-1,o=e;for(let s=e+1;s<i;s++){const e=t[s],i=a.distance(e);i>n&&(n=i,o=s)}return s[0]=n,o}simplify(t){this._line=t,this._linePts=t.getParentCoordinates(),this.simplifySection(0,this._linePts.length-1,0)}remove(t,e,i){for(let s=e;s<i;s++){const e=t.getSegment(s);this._inputIndex.remove(e)}}hasInteriorIntersection(t,e){return this._li.computeIntersection(t.p0,t.p1,e.p0,e.p1),this._li.isInteriorIntersection()}hasBadInputIntersection(t,e,i){for(let s=this._inputIndex.query(i).iterator();s.hasNext();){const a=s.next();if(this.hasInteriorIntersection(a,i)){if(bo.isInLineSection(t,e,a))continue;return!0}}return!1}}class wo{constructor(){wo.constructor_.apply(this,arguments)}static constructor_(){this._inputIndex=new Lo,this._outputIndex=new Lo,this._distanceTolerance=0}setDistanceTolerance(t){this._distanceTolerance=t}simplify(t){for(let e=t.iterator();e.hasNext();)this._inputIndex.add(e.next());for(let e=t.iterator();e.hasNext();){const t=new bo(this._inputIndex,this._outputIndex);t.setDistanceTolerance(this._distanceTolerance),t.simplify(e.next())}}}class So{constructor(){So.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._lineSimplifier=new wo,this._linestringMap=null;const t=arguments[0];this._inputGeom=t}static simplify(t,e){const i=new So(t);return i.setDistanceTolerance(e),i.getResultGeometry()}getResultGeometry(){return this._inputGeom.isEmpty()?this._inputGeom.copy():(this._linestringMap=new Ct,this._inputGeom.apply(new Eo(this)),this._lineSimplifier.simplify(this._linestringMap.values()),new Io(this._linestringMap).transform(this._inputGeom))}setDistanceTolerance(t){if(t<0)throw new s("Tolerance must be non-negative");this._lineSimplifier.setDistanceTolerance(t)}}class Io extends ge{constructor(){super(),Io.constructor_.apply(this,arguments)}static constructor_(){this._linestringMap=null;const t=arguments[0];this._linestringMap=t}transformCoordinates(t,e){if(0===t.size())return null;if(e instanceof Q){const t=this._linestringMap.get(e);return this.createCoordinateSequence(t.getResultCoordinates())}return super.transformCoordinates.call(this,t,e)}}class Eo{constructor(){Eo.constructor_.apply(this,arguments)}static constructor_(){this.tps=null;const t=arguments[0];this.tps=t}filter(t){if(t instanceof Q){const e=t;if(e.isEmpty())return null;const i=e.isClosed()?4:2,s=new Co(e,i);this.tps._linestringMap.put(e,s)}}get interfaces_(){return[V]}}So.LineStringTransformer=Io,So.LineStringMapBuilderFilter=Eo;class To{constructor(){To.constructor_.apply(this,arguments)}static constructor_(){this._pts=null,this._tolerance=null;const t=arguments[0],e=arguments[1];this._pts=t,this._tolerance=e*e}static simplify(t,e){return new To(t,e).simplify()}simplifyVertex(t){let e=t,i=e.getArea(),s=null;for(;null!==e;){const t=e.getArea();t<i&&(i=t,s=e),e=e._next}return null!==s&&i<this._tolerance&&s.remove(),t.isLive()?i:-1}simplify(){const t=Do.buildLine(this._pts);let e=this._tolerance;do{e=this.simplifyVertex(t)}while(e<this._tolerance);const i=t.getCoordinates();return i.length<2?[i[0],new y(i[0])]:i}}class Do{constructor(){Do.constructor_.apply(this,arguments)}static constructor_(){this._pt=null,this._prev=null,this._next=null,this._area=Do.MAX_AREA,this._isLive=!0;const t=arguments[0];this._pt=t}static buildLine(t){let e=null,i=null;for(let s=0;s<t.length;s++){const a=new Do(t[s]);null===e&&(e=a),a.setPrev(i),null!==i&&(i.setNext(a),i.updateArea()),i=a}return e}getCoordinates(){const t=new E;let e=this;do{t.add(e._pt,!1),e=e._next}while(null!==e);return t.toCoordinateArray()}getArea(){return this._area}updateArea(){if(null===this._prev||null===this._next)return this._area=Do.MAX_AREA,null;this._area=Math.abs(ee.area(this._prev._pt,this._pt,this._next._pt))}remove(){const t=this._prev,e=this._next;let i=null;return null!==this._prev&&(this._prev.setNext(e),this._prev.updateArea(),i=this._prev),null!==this._next&&(this._next.setPrev(t),this._next.updateArea(),null===i&&(i=this._next)),this._isLive=!1,i}isLive(){return this._isLive}setPrev(t){this._prev=t}setNext(t){this._next=t}}Do.MAX_AREA=n.MAX_VALUE,To.VWVertex=Do;class Po{constructor(){Po.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._distanceTolerance=null,this._isEnsureValidTopology=!0;const t=arguments[0];this._inputGeom=t}static simplify(t,e){const i=new Po(t);return i.setDistanceTolerance(e),i.getResultGeometry()}setEnsureValid(t){this._isEnsureValidTopology=t}getResultGeometry(){return this._inputGeom.isEmpty()?this._inputGeom.copy():new Oo(this._isEnsureValidTopology,this._distanceTolerance).transform(this._inputGeom)}setDistanceTolerance(t){if(t<0)throw new s("Tolerance must be non-negative");this._distanceTolerance=t}}class Oo extends ge{constructor(){super(),Oo.constructor_.apply(this,arguments)}static constructor_(){this._isEnsureValidTopology=!0,this._distanceTolerance=null;const t=arguments[0],e=arguments[1];this._isEnsureValidTopology=t,this._distanceTolerance=e}transformPolygon(t,e){if(t.isEmpty())return null;const i=super.transformPolygon.call(this,t,e);return e instanceof ft?i:this.createValidArea(i)}createValidArea(t){return this._isEnsureValidTopology?t.buffer(0):t}transformCoordinates(t,e){const i=t.toCoordinateArray();let s=null;return s=0===i.length?new Array(0).fill(null):To.simplify(i,this._distanceTolerance),this._factory.getCoordinateSequenceFactory().create(s)}transformMultiPolygon(t,e){const i=super.transformMultiPolygon.call(this,t,e);return this.createValidArea(i)}transformLinearRing(t,e){const i=e instanceof at,s=super.transformLinearRing.call(this,t,e);return!i||s instanceof pt?s:null}}Po.VWTransformer=Oo;var ko=Object.freeze({__proto__:null,DouglasPeuckerSimplifier:_o,TopologyPreservingSimplifier:So,VWSimplifier:Po});class No{constructor(){No.constructor_.apply(this,arguments)}static constructor_(){this._seg=null,this._segLen=null,this._splitPt=null,this._minimumLen=0;const t=arguments[0];this._seg=t,this._segLen=t.getLength()}static pointAlongReverse(t,e){const i=new y;return i.x=t.p1.x-e*(t.p1.x-t.p0.x),i.y=t.p1.y-e*(t.p1.y-t.p0.y),i}splitAt(){if(1===arguments.length){const t=arguments[0],e=this._minimumLen/this._segLen;if(t.distance(this._seg.p0)<this._minimumLen)return this._splitPt=this._seg.pointAlong(e),null;if(t.distance(this._seg.p1)<this._minimumLen)return this._splitPt=No.pointAlongReverse(this._seg,e),null;this._splitPt=t}else if(2===arguments.length){const t=arguments[0],e=arguments[1],i=this.getConstrainedLength(t)/this._segLen;e.equals2D(this._seg.p0)?this._splitPt=this._seg.pointAlong(i):this._splitPt=No.pointAlongReverse(this._seg,i)}}setMinimumLength(t){this._minimumLen=t}getConstrainedLength(t){return t<this._minimumLen?this._minimumLen:t}getSplitPoint(){return this._splitPt}}class Ao{findSplitPoint(t,e){}}class Ro{static projectedSplitPoint(t,e){return t.getLineSegment().project(e)}findSplitPoint(t,e){const i=t.getLineSegment(),s=i.getLength()/2,a=new No(i),n=Ro.projectedSplitPoint(t,e);let o=2*n.distance(e)*.8;return o>s&&(o=s),a.setMinimumLength(o),a.splitAt(n),a.getSplitPoint()}get interfaces_(){return[Ao]}}class Fo{static triArea(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)}static isInCircleDDNormalized(t,e,i,s){const a=N.valueOf(t.x).selfSubtract(s.x),n=N.valueOf(t.y).selfSubtract(s.y),o=N.valueOf(e.x).selfSubtract(s.x),r=N.valueOf(e.y).selfSubtract(s.y),l=N.valueOf(i.x).selfSubtract(s.x),h=N.valueOf(i.y).selfSubtract(s.y),c=a.multiply(r).selfSubtract(o.multiply(n)),p=o.multiply(h).selfSubtract(l.multiply(r)),u=l.multiply(n).selfSubtract(a.multiply(h)),d=a.multiply(a).selfAdd(n.multiply(n)),m=o.multiply(o).selfAdd(r.multiply(r)),g=l.multiply(l).selfAdd(h.multiply(h));return d.selfMultiply(p).selfAdd(m.selfMultiply(u)).selfAdd(g.selfMultiply(c)).doubleValue()>0}static checkRobustInCircle(t,e,i,s){const a=Fo.isInCircleNonRobust(t,e,i,s),n=Fo.isInCircleDDSlow(t,e,i,s),o=Fo.isInCircleCC(t,e,i,s),r=ee.circumcentre(t,e,i);G.out.println("p radius diff a = "+Math.abs(s.distance(r)-t.distance(r))/t.distance(r)),a===n&&a===o||(G.out.println("inCircle robustness failure (double result = "+a+", DD result = "+n+", CC result = "+o+")"),G.out.println($t.toLineString(new gt([t,e,i,s]))),G.out.println("Circumcentre = "+$t.toPoint(r)+" radius = "+t.distance(r)),G.out.println("p radius diff a = "+Math.abs(s.distance(r)/t.distance(r)-1)),G.out.println("p radius diff b = "+Math.abs(s.distance(r)/e.distance(r)-1)),G.out.println("p radius diff c = "+Math.abs(s.distance(r)/i.distance(r)-1)),G.out.println())}static isInCircleDDFast(t,e,i,s){const a=N.sqr(t.x).selfAdd(N.sqr(t.y)).selfMultiply(Fo.triAreaDDFast(e,i,s)),n=N.sqr(e.x).selfAdd(N.sqr(e.y)).selfMultiply(Fo.triAreaDDFast(t,i,s)),o=N.sqr(i.x).selfAdd(N.sqr(i.y)).selfMultiply(Fo.triAreaDDFast(t,e,s)),r=N.sqr(s.x).selfAdd(N.sqr(s.y)).selfMultiply(Fo.triAreaDDFast(t,e,i));return a.selfSubtract(n).selfAdd(o).selfSubtract(r).doubleValue()>0}static isInCircleCC(t,e,i,s){const a=ee.circumcentre(t,e,i),n=t.distance(a);return s.distance(a)-n<=0}static isInCircleNormalized(t,e,i,s){const a=t.x-s.x,n=t.y-s.y,o=e.x-s.x,r=e.y-s.y,l=i.x-s.x,h=i.y-s.y;return(a*a+n*n)*(o*h-l*r)+(o*o+r*r)*(l*n-a*h)+(l*l+h*h)*(a*r-o*n)>0}static isInCircleDDSlow(t,e,i,s){const a=N.valueOf(s.x),n=N.valueOf(s.y),o=N.valueOf(t.x),r=N.valueOf(t.y),l=N.valueOf(e.x),h=N.valueOf(e.y),c=N.valueOf(i.x),p=N.valueOf(i.y),u=o.multiply(o).add(r.multiply(r)).multiply(Fo.triAreaDDSlow(l,h,c,p,a,n)),d=l.multiply(l).add(h.multiply(h)).multiply(Fo.triAreaDDSlow(o,r,c,p,a,n)),m=c.multiply(c).add(p.multiply(p)).multiply(Fo.triAreaDDSlow(o,r,l,h,a,n)),g=a.multiply(a).add(n.multiply(n)).multiply(Fo.triAreaDDSlow(o,r,l,h,c,p));return u.subtract(d).add(m).subtract(g).doubleValue()>0}static isInCircleNonRobust(t,e,i,s){return(t.x*t.x+t.y*t.y)*Fo.triArea(e,i,s)-(e.x*e.x+e.y*e.y)*Fo.triArea(t,i,s)+(i.x*i.x+i.y*i.y)*Fo.triArea(t,e,s)-(s.x*s.x+s.y*s.y)*Fo.triArea(t,e,i)>0}static isInCircleRobust(t,e,i,s){return Fo.isInCircleNormalized(t,e,i,s)}static triAreaDDSlow(t,e,i,s,a,n){return i.subtract(t).multiply(n.subtract(e)).subtract(s.subtract(e).multiply(a.subtract(t)))}static triAreaDDFast(t,e,i){const s=N.valueOf(e.x).selfSubtract(t.x).selfMultiply(N.valueOf(i.y).selfSubtract(t.y)),a=N.valueOf(e.y).selfSubtract(t.y).selfMultiply(N.valueOf(i.x).selfSubtract(t.x));return s.selfSubtract(a)}}class Bo{constructor(){Bo.constructor_.apply(this,arguments)}static constructor_(){if(this._p=null,1===arguments.length){const t=arguments[0];this._p=new y(t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._p=new y(t,e)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._p=new y(t,e,i)}}static interpolateZ(){if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=e.distance(i),a=t.distance(e),n=i.getZ()-e.getZ();return e.getZ()+n*(a/s)}if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=e.x,n=e.y,o=i.x-a,r=s.x-a,l=i.y-n,h=s.y-n,c=o*h-r*l,p=t.x-a,u=t.y-n,d=(h*p-r*u)/c,m=(-l*p+o*u)/c;return e.getZ()+d*(i.getZ()-e.getZ())+m*(s.getZ()-e.getZ())}}circleCenter(t,e){const i=new Bo(this.getX(),this.getY()),s=this.bisector(i,t),a=this.bisector(t,e),n=new te(s,a);let o=null;try{o=new Bo(n.getX(),n.getY())}catch(s){if(!(s instanceof Zt))throw s;G.err.println("a: "+i+" b: "+t+" c: "+e),G.err.println(s)}return o}dot(t){return this._p.x*t.getX()+this._p.y*t.getY()}magn(){return Math.sqrt(this._p.x*this._p.x+this._p.y*this._p.y)}getZ(){return this._p.getZ()}bisector(t,e){const i=e.getX()-t.getX(),s=e.getY()-t.getY(),a=new te(t.getX()+i/2,t.getY()+s/2,1),n=new te(t.getX()-s+i/2,t.getY()+i+s/2,1);return new te(a,n)}equals(){if(1===arguments.length){const t=arguments[0];return this._p.x===t.getX()&&this._p.y===t.getY()}if(2===arguments.length){const t=arguments[0],e=arguments[1];return this._p.distance(t.getCoordinate())<e}}getCoordinate(){return this._p}isInCircle(t,e,i){return Fo.isInCircleRobust(t._p,e._p,i._p,this._p)}interpolateZValue(t,e,i){const s=t.getX(),a=t.getY(),n=e.getX()-s,o=i.getX()-s,r=e.getY()-a,l=i.getY()-a,h=n*l-o*r,c=this.getX()-s,p=this.getY()-a,u=(l*c-o*p)/h,d=(-r*c+n*p)/h;return t.getZ()+u*(e.getZ()-t.getZ())+d*(i.getZ()-t.getZ())}midPoint(t){const e=(this._p.x+t.getX())/2,i=(this._p.y+t.getY())/2,s=(this._p.getZ()+t.getZ())/2;return new Bo(e,i,s)}rightOf(t){return this.isCCW(t.dest(),t.orig())}isCCW(t,e){return(t._p.x-this._p.x)*(e._p.y-this._p.y)-(t._p.y-this._p.y)*(e._p.x-this._p.x)>0}getX(){return this._p.x}crossProduct(t){return this._p.x*t.getY()-this._p.y*t.getX()}setZ(t){this._p.setZ(t)}times(t){return new Bo(t*this._p.x,t*this._p.y)}cross(){return new Bo(this._p.y,-this._p.x)}leftOf(t){return this.isCCW(t.orig(),t.dest())}toString(){return"POINT ("+this._p.x+" "+this._p.y+")"}sub(t){return new Bo(this._p.x-t.getX(),this._p.y-t.getY())}getY(){return this._p.y}classify(t,e){const i=this,s=e.sub(t),a=i.sub(t),n=s.crossProduct(a);return n>0?Bo.LEFT:n<0?Bo.RIGHT:s.getX()*a.getX()<0||s.getY()*a.getY()<0?Bo.BEHIND:s.magn()<a.magn()?Bo.BEYOND:t.equals(i)?Bo.ORIGIN:e.equals(i)?Bo.DESTINATION:Bo.BETWEEN}sum(t){return new Bo(this._p.x+t.getX(),this._p.y+t.getY())}distance(t,e){return Math.sqrt(Math.pow(e.getX()-t.getX(),2)+Math.pow(e.getY()-t.getY(),2))}circumRadiusRatio(t,e){const i=this.circleCenter(t,e),s=this.distance(i,t);let a=this.distance(this,t),n=this.distance(t,e);return n<a&&(a=n),n=this.distance(e,this),n<a&&(a=n),s/a}}Bo.LEFT=0,Bo.RIGHT=1,Bo.BEYOND=2,Bo.BEHIND=3,Bo.BETWEEN=4,Bo.ORIGIN=5,Bo.DESTINATION=6;class Go extends Bo{constructor(){super(),Go.constructor_.apply(this,arguments)}static constructor_(){this._isOnConstraint=null,this._constraint=null;const t=arguments[0];Bo.constructor_.call(this,t)}getConstraint(){return this._constraint}setOnConstraint(t){this._isOnConstraint=t}merge(t){t._isOnConstraint&&(this._isOnConstraint=!0,this._constraint=t._constraint)}isOnConstraint(){return this._isOnConstraint}setConstraint(t){this._isOnConstraint=!0,this._constraint=t}}class zo{constructor(){zo.constructor_.apply(this,arguments)}static constructor_(){this._rot=null,this._vertex=null,this._next=null,this._data=null}static makeEdge(t,e){const i=new zo,s=new zo,a=new zo,n=new zo;i._rot=s,s._rot=a,a._rot=n,n._rot=i,i.setNext(i),s.setNext(n),a.setNext(a),n.setNext(s);const o=i;return o.setOrig(t),o.setDest(e),o}static swap(t){const e=t.oPrev(),i=t.sym().oPrev();zo.splice(t,e),zo.splice(t.sym(),i),zo.splice(t,e.lNext()),zo.splice(t.sym(),i.lNext()),t.setOrig(e.dest()),t.setDest(i.dest())}static splice(t,e){const i=t.oNext().rot(),s=e.oNext().rot(),a=e.oNext(),n=t.oNext(),o=s.oNext(),r=i.oNext();t.setNext(a),e.setNext(n),i.setNext(o),s.setNext(r)}static connect(t,e){const i=zo.makeEdge(t.dest(),e.orig());return zo.splice(i,t.lNext()),zo.splice(i.sym(),e),i}equalsNonOriented(t){return!!this.equalsOriented(t)||!!this.equalsOriented(t.sym())}toLineSegment(){return new Yt(this._vertex.getCoordinate(),this.dest().getCoordinate())}dest(){return this.sym().orig()}oNext(){return this._next}equalsOriented(t){return!(!this.orig().getCoordinate().equals2D(t.orig().getCoordinate())||!this.dest().getCoordinate().equals2D(t.dest().getCoordinate()))}dNext(){return this.sym().oNext().sym()}lPrev(){return this._next.sym()}rPrev(){return this.sym().oNext()}rot(){return this._rot}oPrev(){return this._rot._next._rot}sym(){return this._rot._rot}setOrig(t){this._vertex=t}lNext(){return this.invRot().oNext().rot()}getLength(){return this.orig().getCoordinate().distance(this.dest().getCoordinate())}invRot(){return this._rot.sym()}setDest(t){this.sym().setOrig(t)}setData(t){this._data=t}getData(){return this._data}delete(){this._rot=null}orig(){return this._vertex}rNext(){return this._rot._next.invRot()}toString(){const t=this._vertex.getCoordinate(),e=this.dest().getCoordinate();return $t.toLineString(t,e)}isLive(){return null!==this._rot}getPrimary(){return this.orig().getCoordinate().compareTo(this.dest().getCoordinate())<=0?this:this.sym()}dPrev(){return this.invRot().oNext().invRot()}setNext(t){this._next=t}}class jo{constructor(){jo.constructor_.apply(this,arguments)}static constructor_(){this._subdiv=null,this._isUsingTolerance=!1;const t=arguments[0];this._subdiv=t,this._isUsingTolerance=t.getTolerance()>0}insertSite(t){let e=this._subdiv.locate(t);if(this._subdiv.isVertexOfEdge(e,t))return e;this._subdiv.isOnEdge(e,t.getCoordinate())&&(e=e.oPrev(),this._subdiv.delete(e.oNext()));let i=this._subdiv.makeEdge(e.orig(),t);zo.splice(i,e);const s=i;do{i=this._subdiv.connect(e,i.sym()),e=i.oPrev()}while(e.lNext()!==s);for(;;){const a=e.oPrev();if(a.dest().rightOf(e)&&t.isInCircle(e.orig(),a.dest(),e.dest()))zo.swap(e),e=e.oPrev();else{if(e.oNext()===s)return i;e=e.oNext().lPrev()}}}insertSites(t){for(let e=t.iterator();e.hasNext();){const t=e.next();this.insertSite(t)}}}class Uo{locate(t){}}class Vo{constructor(){Vo.constructor_.apply(this,arguments)}static constructor_(){this._subdiv=null,this._lastEdge=null;const t=arguments[0];this._subdiv=t,this.init()}init(){this._lastEdge=this.findEdge()}locate(t){this._lastEdge.isLive()||this.init();const e=this._subdiv.locateFromEdge(t,this._lastEdge);return this._lastEdge=e,e}findEdge(){return this._subdiv.getEdges().iterator().next()}get interfaces_(){return[Uo]}}class qo extends c{constructor(){super(),qo.constructor_.apply(this,arguments)}static constructor_(){if(this._seg=null,1===arguments.length){if("string"==typeof arguments[0]){const t=arguments[0];c.constructor_.call(this,t)}else if(arguments[0]instanceof Yt){const t=arguments[0];c.constructor_.call(this,"Locate failed to converge (at edge: "+t+"). Possible causes include invalid Subdivision topology or very close sites"),this._seg=new Yt(t)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];c.constructor_.call(this,qo.msgWithSpatial(t,e)),this._seg=new Yt(e)}}static msgWithSpatial(t,e){return null!==e?t+" [ "+e+" ]":t}getSegment(){return this._seg}}class Ho{visit(t){}}class $o{constructor(){$o.constructor_.apply(this,arguments)}static constructor_(){this._visitedKey=0,this._quadEdges=new S,this._startingEdge=null,this._tolerance=null,this._edgeCoincidenceTolerance=null,this._frameVertex=new Array(3).fill(null),this._frameEnv=null,this._locator=null,this._seg=new Yt,this._triEdges=new Array(3).fill(null);const t=arguments[0],e=arguments[1];this._tolerance=e,this._edgeCoincidenceTolerance=e/$o.EDGE_COINCIDENCE_TOL_FACTOR,this.createFrame(t),this._startingEdge=this.initSubdiv(),this._locator=new Vo(this)}static getTriangleEdges(t,e){if(e[0]=t,e[1]=e[0].lNext(),e[2]=e[1].lNext(),e[2].lNext()!==e[0])throw new s("Edges do not form a triangle")}getTriangleVertices(t){const e=new Yo;return this.visitTriangles(e,t),e.getTriangleVertices()}isFrameVertex(t){return!!t.equals(this._frameVertex[0])||!!t.equals(this._frameVertex[1])||!!t.equals(this._frameVertex[2])}isVertexOfEdge(t,e){return!(!e.equals(t.orig(),this._tolerance)&&!e.equals(t.dest(),this._tolerance))}connect(t,e){const i=zo.connect(t,e);return this._quadEdges.add(i),i}getVoronoiCellPolygon(t,e){const i=new S,s=t;do{const e=t.rot().orig().getCoordinate();i.add(e),t=t.oPrev()}while(t!==s);const a=new E;a.addAll(i,!1),a.closeRing(),a.size()<4&&(G.out.println(a),a.add(a.get(a.size()-1),!0));const n=a.toCoordinateArray(),o=e.createPolygon(e.createLinearRing(n)),r=s.orig();return o.setUserData(r.getCoordinate()),o}setLocator(t){this._locator=t}initSubdiv(){const t=this.makeEdge(this._frameVertex[0],this._frameVertex[1]),e=this.makeEdge(this._frameVertex[1],this._frameVertex[2]);zo.splice(t.sym(),e);const i=this.makeEdge(this._frameVertex[2],this._frameVertex[0]);return zo.splice(e.sym(),i),zo.splice(i.sym(),t),t}isFrameBorderEdge(t){const e=new Array(3).fill(null);$o.getTriangleEdges(t,e);const i=new Array(3).fill(null);$o.getTriangleEdges(t.sym(),i);const s=t.lNext().dest();if(this.isFrameVertex(s))return!0;const a=t.sym().lNext().dest();return!!this.isFrameVertex(a)}makeEdge(t,e){const i=zo.makeEdge(t,e);return this._quadEdges.add(i),i}visitTriangles(t,e){this._visitedKey++;const i=new ti;i.push(this._startingEdge);const s=new vt;for(;!i.empty();){const a=i.pop();if(!s.contains(a)){const n=this.fetchTriangleToVisit(a,i,e,s);null!==n&&t.visit(n)}}}isFrameEdge(t){return!(!this.isFrameVertex(t.orig())&&!this.isFrameVertex(t.dest()))}isOnEdge(t,e){return this._seg.setCoordinates(t.orig().getCoordinate(),t.dest().getCoordinate()),this._seg.distance(e)<this._edgeCoincidenceTolerance}getEnvelope(){return new D(this._frameEnv)}createFrame(t){const e=t.getWidth(),i=t.getHeight();let s=0;s=e>i?10*e:10*i,this._frameVertex[0]=new Bo((t.getMaxX()+t.getMinX())/2,t.getMaxY()+s),this._frameVertex[1]=new Bo(t.getMinX()-s,t.getMinY()-s),this._frameVertex[2]=new Bo(t.getMaxX()+s,t.getMinY()-s),this._frameEnv=new D(this._frameVertex[0].getCoordinate(),this._frameVertex[1].getCoordinate()),this._frameEnv.expandToInclude(this._frameVertex[2].getCoordinate())}getTriangleCoordinates(t){const e=new Jo;return this.visitTriangles(e,t),e.getTriangles()}getVertices(t){const e=new vt;for(let i=this._quadEdges.iterator();i.hasNext();){const s=i.next(),a=s.orig();!t&&this.isFrameVertex(a)||e.add(a);const n=s.dest();!t&&this.isFrameVertex(n)||e.add(n)}return e}fetchTriangleToVisit(t,e,i,s){let a=t,n=0,o=!1;do{this._triEdges[n]=a,this.isFrameEdge(a)&&(o=!0);const t=a.sym();s.contains(t)||e.push(t),s.add(a),n++,a=a.lNext()}while(a!==t);return o&&!i?null:this._triEdges}getEdges(){if(0===arguments.length)return this._quadEdges;if(1===arguments.length){const t=arguments[0],e=this.getPrimaryEdges(!1),i=new Array(e.size()).fill(null);let s=0;for(let a=e.iterator();a.hasNext();){const e=a.next();i[s++]=t.createLineString([e.orig().getCoordinate(),e.dest().getCoordinate()])}return t.createMultiLineString(i)}}getVertexUniqueEdges(t){const e=new S,i=new vt;for(let s=this._quadEdges.iterator();s.hasNext();){const a=s.next(),n=a.orig();i.contains(n)||(i.add(n),!t&&this.isFrameVertex(n)||e.add(a));const o=a.sym(),r=o.orig();i.contains(r)||(i.add(r),!t&&this.isFrameVertex(r)||e.add(o))}return e}getTriangleEdges(t){const e=new Ko;return this.visitTriangles(e,t),e.getTriangleEdges()}getPrimaryEdges(t){this._visitedKey++;const e=new S,i=new ti;i.push(this._startingEdge);const s=new vt;for(;!i.empty();){const a=i.pop();if(!s.contains(a)){const n=a.getPrimary();!t&&this.isFrameEdge(n)||e.add(n),i.push(a.oNext()),i.push(a.sym().oNext()),s.add(a),s.add(a.sym())}}return e}delete(t){zo.splice(t,t.oPrev()),zo.splice(t.sym(),t.sym().oPrev());const e=t.sym(),i=t.rot(),s=t.rot().sym();this._quadEdges.remove(t),this._quadEdges.remove(e),this._quadEdges.remove(i),this._quadEdges.remove(s),t.delete(),e.delete(),i.delete(),s.delete()}locateFromEdge(t,e){let i=0;const s=this._quadEdges.size();let a=e;for(;;){if(i++,i>s)throw new qo(a.toLineSegment());if(t.equals(a.orig())||t.equals(a.dest()))break;if(t.rightOf(a))a=a.sym();else if(t.rightOf(a.oNext())){if(t.rightOf(a.dPrev()))break;a=a.dPrev()}else a=a.oNext()}return a}getTolerance(){return this._tolerance}getVoronoiCellPolygons(t){this.visitTriangles(new Wo,!0);const e=new S;for(let i=this.getVertexUniqueEdges(!1).iterator();i.hasNext();){const s=i.next();e.add(this.getVoronoiCellPolygon(s,t))}return e}getVoronoiDiagram(t){const e=this.getVoronoiCellPolygons(t);return t.createGeometryCollection(wt.toGeometryArray(e))}getTriangles(t){const e=this.getTriangleCoordinates(!1),i=new Array(e.size()).fill(null);let s=0;for(let a=e.iterator();a.hasNext();){const e=a.next();i[s++]=t.createPolygon(t.createLinearRing(e))}return t.createGeometryCollection(i)}insertSite(t){let e=this.locate(t);if(t.equals(e.orig(),this._tolerance)||t.equals(e.dest(),this._tolerance))return e;let i=this.makeEdge(e.orig(),t);zo.splice(i,e);const s=i;do{i=this.connect(e,i.sym()),e=i.oPrev()}while(e.lNext()!==s);return s}locate(){if(1===arguments.length){if(arguments[0]instanceof Bo){const t=arguments[0];return this._locator.locate(t)}if(arguments[0]instanceof y){const t=arguments[0];return this._locator.locate(new Bo(t))}}else if(2===arguments.length){const t=arguments[0],e=arguments[1],i=this._locator.locate(new Bo(t));if(null===i)return null;let s=i;i.dest().getCoordinate().equals2D(t)&&(s=i.sym());let a=s;do{if(a.dest().getCoordinate().equals2D(e))return a;a=a.oNext()}while(a!==s);return null}}}class Wo{visit(t){const e=t[0].orig().getCoordinate(),i=t[1].orig().getCoordinate(),s=t[2].orig().getCoordinate(),a=ee.circumcentreDD(e,i,s),n=new Bo(a);for(let e=0;e<3;e++)t[e].rot().setOrig(n)}get interfaces_(){return[Ho]}}class Ko{constructor(){Ko.constructor_.apply(this,arguments)}static constructor_(){this._triList=new S}getTriangleEdges(){return this._triList}visit(t){this._triList.add(t)}get interfaces_(){return[Ho]}}class Yo{constructor(){Yo.constructor_.apply(this,arguments)}static constructor_(){this._triList=new S}visit(t){this._triList.add([t[0].orig(),t[1].orig(),t[2].orig()])}getTriangleVertices(){return this._triList}get interfaces_(){return[Ho]}}class Jo{constructor(){Jo.constructor_.apply(this,arguments)}static constructor_(){this._coordList=new E,this._triCoords=new S}checkTriangleSize(t){t.length>=2?$t.toLineString(t[0],t[1]):t.length>=1&&$t.toPoint(t[0])}visit(t){this._coordList.clear();for(let e=0;e<3;e++){const i=t[e].orig();this._coordList.add(i.getCoordinate())}if(this._coordList.size()>0){this._coordList.closeRing();const t=this._coordList.toCoordinateArray();if(4!==t.length)return null;this._triCoords.add(t)}}getTriangles(){return this._triCoords}get interfaces_(){return[Ho]}}$o.TriangleCircumcentreVisitor=Wo,$o.TriangleEdgesListVisitor=Ko,$o.TriangleVertexListVisitor=Yo,$o.TriangleCoordinatesVisitor=Jo,$o.EDGE_COINCIDENCE_TOL_FACTOR=1e3;class Xo{constructor(){Xo.constructor_.apply(this,arguments)}static constructor_(){if(this._ls=null,this._data=null,2===arguments.length){const t=arguments[0],e=arguments[1];this._ls=new Yt(t,e)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._ls=new Yt(t,e),this._data=i}else if(6===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4],n=arguments[5];Xo.constructor_.call(this,new y(t,e,i),new y(s,a,n))}else if(7===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3],a=arguments[4],n=arguments[5],o=arguments[6];Xo.constructor_.call(this,new y(t,e,i),new y(s,a,n),o)}}getLineSegment(){return this._ls}getEndZ(){return this._ls.getCoordinate(1).getZ()}getStartZ(){return this._ls.getCoordinate(0).getZ()}intersection(t){return this._ls.intersection(t.getLineSegment())}getStart(){return this._ls.getCoordinate(0)}getEnd(){return this._ls.getCoordinate(1)}getEndY(){return this._ls.getCoordinate(1).y}getStartX(){return this._ls.getCoordinate(0).x}equalsTopo(t){return this._ls.equalsTopo(t.getLineSegment())}getStartY(){return this._ls.getCoordinate(0).y}setData(t){this._data=t}getData(){return this._data}getEndX(){return this._ls.getCoordinate(1).x}toString(){return this._ls.toString()}}class Qo extends c{constructor(){super(),Qo.constructor_.apply(this,arguments)}static constructor_(){if(this._pt=null,1===arguments.length){const t=arguments[0];c.constructor_.call(this,t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];c.constructor_.call(this,Qo.msgWithCoord(t,e)),this._pt=new y(e)}}static msgWithCoord(t,e){return null!==e?t+" [ "+$t.toPoint(e)+" ]":t}getCoordinate(){return this._pt}}class Zo{constructor(){Zo.constructor_.apply(this,arguments)}static constructor_(){this._initialVertices=null,this._segVertices=null,this._segments=new S,this._subdiv=null,this._incDel=null,this._convexHull=null,this._splitFinder=new Ro,this._kdt=null,this._vertexFactory=null,this._computeAreaEnv=null,this._splitPt=null,this._tolerance=null;const t=arguments[0],e=arguments[1];this._initialVertices=new S(t),this._tolerance=e,this._kdt=new hs(e)}static computeVertexEnvelope(t){const e=new D;for(let i=t.iterator();i.hasNext();){const t=i.next();e.expandToInclude(t.getCoordinate())}return e}getInitialVertices(){return this._initialVertices}getKDT(){return this._kdt}enforceConstraints(){this.addConstraintVertices();let t=0,e=0;do{e=this.enforceGabriel(this._segments),t++}while(e>0&&t<Zo.MAX_SPLIT_ITER);if(t===Zo.MAX_SPLIT_ITER)throw new Qo("Too many splitting iterations while enforcing constraints. Last split point was at: ",this._splitPt)}insertSites(t){for(let e=t.iterator();e.hasNext();){const t=e.next();this.insertSite(t)}}getVertexFactory(){return this._vertexFactory}getPointArray(){const t=new Array(this._initialVertices.size()+this._segVertices.size()).fill(null);let e=0;for(let i=this._initialVertices.iterator();i.hasNext();){const s=i.next();t[e++]=s.getCoordinate()}for(let i=this._segVertices.iterator();i.hasNext();){const s=i.next();t[e++]=s.getCoordinate()}return t}setConstraints(t,e){this._segments=t,this._segVertices=e}computeConvexHull(){const t=new wt,e=this.getPointArray(),i=new ii(e,t);this._convexHull=i.getConvexHull()}addConstraintVertices(){this.computeConvexHull(),this.insertSites(this._segVertices)}findNonGabrielPoint(t){const e=t.getStart(),i=t.getEnd(),s=new y((e.x+i.x)/2,(e.y+i.y)/2),a=e.distance(s),o=new D(s);o.expandBy(a);const r=this._kdt.query(o);let l=null,h=n.MAX_VALUE;for(let t=r.iterator();t.hasNext();){const n=t.next().getCoordinate();if(n.equals2D(e)||n.equals2D(i))continue;const o=s.distance(n);o<a&&(null===l||o<h)&&(l=n,h=o)}return l}getConstraintSegments(){return this._segments}setSplitPointFinder(t){this._splitFinder=t}getConvexHull(){return this._convexHull}getTolerance(){return this._tolerance}enforceGabriel(t){const e=new S;let i=0;const s=new S;for(let a=t.iterator();a.hasNext();){const t=a.next(),n=this.findNonGabrielPoint(t);if(null===n)continue;this._splitPt=this._splitFinder.findSplitPoint(t,n);const o=this.createVertex(this._splitPt,t);this.insertSite(o).getCoordinate().equals2D(this._splitPt);const r=new Xo(t.getStartX(),t.getStartY(),t.getStartZ(),o.getX(),o.getY(),o.getZ(),t.getData()),l=new Xo(o.getX(),o.getY(),o.getZ(),t.getEndX(),t.getEndY(),t.getEndZ(),t.getData());e.add(r),e.add(l),s.add(t),i+=1}return t.removeAll(s),t.addAll(e),i}createVertex(){if(1===arguments.length){const t=arguments[0];let e=null;return e=null!==this._vertexFactory?this._vertexFactory.createVertex(t,null):new Go(t),e}if(2===arguments.length){const t=arguments[0],e=arguments[1];let i=null;return i=null!==this._vertexFactory?this._vertexFactory.createVertex(t,e):new Go(t),i.setOnConstraint(!0),i}}getSubdivision(){return this._subdiv}computeBoundingBox(){const t=Zo.computeVertexEnvelope(this._initialVertices),e=Zo.computeVertexEnvelope(this._segVertices),i=new D(t);i.expandToInclude(e);const s=.2*i.getWidth(),a=.2*i.getHeight(),n=Math.max(s,a);this._computeAreaEnv=new D(i),this._computeAreaEnv.expandBy(n)}setVertexFactory(t){this._vertexFactory=t}formInitialDelaunay(){this.computeBoundingBox(),this._subdiv=new $o(this._computeAreaEnv,this._tolerance),this._subdiv.setLocator(new Vo(this._subdiv)),this._incDel=new jo(this._subdiv),this.insertSites(this._initialVertices)}insertSite(){if(arguments[0]instanceof Go){const t=arguments[0],e=this._kdt.insert(t.getCoordinate(),t);if(e.isRepeated()){const i=e.getData();return i.merge(t),i}return this._incDel.insertSite(t),t}if(arguments[0]instanceof y){const t=arguments[0];this.insertSite(this.createVertex(t))}}}Zo.MAX_SPLIT_ITER=99;class tr{constructor(){tr.constructor_.apply(this,arguments)}static constructor_(){this._siteCoords=null,this._tolerance=0,this._subdiv=null}static extractUniqueCoordinates(t){if(null===t)return new E;const e=t.getCoordinates();return tr.unique(e)}static envelope(t){const e=new D;for(let i=t.iterator();i.hasNext();){const t=i.next();e.expandToInclude(t)}return e}static unique(t){const e=dt.copyDeep(t);return it.sort(e),new E(e,!1)}static toVertices(t){const e=new S;for(let i=t.iterator();i.hasNext();){const t=i.next();e.add(new Bo(t))}return e}create(){if(null!==this._subdiv)return null;const t=tr.envelope(this._siteCoords),e=tr.toVertices(this._siteCoords);this._subdiv=new $o(t,this._tolerance),new jo(this._subdiv).insertSites(e)}setTolerance(t){this._tolerance=t}setSites(){if(arguments[0]instanceof q){const t=arguments[0];this._siteCoords=tr.extractUniqueCoordinates(t)}else if(C(arguments[0],L)){const t=arguments[0];this._siteCoords=tr.unique(dt.toCoordinateArray(t))}}getEdges(t){return this.create(),this._subdiv.getEdges(t)}getSubdivision(){return this.create(),this._subdiv}getTriangles(t){return this.create(),this._subdiv.getTriangles(t)}}class er{constructor(){er.constructor_.apply(this,arguments)}static constructor_(){this._siteCoords=null,this._constraintLines=null,this._tolerance=0,this._subdiv=null,this._constraintVertexMap=new qi}static createConstraintSegments(){if(1===arguments.length){const t=arguments[0],e=fe.getLines(t),i=new S;for(let t=e.iterator();t.hasNext();){const e=t.next();er.createConstraintSegments(e,i)}return i}if(2===arguments.length){const t=arguments[1],e=arguments[0].getCoordinates();for(let i=1;i<e.length;i++)t.add(new Xo(e[i-1],e[i]))}}createSiteVertices(t){const e=new S;for(let i=t.iterator();i.hasNext();){const t=i.next();this._constraintVertexMap.containsKey(t)||e.add(new Go(t))}return e}create(){if(null!==this._subdiv)return null;const t=tr.envelope(this._siteCoords);let e=new S;null!==this._constraintLines&&(t.expandToInclude(this._constraintLines.getEnvelopeInternal()),this.createVertices(this._constraintLines),e=er.createConstraintSegments(this._constraintLines));const i=this.createSiteVertices(this._siteCoords),s=new Zo(i,this._tolerance);s.setConstraints(e,new S(this._constraintVertexMap.values())),s.formInitialDelaunay(),s.enforceConstraints(),this._subdiv=s.getSubdivision()}setTolerance(t){this._tolerance=t}setConstraints(t){this._constraintLines=t}setSites(t){this._siteCoords=tr.extractUniqueCoordinates(t)}getEdges(t){return this.create(),this._subdiv.getEdges(t)}getSubdivision(){return this.create(),this._subdiv}getTriangles(t){return this.create(),this._subdiv.getTriangles(t)}createVertices(t){const e=t.getCoordinates();for(let t=0;t<e.length;t++){const i=new Go(e[t]);this._constraintVertexMap.put(e[t],i)}}}class ir{constructor(){ir.constructor_.apply(this,arguments)}static constructor_(){this._siteCoords=null,this._tolerance=0,this._subdiv=null,this._clipEnv=null,this._diagramEnv=null}static clipGeometryCollection(t,e){const i=t.getFactory().toGeometry(e),s=new S;for(let a=0;a<t.getNumGeometries();a++){const n=t.getGeometryN(a);let o=null;e.contains(n.getEnvelopeInternal())?o=n:e.intersects(n.getEnvelopeInternal())&&(o=Cn.intersection(i,n),o.setUserData(n.getUserData())),null===o||o.isEmpty()||s.add(o)}return t.getFactory().createGeometryCollection(wt.toGeometryArray(s))}create(){if(null!==this._subdiv)return null;const t=tr.envelope(this._siteCoords);if(this._diagramEnv=this._clipEnv,null===this._diagramEnv){this._diagramEnv=t;const e=this._diagramEnv.getDiameter();this._diagramEnv.expandBy(e)}const e=tr.toVertices(this._siteCoords);this._subdiv=new $o(t,this._tolerance),new jo(this._subdiv).insertSites(e)}getDiagram(t){this.create();const e=this._subdiv.getVoronoiDiagram(t);return ir.clipGeometryCollection(e,this._diagramEnv)}setTolerance(t){this._tolerance=t}setSites(){if(arguments[0]instanceof q){const t=arguments[0];this._siteCoords=tr.extractUniqueCoordinates(t)}else if(C(arguments[0],L)){const t=arguments[0];this._siteCoords=tr.unique(dt.toCoordinateArray(t))}}setClipEnvelope(t){this._clipEnv=t}getSubdivision(){return this.create(),this._subdiv}}var sr=Object.freeze({__proto__:null,Vertex:Bo}),ar=Object.freeze({__proto__:null,ConformingDelaunayTriangulationBuilder:er,DelaunayTriangulationBuilder:tr,VoronoiDiagramBuilder:ir,quadedge:sr});class nr{constructor(){nr.constructor_.apply(this,arguments)}static constructor_(){if(this._linearGeom=null,this._numLines=null,this._currentLine=null,this._componentIndex=0,this._vertexIndex=0,1===arguments.length){const t=arguments[0];nr.constructor_.call(this,t,0,0)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];nr.constructor_.call(this,t,e.getComponentIndex(),nr.segmentEndVertexIndex(e))}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];if(!C(t,W))throw new s("Lineal geometry is required");this._linearGeom=t,this._numLines=t.getNumGeometries(),this._componentIndex=e,this._vertexIndex=i,this.loadCurrentLine()}}static segmentEndVertexIndex(t){return t.getSegmentFraction()>0?t.getSegmentIndex()+1:t.getSegmentIndex()}getComponentIndex(){return this._componentIndex}getLine(){return this._currentLine}getVertexIndex(){return this._vertexIndex}getSegmentEnd(){return this._vertexIndex<this.getLine().getNumPoints()-1?this._currentLine.getCoordinateN(this._vertexIndex+1):null}next(){if(!this.hasNext())return null;this._vertexIndex++,this._vertexIndex>=this._currentLine.getNumPoints()&&(this._componentIndex++,this.loadCurrentLine(),this._vertexIndex=0)}loadCurrentLine(){if(this._componentIndex>=this._numLines)return this._currentLine=null,null;this._currentLine=this._linearGeom.getGeometryN(this._componentIndex)}getSegmentStart(){return this._currentLine.getCoordinateN(this._vertexIndex)}isEndOfLine(){return!(this._componentIndex>=this._numLines||this._vertexIndex<this._currentLine.getNumPoints()-1)}hasNext(){return!(this._componentIndex>=this._numLines||this._componentIndex===this._numLines-1&&this._vertexIndex>=this._currentLine.getNumPoints())}}class or{constructor(){or.constructor_.apply(this,arguments)}static constructor_(){this._linearGeom=null;const t=arguments[0];this._linearGeom=t}static indexOf(t,e){return new or(t).indexOf(e)}static indexOfAfter(t,e,i){return new or(t).indexOfAfter(e,i)}indexOf(t){return this.indexOfFromStart(t,-1)}indexOfFromStart(t,e){let i=n.MAX_VALUE,s=e,a=0;const o=new Yt,r=new nr(this._linearGeom);for(;r.hasNext();){if(!r.isEndOfLine()){o.p0=r.getSegmentStart(),o.p1=r.getSegmentEnd();const n=o.distance(t),l=this.segmentNearestMeasure(o,t,a);n<i&&l>e&&(s=l,i=n),a+=o.getLength()}r.next()}return s}indexOfAfter(t,e){if(e<0)return this.indexOf(t);const i=this._linearGeom.getLength();if(i<e)return i;const s=this.indexOfFromStart(t,e);return u.isTrue(s>=e,"computed index is before specified minimum index"),s}segmentNearestMeasure(t,e,i){const s=t.projectionFactor(e);return s<=0?i:s<=1?i+s*t.getLength():i+t.getLength()}}class rr{constructor(){rr.constructor_.apply(this,arguments)}static constructor_(){if(this._componentIndex=0,this._segmentIndex=0,this._segmentFraction=0,0===arguments.length);else if(1===arguments.length){const t=arguments[0];this._componentIndex=t._componentIndex,this._segmentIndex=t._segmentIndex,this._segmentFraction=t._segmentFraction}else if(2===arguments.length){const t=arguments[0],e=arguments[1];rr.constructor_.call(this,0,t,e)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];this._componentIndex=t,this._segmentIndex=e,this._segmentFraction=i,this.normalize()}else if(4===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2],s=arguments[3];this._componentIndex=t,this._segmentIndex=e,this._segmentFraction=i,s&&this.normalize()}}static getEndLocation(t){const e=new rr;return e.setToEnd(t),e}static pointAlongSegmentByFraction(t,e,i){if(i<=0)return t;if(i>=1)return e;const s=(e.x-t.x)*i+t.x,a=(e.y-t.y)*i+t.y,n=(e.getZ()-t.getZ())*i+t.getZ();return new y(s,a,n)}static compareLocationValues(t,e,i,s,a,n){return t<s?-1:t>s?1:e<a?-1:e>a?1:i<n?-1:i>n?1:0}static numSegments(t){const e=t.getNumPoints();return e<=1?0:e-1}getSegmentIndex(){return this._segmentIndex}getComponentIndex(){return this._componentIndex}isEndpoint(t){const e=t.getGeometryN(this._componentIndex),i=rr.numSegments(e);return this._segmentIndex>=i||this._segmentIndex===i-1&&this._segmentFraction>=1}isValid(t){if(this._componentIndex<0||this._componentIndex>=t.getNumGeometries())return!1;const e=t.getGeometryN(this._componentIndex);return!(this._segmentIndex<0||this._segmentIndex>e.getNumPoints()||this._segmentIndex===e.getNumPoints()&&0!==this._segmentFraction||this._segmentFraction<0||this._segmentFraction>1)}normalize(){this._segmentFraction<0&&(this._segmentFraction=0),this._segmentFraction>1&&(this._segmentFraction=1),this._componentIndex<0&&(this._componentIndex=0,this._segmentIndex=0,this._segmentFraction=0),this._segmentIndex<0&&(this._segmentIndex=0,this._segmentFraction=0),1===this._segmentFraction&&(this._segmentFraction=0,this._segmentIndex+=1)}toLowest(t){const e=t.getGeometryN(this._componentIndex),i=rr.numSegments(e);return this._segmentIndex<i?this:new rr(this._componentIndex,i-1,1,!1)}getCoordinate(t){const e=t.getGeometryN(this._componentIndex),i=e.getCoordinateN(this._segmentIndex);if(this._segmentIndex>=rr.numSegments(e))return i;const s=e.getCoordinateN(this._segmentIndex+1);return rr.pointAlongSegmentByFraction(i,s,this._segmentFraction)}getSegmentFraction(){return this._segmentFraction}getSegment(t){const e=t.getGeometryN(this._componentIndex),i=e.getCoordinateN(this._segmentIndex);if(this._segmentIndex>=rr.numSegments(e)){const t=e.getCoordinateN(e.getNumPoints()-2);return new Yt(t,i)}const s=e.getCoordinateN(this._segmentIndex+1);return new Yt(i,s)}clamp(t){if(this._componentIndex>=t.getNumGeometries())return this.setToEnd(t),null;if(this._segmentIndex>=t.getNumPoints()){const e=t.getGeometryN(this._componentIndex);this._segmentIndex=rr.numSegments(e),this._segmentFraction=1}}setToEnd(t){this._componentIndex=t.getNumGeometries()-1;const e=t.getGeometryN(this._componentIndex);this._segmentIndex=rr.numSegments(e),this._segmentFraction=0}compareTo(t){const e=t;return this._componentIndex<e._componentIndex?-1:this._componentIndex>e._componentIndex?1:this._segmentIndex<e._segmentIndex?-1:this._segmentIndex>e._segmentIndex?1:this._segmentFraction<e._segmentFraction?-1:this._segmentFraction>e._segmentFraction?1:0}copy(){return new rr(this._componentIndex,this._segmentIndex,this._segmentFraction)}toString(){return"LinearLoc["+this._componentIndex+", "+this._segmentIndex+", "+this._segmentFraction+"]"}isOnSameSegment(t){return this._componentIndex===t._componentIndex&&(this._segmentIndex===t._segmentIndex||t._segmentIndex-this._segmentIndex==1&&0===t._segmentFraction||this._segmentIndex-t._segmentIndex==1&&0===this._segmentFraction)}snapToVertex(t,e){if(this._segmentFraction<=0||this._segmentFraction>=1)return null;const i=this.getSegmentLength(t),s=this._segmentFraction*i,a=i-s;s<=a&&s<e?this._segmentFraction=0:a<=s&&a<e&&(this._segmentFraction=1)}compareLocationValues(t,e,i){return this._componentIndex<t?-1:this._componentIndex>t?1:this._segmentIndex<e?-1:this._segmentIndex>e?1:this._segmentFraction<i?-1:this._segmentFraction>i?1:0}getSegmentLength(t){const e=t.getGeometryN(this._componentIndex);let i=this._segmentIndex;this._segmentIndex>=rr.numSegments(e)&&(i=e.getNumPoints()-2);const s=e.getCoordinateN(i),a=e.getCoordinateN(i+1);return s.distance(a)}isVertex(){return this._segmentFraction<=0||this._segmentFraction>=1}get interfaces_(){return[o]}}class lr{constructor(){lr.constructor_.apply(this,arguments)}static constructor_(){this._linearGeom=null;const t=arguments[0];this._linearGeom=t}static indexOf(t,e){return new lr(t).indexOf(e)}static indexOfAfter(t,e,i){return new lr(t).indexOfAfter(e,i)}indexOf(t){return this.indexOfFromStart(t,null)}indexOfFromStart(t,e){let i=n.MAX_VALUE,s=0,a=0,o=-1;const r=new Yt;for(let n=new nr(this._linearGeom);n.hasNext();n.next())if(!n.isEndOfLine()){r.p0=n.getSegmentStart(),r.p1=n.getSegmentEnd();const l=r.distance(t),h=r.segmentFraction(t),c=n.getComponentIndex(),p=n.getVertexIndex();l<i&&(null===e||e.compareLocationValues(c,p,h)<0)&&(s=c,a=p,o=h,i=l)}return i===n.MAX_VALUE?new rr(e):new rr(s,a,o)}indexOfAfter(t,e){if(null===e)return this.indexOf(t);const i=rr.getEndLocation(this._linearGeom);if(i.compareTo(e)<=0)return i;const s=this.indexOfFromStart(t,e);return u.isTrue(s.compareTo(e)>=0,"computed location is before specified minimum location"),s}}class hr{constructor(){hr.constructor_.apply(this,arguments)}static constructor_(){this._linearGeom=null;const t=arguments[0];this._linearGeom=t}static indicesOf(t,e){return new hr(t).indicesOf(e)}indicesOf(t){const e=t.getGeometryN(0).getCoordinateN(0),i=t.getGeometryN(t.getNumGeometries()-1),s=i.getCoordinateN(i.getNumPoints()-1),a=new lr(this._linearGeom),n=new Array(2).fill(null);return n[0]=a.indexOf(e),0===t.getLength()?n[1]=n[0].copy():n[1]=a.indexOfAfter(s,n[0]),n}}class cr{constructor(){cr.constructor_.apply(this,arguments)}static constructor_(){this._linearGeom=null;const t=arguments[0];this._linearGeom=t}static getLength(t,e){return new cr(t).getLength(e)}static getLocation(){if(2===arguments.length){const t=arguments[1];return new cr(arguments[0]).getLocation(t)}if(3===arguments.length){const t=arguments[1],e=arguments[2];return new cr(arguments[0]).getLocation(t,e)}}getLength(t){let e=0;const i=new nr(this._linearGeom);for(;i.hasNext();){if(!i.isEndOfLine()){const s=i.getSegmentStart(),a=i.getSegmentEnd().distance(s);if(t.getComponentIndex()===i.getComponentIndex()&&t.getSegmentIndex()===i.getVertexIndex())return e+a*t.getSegmentFraction();e+=a}i.next()}return e}resolveHigher(t){if(!t.isEndpoint(this._linearGeom))return t;let e=t.getComponentIndex();if(e>=this._linearGeom.getNumGeometries()-1)return t;do{e++}while(e<this._linearGeom.getNumGeometries()-1&&0===this._linearGeom.getGeometryN(e).getLength());return new rr(e,0,0)}getLocation(){if(1===arguments.length){const t=arguments[0];return this.getLocation(t,!0)}if(2===arguments.length){const t=arguments[0],e=arguments[1];let i=t;t<0&&(i=this._linearGeom.getLength()+t);const s=this.getLocationForward(i);return e?s:this.resolveHigher(s)}}getLocationForward(t){if(t<=0)return new rr;let e=0;const i=new nr(this._linearGeom);for(;i.hasNext();){if(i.isEndOfLine()){if(e===t){const t=i.getComponentIndex(),e=i.getVertexIndex();return new rr(t,e,0)}}else{const s=i.getSegmentStart(),a=i.getSegmentEnd().distance(s);if(e+a>t){const s=(t-e)/a,n=i.getComponentIndex(),o=i.getVertexIndex();return new rr(n,o,s)}e+=a}i.next()}return rr.getEndLocation(this._linearGeom)}}class pr{constructor(){pr.constructor_.apply(this,arguments)}static constructor_(){this._geomFact=null,this._lines=new S,this._coordList=null,this._ignoreInvalidLines=!1,this._fixInvalidLines=!1,this._lastPt=null;const t=arguments[0];this._geomFact=t}getGeometry(){return this.endLine(),this._geomFact.buildGeometry(this._lines)}getLastCoordinate(){return this._lastPt}endLine(){if(null===this._coordList)return null;if(this._ignoreInvalidLines&&this._coordList.size()<2)return this._coordList=null,null;const t=this._coordList.toCoordinateArray();let e=t;this._fixInvalidLines&&(e=this.validCoordinateSequence(t)),this._coordList=null;let i=null;try{i=this._geomFact.createLineString(e)}catch(t){if(!(t instanceof s))throw t;if(!this._ignoreInvalidLines)throw t}null!==i&&this._lines.add(i)}setFixInvalidLines(t){this._fixInvalidLines=t}add(){if(1===arguments.length){const t=arguments[0];this.add(t,!0)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];null===this._coordList&&(this._coordList=new E),this._coordList.add(t,e),this._lastPt=t}}setIgnoreInvalidLines(t){this._ignoreInvalidLines=t}validCoordinateSequence(t){return t.length>=2?t:[t[0],t[0]]}}class ur{constructor(){ur.constructor_.apply(this,arguments)}static constructor_(){this._line=null;const t=arguments[0];this._line=t}static extract(t,e,i){return new ur(t).extract(e,i)}computeLinear(t,e){const i=new pr(this._line.getFactory());i.setFixInvalidLines(!0),t.isVertex()||i.add(t.getCoordinate(this._line));for(let s=new nr(this._line,t);s.hasNext()&&!(e.compareLocationValues(s.getComponentIndex(),s.getVertexIndex(),0)<0);s.next()){const t=s.getSegmentStart();i.add(t),s.isEndOfLine()&&i.endLine()}return e.isVertex()||i.add(e.getCoordinate(this._line)),i.getGeometry()}computeLine(t,e){const i=this._line.getCoordinates(),s=new E;let a=t.getSegmentIndex();t.getSegmentFraction()>0&&(a+=1);let n=e.getSegmentIndex();1===e.getSegmentFraction()&&(n+=1),n>=i.length&&(n=i.length-1),t.isVertex()||s.add(t.getCoordinate(this._line));for(let t=a;t<=n;t++)s.add(i[t]);e.isVertex()||s.add(e.getCoordinate(this._line)),s.size()<=0&&s.add(t.getCoordinate(this._line));let o=s.toCoordinateArray();return o.length<=1&&(o=[o[0],o[0]]),this._line.getFactory().createLineString(o)}extract(t,e){return e.compareTo(t)<0?this.reverse(this.computeLinear(e,t)):this.computeLinear(t,e)}reverse(t){return C(t,W)?t.reverse():(u.shouldNeverReachHere("non-linear geometry encountered"),null)}}class dr{constructor(){dr.constructor_.apply(this,arguments)}static constructor_(){this._linearGeom=null;const t=arguments[0];this._linearGeom=t}clampIndex(t){const e=this.positiveIndex(t),i=this.getStartIndex();if(e<i)return i;const s=this.getEndIndex();return e>s?s:e}locationOf(){if(1===arguments.length){const t=arguments[0];return cr.getLocation(this._linearGeom,t)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return cr.getLocation(this._linearGeom,t,e)}}project(t){return or.indexOf(this._linearGeom,t)}positiveIndex(t){return t>=0?t:this._linearGeom.getLength()+t}extractPoint(){if(1===arguments.length){const t=arguments[0];return cr.getLocation(this._linearGeom,t).getCoordinate(this._linearGeom)}if(2===arguments.length){const t=arguments[0],e=arguments[1],i=cr.getLocation(this._linearGeom,t).toLowest(this._linearGeom);return i.getSegment(this._linearGeom).pointAlongOffset(i.getSegmentFraction(),e)}}isValidIndex(t){return t>=this.getStartIndex()&&t<=this.getEndIndex()}getEndIndex(){return this._linearGeom.getLength()}getStartIndex(){return 0}indexOfAfter(t,e){return or.indexOfAfter(this._linearGeom,t,e)}extractLine(t,e){const i=this.clampIndex(t),s=this.clampIndex(e),a=i===s,n=this.locationOf(i,a),o=this.locationOf(s);return ur.extract(this._linearGeom,n,o)}indexOf(t){return or.indexOf(this._linearGeom,t)}indicesOf(t){const e=hr.indicesOf(this._linearGeom,t);return[cr.getLength(this._linearGeom,e[0]),cr.getLength(this._linearGeom,e[1])]}}class mr{constructor(){mr.constructor_.apply(this,arguments)}static constructor_(){this._linearGeom=null;const t=arguments[0];this._linearGeom=t,this.checkGeometryType()}clampIndex(t){const e=t.copy();return e.clamp(this._linearGeom),e}project(t){return lr.indexOf(this._linearGeom,t)}checkGeometryType(){if(!(this._linearGeom instanceof Q||this._linearGeom instanceof bt))throw new s("Input geometry must be linear")}extractPoint(){if(1===arguments.length)return arguments[0].getCoordinate(this._linearGeom);if(2===arguments.length){const t=arguments[1],e=arguments[0].toLowest(this._linearGeom);return e.getSegment(this._linearGeom).pointAlongOffset(e.getSegmentFraction(),t)}}isValidIndex(t){return t.isValid(this._linearGeom)}getEndIndex(){return rr.getEndLocation(this._linearGeom)}getStartIndex(){return new rr}indexOfAfter(t,e){return lr.indexOfAfter(this._linearGeom,t,e)}extractLine(t,e){return ur.extract(this._linearGeom,t,e)}indexOf(t){return lr.indexOf(this._linearGeom,t)}indicesOf(t){return hr.indicesOf(this._linearGeom,t)}}var gr=Object.freeze({__proto__:null,LengthIndexedLine:dr,LengthLocationMap:cr,LinearGeometryBuilder:pr,LinearIterator:nr,LinearLocation:rr,LocationIndexedLine:mr});class yr{static transform(t,e){const i=new S;for(let s=t.iterator();s.hasNext();)i.add(e.execute(s.next()));return i}static select(t,e){const i=new S;for(let s=t.iterator();s.hasNext();){const t=s.next();Boolean.TRUE.equals(e.execute(t))&&i.add(t)}return i}static apply(t,e){for(let i=t.iterator();i.hasNext();)e.execute(i.next())}}yr.Function=function(){};class fr{constructor(){fr.constructor_.apply(this,arguments)}static constructor_(){this.pts=null,this.n=0;const t=arguments[0];this.pts=new Array(t).fill(null)}filter(t){this.pts[this.n++]=t}getCoordinates(){return this.pts}get interfaces_(){return[H]}}class _r{constructor(){_r.constructor_.apply(this,arguments)}static constructor_(){this._n=0}filter(t){this._n++}getCount(){return this._n}get interfaces_(){return[H]}}class vr{constructor(){vr.constructor_.apply(this,arguments)}static constructor_(){this._counts=new Ct}count(t){const e=this._counts.get(t);return null===e?0:e.count()}add(t){const e=this._counts.get(t);null===e?this._counts.put(t,new xr(1)):e.increment()}}class xr{constructor(){xr.constructor_.apply(this,arguments)}static constructor_(){if(this.count=0,0===arguments.length);else if(1===arguments.length){const t=arguments[0];this.count=t}}count(){return this.count}increment(){this.count++}}function Cr(){}function Lr(){}function Mr(){}vr.Counter=xr;class br extends i{}function wr(){}class Sr{static chars(t,e){const i=new Array(e).fill(null);for(let s=0;s<e;s++)i[s]=t;return new String(i)}static getStackTrace(){if(1===arguments.length){const t=arguments[0],e=new Mr,i=new Cr;return t.printStackTrace(i),e.toString()}if(2===arguments.length){const t=arguments[0],e=arguments[1];let i="";const s=new wr(new Lr(Sr.getStackTrace(t)));for(let t=0;t<e;t++)try{i+=s.readLine()+Sr.NEWLINE}catch(t){if(!(t instanceof br))throw t;u.shouldNeverReachHere()}return i}}static spaces(t){return Sr.chars(" ",t)}static split(t,e){const i=e.length,s=new S;let a=""+t,n=a.indexOf(e);for(;n>=0;){const t=a.substring(0,n);s.add(t),a=a.substring(n+i),n=a.indexOf(e)}a.length>0&&s.add(a);const o=new Array(s.size()).fill(null);for(let t=0;t<o.length;t++)o[t]=s.get(t);return o}}Sr.NEWLINE=G.getProperty("line.separator");var Ir=Object.freeze({__proto__:null,CollectionUtil:yr,CoordinateArrayFilter:fr,CoordinateCountFilter:_r,GeometricShapeFactory:Le,NumberUtil:e,ObjectCounter:vr,PriorityQueue:Ms,StringUtil:Sr,UniqueCoordinateArrayFilter:ei});class Er{get interfaces_(){return[]}getClass(){return Er}static union(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cn.createEmptyResult(Cn.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),vn.overlayOp(t,e,Cn.UNION)}}Q.prototype.getBoundary=function(){return ea.getBoundary(this)},bt.prototype.getBoundary=function(){return ea.getBoundary(this)},q.prototype.equalsTopo=function(t){return Yn.equalsTopo(this,t)},q.prototype.equals=function(t){return null!==t&&Yn.equalsTopo(this,t)},q.prototype.union=function(){if(0===arguments.length)return eo.union(this);if(1===arguments.length){const t=arguments[0];return Er.union(this,t)}},q.prototype.isValid=function(){return An.isValid(this)},q.prototype.intersection=function(t){return Cn.intersection(this,t)},q.prototype.covers=function(t){return Yn.covers(this,t)},q.prototype.coveredBy=function(t){return Yn.covers(t,this)},q.prototype.touches=function(t){return Yn.touches(this,t)},q.prototype.intersects=function(t){return Yn.intersects(this,t)},q.prototype.within=function(t){return Yn.contains(t,this)},q.prototype.overlaps=function(t){return Yn.overlaps(this,t)},q.prototype.disjoint=function(t){return Yn.disjoint(this,t)},q.prototype.crosses=function(t){return Yn.crosses(this,t)},q.prototype.buffer=function(){if(1===arguments.length){const t=arguments[0];return Aa.bufferOp(this,t)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return Aa.bufferOp(this,t,e)}if(3===arguments.length){const t=arguments[0],e=arguments[1],i=arguments[2];return Aa.bufferOp(this,t,e,i)}},q.prototype.convexHull=function(){return new ii(this).getConvexHull()},q.prototype.relate=function(){if(1===arguments.length){const t=arguments[0];return Yn.relate(this,t)}if(2===arguments.length){const t=arguments[0],e=arguments[1];return Yn.relate(this,t).matches(e)}},q.prototype.getCentroid=function(){if(this.isEmpty())return this._factory.createPoint();const t=Qe.getCentroid(this);return this.createPointFromInternalCoord(t,this)},q.prototype.getInteriorPoint=function(){if(this.isEmpty())return this._factory.createPoint();let t=null;const e=this.getDimension();t=0===e?new hi(this):1===e?new li(this):new ai(this);const i=t.getInteriorPoint();return this.createPointFromInternalCoord(i,this)},q.prototype.symDifference=function(t){return Cn.symDifference(this,t)},q.prototype.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},q.prototype.toText=function(){return(new $t).write(this)},q.prototype.toString=function(){this.toText()},q.prototype.contains=function(t){return Yn.contains(this,t)},q.prototype.difference=function(t){return Cn.difference(this,t)},q.prototype.isSimple=function(){return new sa(this).isSimple()},q.prototype.isWithinDistance=function(t,e){return!(this.getEnvelopeInternal().distance(t.getEnvelopeInternal())>e)&&Ga.isWithinDistance(this,t,e)},q.prototype.distance=function(t){return Ga.distance(this,t)},t.algorithm=_i,t.densify=Ci,t.dissolve=Ti,t.geom=Se,t.geomgraph=os,t.index=Os,t.io=Bs,t.linearref=gr,t.noding=ta,t.operation=ao,t.precision=yo,t.simplify=ko,t.triangulate=ar,t.util=Ir,t.version="2.9.0 (0ca6ac5)",Object.defineProperty(t,"__esModule",{value:!0})}(e)})),gs=j(ms),ys=Object.freeze({__proto__:null,default:gs,__moduleExports:ms});function fs(t){if(!t)return null;return D.parse(t)}function _s(t){if(!t)return null;return D.stringify(t)}function vs(t){if(!t)return null;var e,i=Ls(t);return i&&(e=function(t){var e;if(T.centroid(t).geometry.coordinates[0]>180){const i=new(void 0)(new(void 0)).read(t);e=i.getLength()}else{var i=t.coordinates,s=t.type;new RegExp("multi","i").test(s)?(e=0,i.map((t=>{e+=I.default.Utils.distance(t)}))):e=I.default.Utils.distance(i)}return e}(i)),e}function xs(t){if(!t)return null;var e,i=Ls(t);return i&&(e=function(t){var e;if(T.centroid(t).geometry.coordinates[0]>180){const i=new(void 0)(new(void 0)).read(t);e=i.getArea()}else{var i=t.coordinates,s=t.type;new RegExp("multi","i").test(s)?(e=0,i.map((t=>{e+=I.default.Utils.area(t)}))):e=I.default.Utils.area(i)}return e}(i)),e}function Cs(t){if(!t)return null;var e,i=Ls(t);return i&&(e=T.centroid(i).geometry.coordinates),e}function Ls(t){var e=typeof t;try{return"string"==e?D.parse(t):t.geometry?t.geometry:t}catch(t){return null}}var Ms=Object.freeze({__proto__:null,jsts:ys,st_wkt2geojson:fs,st_geojson2wkt:_s,st_length:vs,st_area:xs,st_centroid:Cs});var bs=new class{constructor(t={}){this.a=6378137,this.b=6356752.3141,this.f=1/298.257222101,this.e=.0818191910428,this.e2=.006693421622966,this.e12=.006738525414683,this.c=6399593.62586,this.p=206264.806252992,this.pi=3.1415926535,this.IsBigNumber=!0,this.Strip=t.Strip||3,this.L0=t.L0||120}GetBLFromXY(t,e){let i=e,s=i-5e5;1==this.IsBigNumber&&(s-=this.L0/this.Strip*1e6),i=s;const a=3600*this.L0,{e2:n}=this,o=this.pow(n,2),r=this.pow(n,3),l=this.pow(n,4),h=this.pow(n,5),c=this.pow(n,6),p=1+3*n/4+45*o/64+175*r/256+11025*l/16384+43659*h/65536+693693*c/1048576,u=3*n/8+15*o/32+525*r/1024+2205*l/4096+72765*h/131072+297297*c/524288,d=15*o/256+105*r/1024+2205*l/16384+10395*h/65536+1486485*c/8388608,m=35*r/3072+105*l/4096+10395*h/262144+55055*c/1048576,g=315*l/131072+3465*h/524288+99099*c/8388608,y=693*h/1310720+9009*c/5242880,f=1001*c/8388608;let _=t/(this.a*(1-n)*p),v=0,x=0,C=0;const L=this.a*(1-n);let M=Math.abs(v-_);for(;M>48e-12;)v=_,x=L*(p*v-u*this.sin(2*v)+d*this.sin(4*v)-m*this.sin(6*v)+g*this.sin(8*v)-y*this.sin(10*v)+f*this.sin(12*v)),C=L*(p-2*u*this.cos(2*v)+4*d*this.cos(4*v)-6*m*this.cos(6*v)+8*g*this.cos(8*v)-10*y*this.cos(10*v)+12*f*this.cos(12*v)),_=v+(t-x)/C,M=Math.abs(v-_);const b=this.sin(v),w=b*b,S=this.sqrt(1-n*w),I=S*S*S,E=this.a/S,T=this.tan(v),D=T*T,P=D*D,O=this.cos(v),k=O*O,N=this.e12*k,A=L/I,R=i/E,F=R*R,B=F*F,G=v*this.p-this.p*T/(2*A)*i*R*(1-(5+3*D+N-9*N*D)*F+(61+90*D+45*P)*B/360);let z=this.p/O*R*(1-(1+2*D+N)*F/6+(5+28*D+24*P+6*N+8*N*D)*B/120)+a;return z/=3600,[z,G/3600]}GetXYFromBL(t,e){const{e2:i}=this,s=this.pow(i,2),a=this.pow(i,3),n=this.pow(i,4),o=this.pow(i,5),r=this.pow(i,6),l=1+3*i/4+45*s/64+175*a/256+11025*n/16384+43659*o/65536+693693*r/1048576,h=3*i/8+15*s/32+525*a/1024+2205*n/4096+72765*o/131072+297297*r/524288,c=15*s/256+105*a/1024+2205*n/16384+10395*o/65536+1486485*r/8388608,p=35*a/3072+105*n/4096+10395*o/262144+55055*r/1048576,u=315*n/131072+3465*o/524288+99099*r/8388608,d=693*o/1310720+9009*r/5242880,m=1001*r/8388608,g=3600*this.L0,y=3600*e,f=t*this.pi/180,_=(y-g)/this.p,v=this.pow(_,2),x=this.pow(_,4),C=this.sin(f),L=C*C,M=this.sqrt(1-i*L),b=this.a/M,w=this.tan(f),S=w*w,I=S*S,E=this.cos(f),T=E*E,D=T*T,P=this.e12*T,O=P*P,k=_,N=v,A=x,R=this.a*(1-this.e2)*(l*f-h*this.sin(2*f)+c*this.sin(4*f)-p*this.sin(6*f)+u*this.sin(8*f)-d*this.sin(10*f)+m*this.sin(12*f))+b*w*T*N*(.5+(5-S+9*P+4*O)*T*N/24+(61-58*S+I)*D*A/720);let F=b*E*k*(1+(1-S+P)*T*N/6+(5-18*S+I+14*P-58*P*S)*D*A/120);return 1==this.IsBigNumber&&(F+=this.L0/this.Strip*1e6),F+=5e5,[F,R]}sqrt(t){return this.toDec(Math.sqrt(this.toNum(t)))}tan(t){return this.toDec(Math.tan(this.toNum(t)))}sin(t){return this.toDec(Math.sin(this.toNum(t)))}cos(t){return this.toDec(Math.cos(this.toNum(t)))}pow(t,e){return this.toDec(Math.pow(this.toNum(t),this.toNum(e)))}toDec(t){return parseFloat(t)}toNum(t){return parseFloat(t)}};const{PI:ws}=Math,Ss=6378245,Is=.006693421622965943,Es=3e3*ws/180;function Ts(t,e){const i=[e,t];if(Ps(e,t))return i[0]=e,i[1]=t,i;const s=Os(e,t);return i[0]=e-s[0],i[1]=t-s[1],i.reverse()}function Ds(t,e){const i=[t,e],s=t-.0065,a=e-.006,n=Math.sqrt(s*s+a*a)-2e-5*Math.sin(a*Es),o=Math.atan2(a,s)-3e-6*Math.cos(s*Es);return i[0]=n*Math.cos(o),i[1]=n*Math.sin(o),i}function Ps(t,e){return e<72.004||e>137.8347||(t<.8293||t>55.8271)}function Os(t,e){const i=[t,e];let s=function(t,e){let i=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*ws)+20*Math.sin(2*t*ws))/3,i+=2*(20*Math.sin(e*ws)+40*Math.sin(e/3*ws))/3,i+=2*(160*Math.sin(e/12*ws)+320*Math.sin(e*ws/30))/3,i}(e-105,t-35),a=function(t,e){let i=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*ws)+20*Math.sin(2*t*ws))/3,i+=2*(20*Math.sin(t*ws)+40*Math.sin(t/3*ws))/3,i+=2*(150*Math.sin(t/12*ws)+300*Math.sin(t/30*ws))/3,i}(e-105,t-35);const n=t/180*Math.PI;let o=Math.sin(n);o=1-Is*o*o;const r=Math.sqrt(o);return s=180*s/(Ss*(1-Is)/(o*r)*ws),a=180*a/(Ss/r*Math.cos(n)*ws),i[0]=s,i[1]=a,i}var ks=Object.freeze({__proto__:null,CGS84ToGCJ_02:function(t,e){return function(t,e){const i=[];if(Ps(t,e))return i[0]=t,i[1]=e,i;const s=Os(t,e);return i[0]=t+s[0],i[1]=e+s[1],i}(e,t).reverse()},GCJ_02ToCGS84:function(t,e){const i=[];if(Ps(e,t))return i[0]=t,i[1]=e,i;const s=Os(e,t);return i[0]=t-s[1],i[1]=e-s[0],i},GCJ02ToWGS84:Ts,BD09ToWGS84:function(t,e){const i=Ds(e,t);return Ts(i[0],i[1])},BD09ToGCJ02:Ds,CGS84ToWGS84:function(t,e,i=120,s=3){return bs.L0=i,bs.Strip=s,bs.GetXYFromBL(e,t)},WGS84ToCGS84:function(t,e,i=120,s=3){return bs.L0=i,bs.Strip=s,bs.GetBLFromXY(e,t)}});var Ns,As=new class{read_shapefiles_zip(t){return new Promise((e=>{this.file=t;const{name:i}=this.file;if(void 0===i)return;if("zip"!==i.split(".")[1])alert("请上传压缩后的ZIP类型文件.....");else{const t=new FileReader,i=this.file.raw;t.readAsArrayBuffer(i),t.onload=async function(){const t=await(async t=>{const e=new M.default;await e.loadAsync(t);const i=e.file(/.+/),s={};return await Promise.all(i.map((async t=>{let e;e="shp"===t.name.slice(-3).toLowerCase()||"dbf"===t.name.slice(-3).toLowerCase()?await t.async("nodebuffer"):await t.async("text"),s[t.name]=e}))),s})(this.result),i=Object.keys(t)[0].split(".")[0];t[`${i}.dbf`]&&t[`${i}.shp`]?P.read(t[`${i}.shp`],t[`${i}.dbf`],{encoding:"gbk"}).then((s=>{-1===JSON.stringify(s).indexOf("�")?e(s):P.read(t[`${i}.shp`],t[`${i}.dbf`],{encoding:"utf-8"}).then((t=>{e(t)}))})):P.read(t[`${i}.shp`]).then((t=>{e(t)}))}}}))}read_shapefiles(t){return new Promise((e=>{this.file=t;const{name:i}=this.file;if("shp"!==i.split(".")[1])alert("请上传shp类型文件.....");else{const t=new FileReader,i=this.file.raw;t.readAsArrayBuffer(i),t.onload=async function(){P.read(this.result).then((t=>{e(t)}))}}}))}},Rs=Error,Fs=EvalError,Bs=RangeError,Gs=ReferenceError,zs=SyntaxError,js=TypeError,Us=URIError,Vs="undefined"!=typeof Symbol&&Symbol,qs={__proto__:null,foo:{}},Hs=Object,$s=Object.prototype.toString,Ws=Math.max,Ks=function(t,e){for(var i=[],s=0;s<t.length;s+=1)i[s]=t[s];for(var a=0;a<e.length;a+=1)i[a+t.length]=e[a];return i},Ys=Function.prototype.bind||function(t){var e=this;if("function"!=typeof e||"[object Function]"!==$s.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var i,s=function(t,e){for(var i=[],s=e||0,a=0;s<t.length;s+=1,a+=1)i[a]=t[s];return i}(arguments,1),a=Ws(0,e.length-s.length),n=[],o=0;o<a;o++)n[o]="$"+o;if(i=Function("binder","return function ("+function(t,e){for(var i="",s=0;s<t.length;s+=1)i+=t[s],s+1<t.length&&(i+=e);return i}(n,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var a=e.apply(this,Ks(s,arguments));return Object(a)===a?a:this}return e.apply(t,Ks(s,arguments))})),e.prototype){var r=function(){};r.prototype=e.prototype,i.prototype=new r,r.prototype=null}return i},Js=Function.prototype.call,Xs=Object.prototype.hasOwnProperty,Qs=Ys.call(Js,Xs),Zs=Rs,ta=Fs,ea=Bs,ia=Gs,sa=zs,aa=js,na=Us,oa=function(){return{__proto__:qs}.foo===qs.foo&&!(qs instanceof Hs)},ra=Qs,la=Function,ha=function(t){try{return la('"use strict"; return ('+t+").constructor;")()}catch(t){}},ca=Object.getOwnPropertyDescriptor;if(ca)try{ca({},"")}catch(t){ca=null}var pa=function(){throw new aa},ua=ca?function(){try{return pa}catch(t){try{return ca(arguments,"callee").get}catch(t){return pa}}}():pa,da="function"==typeof Vs&&"function"==typeof Symbol&&"symbol"==typeof Vs("foo")&&"symbol"==typeof Symbol("bar")&&function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var s=Object.getOwnPropertySymbols(t);if(1!==s.length||s[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(t,e);if(42!==a.value||!0!==a.enumerable)return!1}return!0}(),ma=oa(),ga=Object.getPrototypeOf||(ma?function(t){return t.__proto__}:null),ya={},fa="undefined"!=typeof Uint8Array&&ga?ga(Uint8Array):Ns,_a={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?Ns:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Ns:ArrayBuffer,"%ArrayIteratorPrototype%":da&&ga?ga([][Symbol.iterator]()):Ns,"%AsyncFromSyncIteratorPrototype%":Ns,"%AsyncFunction%":ya,"%AsyncGenerator%":ya,"%AsyncGeneratorFunction%":ya,"%AsyncIteratorPrototype%":ya,"%Atomics%":"undefined"==typeof Atomics?Ns:Atomics,"%BigInt%":"undefined"==typeof BigInt?Ns:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Ns:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Ns:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Ns:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Zs,"%eval%":eval,"%EvalError%":ta,"%Float32Array%":"undefined"==typeof Float32Array?Ns:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Ns:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Ns:FinalizationRegistry,"%Function%":la,"%GeneratorFunction%":ya,"%Int8Array%":"undefined"==typeof Int8Array?Ns:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Ns:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Ns:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":da&&ga?ga(ga([][Symbol.iterator]())):Ns,"%JSON%":"object"==typeof JSON?JSON:Ns,"%Map%":"undefined"==typeof Map?Ns:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&da&&ga?ga((new Map)[Symbol.iterator]()):Ns,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Ns:Promise,"%Proxy%":"undefined"==typeof Proxy?Ns:Proxy,"%RangeError%":ea,"%ReferenceError%":ia,"%Reflect%":"undefined"==typeof Reflect?Ns:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Ns:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&da&&ga?ga((new Set)[Symbol.iterator]()):Ns,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Ns:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":da&&ga?ga(""[Symbol.iterator]()):Ns,"%Symbol%":da?Symbol:Ns,"%SyntaxError%":sa,"%ThrowTypeError%":ua,"%TypedArray%":fa,"%TypeError%":aa,"%Uint8Array%":"undefined"==typeof Uint8Array?Ns:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Ns:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Ns:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Ns:Uint32Array,"%URIError%":na,"%WeakMap%":"undefined"==typeof WeakMap?Ns:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Ns:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Ns:WeakSet};if(ga)try{null.error}catch(t){var va=ga(ga(t));_a["%Error.prototype%"]=va}var xa=function t(e){var i;if("%AsyncFunction%"===e)i=ha("async function () {}");else if("%GeneratorFunction%"===e)i=ha("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=ha("async function* () {}");else if("%AsyncGenerator%"===e){var s=t("%AsyncGeneratorFunction%");s&&(i=s.prototype)}else if("%AsyncIteratorPrototype%"===e){var a=t("%AsyncGenerator%");a&&ga&&(i=ga(a.prototype))}return _a[e]=i,i},Ca={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},La=Ys.call(Function.call,Array.prototype.concat),Ma=Ys.call(Function.apply,Array.prototype.splice),ba=Ys.call(Function.call,String.prototype.replace),wa=Ys.call(Function.call,String.prototype.slice),Sa=Ys.call(Function.call,RegExp.prototype.exec),Ia=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ea=/\\(\\)?/g,Ta=function(t,e){var i,s=t;if(ra(Ca,s)&&(s="%"+(i=Ca[s])[0]+"%"),ra(_a,s)){var a=_a[s];if(a===ya&&(a=xa(s)),void 0===a&&!e)throw new aa("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:s,value:a}}throw new sa("intrinsic "+t+" does not exist!")},Da=function(t,e){if("string"!=typeof t||0===t.length)throw new aa("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new aa('"allowMissing" argument must be a boolean');if(null===Sa(/^%?[^%]*%?$/,t))throw new sa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=wa(t,0,1),i=wa(t,-1);if("%"===e&&"%"!==i)throw new sa("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new sa("invalid intrinsic syntax, expected opening `%`");var s=[];return ba(t,Ia,(function(t,e,i,a){s[s.length]=i?ba(a,Ea,"$1"):e||t})),s}(t),s=i.length>0?i[0]:"",a=Ta("%"+s+"%",e),n=a.name,o=a.value,r=!1,l=a.alias;l&&(s=l[0],Ma(i,La([0,1],l)));for(var h=1,c=!0;h<i.length;h+=1){var p=i[h],u=wa(p,0,1),d=wa(p,-1);if(('"'===u||"'"===u||"`"===u||'"'===d||"'"===d||"`"===d)&&u!==d)throw new sa("property names with quotes must have matching quotes");if("constructor"!==p&&c||(r=!0),ra(_a,n="%"+(s+="."+p)+"%"))o=_a[n];else if(null!=o){if(!(p in o)){if(!e)throw new aa("base intrinsic for "+t+" exists, but the property is not available.");return}if(ca&&h+1>=i.length){var m=ca(o,p);o=(c=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:o[p]}else c=ra(o,p),o=o[p];c&&!r&&(_a[n]=o)}}return o},Pa=Da("%Object.defineProperty%",!0)||!1;if(Pa)try{Pa({},"a",{value:1})}catch(t){Pa=!1}var Oa=Pa,ka=Da("%Object.getOwnPropertyDescriptor%",!0);if(ka)try{ka([],"length")}catch(t){ka=null}var Na=Oa,Aa=ka,Ra=function(){return!!Na};Ra.hasArrayLengthDefineBug=function(){if(!Na)return null;try{return 1!==Na([],"length",{value:1}).length}catch(t){return!0}};var Fa=function(t,e,i){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new aa("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new aa("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new aa("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new aa("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new aa("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new aa("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,o=arguments.length>6&&arguments[6],r=!!Aa&&Aa(t,e);if(Na)Na(t,e,{configurable:null===n&&r?r.configurable:!n,enumerable:null===s&&r?r.enumerable:!s,value:i,writable:null===a&&r?r.writable:!a});else{if(!o&&(s||a||n))throw new sa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=i}},Ba=Ra(),Ga=Da("%Math.floor%"),za=function(t,e){if("function"!=typeof t)throw new aa("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||Ga(e)!==e)throw new aa("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,a=!0;if("length"in t&&Aa){var n=Aa(t,"length");n&&!n.configurable&&(s=!1),n&&!n.writable&&(a=!1)}return(s||a||!i)&&(Ba?Fa(t,"length",e,!0,!0):Fa(t,"length",e)),t},ja=U((function(t){var e=Da("%Function.prototype.apply%"),i=Da("%Function.prototype.call%"),s=Da("%Reflect.apply%",!0)||Ys.call(i,e),a=Da("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new aa("a function is required");var e=s(Ys,i,arguments);return za(e,1+a(0,t.length-(arguments.length-1)),!0)};var n=function(){return s(Ys,e,arguments)};Na?Na(t.exports,"apply",{value:n}):t.exports.apply=n}));ja.apply;var Ua=ja(Da("String.prototype.indexOf")),Va=function(t,e){var i=Da(t,!!e);return"function"==typeof i&&Ua(t,".prototype.")>-1?ja(i):i},qa=b.default.inspect,Ha="function"==typeof Map&&Map.prototype,$a=Object.getOwnPropertyDescriptor&&Ha?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Wa=Ha&&$a&&"function"==typeof $a.get?$a.get:null,Ka=Ha&&Map.prototype.forEach,Ya="function"==typeof Set&&Set.prototype,Ja=Object.getOwnPropertyDescriptor&&Ya?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Xa=Ya&&Ja&&"function"==typeof Ja.get?Ja.get:null,Qa=Ya&&Set.prototype.forEach,Za="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,tn="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,en="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,sn=Boolean.prototype.valueOf,an=Object.prototype.toString,nn=Function.prototype.toString,on=String.prototype.match,rn=String.prototype.slice,ln=String.prototype.replace,hn=String.prototype.toUpperCase,cn=String.prototype.toLowerCase,pn=RegExp.prototype.test,un=Array.prototype.concat,dn=Array.prototype.join,mn=Array.prototype.slice,gn=Math.floor,yn="function"==typeof BigInt?BigInt.prototype.valueOf:null,fn=Object.getOwnPropertySymbols,_n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,vn="function"==typeof Symbol&&"object"==typeof Symbol.iterator,xn="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===vn||"symbol")?Symbol.toStringTag:null,Cn=Object.prototype.propertyIsEnumerable,Ln=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Mn(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||pn.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var s=t<0?-gn(-t):gn(t);if(s!==t){var a=String(s),n=rn.call(e,a.length+1);return ln.call(a,i,"$&_")+"."+ln.call(ln.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ln.call(e,i,"$&_")}var bn=qa.custom,wn=Dn(bn)?bn:null;function Sn(t,e,i){var s="double"===(i.quoteStyle||e)?'"':"'";return s+t+s}function In(t){return ln.call(String(t),/"/g,"&quot;")}function En(t){return!("[object Array]"!==kn(t)||xn&&"object"==typeof t&&xn in t)}function Tn(t){return!("[object RegExp]"!==kn(t)||xn&&"object"==typeof t&&xn in t)}function Dn(t){if(vn)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!_n)return!1;try{return _n.call(t),!0}catch(t){}return!1}var Pn=Object.prototype.hasOwnProperty||function(t){return t in this};function On(t,e){return Pn.call(t,e)}function kn(t){return an.call(t)}function Nn(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,s=t.length;i<s;i++)if(t[i]===e)return i;return-1}function An(t,e){if(t.length>e.maxStringLength){var i=t.length-e.maxStringLength,s="... "+i+" more character"+(i>1?"s":"");return An(rn.call(t,0,e.maxStringLength),e)+s}return Sn(ln.call(ln.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Rn),"single",e)}function Rn(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+hn.call(e.toString(16))}function Fn(t){return"Object("+t+")"}function Bn(t){return t+" { ? }"}function Gn(t,e,i,s){return t+" ("+e+") {"+(s?zn(i,s):dn.call(i,", "))+"}"}function zn(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+dn.call(t,","+i)+"\n"+e.prev}function jn(t,e){var i=En(t),s=[];if(i){s.length=t.length;for(var a=0;a<t.length;a++)s[a]=On(t,a)?e(t[a],t):""}var n,o="function"==typeof fn?fn(t):[];if(vn){n={};for(var r=0;r<o.length;r++)n["$"+o[r]]=o[r]}for(var l in t)On(t,l)&&(i&&String(Number(l))===l&&l<t.length||vn&&n["$"+l]instanceof Symbol||(pn.call(/[^\w$]/,l)?s.push(e(l,t)+": "+e(t[l],t)):s.push(l+": "+e(t[l],t))));if("function"==typeof fn)for(var h=0;h<o.length;h++)Cn.call(t,o[h])&&s.push("["+e(o[h])+"]: "+e(t[o[h]],t));return s}var Un=function t(e,i,s,a){var n=i||{};if(On(n,"quoteStyle")&&"single"!==n.quoteStyle&&"double"!==n.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(On(n,"maxStringLength")&&("number"==typeof n.maxStringLength?n.maxStringLength<0&&n.maxStringLength!==1/0:null!==n.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=!On(n,"customInspect")||n.customInspect;if("boolean"!=typeof o&&"symbol"!==o)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(On(n,"indent")&&null!==n.indent&&"\t"!==n.indent&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(On(n,"numericSeparator")&&"boolean"!=typeof n.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var r=n.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return An(e,n);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var l=String(e);return r?Mn(e,l):l}if("bigint"==typeof e){var h=String(e)+"n";return r?Mn(e,h):h}var c=void 0===n.depth?5:n.depth;if(void 0===s&&(s=0),s>=c&&c>0&&"object"==typeof e)return En(e)?"[Array]":"[Object]";var p=function(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=dn.call(Array(t.indent+1)," ")}return{base:i,prev:dn.call(Array(e+1),i)}}(n,s);if(void 0===a)a=[];else if(Nn(a,e)>=0)return"[Circular]";function u(e,i,o){if(i&&(a=mn.call(a)).push(i),o){var r={depth:n.depth};return On(n,"quoteStyle")&&(r.quoteStyle=n.quoteStyle),t(e,r,s+1,a)}return t(e,n,s+1,a)}if("function"==typeof e&&!Tn(e)){var d=function(t){if(t.name)return t.name;var e=on.call(nn.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),m=jn(e,u);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(m.length>0?" { "+dn.call(m,", ")+" }":"")}if(Dn(e)){var g=vn?ln.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):_n.call(e);return"object"!=typeof e||vn?g:Fn(g)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var y="<"+cn.call(String(e.nodeName)),f=e.attributes||[],_=0;_<f.length;_++)y+=" "+f[_].name+"="+Sn(In(f[_].value),"double",n);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+cn.call(String(e.nodeName))+">"}if(En(e)){if(0===e.length)return"[]";var v=jn(e,u);return p&&!function(t){for(var e=0;e<t.length;e++)if(Nn(t[e],"\n")>=0)return!1;return!0}(v)?"["+zn(v,p)+"]":"[ "+dn.call(v,", ")+" ]"}if(function(t){return!("[object Error]"!==kn(t)||xn&&"object"==typeof t&&xn in t)}(e)){var x=jn(e,u);return"cause"in Error.prototype||!("cause"in e)||Cn.call(e,"cause")?0===x.length?"["+String(e)+"]":"{ ["+String(e)+"] "+dn.call(x,", ")+" }":"{ ["+String(e)+"] "+dn.call(un.call("[cause]: "+u(e.cause),x),", ")+" }"}if("object"==typeof e&&o){if(wn&&"function"==typeof e[wn]&&qa)return qa(e,{depth:c-s});if("symbol"!==o&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!Wa||!t||"object"!=typeof t)return!1;try{Wa.call(t);try{Xa.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var C=[];return Ka&&Ka.call(e,(function(t,i){C.push(u(i,e,!0)+" => "+u(t,e))})),Gn("Map",Wa.call(e),C,p)}if(function(t){if(!Xa||!t||"object"!=typeof t)return!1;try{Xa.call(t);try{Wa.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var L=[];return Qa&&Qa.call(e,(function(t){L.push(u(t,e))})),Gn("Set",Xa.call(e),L,p)}if(function(t){if(!Za||!t||"object"!=typeof t)return!1;try{Za.call(t,Za);try{tn.call(t,tn)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Bn("WeakMap");if(function(t){if(!tn||!t||"object"!=typeof t)return!1;try{tn.call(t,tn);try{Za.call(t,Za)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Bn("WeakSet");if(function(t){if(!en||!t||"object"!=typeof t)return!1;try{return en.call(t),!0}catch(t){}return!1}(e))return Bn("WeakRef");if(function(t){return!("[object Number]"!==kn(t)||xn&&"object"==typeof t&&xn in t)}(e))return Fn(u(Number(e)));if(function(t){if(!t||"object"!=typeof t||!yn)return!1;try{return yn.call(t),!0}catch(t){}return!1}(e))return Fn(u(yn.call(e)));if(function(t){return!("[object Boolean]"!==kn(t)||xn&&"object"==typeof t&&xn in t)}(e))return Fn(sn.call(e));if(function(t){return!("[object String]"!==kn(t)||xn&&"object"==typeof t&&xn in t)}(e))return Fn(u(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===z)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==kn(t)||xn&&"object"==typeof t&&xn in t)}(e)&&!Tn(e)){var M=jn(e,u),b=Ln?Ln(e)===Object.prototype:e instanceof Object||e.constructor===Object,w=e instanceof Object?"":"null prototype",S=!b&&xn&&Object(e)===e&&xn in e?rn.call(kn(e),8,-1):w?"Object":"",I=(b||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(S||w?"["+dn.call(un.call([],S||[],w||[]),": ")+"] ":"");return 0===M.length?I+"{}":p?I+"{"+zn(M,p)+"}":I+"{ "+dn.call(M,", ")+" }"}return String(e)},Vn=Da("%WeakMap%",!0),qn=Da("%Map%",!0),Hn=Va("WeakMap.prototype.get",!0),$n=Va("WeakMap.prototype.set",!0),Wn=Va("WeakMap.prototype.has",!0),Kn=Va("Map.prototype.get",!0),Yn=Va("Map.prototype.set",!0),Jn=Va("Map.prototype.has",!0),Xn=function(t,e){for(var i,s=t;null!==(i=s.next);s=i)if(i.key===e)return s.next=i.next,i.next=t.next,t.next=i,i},Qn=function(){var t,e,i,s={assert:function(t){if(!s.has(t))throw new aa("Side channel does not contain "+Un(t))},get:function(s){if(Vn&&s&&("object"==typeof s||"function"==typeof s)){if(t)return Hn(t,s)}else if(qn){if(e)return Kn(e,s)}else if(i)return function(t,e){var i=Xn(t,e);return i&&i.value}(i,s)},has:function(s){if(Vn&&s&&("object"==typeof s||"function"==typeof s)){if(t)return Wn(t,s)}else if(qn){if(e)return Jn(e,s)}else if(i)return function(t,e){return!!Xn(t,e)}(i,s);return!1},set:function(s,a){Vn&&s&&("object"==typeof s||"function"==typeof s)?(t||(t=new Vn),$n(t,s,a)):qn?(e||(e=new qn),Yn(e,s,a)):(i||(i={key:{},next:null}),function(t,e,i){var s=Xn(t,e);s?s.value=i:t.next={key:e,next:t.next,value:i}}(i,s,a))}};return s},Zn=String.prototype.replace,to=/%20/g,eo="RFC3986",io={default:eo,formatters:{RFC1738:function(t){return Zn.call(t,to,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:eo},so=Object.prototype.hasOwnProperty,ao=Array.isArray,no=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),oo=function(t,e){for(var i=e&&e.plainObjects?Object.create(null):{},s=0;s<t.length;++s)void 0!==t[s]&&(i[s]=t[s]);return i},ro={arrayToObject:oo,assign:function(t,e){return Object.keys(e).reduce((function(t,i){return t[i]=e[i],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],s=0;s<e.length;++s)for(var a=e[s],n=a.obj[a.prop],o=Object.keys(n),r=0;r<o.length;++r){var l=o[r],h=n[l];"object"==typeof h&&null!==h&&-1===i.indexOf(h)&&(e.push({obj:n,prop:l}),i.push(h))}return function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(ao(i)){for(var s=[],a=0;a<i.length;++a)void 0!==i[a]&&s.push(i[a]);e.obj[e.prop]=s}}}(e),t},decode:function(t,e,i){var s=t.replace(/\+/g," ");if("iso-8859-1"===i)return s.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(s)}catch(t){return s}},encode:function(t,e,i,s,a){if(0===t.length)return t;var n=t;if("symbol"==typeof t?n=Symbol.prototype.toString.call(t):"string"!=typeof t&&(n=String(t)),"iso-8859-1"===i)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var o="",r=0;r<n.length;++r){var l=n.charCodeAt(r);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||a===io.RFC1738&&(40===l||41===l)?o+=n.charAt(r):l<128?o+=no[l]:l<2048?o+=no[192|l>>6]+no[128|63&l]:l<55296||l>=57344?o+=no[224|l>>12]+no[128|l>>6&63]+no[128|63&l]:(r+=1,l=65536+((1023&l)<<10|1023&n.charCodeAt(r)),o+=no[240|l>>18]+no[128|l>>12&63]+no[128|l>>6&63]+no[128|63&l])}return o},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(ao(t)){for(var i=[],s=0;s<t.length;s+=1)i.push(e(t[s]));return i}return e(t)},merge:function t(e,i,s){if(!i)return e;if("object"!=typeof i){if(ao(e))e.push(i);else{if(!e||"object"!=typeof e)return[e,i];(s&&(s.plainObjects||s.allowPrototypes)||!so.call(Object.prototype,i))&&(e[i]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(i);var a=e;return ao(e)&&!ao(i)&&(a=oo(e,s)),ao(e)&&ao(i)?(i.forEach((function(i,a){if(so.call(e,a)){var n=e[a];n&&"object"==typeof n&&i&&"object"==typeof i?e[a]=t(n,i,s):e.push(i)}else e[a]=i})),e):Object.keys(i).reduce((function(e,a){var n=i[a];return so.call(e,a)?e[a]=t(e[a],n,s):e[a]=n,e}),a)}},lo=Object.prototype.hasOwnProperty,ho={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},co=Array.isArray,po=String.prototype.split,uo=Array.prototype.push,mo=function(t,e){uo.apply(t,co(e)?e:[e])},go=Date.prototype.toISOString,yo=io.default,fo={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ro.encode,encodeValuesOnly:!1,format:yo,formatter:io.formatters[yo],indices:!1,serializeDate:function(t){return go.call(t)},skipNulls:!1,strictNullHandling:!1},_o={},vo=function t(e,i,s,a,n,o,r,l,h,c,p,u,d,m,g,y){for(var f,_=e,v=y,x=0,C=!1;void 0!==(v=v.get(_o))&&!C;){var L=v.get(e);if(x+=1,void 0!==L){if(L===x)throw new RangeError("Cyclic object value");C=!0}void 0===v.get(_o)&&(x=0)}if("function"==typeof l?_=l(i,_):_ instanceof Date?_=p(_):"comma"===s&&co(_)&&(_=ro.maybeMap(_,(function(t){return t instanceof Date?p(t):t}))),null===_){if(n)return r&&!m?r(i,fo.encoder,g,"key",u):i;_=""}if("string"==typeof(f=_)||"number"==typeof f||"boolean"==typeof f||"symbol"==typeof f||"bigint"==typeof f||ro.isBuffer(_)){if(r){var M=m?i:r(i,fo.encoder,g,"key",u);if("comma"===s&&m){for(var b=po.call(String(_),","),w="",S=0;S<b.length;++S)w+=(0===S?"":",")+d(r(b[S],fo.encoder,g,"value",u));return[d(M)+(a&&co(_)&&1===b.length?"[]":"")+"="+w]}return[d(M)+"="+d(r(_,fo.encoder,g,"value",u))]}return[d(i)+"="+d(String(_))]}var I,E=[];if(void 0===_)return E;if("comma"===s&&co(_))I=[{value:_.length>0?_.join(",")||null:void 0}];else if(co(l))I=l;else{var T=Object.keys(_);I=h?T.sort(h):T}for(var D=a&&co(_)&&1===_.length?i+"[]":i,P=0;P<I.length;++P){var O=I[P],k="object"==typeof O&&void 0!==O.value?O.value:_[O];if(!o||null!==k){var N=co(_)?"function"==typeof s?s(D,O):D:D+(c?"."+O:"["+O+"]");y.set(e,x);var A=Qn();A.set(_o,y),mo(E,t(k,N,s,a,n,o,r,l,h,c,p,u,d,m,g,A))}}return E},xo=(Object.prototype.hasOwnProperty,Array.isArray,function(t,e){var i,s=t,a=function(t){if(!t)return fo;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||fo.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=io.default;if(void 0!==t.format){if(!lo.call(io.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var s=io.formatters[i],a=fo.filter;return("function"==typeof t.filter||co(t.filter))&&(a=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:fo.addQueryPrefix,allowDots:void 0===t.allowDots?fo.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:fo.charsetSentinel,delimiter:void 0===t.delimiter?fo.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:fo.encode,encoder:"function"==typeof t.encoder?t.encoder:fo.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:fo.encodeValuesOnly,filter:a,format:i,formatter:s,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:fo.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:fo.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:fo.strictNullHandling}}(e);"function"==typeof a.filter?s=(0,a.filter)("",s):co(a.filter)&&(i=a.filter);var n,o=[];if("object"!=typeof s||null===s)return"";n=e&&e.arrayFormat in ho?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var r=ho[n];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l="comma"===r&&e&&e.commaRoundTrip;i||(i=Object.keys(s)),a.sort&&i.sort(a.sort);for(var h=Qn(),c=0;c<i.length;++c){var p=i[c];a.skipNulls&&null===s[p]||mo(o,vo(s[p],p,r,l,a.strictNullHandling,a.skipNulls,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,h))}var u=o.join(a.delimiter),d=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&("iso-8859-1"===a.charset?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),u.length>0?d+u:""});const Co=w.default.prototype;let Lo,Mo;const bo=new class{ShowMessage(t){var e=t.offset||window.screen.height/2.5,i=document.getElementById("map");i&&(e=(window.screen.height-i.getBoundingClientRect().top)/2-100),i.getBoundingClientRect().top,void 0!==Lo&&Lo.close(),this.timerL&&clearTimeout(this.timerL),Lo=Co.$message({message:t.message||"未查询到任何记录!",type:t.type||"warning",duration:t.duration||3e3,showClose:t.showClose||!0,offset:e})}ShowNotifyTip(t){void 0!==t.notify&&t.notify.close();const e=Co.$notify({title:"操作提示",message:t.message||"",type:t.type||"info",duration:t.duration||4e3,showClose:t.showClose||!0,position:t.position||"bottom-right",offset:t.offset||0});void 0!==t.callback&&t.callback(e)}ShowLoading(t){void 0!==t.loading&&t.loading.close(),void 0!==Mo&&(Mo.close(),Mo=void 0),this.timerL&&clearTimeout(this.timerL),Mo=Co.$loading({lock:!0,body:!1,text:t.text||"正在拼命加载中,请耐心等待!",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.65)"}),t.callback&&t.callback(Mo),this.timerL=setTimeout((()=>{Mo&&(Mo.close(),Mo=void 0,this.ShowMessage({message:"服务请求已超时!",type:"warning"}))}),2e4)}CloseLoading(){void 0!==Mo&&(Mo.close&&Mo.close(),Mo=void 0),this.timerL&&clearTimeout(this.timerL)}};window.MapMessage=bo;var wo={};wo[te("toStringTag")]="z";var So="[object z]"===String(wo),Io=te("toStringTag"),Eo=Object,To="Arguments"===pt(function(){return arguments}()),Do=So?pt:function(t){var e,i,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Eo(t),Io))?i:To?pt(e):"Object"===(s=pt(e))&&xt(e.callee)?"Arguments":s},Po=String,Oo=function(t){if("Symbol"===Do(t))throw new TypeError("Cannot convert a Symbol value to a string");return Po(t)},ko=TypeError,No=function(t,e){if(t<e)throw new ko("Not enough arguments");return t},Ao=URLSearchParams,Ro=Ao.prototype,Fo=lt(Ro.append),Bo=lt(Ro.delete),Go=lt(Ro.forEach),zo=lt([].push),jo=new Ao("a=1&a=2&b=3");jo.delete("a",1),jo.delete("b",void 0),jo+""!="a=2"&&qe(Ro,"delete",(function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return Bo(this,t);var s=[];Go(this,(function(t,e){zo(s,{key:e,value:t})})),No(e,1);for(var a,n=Oo(t),o=Oo(i),r=0,l=0,h=!1,c=s.length;r<c;)a=s[r++],h||a.key===n?(h=!0,Bo(this,a.key)):l++;for(;l<c;)(a=s[l++]).key===n&&a.value===o||Fo(this,a.key,a.value)}),{enumerable:!0,unsafe:!0});var Uo=URLSearchParams,Vo=Uo.prototype,qo=lt(Vo.getAll),Ho=lt(Vo.has),$o=new Uo("a=1");!$o.has("a",2)&&$o.has("a",void 0)||qe(Vo,"has",(function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return Ho(this,t);var s=qo(this,t);No(e,1);for(var a=Oo(i),n=0;n<s.length;)if(s[n++]===a)return!0;return!1}),{enumerable:!0,unsafe:!0});var Wo=URLSearchParams.prototype,Ko=lt(Wo.forEach);J&&!("size"in Wo)&&ki(Wo,"size",{get:function(){var t=0;return Ko(this,(function(){t++})),t},configurable:!0,enumerable:!0});const Yo=new class{constructor(){this.WKT=O.default}getQueryString(t,e){if("string"!=typeof e)return null;const i=new RegExp(`(^|&)${t}=([^&]*)(&|$)`,"i"),s=e?e.substr(e.indexOf("?")+1).match(i):window.location.search.substr(1).match(i);return null!=s?unescape(s[2]):null}isEmptyObject(t){let e;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}isIntNum(t){return new RegExp(/^\d{1,}$/).test(t)}deepCopy(t){return"object"==typeof t?JSON.parse(JSON.stringify(t)):null}random(t=10){let e="";for(let i=0;i<t;i++)e+=Math.floor(10*Math.random());return e}guid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}isImage(t){return!!/\.(gif|jpg|jpeg|png|GIF|JPEG|JPG|PNG)$/.test(t)}getRandomColor(){return`#${Math.floor(16777215*Math.random()).toString(16)}`}getNowDate(){return new Date((new Date).getTime()+288e5).toJSON().split("T").join(" ").substr(0,10)}getDateFormate(t,e){const i=e,s=Date;return s.prototype.format=function(t){let e=t;const i={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,`${this.getFullYear()}`.substr(4-RegExp.$1.length)));for(const t in i)new RegExp(`(${t})`).test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?i[t]:`00${i[t]}`.substr(`${i[t]}`.length)));return e},new s(t).format(i)}},Jo="MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALOXpiSa5YskqL87B6fIjAerAglwjxAArZvq78NZzjCcoTY2CrYmFSPfHEFvvjJy6E+/UckhE56dyk0krh91QeD3RDucIdpHskeuNnBL2RjQatzbLTNc07lXX3kuiWhX6Z/igT27pUFqIn7vkKP6ntCBlOYa+l6kU2MpMhn7AUUdAgMBAAECgYEAmWL+bek2AB9xWNLr+OuaXbo65SETr1FE9hQ0b562MmK0df62K1hfWeHm2iS8R45IyEPZcHUlsqWF8VlQtmGJv1Jrxsdis/RBQqtq7R6vqU+ptEVD8JUJn6UaaRX0kkfmA3r0n6ywDPfWSuzJVea8l9Zj/QGA3uET0xpH+GxZb8ECQQDXE8qxBqfRaZ0YXVRRrIzEOtFYzZnipIxXGJC0Jo7hxYVOVCrjmHXudceIvAyyVs2IIHQNo+eFavgUrvyR+LG1AkEA1cNroERaW3ovPiEThJfzzmmiq30b2LNLHoIGZYXtch1t5TW0ocW2212sPL5Qic8TO8Wsr/b1aj/WGctWUnWGyQJAdVsnTlEDYRDv10uVprswVCKD+KC3RyPiL+QHkUU40ZillIf4nxehwewiZEm349fZbl3G9Wpp+jLUCvUwe7XnwQJBAKtUELwIbN9qw9ipDAq2+2sSEZYfFSWPNoMCNfxC5ngTDFSswdTzMccKghTBeK2rcb/zhKAYcMSy23gbGFnI5rkCQD5+rEvXsN76QbMpP4o6dn3mvMXzCMhIED/l1IXQzxJVj4b/1gTLxN+4mymQb2RZsAN1x5EgkdSzYpnOWOx1xVo=";function Xo(t){let e=new N.default;return e.setPrivateKey(Jo),e.decrypt(t)}function Qo(t,e){let i=t;if(!ir(i)){if(!function(t){try{let e=t||"";return e=window.location.origin+e,new URL(e),!0}catch(t){return!1}}(i))return i;i=window.location.origin+i}let s=new URL(i),a=new URLSearchParams(s.search);return a.delete(e),s.search=a.toString(),s.toString()}function Zo(t,e,i){if(!t)return null;if(t[e]==i)return t;for(let s in t)if("object"==typeof t[s]&&null!==t[s]){const a=Zo(t[s],e,i);if(a)return a}return null}function tr(t,e=1,i=3){let s=t;var a="m²";switch(e){case 1:s=Number(s)<1e6?er(t,a="m²",i):er(t,a="km²",i);break;case 2:s=Number(s)<666.667?er(t,a="亩",i=i<5?5:i):Number(s)<1e4?er(t,a="亩",i):er(t,a="公顷",i)}return`${s} ${a}`}function er(t,e,i=3){var s,a=i;switch(e){case"米":case"平方米":case"m":case"m²":default:s=t;break;case"亩":s=.0015*t;break;case"公顷":case"ha":s=1e-4*t;break;case"平方千米":case"km²":s=1e-6*t;break;case"千米":case"km":case"公里":s=.001*t;break;case"里":s=.002*t;break;case"尺":s=3*t}return Number.isInteger(s)&&(a=0),s=s.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:a})}function ir(t){try{return new URL(t||""),!0}catch(t){return!1}}function sr(t){let e=t||"";e=function(t){return t.replace("{origin}",window.location.origin).replace("{localhost}",window.location.host)}(e),ir(e)||(e=window.location.origin+e);try{return new URL(e),e}catch(t){return e}}const ar={MapCoordinate:!0,MapTools:!0,MapScale:!0,MapSearch:!0,MapSwitch:!0,MapLayerManager:!0,MapLegend:!1,MapWaterMark:!1,MapWeather:!1},nr={MapTools:!1,MapSearch:!1,MapSwitch:!1,MapLayerManager:!1,MapLegend:!1,MapWaterMark:!1,MapWeather:!1},or={MapTools:!1,MapSearch:!1,MapSwitch:!1,MapLayerManager:!1,MapLegend:!1,MapWaterMark:!1,MapWeather:!1};class rr{constructor(){this.mapTokens=null,this.globalKey="medo",this.baseIp="https://medo.dpark.com.cn/mapmostgl",this.customURL_Init="https://medo.dpark.com.cn/medox-api",this.customURL=this.customURL_Init,this.locationQueryServiceCode="",this.appCode="web",this.customAdminURL="",this.sky="light",this.mapmostStyleJson="",this.viewMode="3D",this.glyphsFonts=["Noto Sans Hans Regular"],this.locationsPoi=!1,this.requestForcePost=!1,this.observeMap=!0,this.originReplace=!1,this.repairClockLineToPolygon=!1,this.useWebGL2=!0,this.iqueryBuffer={deviation:2e-4,buffer3Dtiles:1,highlightColorTo3dtiles:"#FF9900",queryRenderedFeatures:!1,closeAllFitBounds:!1},this.renderDefaultStyle={},this.mapmostOption={},this.accessToken="",this.theme="",this.controls=null,this.controlsInit=null,this.controlsUIStyle=null,this.enableTransform=!1,this.mapTheme={active:"","blue-algae":"maptheme-blue-algae",common:"maptheme-common"},this.loadControl(),this.initAllAPI(),this.sipsgConfig="",this.mapOptionsJSON={},this.optionComponents={},this.optionControls={},this.componentsIds={},this.logEnable=!0,this.init(this.baseIp)}initComponentsIds(t){return this.componentsIds[t]={MapWaterMark:`${t}MapWaterMark`},this.componentsIds[t]}loadControl(){this.mapOptionsJSON={},this.controls={...ar},this.controlsInit={...nr},this.controlsUIStyle={...or},this.removeTheme()}init(t){this.baseIp=sr(t),this.sprite=`${this.baseIp}/sprite/streets-v9/sprite`,this.glyphs=`${this.baseIp}/glyphs/{fontstack}/{range}.pbf`,this.images=`${this.baseIp}/images`,this.draco=`${this.baseIp}/draco/`,this.hdr=`${this.baseIp}/hdr/source_sky_WhiteBG_Ref_1K.hdr`}initAllAPI(t,e){e&&(this.customURL=e),this.globalKey=t,this.customURLMapConfig=`${this.customURL}/onemap/geoMapConfig/getMapConfig`,this.customURL_GaodeAPI=`${this.customURL}/amap/api`,this.customURL_Upload=`${this.customURL}/onemap/geoMapResourceCustom/save`,this.customURL_CopyToCustom=`${this.customURL}/onemap/geoMapResourceCustom/copyIqueryToCustom`,this.customURL_UploadEditLayer=`${this.customURL}/onemap/geoMapResourceCustom/update`,this.customURL_UploadDelete=`${this.customURL}/onemap/geoMapResourceCustom/delete`,this.customURL_ReadUploadFile=`${this.customURL}/geo/file2GeoJson`,this.customURL_ReadGeoJSONByFile=`${this.customURL}/geo/file2GeoJson`,this.customURL_ReadGeoJSONByIQuery=`${this.customURL}/onemap/geoApiQuery/execute/geojson`,this.customURL_ImageCompare=`${this.customURL}/`,this.customURL_getMapDataExportList=`${this.customURL}/onemap/geoMapLayer/getExportShpLayerList`,this.customURL_MapDataExport=`${this.customURL}/onemap/geoMapConfig/exportShapeFile`,this.customURL_RoamingList=`${this.customURL}/onemap/geoMapRoamGroup/list`,this.customURL_RoamingSave=`${this.customURL}/onemap/geoMapRoamGroup/save`,this.customURL_RoamingUpdate=`${this.customURL}/onemap/geoMapRoamGroup/update`,this.customURL_RoamingDetail=`${this.customURL}/onemap/geoMapRoamGroup/detail`,this.customURL_RoamingDelete=`${this.customURL}/onemap/geoMapRoamGroup/delete`,this.customURL_Minio=`${this.customURL}/system/upms/file/list`,this.customURL_MapLayer=`${this.customURL}/onemap/geoMapLayer/detail`,this.customURL_MapPdf=`${this.customURL}/onemap/geoMapConfig/exportPdf`,this.customURL_IQuery=`${this.customURL}/onemap/geoApiQuery/iQuery`,this.customURL_QQuery=`${this.customURL}/onemap/geoApiQuery/qQuery`,this.customURL_dict=`${this.customURL}/system/upms/dict/allItems`,this.customURL_collectFavourUrl=`${this.customURL}/onemap/geoMapLayer/collectMapLayer`,this.customURL_RemoveFavourUrl=`${this.customURL}/onemap/geoMapLayer/delCollectMapLayer`,this.customURL_GaodeAPIAdcodeByLocation=`${this.customURL_GaodeAPI}/getRegeo?location=`,this.customURL_GaodeAPIWeatherByAdcode=`${this.customURL_GaodeAPI}/getWeatherInfo`,this.customURL_TrackingReport=`${this.customURL}/system/upms/tracking/report/single`}setConfig(t){t.baseIp&&this.init(t.baseIp);Object.keys(t).forEach((e=>{void 0!==this[e]&&("object"!=typeof this[e]||Array.isArray(this[e])?["baseIp","sprite","glyphs","images","draco","hdr"].includes(e)?this[e]=sr(t[e]):this[e]=t[e]:Object.assign(this[e],t[e]))}))}getOptionData(t,e){return this.mapOptionsJSON[t][e]}setOptionComponents(t){this.optionComponents[t.container]=t}setMapOptions(t){this.mapOptionsJSON[t.Container]=t,this.optionControls[t.Container]={...this.controls}}getPositionStyle(t){if(t){return{position:"absolute",top:null==t[0]?"auto":t[0],right:null==t[1]?"auto":t[1],bottom:null==t[2]?"auto":t[2],left:null==t[3]?"auto":t[3]}}return""}getPositionCss(t){let e="";return t&&"object"==typeof t&&(e=this.getPositionStyle(t.position)),e}getPositionArr(t){let e="";return"object"==typeof t&&(e=t.position),e}addMeta(t,e){const i=document.createElement("meta");i.content=e,i.name=t,document.getElementsByTagName("head")[0].appendChild(i)}setLinkTheme(t){const e=document.createElement("link");e.id="theme-chalk",e.rel="styleSheet",e.type="text/css",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}setTheme(t="common"){const e=document.getElementById("app");if(e){switch(this.mapTheme.active&&this.removeTheme(this.mapTheme.active),t){case"common":e.classList.contains(this.mapTheme["blue-algae"])&&e.classList.remove(this.mapTheme["blue-algae"]);break;case"blue-algae":e.classList.contains(this.mapTheme.common)&&e.classList.remove(this.mapTheme.common)}e.classList.add(this.mapTheme[t]),this.mapTheme.active=t}}setGlyphsFonts(t){Array.isArray(t)?this.glyphsFonts=t:this.glyphsFonts=[t]}removeTheme(t){const e=document.getElementById("app");if(e){if(t)return void e.classList.remove(this.mapTheme[t]);e.classList.forEach((t=>{t.indexOf("mapTheme-")>-1&&e.classList.remove(t)})),this.mapTheme.active=""}}}new rr;var lr=new class{constructor(){this.config={},this.defaultKey="container",this.activeKey=""}getGaodeAPIAdcodeByLocationUrl(){return this.activeKey?this.getConfig(this.activeKey).customURL_GaodeAPIAdcodeByLocation:null}getRequestForcePost(){return!!this.activeKey&&this.getConfig(this.activeKey).requestForcePost}load(t){this.activeKey=t;var e=new rr;return this.config[t||this.defaultKey]=e,e}getConfig(t){return this.config[t||this.defaultKey]}};let hr;window.callbackCode401=t=>{if(t&&401==t)throw window.MapCallbackCode401&&window.MapCallbackCode401(),"地图数据访问权限失效!"};const cr=k.default.create({headers:{"Content-Type":"application/json;charset=utf-8;"},timeout:2e4,responseType:"json"});function pr(t,e=""){let i;switch(t){case 401:bo.ShowMessage({message:"登录失效,请重新登录!",type:"error"});break;case 404:bo.ShowMessage({message:"请求接口不存在!",type:"error"});break;case 400:i=e||"400",bo.ShowMessage({message:i,type:"error"});break;case 500:i=e||"服务正在维护中,请稍后...",bo.ShowMessage({message:i,type:"error"});break;default:bo.ShowMessage({message:"服务发生异常,请稍后重试!",type:"error"})}}function ur(){var t={},e=sessionStorage.getItem("medox-token-name")||"Authorization";return t&&(t[e]=sessionStorage.getItem("medox-token-value")),t}cr.interceptors.request.use((t=>{hr&&clearTimeout(hr),hr=setTimeout((()=>{window.MapMessage.ShowLoading({})}),2e3),1!=t.notoken&&Object.assign(t.headers,ur()),Object.assign(t.headers,t.addheaders||{}),t.addresponseType&&(t.responseType=t.addresponseType),t.addtimeout&&(t.timeout=t.addtimeout);var e=t.method.toLowerCase();lr.getRequestForcePost()&&["put","delete"].includes(e)&&(t.headers["X-HTTP-Method-Override"]=e,t.method="post");const i=t.headers["Content-Type"]||"";if("post"==t.method.toLowerCase()&&(!i||i&&i.toLowerCase().indexOf("application/json")>-1)){const e=t.data||"",i=d.sm3(JSON.stringify(e));t.headers["x-sign"]=i}return t}),(t=>(hr&&clearTimeout(hr),window.MapMessage.CloseLoading({}),Promise.resolve(t)))),cr.interceptors.response.use((t=>{if(hr&&clearTimeout(hr),window.MapMessage.CloseLoading({}),1==t.config.nocode)return Promise.resolve(t.data);if(t.data&&window.callbackCode401(t.data.code),t.data.success)return Promise.resolve(t.data);{const e=t.data.message||t.data.msg||t.msg;if(t.data.code)return 1!=t.config.nomessage&&pr(t.data.code,e),Promise.resolve(t.data)}}),(t=>{hr&&clearTimeout(hr),window.MapMessage.CloseLoading({});const{status:e,config:i}=t.response;if(1!=i.nomessage&&pr(e,t.message),401===e)window.callbackCode401(e)}));var dr=new class{request(t){return cr(t)}get(t){return cr(Object.assign({url:encodeURI(t.url),method:"get",params:t.params||{}},t))}post(t){return t.params&&(t.data=t.params,delete t.params),cr(Object.assign({url:encodeURI(t.url),method:"post",data:t.params||{}},t))}postRaw(t){return cr({url:encodeURI(t.url),method:"post",addheaders:{"Content-Type":"application/json"},data:t.params||{}})}postRaw2(t){return cr({url:encodeURI(t.url),method:"post",addheaders:{"Content-Type":"text/plain"},data:t.params||{}})}postServiceJson({url:t,data:e,headers:i={}}){return Object.assign(i,ur()),cr(Object.assign({method:"post",url:t,data:e},{headers:Object.assign({"content-type":"application/json"},i)}))}postShape(t){const e=new FormData;e.append(t.filesKey||"file",t.files.raw);const i=t.extras;if("object"==typeof i)for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.append(t,i[t]);return cr(Object.assign({url:encodeURI(t.url),method:"post",addheaders:{"Content-Type":"multipart/formdata"},data:e||{},loading:!0},t))}};function mr({url:t,data:e,headers:i={}}){return Object.assign(i,ur()),cr(Object.assign({method:"post",notoken:!0,nocode:!0,nomessage:!0,url:t,data:e},{headers:Object.assign({"content-type":"application/json"},i)}))}function gr({url:t,data:e,headers:i={}}){return Object.assign(i,ur()),cr(Object.assign({method:"post",notoken:!0,nocode:!0,nomessage:!0,url:t,data:e},{headers:Object.assign({},i)}))}function yr(t){const e=t;return e&&e.headers&&"application/x-www-form-urlencoded"===e.headers["content-type"]&&(e.data=xo(e.data)),cr(Object.assign({notoken:!0,nocode:!0,nomessage:!0,method:"post"},e))}function fr(t){return cr(Object.assign({notoken:!0,nocode:!0,nomessage:!0,method:"get"},t))}const _r={3857:"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",1001:"NPuV3MZkQdQOqYMWFjRQJ7X6gNC30tgCo/GkDEhbI8N/r4If0IY+fRIAbE+o06O91jKZ+Kb8z8XXiRJAuBRW1O7vQ/sVw8jXRiCgoa+/+tVVE1NLEHZ05lHtRoB1Vj+lP1atU9MwOJRU/zK7vzZhXqp+dc+XkEekFwnTg95pznc=",1002:"NPuV3MZkQdQOqYMWFjRQJ7X6gNC30tgCo/GkDEhbI8N/r4If0IY+fRIAbE+o06O91jKZ+Kb8z8XXiRJAuBRW1O7vQ/sVw8jXRiCgoa+/+tVVE1NLEHZ05lHtRoB1Vj+lP1atU9MwOJRU/zK7vzZhXqp+dc+XkEekFwnTg95pznc=",4326:"+proj=longlat +datum=WGS84 +no_defs ",4479:"+proj=geocent +ellps=GRS80 +units=m +no_defs",4490:"+proj=longlat +ellps=GRS80 +no_defs ",4214:"+proj=longlat +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +no_defs",4610:"+proj=longlat +a=6378140 +b=6356755.288157528 +no_defs",4491:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4492:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4493:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4494:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4495:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4496:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4497:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4498:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4499:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4500:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4501:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4502:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4503:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4504:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4505:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4506:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4507:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4508:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4509:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4510:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4511:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4512:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4513:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=25500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4514:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=26500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4515:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=27500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4516:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=28500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4517:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=29500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4518:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=30500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4519:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=31500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4520:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=32500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4521:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=33500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4522:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=34500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4523:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=35500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4524:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=36500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4525:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=37500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4526:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4527:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4528:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4529:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=41500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4530:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=42500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4531:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=43500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4532:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=44500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4533:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=45500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4534:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4535:"+proj=tmerc +lat_0=0 +lon_0=78 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4536:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4537:"+proj=tmerc +lat_0=0 +lon_0=84 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4538:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4539:"+proj=tmerc +lat_0=0 +lon_0=90 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4540:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4541:"+proj=tmerc +lat_0=0 +lon_0=96 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4542:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4543:"+proj=tmerc +lat_0=0 +lon_0=102 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4544:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4545:"+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4546:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4547:"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",45116:"+proj=tmerc +lat_0=0 +lon_0=116 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4548:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4549:"+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4550:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4551:"+proj=tmerc +lat_0=0 +lon_0=126 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4552:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4553:"+proj=tmerc +lat_0=0 +lon_0=132 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4554:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs ",4555:"+proj=longlat +ellps=krass +no_defs ",4556:"+proj=geocent +ellps=GRS80 +units=m +no_defs ",4557:"+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs",4558:"+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs ",4559:"+proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ",4568:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +units=m +no_defs ",4569:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=14500000 +y_0=0 +ellps=krass +units=m +no_defs ",4570:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=15500000 +y_0=0 +ellps=krass +units=m +no_defs ",4571:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=16500000 +y_0=0 +ellps=krass +units=m +no_defs ",4572:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=17500000 +y_0=0 +ellps=krass +units=m +no_defs ",4573:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=18500000 +y_0=0 +ellps=krass +units=m +no_defs ",4574:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=19500000 +y_0=0 +ellps=krass +units=m +no_defs ",4575:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=20500000 +y_0=0 +ellps=krass +units=m +no_defs ",4576:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=21500000 +y_0=0 +ellps=krass +units=m +no_defs ",4577:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=22500000 +y_0=0 +ellps=krass +units=m +no_defs ",4578:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=23500000 +y_0=0 +ellps=krass +units=m +no_defs ",4579:"+proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4580:"+proj=tmerc +lat_0=0 +lon_0=81 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4581:"+proj=tmerc +lat_0=0 +lon_0=87 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4582:"+proj=tmerc +lat_0=0 +lon_0=93 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4583:"+proj=tmerc +lat_0=0 +lon_0=99 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4584:"+proj=tmerc +lat_0=0 +lon_0=105 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4585:"+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4586:"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4587:"+proj=tmerc +lat_0=0 +lon_0=123 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4588:"+proj=tmerc +lat_0=0 +lon_0=129 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",4589:"+proj=tmerc +lat_0=0 +lon_0=135 +k=1 +x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs ",5555:"+proj=tmerc +lat_0=0 +lon_0=121.2751921 +k=1 +x_0=-3457147.81 +y_0=0 +ellps=krass +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"};var vr=new class{constructor(){this.proj4Text=_r,this.bboxSR={45116:{bboxSR:"%7B%22wkt%22%3A%22PROJCS%5B%5C%22CGCS2000_3_Degree_GK_CM_116E%5C%22%2CGEOGCS%5B%5C%22GCS_China_Geodetic_Coordinate_System_2000%5C%22%2CDATUM%5B%5C%22D_China_2000%5C%22%2CSPHEROID%5B%5C%22CGCS2000%5C%22%2C6378137.0%2C298.257222101%5D%5D%2CPRIMEM%5B%5C%22Greenwich%5C%22%2C0.0%5D%2CUNIT%5B%5C%22Degree%5C%22%2C0.0174532925199433%5D%5D%2CPROJECTION%5B%5C%22Gauss_Kruger%5C%22%5D%2CPARAMETER%5B%5C%22False_Easting%5C%22%2C500000.0%5D%2CPARAMETER%5B%5C%22False_Northing%5C%22%2C0.0%5D%2CPARAMETER%5B%5C%22Central_Meridian%5C%22%2C116.0%5D%2CPARAMETER%5B%5C%22Scale_Factor%5C%22%2C1.0%5D%2CPARAMETER%5B%5C%22Latitude_Of_Origin%5C%22%2C0.0%5D%2CUNIT%5B%5C%22Meter%5C%22%2C1.0%5D%5D%22%7D",imageSR:"%7B%22wkt%22%3A%22PROJCS%5B%5C%22CGCS2000_3_Degree_GK_CM_116E%5C%22%2CGEOGCS%5B%5C%22GCS_China_Geodetic_Coordinate_System_2000%5C%22%2CDATUM%5B%5C%22D_China_2000%5C%22%2CSPHEROID%5B%5C%22CGCS2000%5C%22%2C6378137.0%2C298.257222101%5D%5D%2CPRIMEM%5B%5C%22Greenwich%5C%22%2C0.0%5D%2CUNIT%5B%5C%22Degree%5C%22%2C0.0174532925199433%5D%5D%2CPROJECTION%5B%5C%22Gauss_Kruger%5C%22%5D%2CPARAMETER%5B%5C%22False_Easting%5C%22%2C500000.0%5D%2CPARAMETER%5B%5C%22False_Northing%5C%22%2C0.0%5D%2CPARAMETER%5B%5C%22Central_Meridian%5C%22%2C116.0%5D%2CPARAMETER%5B%5C%22Scale_Factor%5C%22%2C1.0%5D%2CPARAMETER%5B%5C%22Latitude_Of_Origin%5C%22%2C0.0%5D%2CUNIT%5B%5C%22Meter%5C%22%2C1.0%5D%5D%22%7D"},SZ2000:{bboxSR:"%7B%5C%22wkt%5C%22%3A%5C%22PROJCS%5B%5C%222000SZ%5C%22%2CGEOGCS%5B%5C%22GCS_China_Geodetic_Coordinate_System_2000%5C%22%2CDATUM%5B%5C%22D_China_2000%5C%22%2CSPHEROID%5B%5C%22CGCS2000%5C%22%2C6378137.0%2C298.257222101%5D%5D%2CPRIMEM%5B%5C%22Greenwich%5C%22%2C0.0%5D%2CUNIT%5B%5C%22Degree%5C%22%2C0.0174532925199433%5D%5D%2CPROJECTION%5B%5C%22Gauss_Kruger%5C%22%5D%2CPARAMETER%5B%5C%22False_Easting%5C%22%2C350000.0%5D%2CPARAMETER%5B%5C%22False_Northing%5C%22%2C-2800000.0%5D%2CPARAMETER%5B%5C%22Central_Meridian%5C%22%2C120.7833333333333%5D%2CPARAMETER%5B%5C%22Scale_Factor%5C%22%2C1.0%5D%2CPARAMETER%5B%5C%22Latitude_Of_Origin%5C%22%2C0.0%5D%2CUNIT%5B%5C%22Meter%5C%22%2C1.0%5D%5D%5C%22%7D",imageSR:"%7B%5C%22wkt%5C%22%3A%5C%22PROJCS%5B%5C%222000SZ%5C%22%2CGEOGCS%5B%5C%22GCS_China_Geodetic_Coordinate_System_2000%5C%22%2CDATUM%5B%5C%22D_China_2000%5C%22%2CSPHEROID%5B%5C%22CGCS2000%5C%22%2C6378137.0%2C298.257222101%5D%5D%2CPRIMEM%5B%5C%22Greenwich%5C%22%2C0.0%5D%2CUNIT%5B%5C%22Degree%5C%22%2C0.0174532925199433%5D%5D%2CPROJECTION%5B%5C%22Gauss_Kruger%5C%22%5D%2CPARAMETER%5B%5C%22False_Easting%5C%22%2C350000.0%5D%2CPARAMETER%5B%5C%22False_Northing%5C%22%2C-2800000.0%5D%2CPARAMETER%5B%5C%22Central_Meridian%5C%22%2C120.7833333333333%5D%2CPARAMETER%5B%5C%22Scale_Factor%5C%22%2C1.0%5D%2CPARAMETER%5B%5C%22Latitude_Of_Origin%5C%22%2C0.0%5D%2CUNIT%5B%5C%22Meter%5C%22%2C1.0%5D%5D%5C%22%7D"}},this.zoomOffset={},this.syncDynamicLayer={},this.resolutions={}}setResolutions(t,e){this.syncDynamicLayer[t]&&!this.resolutions[t]&&e&&(this.resolutions[t]=e)}getResolutions(t){return this.syncDynamicLayer[t]&&this.resolutions[t]?this.resolutions[t]:null}getProj(t){return this.proj4Text[t]}getZoomOffset(t){return this.zoomOffset[t]||0}getBboxSR(t){return["local","sz2000sdk","SZ2000","sz2000"].includes(t)?this.bboxSR.SZ2000||this.bboxSR[t]||{}:this.bboxSR[t]||{}}addDefineProject(t){for(const e in t)if(t.hasOwnProperty(e)){let i=t[e];i.proj&&(this.proj4Text[e]=i.proj),(i.bboxSR||i.imageSR)&&(this.bboxSR[e]={},i.bboxSR&&(this.bboxSR[e].bboxSR=i.bboxSR),i.imageSR&&(this.bboxSR[e].imageSR=i.imageSR)),i.zoomOffset&&(this.zoomOffset[e]=i.zoomOffset),this.syncDynamicLayer[e]=0!=i.syncDynamicLayer}}};var xr=1,Cr=2,Lr=3,Mr=4,br=5,wr=6378137,Sr=6356752.314,Ir=.0066943799901413165,Er=484813681109536e-20,Tr=Math.PI/2,Dr=.16666666666666666,Pr=.04722222222222222,Or=.022156084656084655,kr=1e-10,Nr=.017453292519943295,Ar=57.29577951308232,Rr=Math.PI/4,Fr=2*Math.PI,Br=3.14159265359,Gr={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},zr={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},jr=/[\s_\-\/\(\)]/g;function Ur(t,e){if(t[e])return t[e];for(var i,s=Object.keys(t),a=e.toLowerCase().replace(jr,""),n=-1;++n<s.length;)if((i=s[n]).toLowerCase().replace(jr,"")===a)return t[i]}function Vr(t){var e,i,s,a={},n=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var i=e.split("=");return i.push(!0),t[i[0].toLowerCase()]=i[1],t}),{}),o={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*Nr},lat_1:function(t){a.lat1=t*Nr},lat_2:function(t){a.lat2=t*Nr},lat_ts:function(t){a.lat_ts=t*Nr},lon_0:function(t){a.long0=t*Nr},lon_1:function(t){a.long1=t*Nr},lon_2:function(t){a.long2=t*Nr},alpha:function(t){a.alpha=parseFloat(t)*Nr},gamma:function(t){a.rectified_grid_angle=parseFloat(t)},lonc:function(t){a.longc=t*Nr},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t;var e=Ur(zr,t);e&&(a.to_meter=e.to_meter)},from_greenwich:function(t){a.from_greenwich=t*Nr},pm:function(t){var e=Ur(Gr,t);a.from_greenwich=(e||parseFloat(t))*Nr},nadgrids:function(t){"@null"===t?a.datumCode="none":a.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(a.axis=t)},approx:function(){a.approx=!0}};for(e in n)i=n[e],e in o?"function"==typeof(s=o[e])?s(i):a[s]=i:a[e]=i;return"string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}var qr=1,Hr=/\s/,$r=/[A-Za-z]/,Wr=/[A-Za-z84_]/,Kr=/[,\]]/,Yr=/[\d\.E\-\+]/;function Jr(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=qr}function Xr(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var s=e?{}:t,a=i.reduce((function(t,e){return Qr(e,t),t}),s);e&&(t[e]=a)}function Qr(t,e){if(Array.isArray(t)){var i=t.shift();if("PARAMETER"===i&&(i=t.shift()),1===t.length)return Array.isArray(t[0])?(e[i]={},void Qr(t[0],e[i])):void(e[i]=t[0]);if(t.length)if("TOWGS84"!==i){if("AXIS"===i)return i in e||(e[i]=[]),void e[i].push(t);var s;switch(Array.isArray(i)||(e[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[i]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&Qr(t[2],e[i]));case"SPHEROID":case"ELLIPSOID":return e[i]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&Qr(t[3],e[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void Xr(e,i,t);default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return Qr(t,e[i]);return Xr(e,i,t)}}else e[i]=t;else e[i]=!0}else e[t]=!0}Jr.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;Hr.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case qr:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},Jr.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(Kr.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},Jr.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=qr)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=qr,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Jr.prototype.number=function(t){if(!Yr.test(t)){if(Kr.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},Jr.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},Jr.prototype.keyword=function(t){if(Wr.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=qr)}if(!Kr.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},Jr.prototype.neutral=function(t){if($r.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(Yr.test(t))return this.word=t,void(this.state=3);if(!Kr.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},Jr.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var Zr=.017453292519943295;function tl(t){return t*Zr}function el(t){var e=new Jr(t).output(),i=e.shift(),s=e.shift();e.unshift(["name",s]),e.unshift(["type",i]);var a={};return Qr(e,a),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var e="",i=0,s=t.AXIS.length;i<s;++i){var a=[t.AXIS[i][0].toLowerCase(),t.AXIS[i][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?e+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?e+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?e+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(e+="w")}2===e.length&&(e+="u"),3===e.length&&(t.axis=e)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var n=t.GEOGCS;function o(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(n=t),n&&(n.DATUM?t.datumCode=n.DATUM.name.toLowerCase():t.datumCode=n.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),n.DATUM&&n.DATUM.SPHEROID&&(t.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=n.DATUM.SPHEROID.a,t.rf=parseFloat(n.DATUM.SPHEROID.rf,10)),n.DATUM&&n.DATUM.TOWGS84&&(t.datum_params=n.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",tl],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",tl],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",tl],["lat0","latitude_of_origin",tl],["lat0","standard_parallel_1",tl],["lat1","standard_parallel_1",tl],["lat2","standard_parallel_2",tl],["azimuth","Azimuth"],["alpha","azimuth",tl],["srsCode","name"]].forEach((function(e){return function(t,e){var i=e[0],s=e[1];!(i in t)&&s in t&&(t[i]=t[s],3===e.length&&(t[i]=e[2](t[i])))}(t,e)})),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName?!t.lat_ts&&t.lat0&&"Polar_Stereographic"===t.projName&&(t.lat_ts=t.lat0,t.lat0=tl(t.lat0>0?90:-90)):(t.lat0=tl(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(a),a}function il(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?il[t]=Vr(arguments[1]):il[t]=el(arguments[1]):il[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?il.apply(e,t):il(t)}));if("string"==typeof t){if(t in il)return il[t]}else"EPSG"in t?il["EPSG:"+t.EPSG]=t:"ESRI"in t?il["ESRI:"+t.ESRI]=t:"IAU2000"in t?il["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(il);var sl=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var al=["3857","900913","3785","102113"];function nl(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in il}(t))return il[t];if(function(t){return sl.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=el(t);if(function(t){var e=Ur(t,"authority");if(e){var i=Ur(e,"epsg");return i&&al.indexOf(i)>-1}}(e))return il["EPSG:3857"];var i=function(t){var e=Ur(t,"extension");if(e)return Ur(e,"proj4")}(e);return i?Vr(i):e}return function(t){return"+"===t[0]}(t)?Vr(t):void 0}function rl(t,e){var i,s;if(t=t||{},!e)return t;for(s in e)void 0!==(i=e[s])&&(t[s]=i);return t}function ll(t,e,i){var s=t*e;return i/Math.sqrt(1-s*s)}function hl(t){return t<0?-1:1}function cl(t){return Math.abs(t)<=Br?t:t-hl(t)*Fr}function pl(t,e,i){var s=t*i,a=.5*t;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(Tr-e))/s}function ul(t,e){for(var i,s,a=.5*t,n=Tr-2*Math.atan(e),o=0;o<=15;o++)if(i=t*Math.sin(n),n+=s=Tr-2*Math.atan(e*Math.pow((1-i)/(1+i),a))-n,Math.abs(s)<=1e-10)return n;return-9999}function dl(t){return t}var ml=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=ll(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,i,s=t.x,a=t.y;if(a*Ar>90&&a*Ar<-90&&s*Ar>180&&s*Ar<-180)return null;if(Math.abs(Math.abs(a)-Tr)<=kr)return null;if(this.sphere)e=this.x0+this.a*this.k0*cl(s-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(Rr+.5*a));else{var n=Math.sin(a),o=pl(this.e,a,n);e=this.x0+this.a*this.k0*cl(s-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=i,t},inverse:function(t){var e,i,s=t.x-this.x0,a=t.y-this.y0;if(this.sphere)i=Tr-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else{var n=Math.exp(-a/(this.a*this.k0));if(-9999===(i=ul(this.e,n)))return null}return e=cl(this.long0+s/(this.a*this.k0)),t.x=e,t.y=i,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:dl,inverse:dl,names:["longlat","identity"]}],gl={},yl=[];function fl(t,e){var i=yl.length;return t.names?(yl[i]=t,t.names.forEach((function(t){gl[t.toLowerCase()]=i})),this):(console.log(e),!0)}var _l={start:function(){ml.forEach(fl)},add:fl,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==gl[e]&&yl[gl[e]]?yl[gl[e]]:void 0}},vl={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},xl=vl.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};vl.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Cl={};Cl.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Cl.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Cl.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Cl.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Cl.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Cl.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Cl.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Cl.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Cl.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},Cl.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Cl.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Cl.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Cl.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Cl.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Cl.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Cl.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Cl.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Cl.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var Ll={};function Ml(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Ll[t]||null,isNull:!1}}function bl(t){return t/3600*Math.PI/180}function wl(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function Sl(t){return t.map((function(t){return[bl(t.longitudeShift),bl(t.latitudeShift)]}))}function Il(t,e,i){return{name:wl(t,e+8,e+16).trim(),parent:wl(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function El(t,e,i,s){for(var a=e+176,n=[],o=0;o<i.gridNodeCount;o++){var r={latitudeShift:t.getFloat32(a+16*o,s),longitudeShift:t.getFloat32(a+16*o+4,s),latitudeAccuracy:t.getFloat32(a+16*o+8,s),longitudeAccuracy:t.getFloat32(a+16*o+12,s)};n.push(r)}return n}function Tl(t,e){if(!(this instanceof Tl))return new Tl(t);e=e||function(t){if(t)throw t};var i=nl(t);if("object"==typeof i){var s=Tl.projections.get(i.projName);if(s){if(i.datumCode&&"none"!==i.datumCode){var a=Ur(Cl,i.datumCode);a&&(i.datum_params=i.datum_params||(a.towgs84?a.towgs84.split(","):null),i.ellps=a.ellipse,i.datumName=a.datumName?a.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var n,o,r,l,h,c,p,u=function(t,e,i,s,a){if(!t){var n=Ur(vl,s);n||(n=xl),t=n.a,e=n.b,i=n.rf}return i&&!e&&(e=(1-1/i)*t),(0===i||Math.abs(t-e)<kr)&&(a=!0,e=t),{a:t,b:e,rf:i,sphere:a}}(i.a,i.b,i.rf,i.ellps,i.sphere),d=(n=u.a,o=u.b,u.rf,r=i.R_A,c=((l=n*n)-(h=o*o))/l,p=0,r?(l=(n*=1-c*(Dr+c*(Pr+c*Or)))*n,c=0):p=Math.sqrt(c),{es:c,e:p,ep2:(l-h)/h}),m=function(t){return void 0===t?null:t.split(",").map(Ml)}(i.nadgrids),g=i.datum||function(t,e,i,s,a,n,o){var r={};return r.datum_type=void 0===t||"none"===t?br:Mr,e&&(r.datum_params=e.map(parseFloat),0===r.datum_params[0]&&0===r.datum_params[1]&&0===r.datum_params[2]||(r.datum_type=xr),r.datum_params.length>3&&(0===r.datum_params[3]&&0===r.datum_params[4]&&0===r.datum_params[5]&&0===r.datum_params[6]||(r.datum_type=Cr,r.datum_params[3]*=Er,r.datum_params[4]*=Er,r.datum_params[5]*=Er,r.datum_params[6]=r.datum_params[6]/1e6+1))),o&&(r.datum_type=Lr,r.grids=o),r.a=i,r.b=s,r.es=a,r.ep2=n,r}(i.datumCode,i.datum_params,u.a,u.b,d.es,d.ep2,m);rl(this,i),rl(this,s),this.a=u.a,this.b=u.b,this.rf=u.rf,this.sphere=u.sphere,this.es=d.es,this.e=d.e,this.ep2=d.ep2,this.datum=g,this.init(),e(null,this)}else e(t)}else e(t)}function Dl(t,e,i){var s,a,n,o,r=t.x,l=t.y,h=t.z?t.z:0;if(l<-Tr&&l>-1.001*Tr)l=-Tr;else if(l>Tr&&l<1.001*Tr)l=Tr;else{if(l<-Tr)return{x:-1/0,y:-1/0,z:t.z};if(l>Tr)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),a=Math.sin(l),o=Math.cos(l),n=a*a,{x:((s=i/Math.sqrt(1-e*n))+h)*o*Math.cos(r),y:(s+h)*o*Math.sin(r),z:(s*(1-e)+h)*a}}function Pl(t,e,i,s){var a,n,o,r,l,h,c,p,u,d,m,g,y,f,_,v=1e-12,x=t.x,C=t.y,L=t.z?t.z:0;if(a=Math.sqrt(x*x+C*C),n=Math.sqrt(x*x+C*C+L*L),a/i<v){if(f=0,n/i<v)return Tr,_=-s,{x:t.x,y:t.y,z:t.z}}else f=Math.atan2(C,x);o=L/n,p=(r=a/n)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*r*r)),u=o*l,y=0;do{y++,h=e*(c=i/Math.sqrt(1-e*u*u))/(c+(_=a*p+L*u-c*(1-e*u*u))),g=(m=o*(l=1/Math.sqrt(1-h*(2-h)*r*r)))*p-(d=r*(1-h)*l)*u,p=d,u=m}while(g*g>1e-24&&y<30);return{x:f,y:Math.atan(m/Math.abs(d)),z:_}}function Ol(t){return t===xr||t===Cr}function kl(t,e,i){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===xr?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==Cr||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return i;if(t.datum_type===br||e.datum_type===br)return i;var s=t.a,a=t.es;if(t.datum_type===Lr){if(0!==Nl(t,!1,i))return;s=wr,a=Ir}var n=e.a,o=e.b,r=e.es;if(e.datum_type===Lr&&(n=wr,o=Sr,r=Ir),a===r&&s===n&&!Ol(t.datum_type)&&!Ol(e.datum_type))return i;if((i=Dl(i,a,s),Ol(t.datum_type)&&(i=function(t,e,i){if(e===xr)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(e===Cr){var s=i[0],a=i[1],n=i[2],o=i[3],r=i[4],l=i[5],h=i[6];return{x:h*(t.x-l*t.y+r*t.z)+s,y:h*(l*t.x+t.y-o*t.z)+a,z:h*(-r*t.x+o*t.y+t.z)+n}}}(i,t.datum_type,t.datum_params)),Ol(e.datum_type)&&(i=function(t,e,i){if(e===xr)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(e===Cr){var s=i[0],a=i[1],n=i[2],o=i[3],r=i[4],l=i[5],h=i[6],c=(t.x-s)/h,p=(t.y-a)/h,u=(t.z-n)/h;return{x:c+l*p-r*u,y:-l*c+p+o*u,z:r*c-o*p+u}}}(i,e.datum_type,e.datum_params)),i=Pl(i,r,n,o),e.datum_type===Lr)&&0!==Nl(e,!0,i))return;return i}function Nl(t,e,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var s={x:-i.x,y:i.y},a={x:Number.NaN,y:Number.NaN},n=[];t:for(var o=0;o<t.grids.length;o++){var r=t.grids[o];if(n.push(r.name),r.isNull){a=s;break}if(r.mandatory,null!==r.grid)for(var l=r.grid.subgrids,h=0,c=l.length;h<c;h++){var p=l[h],u=(Math.abs(p.del[1])+Math.abs(p.del[0]))/1e4,d=p.ll[0]-u,m=p.ll[1]-u,g=p.ll[0]+(p.lim[0]-1)*p.del[0]+u,y=p.ll[1]+(p.lim[1]-1)*p.del[1]+u;if(!(m>s.y||d>s.x||y<s.y||g<s.x)&&(a=Al(s,e,p),!isNaN(a.x)))break t}else if(r.mandatory)return console.log("Unable to find mandatory grid '"+r.name+"'"),-1}return isNaN(a.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*Ar+" "+s.y*Ar+" tried: '"+n+"'"),-1):(i.x=-a.x,i.y=a.y,0)}function Al(t,e,i){var s={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return s;var a={x:t.x,y:t.y};a.x-=i.ll[0],a.y-=i.ll[1],a.x=cl(a.x-Math.PI)+Math.PI;var n=Rl(a,i);if(e){if(isNaN(n.x))return s;n.x=a.x-n.x,n.y=a.y-n.y;var o,r,l=9;do{if(r=Rl(n,i),isNaN(r.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:a.x-(r.x+n.x),y:a.y-(r.y+n.y)},n.x+=o.x,n.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=cl(n.x+i.ll[0]),s.y=n.y+i.ll[1]}else isNaN(n.x)||(s.x=t.x+n.x,s.y=t.y+n.y);return s}function Rl(t,e){var i,s={x:t.x/e.del[0],y:t.y/e.del[1]},a=Math.floor(s.x),n=Math.floor(s.y),o=s.x-1*a,r=s.y-1*n,l={x:Number.NaN,y:Number.NaN};if(a<0||a>=e.lim[0])return l;if(n<0||n>=e.lim[1])return l;i=n*e.lim[0]+a;var h=e.cvs[i][0],c=e.cvs[i][1];i++;var p=e.cvs[i][0],u=e.cvs[i][1];i+=e.lim[0];var d=e.cvs[i][0],m=e.cvs[i][1];i--;var g=e.cvs[i][0],y=e.cvs[i][1],f=o*r,_=o*(1-r),v=(1-o)*(1-r),x=(1-o)*r;return l.x=v*h+_*p+x*g+f*d,l.y=v*c+_*u+x*y+f*m,l}function Fl(t,e,i){var s,a,n,o=i.x,r=i.y,l=i.z||0,h={};for(n=0;n<3;n++)if(!e||2!==n||void 0!==i.z)switch(0===n?(s=o,a=-1!=="ew".indexOf(t.axis[n])?"x":"y"):1===n?(s=r,a=-1!=="ns".indexOf(t.axis[n])?"y":"x"):(s=l,a="z"),t.axis[n]){case"e":case"n":h[a]=s;break;case"w":case"s":h[a]=-s;break;case"u":void 0!==i[a]&&(h.z=s);break;case"d":void 0!==i[a]&&(h.z=-s);break;default:return null}return h}function Bl(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function Gl(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function zl(t,e,i,s){var a,n=void 0!==(i=Array.isArray(i)?Bl(i):{x:i.x,y:i.y,z:i.z,m:i.m}).z;if(function(t){Gl(t.x),Gl(t.y)}(i),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===xr||t.datum.datum_type===Cr||t.datum.datum_type===Lr)&&"WGS84"!==e.datumCode||(e.datum.datum_type===xr||e.datum.datum_type===Cr||e.datum.datum_type===Lr)&&"WGS84"!==t.datumCode}(t,e)&&(i=zl(t,a=new Tl("WGS84"),i,s),t=a),s&&"enu"!==t.axis&&(i=Fl(t,!1,i)),"longlat"===t.projName)i={x:i.x*Nr,y:i.y*Nr,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),!(i=t.inverse(i)))return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=kl(t.datum,e.datum,i))return e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),"longlat"===e.projName?i={x:i.x*Ar,y:i.y*Ar,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),s&&"enu"!==e.axis?Fl(e,!0,i):(i&&!n&&delete i.z,i)}Tl.projections=_l,Tl.projections.start();var jl=Tl("WGS84");function Ul(t,e,i,s){var a,n,o;return Array.isArray(i)?(a=zl(t,e,i,s)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof a.z?[a.x,a.y,a.z].concat(i.splice(3)):[a.x,a.y,i[2]].concat(i.splice(3)):[a.x,a.y].concat(i.splice(2)):[a.x,a.y]):(n=zl(t,e,i,s),2===(o=Object.keys(i)).length||o.forEach((function(s){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===s||"y"===s||"z"===s)return}else if("x"===s||"y"===s)return;n[s]=i[s]})),n)}function Vl(t){return t instanceof Tl?t:t.oProj?t.oProj:Tl(t)}function ql(t,e,i){t=Vl(t);var s,a=!1;return void 0===e?(e=t,t=jl,a=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=jl,a=!0),e=Vl(e),i?Ul(t,e,i):(s={forward:function(i,s){return Ul(t,e,i,s)},inverse:function(i,s){return Ul(e,t,i,s)}},a&&(s.oProj=e),s)}var Hl=6,$l="AJSAJS",Wl="AFAFAF",Kl=65,Yl=73,Jl=79,Xl=86,Ql=90,Zl={forward:th,inverse:function(t){var e=ah(rh(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:eh};function th(t,e){return e=e||5,function(t,e){var i="00000"+t.easting,s="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(d=t.easting,m=t.northing,g=t.zoneNumber,y=oh(g),f=Math.floor(d/1e5),_=Math.floor(m/1e5)%20,a=f,n=_,o=y,r=o-1,l=$l.charCodeAt(r),h=Wl.charCodeAt(r),c=l+a-1,p=h+n,u=!1,c>Ql&&(c=c-Ql+Kl-1,u=!0),(c===Yl||l<Yl&&c>Yl||(c>Yl||l<Yl)&&u)&&c++,(c===Jl||l<Jl&&c>Jl||(c>Jl||l<Jl)&&u)&&++c===Yl&&c++,c>Ql&&(c=c-Ql+Kl-1),p>Xl?(p=p-Xl+Kl-1,u=!0):u=!1,(p===Yl||h<Yl&&p>Yl||(p>Yl||h<Yl)&&u)&&p++,(p===Jl||h<Jl&&p>Jl||(p>Jl||h<Jl)&&u)&&++p===Yl&&p++,p>Xl&&(p=p-Xl+Kl-1),String.fromCharCode(c)+String.fromCharCode(p))+i.substr(i.length-5,e)+s.substr(s.length-5,e);var a,n,o,r,l,h,c,p,u;var d,m,g,y,f,_}(function(t){var e,i,s,a,n,o,r,l,h=t.lat,c=t.lon,p=6378137,u=.00669438,d=.9996,m=ih(h),g=ih(c);l=Math.floor((c+180)/6)+1,180===c&&(l=60);h>=56&&h<64&&c>=3&&c<12&&(l=32);h>=72&&h<84&&(c>=0&&c<9?l=31:c>=9&&c<21?l=33:c>=21&&c<33?l=35:c>=33&&c<42&&(l=37));r=ih(6*(l-1)-180+3),e=u/(1-u),i=p/Math.sqrt(1-u*Math.sin(m)*Math.sin(m)),s=Math.tan(m)*Math.tan(m),a=e*Math.cos(m)*Math.cos(m),n=Math.cos(m)*(g-r),o=p*((1-u/4-3*u*u/64-5*u*u*u/256)*m-(3*u/8+3*u*u/32+45*u*u*u/1024)*Math.sin(2*m)+(15*u*u/256+45*u*u*u/1024)*Math.sin(4*m)-35*u*u*u/3072*Math.sin(6*m));var y=d*i*(n+(1-s+a)*n*n*n/6+(5-18*s+s*s+72*a-58*e)*n*n*n*n*n/120)+5e5,f=d*(o+i*Math.tan(m)*(n*n/2+(5-s+9*a+4*a*a)*n*n*n*n/24+(61-58*s+s*s+600*a-330*e)*n*n*n*n*n*n/720));h<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(y),zoneNumber:l,zoneLetter:nh(h)}}({lat:t[1],lon:t[0]}),e)}function eh(t){var e=ah(rh(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function ih(t){return t*(Math.PI/180)}function sh(t){return t/Math.PI*180}function ah(t){var e=t.northing,i=t.easting,s=t.zoneLetter,a=t.zoneNumber;if(a<0||a>60)return null;var n,o,r,l,h,c,p,u,d,m=.9996,g=6378137,y=.00669438,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),_=i-5e5,v=e;s<"N"&&(v-=1e7),p=6*(a-1)-180+3,n=.006739496752268451,d=(u=v/m/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),o=g/Math.sqrt(1-y*Math.sin(d)*Math.sin(d)),r=Math.tan(d)*Math.tan(d),l=n*Math.cos(d)*Math.cos(d),h=.99330562*g/Math.pow(1-y*Math.sin(d)*Math.sin(d),1.5),c=_/(o*m);var x=d-o*Math.tan(d)/h*(c*c/2-(5+3*r+10*l-4*l*l-9*n)*c*c*c*c/24+(61+90*r+298*l+45*r*r-1.6983531815716497-3*l*l)*c*c*c*c*c*c/720);x=sh(x);var C,L=(c-(1+2*r+l)*c*c*c/6+(5-2*l+28*r-3*l*l+8*n+24*r*r)*c*c*c*c*c/120)/Math.cos(d);if(L=p+sh(L),t.accuracy){var M=ah({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});C={top:M.lat,right:M.lon,bottom:x,left:L}}else C={lat:x,lon:L};return C}function nh(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function oh(t){var e=t%Hl;return 0===e&&(e=Hl),e}function rh(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,s=null,a="",n=0;!/[A-Z]/.test(e=t.charAt(n));){if(n>=2)throw"MGRSPoint bad conversion from: "+t;a+=e,n++}var o=parseInt(a,10);if(0===n||n+3>i)throw"MGRSPoint bad conversion from: "+t;var r=t.charAt(n++);if(r<="A"||"B"===r||"Y"===r||r>="Z"||"I"===r||"O"===r)throw"MGRSPoint zone letter "+r+" not handled: "+t;s=t.substring(n,n+=2);for(var l=oh(o),h=function(t,e){var i=$l.charCodeAt(e-1),s=1e5,a=!1;for(;i!==t.charCodeAt(0);){if(++i===Yl&&i++,i===Jl&&i++,i>Ql){if(a)throw"Bad character: "+t;i=Kl,a=!0}s+=1e5}return s}(s.charAt(0),l),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var i=Wl.charCodeAt(e-1),s=0,a=!1;for(;i!==t.charCodeAt(0);){if(++i===Yl&&i++,i===Jl&&i++,i>Xl){if(a)throw"Bad character: "+t;i=Kl,a=!0}s+=1e5}return s}(s.charAt(1),l);c<lh(r);)c+=2e6;var p=i-n;if(p%2!=0)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"+t;var u,d,m,g=p/2,y=0,f=0;return g>0&&(u=1e5/Math.pow(10,g),d=t.substring(n,n+g),y=parseFloat(d)*u,m=t.substring(n+g),f=parseFloat(m)*u),{easting:y+h,northing:f+c,zoneLetter:r,zoneNumber:o,accuracy:u}}function lh(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function hh(t,e,i){if(!(this instanceof hh))return new hh(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var s=t.split(",");this.x=parseFloat(s[0],10),this.y=parseFloat(s[1],10),this.z=parseFloat(s[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}hh.fromMGRS=function(t){return new hh(eh(t))},hh.prototype.toMGRS=function(t){return th([this.x,this.y],t)};var ch=1,ph=.25,uh=.046875,dh=.01953125,mh=.01068115234375,gh=.75,yh=.46875,fh=.013020833333333334,_h=.007120768229166667,vh=.3645833333333333,xh=.005696614583333333,Ch=.3076171875;function Lh(t){var e=[];e[0]=ch-t*(ph+t*(uh+t*(dh+t*mh))),e[1]=t*(gh-t*(uh+t*(dh+t*mh)));var i=t*t;return e[2]=i*(yh-t*(fh+t*_h)),i*=t,e[3]=i*(vh-t*xh),e[4]=i*t*Ch,e}function Mh(t,e,i,s){return i*=e,e*=e,s[0]*t-i*(s[1]+e*(s[2]+e*(s[3]+e*s[4])))}var bh=20;function wh(t,e,i){for(var s=1/(1-e),a=t,n=bh;n;--n){var o=Math.sin(a),r=1-e*o*o;if(a-=r=(Mh(a,o,Math.cos(a),i)-t)*(r*Math.sqrt(r))*s,Math.abs(r)<kr)return a}return a}var Sh={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Lh(this.es),this.ml0=Mh(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,i,s,a=t.x,n=t.y,o=cl(a-this.long0),r=Math.sin(n),l=Math.cos(n);if(this.es){var h=l*o,c=Math.pow(h,2),p=this.ep2*Math.pow(l,2),u=Math.pow(p,2),d=Math.abs(l)>kr?Math.tan(n):0,m=Math.pow(d,2),g=Math.pow(m,2);e=1-this.es*Math.pow(r,2),h/=Math.sqrt(e);var y=Mh(n,r,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-m+p+c/20*(5-18*m+g+14*p-58*m*p+c/42*(61+179*g-g*m-479*m)))))+this.x0,s=this.a*(this.k0*(y-this.ml0+r*o*h/2*(1+c/12*(5-m+9*p+4*u+c/30*(61+g-58*m+270*p-330*m*p+c/56*(1385+543*g-g*m-3111*m))))))+this.y0}else{var f=l*Math.sin(o);if(Math.abs(Math.abs(f)-1)<kr)return 93;if(i=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0,s=l*Math.cos(o)/Math.sqrt(1-Math.pow(f,2)),(f=Math.abs(s))>=1){if(f-1>kr)return 93;s=0}else s=Math.acos(s);n<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return t.x=i,t.y=s,t},inverse:function(t){var e,i,s,a,n=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(i=wh(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(i)<Tr){var r=Math.sin(i),l=Math.cos(i),h=Math.abs(l)>kr?Math.tan(i):0,c=this.ep2*Math.pow(l,2),p=Math.pow(c,2),u=Math.pow(h,2),d=Math.pow(u,2);e=1-this.es*Math.pow(r,2);var m=n*Math.sqrt(e)/this.k0,g=Math.pow(m,2);s=i-(e*=h)*g/(1-this.es)*.5*(1-g/12*(5+3*u-9*c*u+c-4*p-g/30*(61+90*u-252*c*u+45*d+46*c-g/56*(1385+3633*u+4095*d+1574*d*u)))),a=cl(this.long0+m*(1-g/6*(1+2*u+c-g/20*(5+28*u+24*d+8*c*u+6*c-g/42*(61+662*u+1320*d+720*d*u))))/l)}else s=Tr*hl(o),a=0;else{var y=Math.exp(n/this.k0),f=.5*(y-1/y),_=this.lat0+o/this.k0,v=Math.cos(_);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(f,2))),s=Math.asin(e),o<0&&(s=-s),a=0===f&&0===v?0:cl(Math.atan2(f,v)+this.long0)}return t.x=a,t.y=s,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Ih(t){var e=Math.exp(t);return e=(e-1/e)/2}function Eh(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),s=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(s,2))}function Th(t){var e=Math.abs(t);return e=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i}(e*(1+e/(Eh(1,e)+1))),t<0?-e:e}function Dh(t,e){for(var i,s=2*Math.cos(2*e),a=t.length-1,n=t[a],o=0;--a>=0;)i=s*n-o+t[a],o=n,n=i;return e+i*Math.sin(2*e)}function Ph(t,e,i){for(var s,a,n=Math.sin(e),o=Math.cos(e),r=Ih(i),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(i),h=2*o*l,c=-2*n*r,p=t.length-1,u=t[p],d=0,m=0,g=0;--p>=0;)s=m,a=d,u=h*(m=u)-s-c*(d=g)+t[p],g=c*m-a+h*d;return[(h=n*l)*u-(c=o*r)*g,h*g+c*u]}var Oh={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Sh.init.apply(this),this.forward=Sh.forward,this.inverse=Sh.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),i*=e,this.cgb[1]=i*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i*=e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),i*=e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(e*(-24832/14175)-2.4)),i*=e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i*=e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),i*=e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i*=e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i*=e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i*=e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var s=Dh(this.cbg,this.lat0);this.Zb=-this.Qn*(s+function(t,e){for(var i,s=2*Math.cos(e),a=t.length-1,n=t[a],o=0;--a>=0;)i=s*n-o+t[a],o=n,n=i;return Math.sin(e)*i}(this.gtu,2*s))},forward:function(t){var e=cl(t.x-this.long0),i=t.y;i=Dh(this.cbg,i);var s=Math.sin(i),a=Math.cos(i),n=Math.sin(e),o=Math.cos(e);i=Math.atan2(s,o*a),e=Math.atan2(n*a,Eh(s,a*o)),e=Th(Math.tan(e));var r,l,h=Ph(this.gtu,2*i,2*e);return i+=h[0],e+=h[1],Math.abs(e)<=2.623395162778?(r=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(r=1/0,l=1/0),t.x=r,t.y=l,t},inverse:function(t){var e,i,s=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(a=(a-this.Zb)/this.Qn,s/=this.Qn,Math.abs(s)<=2.623395162778){var n=Ph(this.utg,2*a,2*s);a+=n[0],s+=n[1],s=Math.atan(Ih(s));var o=Math.sin(a),r=Math.cos(a),l=Math.sin(s),h=Math.cos(s);a=Math.atan2(o*h,Eh(l,h*r)),e=cl((s=Math.atan2(l,h*r))+this.long0),i=Dh(this.cgb,a)}else e=1/0,i=1/0;return t.x=e,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var kh={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(cl(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Nr,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Oh.init.apply(this),this.forward=Oh.forward,this.inverse=Oh.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Nh(t,e){return Math.pow((1-t)/(1+t),e)}var Ah={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Rr)/(Math.pow(Math.tan(.5*this.lat0+Rr),this.C)*Nh(this.e*t,this.ratexp))},forward:function(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+Rr),this.C)*Nh(this.e*Math.sin(i),this.ratexp))-Tr,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,i=t.y,s=Math.pow(Math.tan(.5*i+Rr)/this.K,1/this.C),a=20;a>0&&(i=2*Math.atan(s*Nh(this.e*Math.sin(t.y),-.5*this.e))-Tr,!(Math.abs(i-t.y)<1e-14));--a)t.y=i;return a?(t.x=e,t.y=i,t):null},names:["gauss"]};var Rh={init:function(){Ah.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,i,s,a;return t.x=cl(t.x-this.long0),Ah.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),s=Math.cos(t.x),a=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*s),t.x=a*i*Math.sin(t.x),t.y=a*(this.cosc0*e-this.sinc0*i*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,i,s,a,n;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,n=Eh(t.x,t.y)){var o=2*Math.atan2(n,this.R2);e=Math.sin(o),i=Math.cos(o),a=Math.asin(i*this.sinc0+t.y*e*this.cosc0/n),s=Math.atan2(t.x*e,n*this.cosc0*i-t.y*this.sinc0*e)}else a=this.phic0,s=0;return t.x=s,t.y=a,Ah.inverse.apply(this,[t]),t.x=cl(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var Fh={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=kr&&(this.k0=.5*(1+hl(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=kr&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=kr&&Math.abs(Math.cos(this.lat_ts))>kr&&(this.k0=.5*this.cons*ll(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/pl(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=ll(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Tr,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,i,s,a,n,o,r=t.x,l=t.y,h=Math.sin(l),c=Math.cos(l),p=cl(r-this.long0);return Math.abs(Math.abs(r-this.long0)-Math.PI)<=kr&&Math.abs(l+this.lat0)<=kr?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*h+this.coslat0*c*Math.cos(p)),t.x=this.a*e*c*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*h-this.sinlat0*c*Math.cos(p))+this.y0,t):(i=2*Math.atan(this.ssfn_(l,h,this.e))-Tr,a=Math.cos(i),s=Math.sin(i),Math.abs(this.coslat0)<=kr?(n=pl(this.e,l*this.con,this.con*h),o=2*this.a*this.k0*n/this.cons,t.x=this.x0+o*Math.sin(r-this.long0),t.y=this.y0-this.con*o*Math.cos(r-this.long0),t):(Math.abs(this.sinlat0)<kr?(e=2*this.a*this.k0/(1+a*Math.cos(p)),t.y=e*s):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*a*Math.cos(p))),t.y=e*(this.cosX0*s-this.sinX0*a*Math.cos(p))+this.y0),t.x=e*a*Math.sin(p)+this.x0,t))},inverse:function(t){var e,i,s,a,n;t.x-=this.x0,t.y-=this.y0;var o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var r=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,i=this.lat0,o<=kr?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(r)*this.sinlat0+t.y*Math.sin(r)*this.coslat0/o),e=Math.abs(this.coslat0)<kr?this.lat0>0?cl(this.long0+Math.atan2(t.x,-1*t.y)):cl(this.long0+Math.atan2(t.x,t.y)):cl(this.long0+Math.atan2(t.x*Math.sin(r),o*this.coslat0*Math.cos(r)-t.y*this.sinlat0*Math.sin(r))),t.x=e,t.y=i,t)}if(Math.abs(this.coslat0)<=kr){if(o<=kr)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,s=o*this.cons/(2*this.a*this.k0),i=this.con*ul(this.e,s),e=this.con*cl(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else a=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=kr?n=this.X0:(n=Math.asin(Math.cos(a)*this.sinX0+t.y*Math.sin(a)*this.cosX0/o),e=cl(this.long0+Math.atan2(t.x*Math.sin(a),o*this.cosX0*Math.cos(a)-t.y*this.sinX0*Math.sin(a)))),i=-1*ul(this.e,Math.tan(.5*(Tr+n)));return t.x=e,t.y=i,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,i){return e*=i,Math.tan(.5*(Tr+t))*Math.pow((1-e)/(1+e),.5*i)}};var Bh={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,s=1/this.rf,a=2*s-Math.pow(s,2),n=this.e=Math.sqrt(a);this.R=this.k0*i*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),r=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+n*e)/(1-n*e));this.K=o-this.alpha*r+this.alpha*n/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),s=-this.alpha*(e+i)+this.K,a=2*(Math.atan(Math.exp(s))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(n))),r=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,i=t.y-this.y0,s=e/this.R,a=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(a)+Math.sin(this.b0)*Math.cos(a)*Math.cos(s)),o=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(a))),r=this.lambda0+o/this.alpha,l=0,h=n,c=-1e3,p=0;Math.abs(h-c)>1e-7;){if(++p>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=r,t.y=h,t},names:["somerc"]},Gh=1e-7;var zh={init:function(){var t,e,i,s,a,n,o,r,l,h,c,p,u,d=0,m=0,g=0,y=0,f=0,_=0,v=0;this.no_off=(u="object"==typeof(p=this).PROJECTION?Object.keys(p.PROJECTION)[0]:p.PROJECTION,"no_uoff"in p||"no_off"in p||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(u)),this.no_rot="no_rot"in this;var x=!1;"alpha"in this&&(x=!0);var C=!1;if("rectified_grid_angle"in this&&(C=!0),x&&(v=this.alpha),C&&(d=this.rectified_grid_angle*Nr),x||C)m=this.longc;else if(g=this.long1,f=this.lat1,y=this.long2,_=this.lat2,Math.abs(f-_)<=Gh||(t=Math.abs(f))<=Gh||Math.abs(t-Tr)<=Gh||Math.abs(Math.abs(this.lat0)-Tr)<=Gh||Math.abs(Math.abs(_)-Tr)<=Gh)throw new Error;var L=1-this.es;e=Math.sqrt(L),Math.abs(this.lat0)>kr?(r=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*r*r,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/L),this.A=this.B*this.k0*e/t,(a=(s=this.B*e/(i*Math.sqrt(t)))*s-1)<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=s,this.E*=Math.pow(pl(this.e,this.lat0,r),this.B)):(this.B=1/e,this.A=this.k0,this.E=s=a=1),x||C?(x?(c=Math.asin(Math.sin(v)/s),C||(d=v)):(c=d,v=Math.asin(s*Math.sin(c))),this.lam0=m-Math.asin(.5*(a-1/a)*Math.tan(c))/this.B):(n=Math.pow(pl(this.e,f,Math.sin(f)),this.B),o=Math.pow(pl(this.e,_,Math.sin(_)),this.B),a=this.E/n,l=(o-n)/(o+n),h=((h=this.E*this.E)-o*n)/(h+o*n),(t=g-y)<-Math.pi?y-=Fr:t>Math.pi&&(y+=Fr),this.lam0=cl(.5*(g+y)-Math.atan(h*Math.tan(.5*this.B*(g-y))/l)/this.B),c=Math.atan(2*Math.sin(this.B*cl(g-this.lam0))/(a-1/a)),d=v=Math.asin(s*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(s*s-1)/Math.cos(v))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(Rr-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(Rr+a))},forward:function(t){var e,i,s,a,n,o,r,l,h={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Tr)>kr){if(e=.5*((n=this.E/Math.pow(pl(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/n)),i=.5*(n+o),a=Math.sin(this.B*t.x),s=(e*this.singam-a*this.cosgam)/i,Math.abs(Math.abs(s)-1)<kr)throw new Error;l=.5*this.ArB*Math.log((1-s)/(1+s)),o=Math.cos(this.B*t.x),r=Math.abs(o)<Gh?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+a*this.singam,o)}else l=t.y>0?this.v_pole_n:this.v_pole_s,r=this.ArB*t.y;return this.no_rot?(h.x=r,h.y=l):(r-=this.u_0,h.x=l*this.cosrot+r*this.sinrot,h.y=r*this.cosrot-l*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(t){var e,i,s,a,n,o,r,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,e=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),a=.5*((s=Math.exp(-this.BrA*i))-1/s),n=.5*(s+1/s),r=((o=Math.sin(this.BrA*e))*this.cosgam+a*this.singam)/n,Math.abs(Math.abs(r)-1)<kr)l.x=0,l.y=r<0?-Tr:Tr;else{if(l.y=this.E/Math.sqrt((1+r)/(1-r)),l.y=ul(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(a*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["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"]};var jh={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<kr)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),s=ll(this.e,e,i),a=pl(this.e,this.lat1,e),n=Math.sin(this.lat2),o=Math.cos(this.lat2),r=ll(this.e,n,o),l=pl(this.e,this.lat2,n),h=pl(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>kr?this.ns=Math.log(s/r)/Math.log(a/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=kr&&(i=hl(i)*(Tr-2*kr));var s,a,n=Math.abs(Math.abs(i)-Tr);if(n>kr)s=pl(this.e,i,Math.sin(i)),a=this.a*this.f0*Math.pow(s,this.ns);else{if((n=i*this.ns)<=0)return null;a=0}var o=this.ns*cl(e-this.long0);return t.x=this.k0*(a*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-a*Math.cos(o))+this.y0,t},inverse:function(t){var e,i,s,a,n,o=(t.x-this.x0)/this.k0,r=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+r*r),i=1):(e=-Math.sqrt(o*o+r*r),i=-1);var l=0;if(0!==e&&(l=Math.atan2(i*o,i*r)),0!==e||this.ns>0){if(i=1/this.ns,s=Math.pow(e/(this.a*this.f0),i),-9999===(a=ul(this.e,s)))return null}else a=-Tr;return n=cl(l/this.ns+this.long0),t.x=n,t.y=a,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var Uh={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,i,s,a,n,o,r,l=t.x,h=t.y,c=cl(l-this.long0);return e=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/e)-this.s45),s=-c*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(s)),n=Math.asin(Math.cos(i)*Math.sin(s)/Math.cos(a)),o=this.n*n,r=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=r*Math.cos(o)/1,t.x=r*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,i,s,a,n,o,r,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),n=Math.sqrt(t.x*t.x+t.y*t.y),a=Math.atan2(t.y,t.x)/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/n,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),i=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(e)),t.x=this.long0-i/this.alfa,o=e,r=0;var h=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(r=1),o=t.y,h+=1}while(0===r&&h<15);return h>=15?null:t},names:["Krovak","krovak"]};function Vh(t,e,i,s,a){return t*a-e*Math.sin(2*a)+i*Math.sin(4*a)-s*Math.sin(6*a)}function qh(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Hh(t){return.375*t*(1+.25*t*(1+.46875*t))}function $h(t){return.05859375*t*t*(1+.75*t)}function Wh(t){return t*t*t*(35/3072)}function Kh(t,e,i){var s=e*i;return t/Math.sqrt(1-s*s)}function Yh(t){return Math.abs(t)<Tr?t:t-hl(t)*Math.PI}function Jh(t,e,i,s,a){var n,o;n=t/e;for(var r=0;r<15;r++)if(n+=o=(t-(e*n-i*Math.sin(2*n)+s*Math.sin(4*n)-a*Math.sin(6*n)))/(e-2*i*Math.cos(2*n)+4*s*Math.cos(4*n)-6*a*Math.cos(6*n)),Math.abs(o)<=1e-10)return n;return NaN}var Xh={init:function(){this.sphere||(this.e0=qh(this.es),this.e1=Hh(this.es),this.e2=$h(this.es),this.e3=Wh(this.es),this.ml0=this.a*Vh(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,i,s=t.x,a=t.y;if(s=cl(s-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(a)*Math.sin(s)),i=this.a*(Math.atan2(Math.tan(a),Math.cos(s))-this.lat0);else{var n=Math.sin(a),o=Math.cos(a),r=Kh(this.a,this.e,n),l=Math.tan(a)*Math.tan(a),h=s*Math.cos(a),c=h*h,p=this.es*o*o/(1-this.es);e=r*h*(1-c*l*(1/6-(8-l+8*p)*c/120)),i=this.a*Vh(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+r*n/o*c*(.5+(5-l+6*p)*c/24)}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,i,s=t.x/this.a,a=t.y/this.a;if(this.sphere){var n=a+this.lat0;e=Math.asin(Math.sin(n)*Math.cos(s)),i=Math.atan2(Math.tan(s),Math.cos(n))}else{var o=Jh(this.ml0/this.a+a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-Tr)<=kr)return t.x=this.long0,t.y=Tr,a<0&&(t.y*=-1),t;var r=Kh(this.a,this.e,Math.sin(o)),l=r*r*r/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(o),2),c=s*this.a/r,p=c*c;e=o-r*Math.tan(o)/l*c*c*(.5-(1+3*h)*c*c/24),i=c*(1-p*(h/3+(1+3*h)*h*p/15))/Math.cos(o)}return t.x=cl(i+this.long0),t.y=Yh(e),t},names:["Cassini","Cassini_Soldner","cass"]};function Qh(t,e){var i;return t>1e-7?(1-t*t)*(e/(1-(i=t*e)*i)-.5/t*Math.log((1-i)/(1+i))):2*e}var Zh=.3333333333333333,tc=.17222222222222222,ec=.10257936507936508,ic=.06388888888888888,sc=.0664021164021164,ac=.016415012942191543;var nc={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-Tr)<kr?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<kr?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Qh(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,i=[];return i[0]=t*Zh,e=t*t,i[0]+=e*tc,i[1]=e*ic,e*=t,i[0]+=e*ec,i[1]+=e*sc,i[2]=e*ac,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Qh(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,i,s,a,n,o,r,l,h,c,p=t.x,u=t.y;if(p=cl(p-this.long0),this.sphere){if(n=Math.sin(u),c=Math.cos(u),s=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*s:1+this.sinph0*n+this.cosph0*c*s)<=kr)return null;e=(i=Math.sqrt(2/i))*c*Math.sin(p),i*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*c*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(u+this.lat0)<kr)return null;i=Rr-.5*u,e=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(p),i*=s}}else{switch(r=0,l=0,h=0,s=Math.cos(p),a=Math.sin(p),n=Math.sin(u),o=Qh(this.e,n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(r=o/this.qp,l=Math.sqrt(1-r*r)),this.mode){case this.OBLIQ:h=1+this.sinb1*r+this.cosb1*l*s;break;case this.EQUIT:h=1+l*s;break;case this.N_POLE:h=Tr+u,o=this.qp-o;break;case this.S_POLE:h=u-Tr,o=this.qp+o}if(Math.abs(h)<kr)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),i=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*r-this.sinb1*l*s):(h=Math.sqrt(2/(1+l*s)))*r*this.ymf,e=this.xmf*h*l*a;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(h=Math.sqrt(o))*a,i=s*(this.mode===this.S_POLE?h:-h)):e=i=0}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,i,s,a,n,o,r,l,h,c,p=t.x/this.a,u=t.y/this.a;if(this.sphere){var d,m=0,g=0;if((i=.5*(d=Math.sqrt(p*p+u*u)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(i),m=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(d)<=kr?0:Math.asin(u*g/d),p*=g,u=m*d;break;case this.OBLIQ:i=Math.abs(d)<=kr?this.lat0:Math.asin(m*this.sinph0+u*g*this.cosph0/d),p*=g*this.cosph0,u=(m-Math.sin(i)*this.sinph0)*d;break;case this.N_POLE:u=-u,i=Tr-i;break;case this.S_POLE:i-=Tr}e=0!==u||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,u):0}else{if(r=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,u*=this.dd,(o=Math.sqrt(p*p+u*u))<kr)return t.x=this.long0,t.y=this.lat0,t;a=2*Math.asin(.5*o/this.rq),s=Math.cos(a),p*=a=Math.sin(a),this.mode===this.OBLIQ?(r=s*this.sinb1+u*a*this.cosb1/o,n=this.qp*r,u=o*this.cosb1*s-u*this.sinb1*a):(r=u*a/o,n=this.qp*r,u=o*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(u=-u),!(n=p*p+u*u))return t.x=this.long0,t.y=this.lat0,t;r=1-n/this.qp,this.mode===this.S_POLE&&(r=-r)}e=Math.atan2(p,u),l=Math.asin(r),h=this.apa,c=l+l,i=l+h[0]*Math.sin(c)+h[1]*Math.sin(c+c)+h[2]*Math.sin(c+c+c)}return t.x=cl(this.long0+e),t.y=i,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function oc(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var rc={init:function(){Math.abs(this.lat1+this.lat2)<kr||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=ll(this.e3,this.sin_po,this.cos_po),this.qs1=Qh(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=ll(this.e3,this.sin_po,this.cos_po),this.qs2=Qh(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Qh(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>kr?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var s=Qh(this.e3,this.sin_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,n=this.ns0*cl(e-this.long0),o=a*Math.sin(n)+this.x0,r=this.rh-a*Math.cos(n)+this.y0;return t.x=o,t.y=r,t},inverse:function(t){var e,i,s,a,n,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),a=0,0!==e&&(a=Math.atan2(s*t.x,s*t.y)),s=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-s*s)/(2*this.ns0)):(i=(this.c-s*s)/this.ns0,o=this.phi1z(this.e3,i)),n=cl(a/this.ns0+this.long0),t.x=n,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var i,s,a,n,o=oc(.5*e);if(t<kr)return o;for(var r=t*t,l=1;l<=25;l++)if(o+=n=.5*(a=1-(s=t*(i=Math.sin(o)))*s)*a/Math.cos(o)*(e/(1-r)-i/a+.5/t*Math.log((1-s)/(1+s))),Math.abs(n)<=1e-7)return o;return null}};var lc={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,i,s,a,n,o,r,l=t.x,h=t.y;return s=cl(l-this.long0),e=Math.sin(h),i=Math.cos(h),a=Math.cos(s),1,(n=this.sin_p14*e+this.cos_p14*i*a)>0||Math.abs(n)<=kr?(o=this.x0+1*this.a*i*Math.sin(s)/n,r=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*a)/n):(o=this.x0+this.infinity_dist*i*Math.sin(s),r=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*a)),t.x=o,t.y=r,t},inverse:function(t){var e,i,s,a,n,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(e,this.rc),i=Math.sin(a),o=oc((s=Math.cos(a))*this.sin_p14+t.y*i*this.cos_p14/e),n=Math.atan2(t.x*i,e*this.cos_p14*s-t.y*this.sin_p14*i),n=cl(this.long0+n)):(o=this.phic0,n=0),t.x=n,t.y=o,t},names:["gnom"]};var hc={init:function(){this.sphere||(this.k0=ll(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,i,s=t.x,a=t.y,n=cl(s-this.long0);if(this.sphere)e=this.x0+this.a*n*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(a)/Math.cos(this.lat_ts);else{var o=Qh(this.e,Math.sin(a));e=this.x0+this.a*this.k0*n,i=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=i,t},inverse:function(t){var e,i;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=cl(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=function(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*Tr:Tr;for(var s,a,n,o,r=Math.asin(.5*e),l=0;l<30;l++)if(a=Math.sin(r),n=Math.cos(r),o=t*a,r+=s=Math.pow(1-o*o,2)/(2*n)*(e/(1-t*t)-a/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(s)<=1e-10)return r;return NaN}(this.e,2*t.y*this.k0/this.a),e=cl(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t},names:["cea"]};var cc={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,i=t.y,s=cl(e-this.long0),a=Yh(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*a,t},inverse:function(t){var e=t.x,i=t.y;return t.x=cl(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Yh(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var pc={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qh(this.es),this.e1=Hh(this.es),this.e2=$h(this.es),this.e3=Wh(this.es),this.ml0=this.a*Vh(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,i,s,a=t.x,n=t.y,o=cl(a-this.long0);if(s=o*Math.sin(n),this.sphere)Math.abs(n)<=kr?(e=this.a*o,i=-1*this.a*this.lat0):(e=this.a*Math.sin(s)/Math.tan(n),i=this.a*(Yh(n-this.lat0)+(1-Math.cos(s))/Math.tan(n)));else if(Math.abs(n)<=kr)e=this.a*o,i=-1*this.ml0;else{var r=Kh(this.a,this.e,Math.sin(n))/Math.tan(n);e=r*Math.sin(s),i=this.a*Vh(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+r*(1-Math.cos(s))}return t.x=e+this.x0,t.y=i+this.y0,t},inverse:function(t){var e,i,s,a,n,o,r,l,h;if(s=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=kr)e=cl(s/this.a+this.long0),i=0;else{var c;for(o=this.lat0+a/this.a,r=s*s/this.a/this.a+o*o,l=o,n=20;n;--n)if(l+=h=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+r)*c)/((l-o)/c-1),Math.abs(h)<=kr){i=l;break}e=cl(this.long0+Math.asin(s*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(a+this.ml0)<=kr)i=0,e=cl(this.long0+s/this.a);else{var p,u,d,m,g;for(o=(this.ml0+a)/this.a,r=s*s/this.a/this.a+o*o,l=o,n=20;n;--n)if(g=this.e*Math.sin(l),p=Math.sqrt(1-g*g)*Math.tan(l),u=this.a*Vh(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(o*(p*(m=u/this.a)+1)-m-.5*p*(m*m+r))/(this.es*Math.sin(2*l)*(m*m+r-2*o*m)/(4*p)+(o-m)*(p*d-2/Math.sin(2*l))-d),Math.abs(h)<=kr){i=l;break}p=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=cl(this.long0+Math.asin(s*p/this.a)/Math.sin(i))}return t.x=e,t.y=i,t},names:["Polyconic","poly"]};var uc={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,i=t.x,s=t.y-this.lat0,a=i-this.long0,n=s/Er*1e-5,o=a,r=1,l=0;for(e=1;e<=10;e++)r*=n,l+=this.A[e]*r;var h,c=l,p=o,u=1,d=0,m=0,g=0;for(e=1;e<=6;e++)h=d*c+u*p,u=u*c-d*p,d=h,m=m+this.B_re[e]*u-this.B_im[e]*d,g=g+this.B_im[e]*u+this.B_re[e]*d;return t.x=g*this.a+this.x0,t.y=m*this.a+this.y0,t},inverse:function(t){var e,i,s=t.x,a=t.y,n=s-this.x0,o=(a-this.y0)/this.a,r=n/this.a,l=1,h=0,c=0,p=0;for(e=1;e<=6;e++)i=h*o+l*r,l=l*o-h*r,h=i,c=c+this.C_re[e]*l-this.C_im[e]*h,p=p+this.C_im[e]*l+this.C_re[e]*h;for(var u=0;u<this.iterations;u++){var d,m=c,g=p,y=o,f=r;for(e=2;e<=6;e++)d=g*c+m*p,m=m*c-g*p,g=d,y+=(e-1)*(this.B_re[e]*m-this.B_im[e]*g),f+=(e-1)*(this.B_im[e]*m+this.B_re[e]*g);m=1,g=0;var _=this.B_re[1],v=this.B_im[1];for(e=2;e<=6;e++)d=g*c+m*p,m=m*c-g*p,g=d,_+=e*(this.B_re[e]*m-this.B_im[e]*g),v+=e*(this.B_im[e]*m+this.B_re[e]*g);var x=_*_+v*v;c=(y*_+f*v)/x,p=(f*_-y*v)/x}var C=c,L=p,M=1,b=0;for(e=1;e<=9;e++)M*=C,b+=this.D[e]*M;var w=this.lat0+b*Er*1e5,S=this.long0+L;return t.x=S,t.y=w,t},names:["New_Zealand_Map_Grid","nzmg"]};var dc={init:function(){},forward:function(t){var e=t.x,i=t.y,s=cl(e-this.long0),a=this.x0+this.a*s,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=a,t.y=n,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=cl(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t},names:["Miller_Cylindrical","mill"]};var mc={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Lh(this.es)},forward:function(t){var e,i,s=t.x,a=t.y;if(s=cl(s-this.long0),this.sphere){if(this.m)for(var n=this.n*Math.sin(a),o=20;o;--o){var r=(this.m*a+Math.sin(a)-n)/(this.m+Math.cos(a));if(a-=r,Math.abs(r)<kr)break}else a=1!==this.n?Math.asin(this.n*Math.sin(a)):a;e=this.a*this.C_x*s*(this.m+Math.cos(a)),i=this.a*this.C_y*a}else{var l=Math.sin(a),h=Math.cos(a);i=this.a*Mh(a,l,h,this.en),e=this.a*s*h/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=i,t},inverse:function(t){var e,i,s;return t.x-=this.x0,i=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,i/=this.C_x*(this.m+Math.cos(e)),this.m?e=oc((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=oc(Math.sin(e)/this.n)),i=cl(i+this.long0),e=Yh(e)):(e=wh(t.y/this.a,this.es,this.en),(s=Math.abs(e))<Tr?(s=Math.sin(e),i=cl(this.long0+t.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)))):s-kr<Tr&&(i=this.long0)),t.x=i,t.y=e,t},names:["Sinusoidal","sinu"]};var gc={init:function(){},forward:function(t){for(var e=t.x,i=t.y,s=cl(e-this.long0),a=i,n=Math.PI*Math.sin(i);;){var o=-(a+Math.sin(a)-n)/(1+Math.cos(a));if(a+=o,Math.abs(o)<kr)break}a/=2,Math.PI/2-Math.abs(i)<kr&&(s=0);var r=.900316316158*this.a*s*Math.cos(a)+this.x0,l=1.4142135623731*this.a*Math.sin(a)+this.y0;return t.x=r,t.y=l,t},inverse:function(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),e=Math.asin(i);var s=cl(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var a=Math.asin(i);return t.x=s,t.y=a,t},names:["Mollweide","moll"]};var yc={init:function(){Math.abs(this.lat1+this.lat2)<kr||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qh(this.es),this.e1=Hh(this.es),this.e2=$h(this.es),this.e3=Wh(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=ll(this.e,this.sinphi,this.cosphi),this.ml1=Vh(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<kr?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=ll(this.e,this.sinphi,this.cosphi),this.ml2=Vh(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Vh(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,i=t.x,s=t.y;if(this.sphere)e=this.a*(this.g-s);else{var a=Vh(this.e0,this.e1,this.e2,this.e3,s);e=this.a*(this.g-a)}var n=this.ns*cl(i-this.long0),o=this.x0+e*Math.sin(n),r=this.y0+this.rh-e*Math.cos(n);return t.x=o,t.y=r,t},inverse:function(t){var e,i,s,a;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var n=0;return 0!==i&&(n=Math.atan2(e*t.x,e*t.y)),this.sphere?(a=cl(this.long0+n/this.ns),s=Yh(this.g-i/this.a),t.x=a,t.y=s,t):(s=Jh(this.g-i/this.a,this.e0,this.e1,this.e2,this.e3),a=cl(this.long0+n/this.ns),t.x=a,t.y=s,t)},names:["Equidistant_Conic","eqdc"]};var fc={init:function(){this.R=this.a},forward:function(t){var e,i,s=t.x,a=t.y,n=cl(s-this.long0);Math.abs(a)<=kr&&(e=this.x0+this.R*n,i=this.y0);var o=oc(2*Math.abs(a/Math.PI));(Math.abs(n)<=kr||Math.abs(Math.abs(a)-Tr)<=kr)&&(e=this.x0,i=a>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var r=.5*Math.abs(Math.PI/n-n/Math.PI),l=r*r,h=Math.sin(o),c=Math.cos(o),p=c/(h+c-1),u=p*p,d=p*(2/h-1),m=d*d,g=Math.PI*this.R*(r*(p-m)+Math.sqrt(l*(p-m)*(p-m)-(m+l)*(u-m)))/(m+l);n<0&&(g=-g),e=this.x0+g;var y=l+p;return g=Math.PI*this.R*(d*y-r*Math.sqrt((m+l)*(l+1)-y*y))/(m+l),i=a>=0?this.y0+g:this.y0-g,t.x=e,t.y=i,t},inverse:function(t){var e,i,s,a,n,o,r,l,h,c,p,u;return t.x-=this.x0,t.y-=this.y0,p=Math.PI*this.R,n=(s=t.x/p)*s+(a=t.y/p)*a,p=3*(a*a/(l=-2*(o=-Math.abs(a)*(1+n))+1+2*a*a+n*n)+(2*(r=o-2*a*a+s*s)*r*r/l/l/l-9*o*r/l/l)/27)/(h=(o-r*r/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(p)>1&&(p=p>=0?1:-1),u=Math.acos(p)/3,i=t.y>=0?(-c*Math.cos(u+Math.PI/3)-r/3/l)*Math.PI:-(-c*Math.cos(u+Math.PI/3)-r/3/l)*Math.PI,e=Math.abs(s)<kr?this.long0:cl(this.long0+Math.PI*(n-1+Math.sqrt(1+2*(s*s-a*a)+n*n))/2/s),t.x=e,t.y=i,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var _c={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,i,s,a,n,o,r,l,h,c,p,u,d,m,g,y,f,_,v,x,C,L,M=t.x,b=t.y,w=Math.sin(t.y),S=Math.cos(t.y),I=cl(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=kr?(t.x=this.x0+this.a*(Tr-b)*Math.sin(I),t.y=this.y0-this.a*(Tr-b)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=kr?(t.x=this.x0+this.a*(Tr+b)*Math.sin(I),t.y=this.y0+this.a*(Tr+b)*Math.cos(I),t):(_=this.sin_p12*w+this.cos_p12*S*Math.cos(I),f=(y=Math.acos(_))?y/Math.sin(y):1,t.x=this.x0+this.a*f*S*Math.sin(I),t.y=this.y0+this.a*f*(this.cos_p12*w-this.sin_p12*S*Math.cos(I)),t):(e=qh(this.es),i=Hh(this.es),s=$h(this.es),a=Wh(this.es),Math.abs(this.sin_p12-1)<=kr?(n=this.a*Vh(e,i,s,a,Tr),o=this.a*Vh(e,i,s,a,b),t.x=this.x0+(n-o)*Math.sin(I),t.y=this.y0-(n-o)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=kr?(n=this.a*Vh(e,i,s,a,Tr),o=this.a*Vh(e,i,s,a,b),t.x=this.x0+(n+o)*Math.sin(I),t.y=this.y0+(n+o)*Math.cos(I),t):(r=w/S,l=Kh(this.a,this.e,this.sin_p12),h=Kh(this.a,this.e,w),c=Math.atan((1-this.es)*r+this.es*l*this.sin_p12/(h*S)),v=0===(p=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(p)-Math.PI)<=kr?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(I)*Math.cos(c)/Math.sin(p)),u=this.e*this.sin_p12/Math.sqrt(1-this.es),y=l*v*(1-(x=v*v)*(g=(d=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es))*d)*(1-g)/6+(C=x*v)/8*(m=u*d)*(1-2*g)+(L=C*v)/120*(g*(4-7*g)-3*u*u*(1-7*g))-L*v/48*m),t.x=this.x0+y*Math.sin(p),t.y=this.y0+y*Math.cos(p),t))},inverse:function(t){var e,i,s,a,n,o,r,l,h,c,p,u,d,m,g,y,f,_,v,x,C,L,M;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*Tr*this.a)return;return i=e/this.a,s=Math.sin(i),a=Math.cos(i),n=this.long0,Math.abs(e)<=kr?o=this.lat0:(o=oc(a*this.sin_p12+t.y*s*this.cos_p12/e),r=Math.abs(this.lat0)-Tr,n=Math.abs(r)<=kr?this.lat0>=0?cl(this.long0+Math.atan2(t.x,-t.y)):cl(this.long0-Math.atan2(-t.x,t.y)):cl(this.long0+Math.atan2(t.x*s,e*this.cos_p12*a-t.y*this.sin_p12*s))),t.x=n,t.y=o,t}return l=qh(this.es),h=Hh(this.es),c=$h(this.es),p=Wh(this.es),Math.abs(this.sin_p12-1)<=kr?(o=Jh(((u=this.a*Vh(l,h,c,p,Tr))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,h,c,p),n=cl(this.long0+Math.atan2(t.x,-1*t.y)),t.x=n,t.y=o,t):Math.abs(this.sin_p12+1)<=kr?(u=this.a*Vh(l,h,c,p,Tr),o=Jh(((e=Math.sqrt(t.x*t.x+t.y*t.y))-u)/this.a,l,h,c,p),n=cl(this.long0+Math.atan2(t.x,t.y)),t.x=n,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),g=Math.atan2(t.x,t.y),d=Kh(this.a,this.e,this.sin_p12),y=Math.cos(g),_=-(f=this.e*this.cos_p12*y)*f/(1-this.es),v=3*this.es*(1-_)*this.sin_p12*this.cos_p12*y/(1-this.es),L=1-_*(C=(x=e/d)-_*(1+_)*Math.pow(x,3)/6-v*(1+3*_)*Math.pow(x,4)/24)*C/2-x*C*C*C/6,m=Math.asin(this.sin_p12*Math.cos(C)+this.cos_p12*Math.sin(C)*y),n=cl(this.long0+Math.asin(Math.sin(g)*Math.sin(C)/Math.cos(m))),M=Math.sin(m),o=Math.atan2((M-this.es*L*this.sin_p12)*Math.tan(m),M*(1-this.es)),t.x=n,t.y=o,t)},names:["Azimuthal_Equidistant","aeqd"]};var vc={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,i,s,a,n,o,r,l=t.x,h=t.y;return s=cl(l-this.long0),e=Math.sin(h),i=Math.cos(h),a=Math.cos(s),1,((n=this.sin_p14*e+this.cos_p14*i*a)>0||Math.abs(n)<=kr)&&(o=1*this.a*i*Math.sin(s),r=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*i*a)),t.x=o,t.y=r,t},inverse:function(t){var e,i,s,a,n,o,r;return t.x-=this.x0,t.y-=this.y0,i=oc((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),s=Math.sin(i),a=Math.cos(i),o=this.long0,Math.abs(e)<=kr?(r=this.lat0,t.x=o,t.y=r,t):(r=oc(a*this.sin_p14+t.y*s*this.cos_p14/e),n=Math.abs(this.lat0)-Tr,Math.abs(n)<=kr?(o=this.lat0>=0?cl(this.long0+Math.atan2(t.x,-t.y)):cl(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=r,t):(o=cl(this.long0+Math.atan2(t.x*s,e*this.cos_p14*a-t.y*this.sin_p14*s)),t.x=o,t.y=r,t))},names:["ortho"]},xc=1,Cc=2,Lc=3,Mc=4,bc=5,wc=6,Sc={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Ic(t,e,i,s){var a;return t<kr?(s.value=Sc.AREA_0,a=0):(a=Math.atan2(e,i),Math.abs(a)<=Rr?s.value=Sc.AREA_0:a>Rr&&a<=Tr+Rr?(s.value=Sc.AREA_1,a-=Tr):a>Tr+Rr||a<=-(Tr+Rr)?(s.value=Sc.AREA_2,a=a>=0?a-Br:a+Br):(s.value=Sc.AREA_3,a+=Tr)),a}function Ec(t,e){var i=t+e;return i<-Br?i+=Fr:i>+Br&&(i-=Fr),i}var Tc={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Tr-Rr/2?this.face=bc:this.lat0<=-(Tr-Rr/2)?this.face=wc:Math.abs(this.long0)<=Rr?this.face=xc:Math.abs(this.long0)<=Tr+Rr?this.face=this.long0>0?Cc:Mc:this.face=Lc,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,i,s,a,n,o,r={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,i=t.x,this.face===bc)a=Tr-e,i>=Rr&&i<=Tr+Rr?(l.value=Sc.AREA_0,s=i-Tr):i>Tr+Rr||i<=-(Tr+Rr)?(l.value=Sc.AREA_1,s=i>0?i-Br:i+Br):i>-(Tr+Rr)&&i<=-Rr?(l.value=Sc.AREA_2,s=i+Tr):(l.value=Sc.AREA_3,s=i);else if(this.face===wc)a=Tr+e,i>=Rr&&i<=Tr+Rr?(l.value=Sc.AREA_0,s=-i+Tr):i<Rr&&i>=-Rr?(l.value=Sc.AREA_1,s=-i):i<-Rr&&i>=-(Tr+Rr)?(l.value=Sc.AREA_2,s=-i-Tr):(l.value=Sc.AREA_3,s=i>0?-i+Br:-i-Br);else{var h,c,p,u,d,m;this.face===Cc?i=Ec(i,+Tr):this.face===Lc?i=Ec(i,+Br):this.face===Mc&&(i=Ec(i,-Tr)),u=Math.sin(e),d=Math.cos(e),m=Math.sin(i),h=d*Math.cos(i),c=d*m,p=u,this.face===xc?s=Ic(a=Math.acos(h),p,c,l):this.face===Cc?s=Ic(a=Math.acos(c),p,-h,l):this.face===Lc?s=Ic(a=Math.acos(-h),p,-c,l):this.face===Mc?s=Ic(a=Math.acos(-c),p,h,l):(a=s=0,l.value=Sc.AREA_0)}return o=Math.atan(12/Br*(s+Math.acos(Math.sin(s)*Math.cos(Rr))-Tr)),n=Math.sqrt((1-Math.cos(a))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===Sc.AREA_1?o+=Tr:l.value===Sc.AREA_2?o+=Br:l.value===Sc.AREA_3&&(o+=1.5*Br),r.x=n*Math.cos(o),r.y=n*Math.sin(o),r.x=r.x*this.a+this.x0,r.y=r.y*this.a+this.y0,t.x=r.x,t.y=r.y,t},inverse:function(t){var e,i,s,a,n,o,r,l,h,c,p,u,d={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,i=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=Sc.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=Sc.AREA_1,e-=Tr):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=Sc.AREA_2,e=e<0?e+Br:e-Br):(m.value=Sc.AREA_3,e+=Tr),h=Br/12*Math.tan(e),n=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),o=Math.atan(n),(r=1-(s=Math.cos(e))*s*(a=Math.tan(i))*a*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?r=-1:r>1&&(r=1),this.face===bc)l=Math.acos(r),d.phi=Tr-l,m.value===Sc.AREA_0?d.lam=o+Tr:m.value===Sc.AREA_1?d.lam=o<0?o+Br:o-Br:m.value===Sc.AREA_2?d.lam=o-Tr:d.lam=o;else if(this.face===wc)l=Math.acos(r),d.phi=l-Tr,m.value===Sc.AREA_0?d.lam=-o+Tr:m.value===Sc.AREA_1?d.lam=-o:m.value===Sc.AREA_2?d.lam=-o-Tr:d.lam=o<0?-o-Br:-o+Br;else{var g,y,f;h=(g=r)*g,y=(h+=(f=h>=1?0:Math.sqrt(1-h)*Math.sin(o))*f)>=1?0:Math.sqrt(1-h),m.value===Sc.AREA_1?(h=y,y=-f,f=h):m.value===Sc.AREA_2?(y=-y,f=-f):m.value===Sc.AREA_3&&(h=y,y=f,f=-h),this.face===Cc?(h=g,g=-y,y=h):this.face===Lc?(g=-g,y=-y):this.face===Mc&&(h=g,g=y,y=-h),d.phi=Math.acos(-f)-Tr,d.lam=Math.atan2(y,g),this.face===Cc?d.lam=Ec(d.lam,-Tr):this.face===Lc?d.lam=Ec(d.lam,-Br):this.face===Mc&&(d.lam=Ec(d.lam,+Tr))}return 0!==this.es&&(c=d.phi<0?1:0,p=Math.tan(d.phi),u=this.b/Math.sqrt(p*p+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-u*u)/(this.one_minus_f*u)),c&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Dc=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Pc=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Oc=.8487,kc=1.3523,Nc=Ar/5,Ac=1/Nc,Rc=18,Fc=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var Bc={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=cl(t.x-this.long0),i=Math.abs(t.y),s=Math.floor(i*Nc);s<0?s=0:s>=Rc&&(s=17);var a={x:Fc(Dc[s],i=Ar*(i-Ac*s))*e,y:Fc(Pc[s],i)};return t.y<0&&(a.y=-a.y),a.x=a.x*this.a*Oc+this.x0,a.y=a.y*this.a*kc+this.y0,a},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*Oc),y:Math.abs(t.y-this.y0)/(this.a*kc)};if(e.y>=1)e.x/=Dc[18][0],e.y=t.y<0?-Tr:Tr;else{var i=Math.floor(e.y*Rc);for(i<0?i=0:i>=Rc&&(i=17);;)if(Pc[i][0]>e.y)--i;else{if(!(Pc[i+1][0]<=e.y))break;++i}var s=Pc[i],a=5*(e.y-s[0])/(Pc[i+1][0]-s[0]);a=function(t,e,i,s){for(var a=e;s;--s){var n=t(a);if(a-=n,Math.abs(n)<i)break}return a}((function(t){return(Fc(s,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(s,t)}),a,kr,100),e.x/=Fc(Dc[i],a),e.y=(5*i+a)*Nr,t.y<0&&(e.y=-e.y)}return e.x=cl(e.x+this.long0),e},names:["Robinson","robin"]};var Gc={init:function(){this.name="geocent"},forward:function(t){return Dl(t,this.es,this.a)},inverse:function(t){return Pl(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},zc=0,jc=1,Uc=2,Vc=3,qc={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var Hc={init:function(){if(Object.keys(qc).forEach(function(t){if(void 0===this[t])this[t]=qc[t].def;else{if(qc[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);qc[t].num&&(this[t]=parseFloat(this[t]))}qc[t].degrees&&(this[t]=this[t]*Nr)}.bind(this)),Math.abs(Math.abs(this.lat0)-Tr)<kr?this.mode=this.lat0<0?jc:zc:Math.abs(this.lat0)<kr?this.mode=Uc:(this.mode=Vc,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,i,s,a,n=Math.sin(t.y),o=Math.cos(t.y),r=Math.cos(t.x);switch(this.mode){case Vc:i=this.sinph0*n+this.cosph0*o*r;break;case Uc:i=o*r;break;case jc:i=-n;break;case zc:i=n}switch(e=(i=this.pn1/(this.p-i))*o*Math.sin(t.x),this.mode){case Vc:i*=this.cosph0*n-this.sinph0*o*r;break;case Uc:i*=n;break;case zc:i*=-o*r;break;case jc:i*=o*r}return a=1/((s=i*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-i*this.sg)*this.cw*a,i=s*a,t.x=e*this.a,t.y=i*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,i,s,a={x:t.x,y:t.y};s=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*s,i=this.pn1*t.y*this.cw*s,t.x=e*this.cg+i*this.sg,t.y=i*this.cg-e*this.sg;var n=Eh(t.x,t.y);if(Math.abs(n)<kr)a.x=0,a.y=t.y;else{var o,r;switch(r=1-n*n*this.pfact,r=(this.p-Math.sqrt(r))/(this.pn1/n+n/this.pn1),o=Math.sqrt(1-r*r),this.mode){case Vc:a.y=Math.asin(o*this.sinph0+t.y*r*this.cosph0/n),t.y=(o-this.sinph0*Math.sin(a.y))*n,t.x*=r*this.cosph0;break;case Uc:a.y=Math.asin(t.y*r/n),t.y=o*n,t.x*=r;break;case zc:a.y=Math.asin(o),t.y=-t.y;break;case jc:a.y=-Math.asin(o)}a.x=Math.atan2(t.x,t.y)}return t.x=a.x+this.long0,t.y=a.y,t},names:["Tilted_Perspective","tpers"]};var $c={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,i,s,a,n=t.x,o=t.y;if(n-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var r=this.radius_p/Eh(this.radius_p*Math.cos(o),Math.sin(o));if(i=r*Math.cos(n)*Math.cos(o),s=r*Math.sin(n)*Math.cos(o),a=r*Math.sin(o),(this.radius_g-i)*i-s*s-a*a*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/Eh(a,e)),t.y=this.radius_g_1*Math.atan(a/e)):(t.x=this.radius_g_1*Math.atan(s/e),t.y=this.radius_g_1*Math.atan(a/Eh(s,e)))}else"sphere"===this.shape&&(e=Math.cos(o),i=Math.cos(n)*e,s=Math.sin(n)*e,a=Math.sin(o),e=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/Eh(a,e)),t.y=this.radius_g_1*Math.atan(a/e)):(t.x=this.radius_g_1*Math.atan(s/e),t.y=this.radius_g_1*Math.atan(a/Eh(s,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,i,s,a,n=-1,o=0,r=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Eh(1,r)):(o=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Eh(1,o));var l=r/this.radius_p;if(e=o*o+l*l+n*n,(s=(i=2*this.radius_g*n)*i-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-i-Math.sqrt(s))/(2*e),n=this.radius_g+a*n,o*=a,r*=a,t.x=Math.atan2(o,n),t.y=Math.atan(r*Math.cos(t.x)/n),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+r*r)):(o=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),e=o*o+r*r+n*n,(s=(i=2*this.radius_g*n)*i-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-i-Math.sqrt(s))/(2*e),n=this.radius_g+a*n,o*=a,r*=a,t.x=Math.atan2(o,n),t.y=Math.atan(r*Math.cos(t.x)/n)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};function Wc(t){return I.default.Convert.fromDefinedProj(t)}function Kc(t){var e=I.default.Convert.toDefinedProj(t);return Array.isArray(e)||(e=t),e}function Yc(t){return I.default.Convert.convertGeojson(t)}function Jc(t){"GeometryCollection"===t.type?t.geometries.forEach((function(t){Jc(t)})):"FeatureCollection"===t.type?t.features.forEach((function(t){Jc(t)})):"Feature"===t.type||"feature"===t.type?Jc(t.geometry):"Point"===t.type?t.coordinates=Kc(t.coordinates):"MultiPoint"===t.type||"LineString"===t.type||"MultiLineString"===t.type?t.coordinates=t.coordinates.map((function(t){return Kc(t)})):"Polygon"!==t.type&&"MultiPolygon"!==t.type||(t.coordinates=t.coordinates.map((function(t){return t.map((function(t){return Kc(t)}))})))}ql.defaultDatum="WGS84",ql.Proj=Tl,ql.WGS84=new ql.Proj("WGS84"),ql.Point=hh,ql.toPoint=Bl,ql.defs=il,ql.nadgrid=function(t,e){var i=new DataView(e),s=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;e=t.getInt32(8,!0),11!==e&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(i),a=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:wl(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(i,s),n=function(t,e,i){for(var s=176,a=[],n=0;n<e.nSubgrids;n++){var o=Il(t,s,i),r=El(t,s,o,i),l=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),h=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);a.push({ll:[bl(o.lowerLongitude),bl(o.lowerLatitude)],del:[bl(o.longitudeInterval),bl(o.latitudeInterval)],lim:[l,h],count:o.gridNodeCount,cvs:Sl(r)}),s+=176+16*o.gridNodeCount}return a}(i,a,s),o={header:a,subgrids:n};return Ll[t]=o,o},ql.transform=zl,ql.mgrs=Zl,ql.version="__VERSION__",function(t){t.Proj.projections.add(Sh),t.Proj.projections.add(Oh),t.Proj.projections.add(kh),t.Proj.projections.add(Rh),t.Proj.projections.add(Fh),t.Proj.projections.add(Bh),t.Proj.projections.add(zh),t.Proj.projections.add(jh),t.Proj.projections.add(Uh),t.Proj.projections.add(Xh),t.Proj.projections.add(nc),t.Proj.projections.add(rc),t.Proj.projections.add(lc),t.Proj.projections.add(hc),t.Proj.projections.add(cc),t.Proj.projections.add(pc),t.Proj.projections.add(uc),t.Proj.projections.add(dc),t.Proj.projections.add(mc),t.Proj.projections.add(gc),t.Proj.projections.add(yc),t.Proj.projections.add(fc),t.Proj.projections.add(_c),t.Proj.projections.add(vc),t.Proj.projections.add(Tc),t.Proj.projections.add(Bc),t.Proj.projections.add(Gc),t.Proj.projections.add(Hc),t.Proj.projections.add($c)}(ql);var Xc=Object.freeze({__proto__:null,fromDefinedProj:Wc,toDefinedProj:Kc,convertGeojson:Yc,convertGeoSDKToSZ2000:async function(t){var e={type:"FeatureCollection",features:[{type:"Feature",geometry:t}]};return await Jc(e),e.features[0].geometry},convertGeoJsonSDKToSZ2000:async function(t){return await Jc(t),t},transformCoordinates:Jc,getUrlAndConvertGeojson:async function(t){const e={url:t,method:"get",nocode:!0,nomessage:!0,notoken:!0},i=await dr.request(e);return i.data?I.default.Convert.convertGeojson(i.data):{type:"FeatureCollection",features:[]}},calcSdkArea:function(t){return I.default.Utils.area(t,"SZ2000")},calcSdkDistance:function(t){return I.default.Utils.distance(t,"SZ2000")},calcSdkAreaToGeoJson:function(t){return I.default.Utils.area(t.coordinates,"SZ2000")},calcSdkDistanceToGeoJSON:function(t){return I.default.Utils.distance(t.coordinates,"SZ2000")}});function Qc(t,e,i={}){const{rotationUnit:s="rad",scaleUnit:a="unitless",validateInput:n=!0,rotationModel:o="position_vector",useApproximation:r=!0}=i;if(n){if(!Array.isArray(t)||t.length<2||t.length>3)throw new Error("输入点坐标必须是包含2或3个数值的数组");if(!t.every((t=>"number"==typeof t&&!isNaN(t))))throw new Error("输入点坐标必须全部为有效数字");if(!e||"object"!=typeof e)throw new Error("七参数必须是有效的对象");const i=["dx","dy","dz","rx","ry","rz","m"];for(const t of i)if("number"!=typeof e[t]||isNaN(e[t]))throw new Error(`七参数中的${t}必须是有效数字`)}const[l,h,c=0]=t;let{dx:p,dy:u,dz:d,rx:m,ry:g,rz:y,m:f}={...e};if("arcsec"===s){const t=Math.PI/648e3;m*=t,g*=t,y*=t}"ppm"===a&&(f/=1e6);let _,v,x;return"coordinate_frame"===o?r?(_=(1+f)*l+-y*h+g*c+p,v=y*l+(1+f)*h+-m*c+u,x=-g*l+m*h+(1+f)*c+d):(_=(1+f)*(l-y*h+g*c)+p,v=(1+f)*(y*l+h-m*c)+u,x=(1+f)*(-g*l+m*h+c)+d):r?(_=(1+f)*l+y*h+-g*c+p,v=-y*l+(1+f)*h+m*c+u,x=g*l+-m*h+(1+f)*c+d):(_=(1+f)*(l+y*h-g*c)+p,v=(1+f)*(-y*l+h+m*c)+u,x=(1+f)*(g*l-m*h+c)+d),2===t.length?[_,v]:[_,v,x]}const Zc={bursaWolfTransform:Qc,computeBursaWolfParams:function(t,e,i={}){if(!Array.isArray(t)||!Array.isArray(e))throw new Error("源点和目标点必须是数组");if(t.length!==e.length)throw new Error("源点和目标点数量必须相同");if(t.length<3)throw new Error("至少需要3对公共点来计算七参数");for(let i=0;i<t.length;i++){const s=t[i],a=e[i];if(!Array.isArray(s)||2!==s.length&&3!==s.length||!s.every((t=>"number"==typeof t&&!isNaN(t))))throw new Error(`源点 ${i} 格式无效,必须是包含2个或3个有效数值的数组`);if(!Array.isArray(a)||2!==a.length&&3!==a.length||!a.every((t=>"number"==typeof t&&!isNaN(t))))throw new Error(`目标点 ${i} 格式无效,必须是包含2个或3个有效数值的数组`);if(s.length!==a.length)throw new Error(`第${i}个点的源点和目标点维度不一致`)}const s=t.length,a=[],n=[];for(let i=0;i<s;i++){const[s,o,r=0]=t[i],[l,h,c=0]=e[i],p=t[i].length;a.push([1,0,0,0,r,-o,s]),n.push(l-s),a.push([0,1,0,-r,0,s,o]),n.push(h-o),3===p&&(a.push([0,0,1,o,-s,0,r]),n.push(c-r))}const o=[],r=[];for(let t=0;t<7;t++)o[t]=new Array(7).fill(0),r[t]=0;for(let t=0;t<a.length;t++)for(let e=0;e<7;e++){for(let i=0;i<7;i++)o[e][i]+=a[t][e]*a[t][i];r[e]+=a[t][e]*n[t]}const l=function(t,e){const i=e.length,s=[];for(let a=0;a<i;a++)s[a]=[...t[a],e[a]];for(let t=0;t<i;t++){let e=t;for(let a=t+1;a<i;a++)Math.abs(s[a][t])>Math.abs(s[e][t])&&(e=a);e!==t&&([s[t],s[e]]=[s[e],s[t]]);const a=s[t][t];if(Math.abs(a)<1e-10)throw new Error("矩阵接近奇异,无法求解");for(let e=t;e<=i;e++)s[t][e]/=a;for(let e=0;e<i;e++)if(e!==t&&Math.abs(s[e][t])>1e-10){const a=s[e][t];for(let n=t;n<=i;n++)s[e][n]-=a*s[t][n]}}const a=[];for(let t=0;t<i;t++)a[t]=s[t][i];return a}(o,r);let[h,c,p,u,d,m,g]=l;const y=i.returnRotationUnit||"rad",f=i.returnScaleUnit||"unitless";if("arcsec"===y){const t=648e3/Math.PI;u*=t,d*=t,m*=t}return"ppm"===f&&(g*=1e6),{dx:h,dy:c,dz:p,rx:u,ry:d,rz:m,m:g}},evaluateAccuracy:function(t,e,i,s={}){if(t.length!==e.length)throw new Error("源点和目标点数量必须相同");const a=[];let n=0;for(let o=0;o<t.length;o++){const r=Qc(t[o],i,s),l=e[o];if(t[o].length!==e[o].length)throw new Error(`第${o}个点的源点和目标点维度不一致`);const h=r[0]-l[0],c=r[1]-l[1],p=3===t[o].length?r[2]-l[2]:0,u=2===t[o].length?Math.sqrt(h*h+c*c):Math.sqrt(h*h+c*c+p*p);n+=u*u,a.push({index:o,dx:h,dy:c,dz:3===t[o].length?p:void 0,error:u})}const o=t.length;let r=0;for(let e=0;e<o;e++)r+=t[e].length;return{meanSquareError:Math.sqrt(n/(r-7)),residuals:a,maxError:Math.max(...a.map((t=>t.error))),minError:Math.min(...a.map((t=>t.error))),RMS:Math.sqrt(n/o)}}};let tp=ys;function ep(t){const e=new tp.geom.GeometryFactory;try{const i=new tp.io.GeoJSONReader(e).read(t);return(i instanceof tp.geom.MultiPolygon||i instanceof tp.geom.Polygon)&&i.isValid()}catch(t){return!1}}async function ip(t,e,i,s=!0){var a=fs(i);return await ap(t,e,a,s),_s(a)}async function sp(t,e,i,s=!0){return await ap(t,e,i,s),i}function ap(t,e,i,s){if(!i)return null;"GeometryCollection"===i.type?i.geometries.forEach((function(i){ap(t,e,i,s)})):"FeatureCollection"===i.type?i.features.forEach((function(i){ap(t,e,i,s)})):"Feature"===i.type||"feature"===i.type?ap(t,e,i.geometry,s):"Point"===i.type?i.coordinates=np(t,e,i.coordinates,s):"MultiPoint"===i.type||"LineString"===i.type||"MultiLineString"===i.type?i.coordinates=i.coordinates.map((function(i){return np(t,e,i,s)})):"Polygon"!==i.type&&"MultiPolygon"!==i.type||(i.coordinates=i.coordinates.map((function(i){return i.map((function(i){return np(t,e,i,s)}))})))}function np(t,e,i,s=!0){t||(t="4490"),e||(e="4490");var a=t,n=e,o=vr.proj4Text;if(s){if(!o[e])return i;a=[1001,1002,"1001","1002"].includes(t)?Xo(o[t]):o[t],n=[1001,1002,"1001","1002"].includes(e)?Xo(o[e]):o[e]}if(a&&n&&a==n)return i;return op(a,n,i)}function op(t,e,i){return"number"==typeof i[0]&&"number"==typeof i[1]?ql(t,e,i):Array.isArray(i[0])?i.map((i=>op(t,e,i))):void 0}function rp(t){if(null==t||""==t||"Null"==t)return null;let e=null;const i={shape:t};i.shape.toLowerCase().indexOf("multipolygon")>-1?e=T.multiPolygon(O.default.parse(i.shape).coordinates):i.shape.toLowerCase().indexOf("polygon")>-1?e=T.polygon(O.default.parse(i.shape).coordinates):i.shape.toLowerCase().indexOf("point")>-1?e=T.point(O.default.parse(i.shape.replace("point","POINT")).coordinates):i.shape.toLowerCase().indexOf("multilinestring")>-1?e=T.multiLineString(O.default.parse(i.shape).coordinates):i.shape.toLowerCase().indexOf("linestring")>-1&&(e=T.lineString(O.default.parse(i.shape).coordinates));let s=[];if("point"==e.geometry.type.toLowerCase())s=e.geometry.coordinates;else if("linestring"==e.geometry.type.toLowerCase()){const t=e.geometry.coordinates.length;if(2==t)s=T.centroid(e).geometry.coordinates;else{const i=Math.ceil(t/2);s=e.geometry.coordinates[i]}}else s=T.centroid(e).geometry.coordinates;return s}function lp(t){let e=[];if("point"==t.geometry.type.toLowerCase())e=t.geometry.coordinates;else if("linestring"==t.geometry.type.toLowerCase()){const i=t.geometry.coordinates.length;if(2==i)e=T.centroid(t).geometry.coordinates;else{const s=Math.ceil(i/2);e=t.geometry.coordinates[s]}}else e=T.centroid(t).geometry.coordinates;return e}function hp(t,e="mapLocationsLayer",i=0,s=!1,a=!1,n){return new Promise((async o=>{var r={type:"FeatureCollection",features:[]},l={type:"FeatureCollection",features:[]};const h=t.length;let c=!1;const p=n;for(let n=0;n<t.length;n++){var u=t[n],d=Math.random();if(""!=(u=Object.assign({id:d,name:d,shape:"",iQueryList:[],qQueryList:[],detaillist:[],sysData:{},extras:[]},u)).shape&&null!=u.shape){const t=fs(u.shape);p&&(t.coordinates=np(p.srid,a?1002:null,t.coordinates),u.shape=_s(t)),!c&&(c=t.type.toLowerCase()),c.indexOf("line")>-1?c="polyline":c.indexOf("polygon")>-1?c="polygon":c.indexOf("point")>-1&&(c="point");const o=(i+n+1).toString();u.poiindex=o,u.layerkey=e;const h={type:"Feature",geometry:t,geometry_name:"SHAPE",id:o,properties:{name:u.name,data:JSON.stringify(u),layerkey:e,poiindex:o}};if(u["3dtiles"]&&(h.properties.classifyAnalysis=u["3dtiles"]),Array.isArray(u.iQueryList)){u.iQueryList.forEach((t=>{h.properties[t.key]=t.value}))}else h.properties=Object.assign(h.properties,u.iQueryList);if(r.features.push(h),s){const t=rp(u.shape),e=JSON.parse(JSON.stringify(h)),i=fs(`POINT(${t[0]} ${t[1]})`);e.geometry=i,l.features.push(e)}}h-1==n&&(a&&(r=await Yc(r),s&&(l=await Yc(l))),s&&(r.features=r.features.concat(l.features)),o({data:r,shapeType:c}))}}))}function cp(t){return{type:"Feature",geometry:fs(t),geometry_name:"SHAPE",properties:{}}}function pp(t,e,i,s={}){var a=s;1==a&&(a={});const n=T.bbox(e);var o=[[n[0],n[1]],[n[2],n[3]]],r=t.getZoom();var l=.15*t.getContainer().clientWidth;l=l>=200?200:l;var h=Object.assign({padding:l,pitch:t.getPitch(),bearing:0,curve:1,maxZoom:r>=16.5?r:16.5,essential:!0},a);return"number"==typeof i&&(h.maxZoom=i),t.fitBounds(o,h),{bounds:n,options:h}}function up(t){return t>1?1/t:t}function dp(t,e,i,s){var a=1e4;return s=s||6378137,i=i||"",t>0&&e>0?(t=up(t),"degree"===i.toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()?254/e/t/(2*Math.PI*s/360)/a:254/e/t/a):-1}function mp(t,e,i,s){var a=1e4;return s=s||6378137,i=i||"",t>0&&e>0?"degree"===i.toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()?254/e/t/(2*Math.PI*s/360)/a:254/e/t/a:-1}function gp(t,e){return 2*(e=e||6378137)*Math.PI/(256*Math.pow(2,t))}function yp(t,e){const i=2*(e=e||6378137)*Math.PI;return Math.log2(i/t/256)-1-.2-.02}function fp(t,e=0,i=!0){let s,a=e,n=null;s="object"==typeof t?t:fs(wkt);var o=lp(s);const r=Array.isArray(o)?o[0]:null;if(r&&(i=r<=180),i)a=0==a?.01:a,n=T.buffer(s,a,{units:"meters"});else{const t=s.geometry,e=new tp.io.GeoJSONReader,i=new tp.io.GeoJSONWriter,o=e.read(t).buffer(a);n={type:"Feature",geometry:i.write(o),properties:{}}}return n}function _p(t,e,i=0){var s=T.point([t[0],t[1]]),a=T.point([e[0],e[1]]);return T.bearing(s,a)-i}function vp(t,e,i){const s=xp(t,e);2==t.length&&t.push(i),2==e.length&&e.push(0);const a=t[2],n=e[2];if(0===a&&0===n)return 0;const o=Math.abs(a-n);return 180*Math.atan(o/s)/Math.PI}function xp(t,e){return vs({type:"Feature",geometry:{type:"LineString",coordinates:[[t[0],t[1]],[e[0],e[1]]]}})}function Cp(t,e){return t.sz2000sdk?t.MapmostSDKConvert.calcSdkAreaToGeoJson(e.geometry):I.default.Utils.area(e.geometry.coordinates)}function Lp(t,e){return t.sz2000sdk?t.MapmostSDKConvert.calcSdkDistanceToGeoJSON(e.geometry):I.default.Utils.distance(e.geometry.coordinates)}function Mp(t,e,i,s=[0,0],a){const n=a||2*Math.PI*6378137/256/Math.pow(2,i);return[s[0]+t*n*256,s[1]+(256*(1<<i)-e)*n]}function bp(t){try{if(0==t.length)return;const e=t[0],i=/^\w+/,s=e.match(i),a=s?s[0]:"",n=new tp.geom.GeometryFactory;let o;switch(a.toLowerCase()){case"multipolygon":case"polygon":o=n.createMultiPolygon(null);break;case"linestring":case"multilinestring":o=n.createMultiLineString(null);break;case"point":case"multipoint":o=n.createMultiPoint([])}return t.forEach((t=>{const e=(new tp.io.WKTReader).read(t);o=o.union(e)})),o.toText()}catch(i){var e=function(t){if(0==t.length)return;var e=fs(t[0]);return t.forEach(((t,i)=>{i>0&&(e=T.union(e,fs(t)))})),_s(e)}(t);return e}}function wp(t){var e=t.features[0].geometry;return t.features.forEach(((t,i)=>{i>0&&(e=T.union(e,t.geometry))})),{features:[e],type:"FeatureCollection"}}async function Sp(t,e){var i=JSON.parse(JSON.stringify(e)),s=t.enableTransform;return s&&(i=await sp(s.srid,null,i)),t.sz2000sdk&&(i=await t.MapmostSDKConvert.convertGeojson(i)),i}function Ip(t){var e=0;return t.forEach((t=>{const i=xs(fs(t));e=i+e})),e}async function Ep(t){var e=Array.isArray(t)?t:[t],i={type:"FeatureCollection",features:[]};e.forEach((t=>{var e={type:"feature",geometry:fs(t)};i.features.push(e)}));return T.bbox(i)}function Tp(t,e){var i,s;Array.isArray(data)?i="object"==typeof data[0]?JSON.parse(JSON.stringify(data)).map((t=>t.shape)):data:"string"==typeof data&&(i=[data]);s=i?function(t){var e=Array.isArray(t)?t:[t],i={type:"FeatureCollection",features:[]};return e.forEach((t=>{var e={type:"feature",geometry:fs(t)};i.features.push(e)})),T.bbox(i)}(i):T.bbox(data);var a=null;if(s){const t=fp(T.bboxPolygon(s),e);a=T.bbox(t)}return Array.isArray(a)&&4==a.length&&(a=[[a[0],a[1]],[a[2],a[3]]]),a}function Dp(t){try{return T.lineToPolygon(t,{autoComplete:!1}).geometry}catch(e){return t}}const Pp={...Ms,...ks,getPolygonArea:Cp,getLineDistance:Lp,st_coordiates2geojson:function(t){return T.polygon([t])},projTransform:np,projTransformToGeoJSON:sp,st_c_circle2geojson:function(t,e,i="lngLat"){let s=null,a=e;if("coordinate"==i){const e=T.point(t).geometry,i=new tp.io.GeoJSONReader,n=new tp.io.GeoJSONWriter,o=i.read(e).buffer(a);s={type:"Feature",geometry:n.write(o),properties:{}}}else a=0==a?.01:a,s=T.circle(t,a,{units:"meters"});return s},st_getcenterbywkt:rp,st_getcenterbyfeature:lp,st_qdata2geojson:hp,st_geojson2qdata:function(t,e="mapLocationsLayer"){return new Promise((i=>{const s=t.features.length;let a=!1,n=[];for(let r=0;r<t.features.length;r++){const l=t.features[r],h=l.geometry;var o=null;h&&(!a&&(a=h.type.toLowerCase()),a.indexOf("line")>-1?a="polyline":a.indexOf("polygon")>-1?a="polygon":a.indexOf("point")>-1&&(a="point"),o=_s(h));const c=(r+1).toString(),p=Object.keys(l.properties||{}),u=[];p.forEach((t=>{u.push({key:t,value:l.properties[t],label:t,unit:""})})),n.push({shape:o,name:c,id:Math.random(),poiindex:c,layerkey:e,qQueryList:u,iQueryList:u,extras:[]}),s-1==r&&i(n)}}))},st_getLocation:function(t){let e=[t.lngLat.lng,t.lngLat.lat];return t.coordinate?(this.mapCoordinateType="coordinate",e=t.coordinate):this.mapCoordinateType="lngLat",e},st_readshpzip2geojson:function(t){return As.read_shapefiles_zip(t)},st_read_shp2geojson:function(t){return As.read_shapefiles(t)},st_geojsonrebuild:function(t,e="mapLocationsLayer",i=!1,s=!1,a){return new Promise((async n=>{var o={type:"FeatureCollection",features:[]};const r=t.features.length;let l=!1;const h=a;for(let a=0;a<t.features.length;a++){const c=t.features[a],p=c.geometry;h&&(p.coordinates=np(h.srid,s?1002:null,p.coordinates)),!l&&(l=p.type.toLowerCase()),l.indexOf("line")>-1?l="polyline":l.indexOf("polygon")>-1?l="polygon":l.indexOf("point")>-1&&(l="point");const u=_s(p),d=(a+1).toString();c.poiindex=d,c.id=d;const m=Object.keys(c.properties||{}),g=[];if(m.forEach((t=>{g.push({key:t,value:c.properties[t],label:t,unit:""})})),c.properties=Object.assign(c.properties||{},{name:d,data:JSON.stringify({shape:u,name:d,id:Math.random(),poiindex:d,layerkey:e,qQueryList:g,iQueryList:g,extras:[]}),layerkey:e,poiindex:d}),i){const t=rp(u),e=JSON.parse(JSON.stringify(c)),i=fs(`POINT(${t[0]} ${t[1]})`);e.geometry=i,o.features.push(e)}if(r-1==a){s&&(t=await Yc(t),i&&(o=await Yc(o))),i&&(t.features=t.features.concat(o.features)),n({data:t,shapeType:l});break}}}))},st_fitBoundsToMap:pp,st_shape2geojson2:cp,jsts_DistanceToPoint:function(t,e){const i=new tp.algorithm.distance.PointPairDistance,s=new tp.io.GeoJSONReader,a=t.geometry,n=s.read(a),o=e.geometry,r=s.read(o);tp.algorithm.distance.DistanceToPoint.computeDistance(r,n.getCoordinate(),i);const l=cp(i.toString());let h=T.lineIntersect(l,e);return h.features.length?(h=h.features[0],h.properties.dist=I.default.Utils.distance([t.geometry.coordinates,h.geometry.coordinates])):h=null,h},st_flyToCenterByWKT:function(t,e,i){const s=rp(e);t.flyTo({center:s,zoom:i||this.map.getZoom(),speed:1,curve:1,easing:t=>t})},st_addressByData:async function(t,e){let i;i="object"==typeof t?lp(t):rp(t);var s=lr.getGaodeAPIAdcodeByLocationUrl();const a=`${e||s}${i[0]},${i[1]}`;return await function(t){return new Promise((e=>{dr.get({url:t,nomessage:!0}).then((async t=>{e(t)}))}))}(a)},st_fitBoundsToQData:function(t,e,i,s,a={}){var n=t.enableTransform;hp(e,"calc",0,!1,t.sz2000sdk,n).then((e=>{var n="object"==typeof a?a:{};const o=e.data,r=T.bbox(o),l=[[r[0],r[1]],[r[2],r[3]]];s&&s({bounds:r});var h=t.getZoom();var c=.15*t.getContainer().clientWidth;c=c>=200?200:c;var p=Object.assign({padding:c,pitch:t.getPitch(),bearing:0,curve:1,maxZoom:h>=16.5?h:16.5,essential:!0},n);"number"==typeof i&&(p.maxZoom=i),setTimeout((()=>{t.fitBounds(l,p)}),10)}))},st_getbufferbydata:fp,st_calc2bearing:_p,st_calc2pitch:vp,jstsIsVaild:ep,getScaleFromResolutionDpi:mp,getResolutionFromScaleDpi:dp,normalizeScale:up,getResolutionFromZoom:gp,getZoomFromResolution:yp,st_length_point:xp,st_mergewkt:bp,st_mergegeojson:wp,convertGeoJSONCoordinate:Sp,projTransformToWkt:ip,st_wkt2bounds:Ep,st_boundsbydistance:Tp,st_clockLine:Dp,tileRowColToXY:Mp,st_calcarea2wkt:Ip},Op=function(t){let e=null;if(t&&t.indexOf("?")>-1){e=t.split("?");const i=e[1],s={},a=i.length?i.split("&"):[];let n=null,o=null,r=null,l=0;const h=a.length;for(l=0;l<h;l++)n=a[l].split("="),o=decodeURIComponent(n[0]),r=decodeURIComponent(n[1]),o.length&&(s[o]=r);return{url:e[0],params:s}}if(null===e)return{url:t,params:{}}};function kp(t){try{let e=t||"";return e=window.location.origin+e,new URL(e),!0}catch(t){return!1}}class Np{constructor(){this.tokenFlat={},this.token={}}register(t){if(!t)return;let e=[];e=t instanceof Array?t:[t];for(const t of e)t.url=this.replaceLocalhost(t.url),this.tokenFlat[t.name]=t}replaceLocalhost(t){return t.replace("{origin}",window.location.origin).replace("{localhost}",window.location.host)}async get(t){let e=null;if(!t)return e;const i=this.tokenFlat[t];if(!i)return e;const{tokenType:s}=i;switch(s){case"ARCGIS":e=await this.getArcgisToken(t);break;case"Bearer":e=await this.getBearerToken(t);break;case"UPI":e=await this.getPTToken(t);break;case"STATIC_RESOURCE":e=await this.getSTATICToken(t);break;case"STATIC":e=await i.url;break;case"CUSTOM":e=await this.getCustomToken(t)}return e}async getBearerToken(t){let e=this.token[t]||null;if(!e||this.isExpired(t)){const i=this.tokenFlat[t]||{url:""};if(i.url.indexOf("http")>-1||i.url.indexOf("https")>-1||kp(i.url))try{const t=Op(i.url),s=await yr({url:t.url,headers:i.requestHeader,data:{...i.requestBody}});s&&200===s.code&&(e=s.token)}catch(t){throw t}else e=i.url;this.token[t]=e,i.updateTokenTime=(new Date).toLocaleString()}return`sipsdToken=${e}`}async getPTToken(t){let e=this.token[t]||null;if(!e||this.isExpired(t)){const i=this.tokenFlat[t]||{url:""};if(i.url.indexOf("http")>-1||i.url.indexOf("https")>-1||kp(i.url))try{const t=Op(i.url),s=await yr({url:t.url,data:t.params});s&&200===s.code&&(e=s.token)}catch(t){throw t}else e=i.url;this.token[t]=e,i.updateTokenTime=(new Date).toLocaleString()}return`sipsdToken=${e}`}async getArcgisToken(t){let e=this.token[t]||null;if(!e||this.isExpired(t)){const i=this.tokenFlat[t]||{url:""};let s=null;if(i.url.indexOf("http")>-1||i.url.indexOf("https")>-1||kp(i.url)){const t="POST"===i.requestMethod?yr:fr;try{s=await t({url:i.url,headers:i.requestHeader,data:{...i.requestBody}})}catch(t){throw t}if(s&&"object"==typeof s){const t="object"==typeof s.data&&s.data.token||"";s="string"==typeof s.data?s.data:t}s&&(s=s.replace(/[\r\n]/g,""))}else s=i.url;e={token:s},this.token[t]=e,i.updateTokenTime=(new Date).toLocaleString()}return`token=${e.token}`}async getSTATICToken(t){let e=this.token[t]||null;if(!e){e=(this.tokenFlat[t]||{url:""}).url,this.token[t]=e}return`token=${e}`}async getCustomToken(t){let e=this.token[t]||null;if(!e||this.isExpired(t)){const i=this.tokenFlat[t],{token:s}=await i.getData();e=s,this.token[t]=e,i.updateTokenTime=(new Date).toLocaleString()}if("object"==typeof e){let t="";return Object.keys(e).forEach((i=>{t+=`${i}=${e[i]}`})),t}return e}isExpired(t){var e=!1;if(!(this.token[t]||null))return e;const i=this.tokenFlat[t],s=i.tokenExpiredMinutes,a=i.updateTokenTime;if("number"!=typeof s||!a)return e;return function(t,e){const i=Math.abs(e.getTime()-t.getTime());return Math.floor(i/6e4)}(new Date(a),new Date)>=s}}class Ap{constructor(t){this.oneMapConfig=t,this.plotselfsymbol={glyphsFonts:this.oneMapConfig.glyphsFonts||["Noto Sans Hans Regular"],pointStyle:"default",pointColor:"rgba(255, 153, 0, 0.8)",pointLightColor:"rgba(255, 0, 0, 0.8)",pointRadius:4,lineOpacity:1,fillOpacity:1,lineStyle:"soild",lineWidth:2,lineColor:"rgba(255, 153, 0, 0.8)",lineLightColor:"rgba(255, 0, 0, 0.8)",fillColor:"rgba(255, 153, 0, 0.25)",fillOutLineColor:"rgba(255, 153, 0, 0.8)",fillLightColor:"rgba(255, 0, 0, 0.25)",fillOutLineLightColor:"rgba(255, 0, 0, 0.8)",fillOutLineWidth:2,text:"文本",textColor:"rgb(0, 0, 0)",textHaloColor:"#FFF",textFontSize:"14px",textSize:{base:14,stops:[[10.9,0],[11,14]]},textHaloWidth:4,textOffset:[0,1.4],textGeoOffset:[0,-1.5],iconSize:1},this.currentSymbolStyle={},this.highLightColor={},this.setHighLightColor()}setHighLightColor(){var t=Object.assign(JSON.parse(JSON.stringify(this.plotselfsymbol)),this.oneMapConfig.renderDefaultStyle||{});this.highLightColor={circle:t.pointLightColor,line:t.lineLightColor,fill:t.fillLightColor,"fill-extrusion":t.fillLightColor}}getHighLightColor(t){return this.highLightColor[t]}getCurrentSymbolStyle(){return 0==Object.keys(this.currentSymbolStyle).length?Object.assign(JSON.parse(JSON.stringify(this.plotselfsymbol)),this.oneMapConfig.renderDefaultStyle||{}):this.currentSymbolStyle}getDrawStyle(t,e,i){var s=Object.assign(JSON.parse(JSON.stringify(this.plotselfsymbol)),this.oneMapConfig.renderDefaultStyle||{},t||{});this.currentSymbolStyle=JSON.parse(JSON.stringify(s));return{symbol:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"symbol",type:"symbol",source:"symbol",layout:{"icon-image":i.symbolname,"icon-size":s.iconSize,"icon-anchor":"bottom","icon-allow-overlap":!i.avoidance,"icon-ignore-placement":!i.avoidance,"text-font":s.glyphsFonts,"text-field":i.labelKey,"text-anchor":"bottom","text-optional":!0,"text-offset":s.textOffset,"text-allow-overlap":!1,"text-ignore-placement":!1,"text-size":s.textSize},paint:{"text-color":s.textColor,"text-halo-color":s.textHaloColor,"text-halo-width":s.textHaloWidth}}]},symbol_poi:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"symbol_poi",type:"symbol",source:"symbol_poi",layout:{"icon-image":i.symbolname,"icon-size":s.iconSize,"text-font":s.glyphsFonts,"text-field":i.labelKey,"icon-anchor":"bottom","text-optional":!0,"text-anchor":"bottom","text-offset":[0,-1],"text-allow-overlap":!0,"text-ignore-placement":!0,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-size":14},paint:{"text-color":"#FFFFFF","text-halo-color":"#FFFFFF","text-halo-width":.1}}]},point:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"point",type:"circle",source:"point",paint:{"circle-stroke-color":"#FFFFFF","circle-stroke-width":s.pointRadius/4,"circle-color":["case",["boolean",["feature-state","hover"],!1],s.pointLightColor,s.pointColor],"circle-radius":s.pointRadius}},{id:"point_label",type:"symbol",source:"point",layout:{"text-anchor":"center","symbol-placement":"point","text-font":s.glyphsFonts,"text-field":i.labelKey,"text-offset":s.textGeoOffset,"text-allow-overlap":!1,"text-ignore-placement":!1,"text-size":s.textSize},paint:{"text-color":s.textColor,"text-halo-color":s.textHaloColor,"text-halo-width":s.textHaloWidth}}]},polyline:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"polyline",type:"line",source:"polyline",filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:this.getPolylineStyle(s)},{id:"polyline_poi",type:"symbol",source:"polyline",filter:["==","$type","Point"],layout:{"icon-image":"locations_leftlist_poisymbol","icon-size":1,"text-font":s.glyphsFonts,"text-field":!1===i.layerLabelPoi?"":"{poiindex}","icon-anchor":"bottom","text-optional":!0,"text-anchor":"bottom","text-offset":[0,-1],"text-allow-overlap":!0,"text-ignore-placement":!0,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-size":14},paint:{"text-color":"#FFFFFF","text-halo-color":"#FFFFFF","text-halo-width":.1}},{id:"polyline_label",type:"symbol",source:"polyline",filter:["==","$type","LineString"],layout:{"text-anchor":"center","symbol-placement":"line","text-pitch-alignment":"viewport","text-font":s.glyphsFonts,"text-field":i.labelKey,"text-offset":s.textGeoOffset,"text-size":s.textSize,"text-allow-overlap":!1,"text-ignore-placement":!1},paint:{"text-color":s.textColor,"text-halo-color":s.textHaloColor,"text-halo-width":1}}]},polygon:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"polygon",type:"fill",source:"polygon",filter:["==","$type","Polygon"],paint:{"fill-opacity":s.fillOpacity,"fill-color":["case",["boolean",["feature-state","hover"],!1],s.fillLightColor,s.fillColor]}},{id:"polygon_fill_extrusion_3dtiles",type:"fill-extrusion",source:"polygon",filter:["all",["has","baseHeight"],["has","stretchHeight"]],paint:{"fill-extrusion-opacity":s.fillOpacity,"fill-extrusion-base":["to-number",["get","baseHeight"]],"fill-extrusion-height":["to-number",["get","stretchHeight"]],"fill-extrusion-color":["case",["boolean",["feature-state","hover"],!1],s.fillLightColor,s.fillColor]}},{id:"polygon_fill",type:"line",source:"polygon",filter:["==","$type","Polygon"],paint:{"line-opacity":s.lineOpacity,"line-color":["case",["boolean",["feature-state","hover"],!1],s.fillOutLineLightColor,s.fillOutLineColor],"line-width":s.fillOutLineWidth}},{id:"polygon_poi",type:"symbol",source:"polygon",filter:["==","$type","Point"],layout:{"icon-image":"locations_leftlist_poisymbol","icon-size":1,"text-font":s.glyphsFonts,"text-field":!1===i.layerLabelPoi?"":"{poiindex}","icon-anchor":"bottom","text-optional":!0,"text-anchor":"bottom","text-offset":[0,-1],"text-allow-overlap":!0,"text-ignore-placement":!0,"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-size":14},paint:{"text-color":"#FFFFFF","text-halo-color":"#FFFFFF","text-halo-width":.1}},{id:"polygon_label",type:"symbol",source:"polygon",filter:["==","$type","Polygon"],layout:{"text-anchor":"center","symbol-placement":"point","text-pitch-alignment":"viewport","text-font":s.glyphsFonts,"text-field":i.labelKey,"text-offset":s.textGeoOffset,"text-size":s.textSize,"text-allow-overlap":!1,"text-ignore-placement":!1},paint:{"text-color":s.textColor,"text-halo-color":s.textHaloColor,"text-halo-width":1}}]}}[e]}getPolylineStyle(t){const e={"line-color":["case",["boolean",["feature-state","hover"],!1],t.lineLightColor,t.lineColor],"line-width":t.lineWidth};let i={};return"dash"==t.lineStyle&&(i={"line-dasharray":[.2,2]}),Object.assign(e,i)}}class Rp{constructor(t,e){this.map=t,this.oneMapConfig=this.getOnemapConfig(),this.locationLayerStyle=this.map.GLSDK?this.map.GLSDK.getLocationLayerStyle():new Ap(this.oneMapConfig),this.options=e,this.id=e.id,this.virtualId=this.options.virtualId,this.cache=void 0===e.sourceCache||(null==e.sourceCache||e.sourceCache),this.layer=void 0,this.mousemove=void 0,this.mouseleave=void 0,this.click=void 0,this.baseSource=[],this.style={point:{type:"circle",paint:{"circle-color":"#ff0000","circle-radius":4},layout:{visibility:!0}}},this.rasterPaint={"raster-saturation":0},this.iQueryIdList=e.iQueryIdList||[],this.originReplace=this.oneMapConfig.originReplace,this.legendService=0,this.legendInfo=null,this.zoomEvent,this.realLayerIds=[],this.layerOpt,this.beforeId,this.minzoom=this.options.minzoom,this.maxzoom=this.options.maxzoom,this.sourceMaxZoom,this.sourceMinZoom,this.hoveredStateId,this.geoMapMarkerList=null,this.defaultStyle={},this.intanceType=null,this.layerType=this.options.layerType,this.symbolLayerEnable=!1,this.geometryType,this.mainLayerId,this.labelLayerId,this.fitBounds,this.fitBoundsResultTemp,this.projection,this.repairClockLineToPolygon=this.oneMapConfig.repairClockLineToPolygon,this.visible=!0}fitBoundsData(t){if(t&&this.fitBounds&&"object"==typeof t){let e="object"==typeof this.fitBounds?this.fitBounds:{};pp(this.map,t,null,e)}}getOnemapConfig(){return this.map.getOnemapConfig()}onAddedSourceCallback(){this.map.GLSDK&&this.map.GLSDK.onAddedSourceCallback&&this.map.GLSDK.onAddedSourceCallback(JSON.parse(JSON.stringify(this.options)),this)}onAddedLayerCallback(){this.map.GLSDK&&this.map.GLSDK.onAddedLayerCallback&&this.map.GLSDK.onAddedLayerCallback(JSON.parse(JSON.stringify(this.options)),this)}setLayerFilter(t,e){t==this.options.id||this.options.label==t||this.options.virtualId==t?this.realLayerIds.forEach((t=>{this.map.getLayer(t)&&this.map.setFilter(t,e)})):this.realLayerIds.includes(t)&&this.map.getLayer(t)&&this.map.setFilter(t,e)}bindZoomEvent(){(this.minzoom||this.maxzoom)&&(this.zoomEvent&&this.map&&this.map.off("zoom",this.zoomEvent),this.zoomEvent=()=>{this.showZoomLayer()},this.map.on("zoom",this.zoomEvent))}showZoomLayer(){var t=this.map.getZoom();t<(this.minzoom||0)||t>(this.maxzoom||24)?this.setVisible&&this.setVisible(!1):this.setVisible&&this.setVisible(!0)}getId(){return this.id}async transformData(t){let e=this.map.enableTransform,i=this.projection,s="4490";if(["local","sz2000","sz2000sdk"].includes(i)&&(i=1002),e){const a=i||e.srid;a!=s&&(t=await sp(a,s,t))}return this.map.sz2000sdk&&(i&&1002!=i&&(t=await sp(i,1002,t)),t=await this.map.MapmostSDKConvert.convertGeojson(t)),e||this.map.sz2000sdk||!i||i==s||(t=await sp(i,s,t)),t}getDefineProjectZoomOffset(t){return vr.getZoomOffset(t)}getDefineProjectBoxSR(t){return vr.getBboxSR(t)}setResolutions(t,e){vr.setResolutions(t,e)}getResolutions(t){return vr.getResolutions(t)}setDefineProject(t,e){let i=vr.getProj(e);e&&i&&t.defineProject&&t.defineProject(e,i)}formatToken(t,e){let i=[];for(let s of t){let t=s;(t.indexOf("{origin}")>-1||t.indexOf("{localhost}")>-1)&&(t=this.replaceLocalhost(t)),this.originReplace&&(t=this.replaceLocalhostToUrl(t)),e?(t=t.indexOf("{token}")>-1?t.replace("{token}",this.getOnlyTokenStr(e)):s.indexOf("?")>-1?`${t}&${e}`:`${t}${e?"?"+e:""}`,i.push(t)):i.push(t)}return i}replaceLocalhost(t){return t.replace("{origin}",window.location.origin).replace("{localhost}",window.location.host)}replaceLocalhostToUrl(t,e){const i=e?this.getUrlOrigin(e):window.location.origin;return t.replace(/^https?:\/\/[^/]+/,i)}getUrlOrigin(t){return(ir(t)?new URL(t):window.location).origin}getOnlyTokenStr(t){const e=t.split("=");return 2==e.length?e[1]:t}insertStr(t,e,i){return t.slice(0,e)+i+t.slice(e)}async formateTileUrlXYZ(t,e=""){let i=[];if(!e)return t;if("arcgis"==e.toLowerCase())t.forEach((t=>{let e=t;if(e.indexOf("/tile/{z}/{y}/{x}")<0&&e.indexOf("/_alllayers/{z}/{y}/{x}.png")<0)if(e.indexOf("?")>-1){const t=e.split("?");if(t.length>2){const t=e.lastIndexOf("?");e=this.insertStr(e,t,"/tile/{z}/{y}/{x}")}else e=`${t[0]}/tile/{z}/{y}/{x}?${t[1]}`}else e=`${e}/tile/{z}/{y}/{x}`;i.push(e)}));else if("scene"==e.toLowerCase()){let e=t;if(-1==e.indexOf("/layers/0"))if(e.indexOf("?")>-1){const t=e.split("?");e=`${t[0]}/layers/0?${t[1]}`}else e=`${e}/layers/0`;i=e}else i=t;return i}formatJsonToken(t,e){let i="";return i=null===e?t:t.indexOf("{token}")>-1?t.replace("{token}",e):t.indexOf("?")>-1?`${t}&${e}`:`${t}?${e}`,i}transformRequestByUrl(t,e,i,s,a){return t.replace("{x}","C"+e.toString(16).padStart(8,"0")).replace("{y}","R"+i.toString(16).padStart(8,"0")).replace("{z}","L"+String(s).padStart(2,"0"))}async getArcGisLegendService(t){const e={url:t=t.indexOf("?")>-1?t.replace("?","/legend?")+"&f=pjson":`${t}/legend?f=pjson`,method:"get",nocode:!0,nomessage:!0,notoken:!0};return await dr.request(e)}async getLegend(t){if(1===this.legendService&&!this.legendInfo){var e=await this.getArcGisLegendService(t);e&&(this.legendInfo=e.layers.filter((t=>this.layersIndexArr.includes(t.layerId.toString()))))}}realLayerIdsHighLight(t){this.realLayerIds.forEach((e=>{const i=this.map.getLayer(e);i&&this.highLight(i,t)}))}highLight(t,e){if(!this.highLightLayerAble)return;const i=t?t.source:this.id;if(this.map.getSource(i)){const h=t||this.map.getLayer(i),c=h?h["source-layer"]||h.sourceLayer:null;var s={source:i};if(c&&(s.sourceLayer=c),h){const t=h.type;if("symbol"!=t){var a=this.map.getPaintProperty(h.id,t+"-color");if(-1==(a="object"==typeof a?JSON.stringify(a):a).indexOf("feature-state")){var n="object"==typeof a?JSON.parse(a):a,o=this.locationLayerStyle.getHighLightColor(t),r=["case",["boolean",["feature-state","hover"],!1],o,n];o&&this.map.setPaintProperty(h.id,t+"-color",r)}}else this.highLightSymbol(h,e)}if(Array.isArray(e)){var l=JSON.parse(JSON.stringify(s));e.forEach((t=>{l.id=t,this.map.setFeatureState(l,{hover:!0})}))}else s.id=e,this.map.setFeatureState(s,{hover:!0});this.hoveredStateId=e}}unHighLight(t,e){if(!this.highLightLayerAble)return;t||(t={source:this.id}),this.hoveredStateId&&this.map.getSource(t.source)&&(this.map.removeFeatureState(t),this.hoveredStateId=null);(e||Object.keys(this.defaultStyle)).forEach((t=>{t&&this.defaultStyle[t]&&this.map.getLayer(t)&&this.map.setLayoutProperty(t,"icon-image",this.defaultStyle[t])}))}highLightSymbol(t,e){const i=t.id,s=i;var a,n=this.map.getLayoutProperty(i,"icon-image");if(this.defaultStyle[i]?this.map.setLayoutProperty(i,"icon-image",this.defaultStyle[i]):this.defaultStyle[i]=n,a="string"==typeof this.defaultStyle[s]?`${this.defaultStyle[s].replace(/_light/g,"")}_light`:Array.isArray(this.defaultStyle[s])?this.getLightLastMarker():["concat",this.defaultStyle[s],"_light"],this.map.hasImage(a)||Array.isArray(this.defaultStyle[s])){var o=Array.isArray(e)?e:[e.toString()],r=["match",["to-string",["get","id"]],...this.getMatchExpression(o,a),this.defaultStyle[s]];this.map.setLayoutProperty(s,"icon-image",r)}if(this.isSDFMarker()){var l=this.map.getPaintProperty(i,"icon-color");if(l)if(-1==("object"==typeof l?JSON.stringify(l):l).indexOf("feature-state")){var h=["case",["boolean",["feature-state","hover"],!1],this.locationLayerStyle.getHighLightColor("circle"),l];this.map.setPaintProperty(i,"icon-color",h)}}}getGeometryType(t){if(this.geometryType)return this.geometryType;var e="";switch(t.type){case"Point":case"MultiPoint":e="点";break;case"LineString":case"MultiLineString":e="线";break;case"Polygon":case"MultiPolygon":e="面"}return e}getMatchExpression(t,e){var i=[];return t.forEach((t=>{i.push(t),i.push(e)})),i}getLightLastMarker(){if(this.geoMapMarkerList){const t=this.geoMapMarkerList.length,e=this.geoMapMarkerList[t-1].markerName;return e.indexOf("_light")>-1?e:"null"}return"null"}getHighLightEnable(){return!!this.geoMapMarkerList&&(this.geoMapMarkerList.filter((t=>t.markerName.indexOf("_light")>-1)).length>0&&this.highLightLayerAble)}isSDFMarker(){return this.geoMapMarkerList.filter((t=>1==t.sdf)).length>0}isNumber(t){return"number"==typeof t&&!isNaN(t)}getRotation(t){return{x:t["model-rotation-x"]||0,y:t["model-rotation-y"]||0,z:t["model-rotation-z"]||0}}getTranslate(t){return{x:t["model-translate-x"]||0,y:t["model-translate-y"]||0,z:t["model-translate-z"]||0}}clear(t=!1){this.zoomEvent&&this.map&&this.map.off("zoom",this.zoomEvent),this.clearBefore&&this.clearBefore(),this.baseSource=[],this.realLayerIds=[],this.map.GLSDK.clearOverlayByIcxCode(this.iQueryIdList),this.click&&this.map.off("click",this.id,this.click),this.mouseleave&&this.map.off("mouseleave",this.id,this.mouseleave),this.mousemove&&this.map.off("mousemove",this.id,this.mousemove),this.mousemove=null,this.mouseleave=null,this.click=null,this.removeModelHandler&&this.removeModelHandler();const e=this.map.getLayer(this.id);e&&(e.source&&this.baseSource.push(e.source),this.map.removeLayer(this.id));const i=this.map.getLayer(this.layer.id);if(i&&(i.source&&this.baseSource.push(i.source),this.map.removeLayer(this.layer.id)),this.map.M.layerManager.removeLayerExById(this.layer.id),this.layer.layers){const t=this.map.M.layerManager.getlayersExTypeArr();this.layer.layers.forEach((e=>{let i,s=e.id;const a=JSON.parse(e.expandPro);a.id&&(s=a.id),t.includes(a.type)?this.map.M.layerManager.removeLayerExById(s):(i=this.map.getLayer(s),i&&(this.baseSource.push(i.source),this.map.removeLayer(s)))}))}t&&(this.map.getSource(this.id)&&this.map.removeSource(this.id),this.baseSource.forEach((t=>{this.map.getSource(t)&&this.map.removeSource(t)})))}}class Fp extends Rp{constructor(t,e){super(t,e),this.isPrjaddRasterLayer2=!1,this.init()}async init(){const{map:t}=this,{id:e,source:i,layer:s,projection:a,serverType:n,token:o,url:r,visible:l}=this.options;this.visible=l;const h=this.options._token;if(!t.getSource(e)){const l=await this.formateTileUrlXYZ(r?[r]:i.tiles,n);i.tiles=this.formatToken(l,h||o),this.sourceMaxZoom=Yo.getQueryString("maxzoom",i.tiles[0]),this.sourceMinZoom=Yo.getQueryString("minzoom",i.tiles[0]),a?(s.project=a,s.source=i,this.isPrjaddRasterLayer2=!0):t.addSource(e,i)}this.layer=s,this.layer.requestMode="image",this.layer.source&&"object"==typeof this.layer.source&&(this.layer.source.requestMode="image")}async addToMap(t){if(!1===this.visible&&(this.layer.layout?this.layer.layout.visibility="none":this.layer.layout={visibility:"none"}),this.options.minzoom&&(this.layer.minzoom=this.options.minzoom),this.options.maxzoom&&(this.layer.maxzoom=this.options.maxzoom),this.isPrjaddRasterLayer2&&"local"!=this.layer.project.toLowerCase())await this.addRasterLayer2ToMap(t);else{const{map:e}=this;let i;if("number"==typeof this.options.opacity&&this.layer.paint){const t=`${this.layer.type}-opacity`;this.layer.paint[t]=this.options.opacity}t&&(i=e.getLayer(t)),i?e.addLayer(this.layer,t):e.addLayer(this.layer),this.onAddedLayerCallback()}}addRasterLayer2ToMap(t){const{map:e}=this;let i;if("4326"==this.layer.project&&(this.layer.source.zoomOffset=-1),this.layer.source&&void 0!==this.layer.source.zoomOffset){var s=Math.abs(this.layer.source.zoomOffset),a=this.layer.source.resolutions.length;this.layer.source.minZoom=s,this.layer.source.maxZoom=this.layer.source.minZoom+(a-s)-1,s>0&&s<a&&(this.layer.source.resolutions=this.layer.source.resolutions.splice(s))}this.sourceMaxZoom&&"object"==typeof this.layer.source&&(this.layer.source.maxZoom=Number(this.sourceMaxZoom)),this.sourceMinZoom&&"object"==typeof this.layer.source&&(this.layer.source.minZoom=Number(this.sourceMinZoom)),t&&(i=e.getLayer(t)),i?e.addRasterLayer2(this.layer,t):e.addRasterLayer2(this.layer),"number"==typeof this.options.opacity&&this.layer.paint&&this.setOpacity(this.options.opacity,this.layer.id),this.onAddedLayerCallback()}getOpacity(t){const e=t||this.getId(),i=this.map.getLayer(e);if(i.project)return i.paint["raster-opacity"]||1;if(i.implementation)return i.implementation.opacity||1;const s=this.map.getPaintProperty(e,"raster-opacity");return"number"==typeof s?s:1}setOpacity(t,e){const i=e||this.getId(),s=this.map.getLayer(i);s.implementation?(s.implementation.opacity=t,this.map.setPaintProperty(i,"raster-opacity",t)):this.map.setPaintProperty(i,"raster-opacity",t)}setVisible(t,e){const i=e||this.getId();this.map.getLayer(i)&&this.map.setLayoutProperty(i,"visibility",t?"visible":"none"),this.visible=t}}class Bp extends Rp{constructor(t,e){super(t,e),this.vectorType=null,this.highLightLayerAble=!0,this.intanceType="vector"}async init(){const{map:t}=this,{id:e,source:i,layer:s,_token:a,serverType:n,geoMapMarkerList:o,geometryType:r}=this.options;this.geoMapMarkerList=o,this.geometryType=r;if(!t.getSource(e)){if(!i.tiles&&"mapmost"==n.toLowerCase()&&i.url);else if(i.tiles=this.formatToken(i.tiles,a),i.tiles&&"mapmost"==n.toLowerCase()&&-1==i.tiles[0].indexOf("{z}/{x}/{y}.pbf")){i.url=i.tiles[0],delete i.tiles;var l=i.url;(l.indexOf("f=getTile")>-1||this.originReplace)&&(i.tiles=await this.getTileData(l),delete i.url)}i.tiles||delete i.tiles,i.url||delete i.url,t.addSource(e,i)}this.layer=s,this.vectorType=s.type,this.symbolLayerEnable=this.getHighLightEnable()}async getTileData(t){const e={url:t,method:"get",nocode:!0,nomessage:!0,notoken:!0},i=(await dr.request(e)).tiles;let s=[];for(let e of i)e=this.replaceLocalhostToUrl(e,t),s.push(e);return s}addToMap(t){const{map:e}=this;let i;t&&(i=e.getLayer(t)),i?this.addLayers(!0,t):this.addLayers(!1)}addLayers(t=!1,e){const{map:i}=this;if(this.layer.layers)this.layer.layers.forEach((s=>{const a=JSON.parse(s.expandPro);if(a.id=a.id||s.id,a.source=this.layer.source,this.options.minzoom&&(a.minzoom=this.options.minzoom),this.options.maxzoom&&(a.maxzoom=this.options.maxzoom),(this.options.opacity||0==this.options.opacity)&&"symbol"!=a.type){const t=`${a.type}-opacity`;a.paint[t]=this.options.opacity}const n=i.GLSDK.getLayerFilter(this.options,a)||a.filter||null;var o=JSON.parse(JSON.stringify(a));n&&(o.filter=n),t?i.addLayer(o,e):i.addLayer(o),!this.realLayerIds.includes(o.id)&&this.realLayerIds.push(o.id)}));else{if(this.options.minzoom&&(this.layer.minzoom=this.options.minzoom),this.options.maxzoom&&(this.layer.maxzoom=this.options.maxzoom),(this.options.opacity||0==this.options.opacity)&&"symbol"!=this.layer.type){const t=`${this.layer.type}-opacity`;this.layer.paint[t]=this.options.opacity}const a=i.GLSDK.getLayerFilter(this.options,this.layer)||this.layer.filter||null;var s=JSON.parse(JSON.stringify(this.layer));a&&(s.filter=a),delete s.layers,t?i.addLayer(s,e):i.addLayer(s),!this.realLayerIds.includes(s.id)&&this.realLayerIds.push(s.id),"面"==this.geometryType&&"fill"==s.type&&(this.mainLayerId=s.id)}}getOpacity(t,e=!1){const i=e?this.mainLayerId||t||this.realLayerIds[0]:t||this.mainLayerId||this.realLayerIds[0];if(!i)return 1;{const t=this.map.getLayer(i)||null;var s;if(t)return"number"==typeof(s="symbol"==t.type?this.map.getPaintProperty(i,"icon-opacity")||this.map.getPaintProperty(i,"text-opacity")||1:this.map.getPaintProperty(i,`${t.type}-opacity`))?s:1}return 1}setOpacity(t,e,i=!1){const s=e,a=this.map.getLayer(s)||null;if(a&&!this.realLayerIds.includes(s))if("symbol"==a.type)this.map.setPaintProperty(s,"icon-opacity",t),this.map.setPaintProperty(s,"text-opacity",t);else{if(i&&"面"==this.geometryType&&"line"==a.type)return;this.map.setPaintProperty(s,`${a.type}-opacity`,t)}else this.realLayerIds.forEach((e=>{const s=e,a=this.map.getLayer(s)||null;if(a)if("symbol"==a.type)this.map.setPaintProperty(s,"icon-opacity",t),this.map.setPaintProperty(s,"text-opacity",t);else{if(i&&"面"==this.geometryType&&"line"==a.type)return;this.map.setPaintProperty(s,`${a.type}-opacity`,t)}}))}}class Gp extends Rp{constructor(t,e){super(t,e),this.vectorType=null,this.waterGeo=null,this.waterDy=null,this.LayerModel=null,this.serverType=null,this.highLightLayerAble=!0,this.intanceType="geojson",this.fileId=null,this.fieldList=[],this.isAddLabelPoint=!1,this.exLayerPaintDefault={grid:{cellSize:10,colorRange:{0:"#1a9850",3:"#9fd568",5:"#ffffbf",10:"#fd9d62",30:"#d73027"},coverage:.5,heightMultiplier:1,extrudable:!0,ambientFactor:.22,directionalFactor:.1}},this.geojsonIsRequest=!1,this.init()}init(){const{map:t}=this,{id:e,source:i,layer:s,_token:a,serverType:n,fileId:o,geoMapMarkerList:r,geometryType:l,fitBounds:h,projection:c}=this.options;if(this.geoMapMarkerList=r,this.geometryType=l,this.fileId=o,this.serverType=n,this.fitBounds=h,this.projection=c,"DynamicWater"==s.type)return this.layer=s,void(this.vectorType=s.type);const p=t.getSource(e);p?this.fitBoundsData(p._data):(i.data=this.formatJsonToken(i.data,a),i.data.indexOf("isrequest=1")>-1||["File","iQueryCopy"].includes(this.serverType)||t.sz2000sdk?(this.geojsonIsRequest=!0,this.addSourceGeoJson(e,i,s,i.data)):this.addSourceGeoJson(e,i,s)),this.layer=s,this.vectorType=s.type,this.symbolLayerEnable=this.getHighLightEnable()}setSourceByRequest(t,e,i,s){const a=this.serverType;if(["File","iQueryCopy"].includes(a)){const n=this.map.GLSDK.getOnemapConfig(),o=("iQueryCopy"==a?n.customURL_ReadGeoJSONByIQuery:n.customURL_ReadUploadFile)+"/"+(this.fileId?this.fileId:e);dr[s||"get"]({url:o,nomessage:!0}).then((async s=>{var a=s;if(a&&(s.features&&(a={data:[s],code:200}),200==a.code&&a.data.length>0)){var n={features:[],type:"FeatureCollection"};if(a.data.forEach((t=>{"FeatureCollection"==t.type?n.features=n.features.concat(t.features):n.features=n.features.concat(t.Collection.features)})),"File"==this.serverType){const t=function(t){try{let e=t?t.toLowerCase():"";const i=/(\.dwg|\.dgn|\.dxf)$/i,s=new URL(e).pathname;return i.test(s)}catch(t){return!1}}(e);if(t){for(let t=n.features.length-1;t>=0;t--){const e=n.features[t],i=e.geometry;if(i){const s=i.type;if("GeometryCollection"===s){let i=[],s=await this.getGeometries(e.properties,e.geometry.geometries,i);n.features.splice(t,1,...s)}else this.repairClockLineToPolygon&&["MultiLineString","LineString"].includes(s)&&(e.geometry=await Dp(i))}}}}n=await this.transformData(n),await this.addFeatureId(n),this.map.getSource(t)&&this.map.getSource(t).setData(n),this.calcGeoJsonCenterToLabel(),i&&i(n),this.fitBoundsData(n)}}))}else{const a=s||"post",n=e.replace("?isrequest=1","").replace("&isrequest=1","");dr[a]({url:n,nocode:!0,nomessage:!0}).then((async e=>{let s=e;e&&(Array.isArray(e.data)?(s=e.data[0]||{},s.type&&"Feature"===s.type&&(s={features:e.data||[],type:"FeatureCollection"})):e.data&&(s=e.data),s=await this.transformData(s),this.waterGeo=s,await this.addFeatureId(s),this.map.getSource(t)&&this.map.getSource(t).setData(s),i&&i(s),this.fitBoundsData(s))}))}}getGeometries(t,e,i){return e.forEach((e=>{if(e.geometries)this.getGeometries(t,e.geometries,i);else{const s=e.type;this.repairClockLineToPolygon&&["MultiLineString","LineString"].includes(s)&&(e.geometry=Dp(e.geometry));let a={type:"Feature",properties:t,geometry:e};i.push(a)}})),i}addFeatureId(t){t.features.map(((t,e)=>{if(void 0===t.id){var i=t.properties,s=i.id?i.id.toString():e.toString();t.id=s,0==this.fieldList.length&&i&&(this.fieldList=Object.keys(i))}return t}))}calcGeoJsonCenterToLabel(){if(!this.isAddLabelPoint){var t=this.map.getSource(this.id);if(t){var e=JSON.parse(JSON.stringify(t._data));if(0==(e?e.features.length:0))return;var i=e.features.filter((t=>{const e=t.properties;return(!t.geometry||!e||"point"!=t.geometry.type.toLowerCase()||void 0===e.Text)&&t.geometry})),s=i[0];if(s.properties&&(this.fieldList=Object.keys(s.properties)),this.geometryType=this.getGeometryType(s.geometry),e.features.findIndex((t=>t.properties&&t.properties.openLabel))>-1)return void(this.isAddLabelPoint=!0);var a=[];i.forEach((t=>{var e=JSON.parse(JSON.stringify(t));"point"!=e.geometry.type.toLowerCase()&&(e.geometry=T.centroid(e).geometry),e.properties?e.properties.openLabel="1":e.properties={openLabel:"1"},a.push(e)})),e.features=e.features.concat(a),t.setData(e),this.isAddLabelPoint=!0}}}addSourceGeoJson(t,e,i,s){const a={...e};if(s&&(a.data={features:[],type:"FeatureCollection"}),a.id&&delete a.id,i.layers&&i.layers.length){const t=JSON.parse(i.layers[0].expandPro);t.cluster&&Object.assign(a,t.cluster)}a&&(a.tolerance=.001),a.fillMetrics=!0,this.map.addSource(t,a),s&&"grid"!=i.type&&this.setSourceByRequest(t,s),this.onAddedSourceCallback()}addToMap(t){if("DynamicWater"==this.vectorType)return void this.addDynamicWater();const{map:e}=this;let i;t&&(i=e.getLayer(t)),i?this.addLayers(!0,t):this.addLayers(!1)}addLayers(t=!1,e){if(this.layer.layers)this.layer.layers.forEach((i=>{let s=JSON.parse(i.expandPro);if(s.id||(s.id=i.id),s.source=this.layer.source,"DynamicWater"==s.type)this.addDynamicWater(s);else{if("grid"===s.type){const i=s.paint||{};return s=Object.assign(s,this.exLayerPaintDefault.grid,i),void this.addGridLayer(s,t,e)}this.addLayersHandler(s,t,e)}}));else{if(""==this.layer.layers&&delete this.layer.layers,"grid"===this.vectorType){const i=this.layer.paint||{};return this.layer=Object.assign(this.layer,this.exLayerPaintDefault.grid,i),void this.addGridLayer(this.layer,t,e)}this.addLayersHandler(this.layer,t,e)}}addLayersHandler(t,e,i){const s=t,{map:a}=this;if(a.M.layerManager.getlayersExTypeArr().includes(s.type))return void a.M.layerManager.addLayerEx({id:s.id,type:s.type,layer:s,source:this.options.source,geoMapMarkerList:this.options.geoMapMarkerList,options:this.options});if(this.options.minzoom&&(s.minzoom=this.options.minzoom),this.options.maxzoom&&(s.maxzoom=this.options.maxzoom),(this.options.opacity||0==this.options.opacity)&&"symbol"!=s.type){const t=`${s.type}-opacity`;s.paint[t]=this.options.opacity}const n=s.id,o=a.GLSDK.getLayerFilter(this.options,s)||s.filter||null;try{if(a.getLayer(n))return void a.setFilter(n,o);var r=JSON.parse(JSON.stringify(s));o&&(r.filter=o),void 0!==r.openLabel&&(this.calcGeoJsonCenterToLabel(),delete r.openLabel,this.labelLayerId=r.id),e?a.addLayer(r,i):a.addLayer(r),!this.realLayerIds.includes(n)&&this.realLayerIds.push(n),"面"==this.geometryType&&"fill"==r.type&&(this.mainLayerId=r.id),this.onAddedLayerCallback()}catch(t){}}addDynamicWater(t){if(this.waterGeo)this.addDynamicWaterHandler(this.waterGeo,t);else{var{url:e}=this.options;dr.get({url:e,nocode:!0,nomessage:!0}).then((t=>{let e=t;t.data&&(e=t.data),this.waterGeo=e,this.addDynamicWaterHandler(e)}))}}addDynamicWaterHandler(t,e={}){var i=this.map.getOnemapConfig();const s={id:e.id||this.layer.id,type:"model",exposure:1.72,callback:(e,s)=>{const a=s;window.LayerModel=s,t.features.map((t=>(this.waterDy=a.addDynamicWater({speed:.1,baseTexture:`${i.images}/material/source_images_water.png`,noiseTexture:`${i.images}/material/source_images_Water_1_M_Normal.jpg`,data:t.geometry.coordinates,opacity:.8}),t)))}};this.map.addLayer(s)}addGridLayer(t,e,i){const s=t,{map:a}=this,n=a.getSource(this.id);let o="get";if(n){var r=JSON.parse(JSON.stringify(n._data));if("object"==typeof r){let t=JSON.parse(JSON.stringify(r));if(!(t&&t.features&&0==t.features.length&&this.geojsonIsRequest))return s.data=this.getGridCoordinates(t),void this.addLayersHandler(s,e,i);r=this.options.source.data,o="post"}this.setSourceByRequest(this.id,r,(t=>{let a=JSON.parse(JSON.stringify(t));s.data=this.getGridCoordinates(a),this.addLayersHandler(s,e,i)}),o)}}getGridCoordinates(t){return t.features.filter((t=>t.geometry&&t.geometry.coordinates)).map((t=>t.geometry.coordinates))}getOpacity(t,e=!1){const i=e?this.mainLayerId||t||this.realLayerIds[0]:t||this.mainLayerId||this.realLayerIds[0];if(!i)return 1;{const t=this.map.getLayer(i)||null;var s;if(t)return"number"==typeof(s="symbol"==t.type?this.map.getPaintProperty(i,"icon-opacity")||this.map.getPaintProperty(i,"text-opacity")||1:t.implementation?t.implementation.opacity:this.map.getPaintProperty(i,`${t.type}-opacity`))?s:1}return 1}setOpacity(t,e,i=!1){const s=e,a=s?this.map.getLayer(s):null;if(a&&!this.realLayerIds.includes(s))if("symbol"==a.type)this.map.setPaintProperty(s,"icon-opacity",t),this.map.setPaintProperty(s,"text-opacity",t);else if(a.implementation)a.implementation.opacity=t;else{if(i&&"面"==this.geometryType&&"line"==a.type)return;this.map.setPaintProperty(s,`${a.type}-opacity`,t)}else this.realLayerIds.forEach((e=>{const s=e,a=this.map.getLayer(s)||null;if(a)if("symbol"==a.type)this.map.setPaintProperty(s,"icon-opacity",t),this.map.setPaintProperty(s,"text-opacity",t);else if(a.implementation)a.implementation.opacity=t;else{if(i&&"面"==this.geometryType&&"line"==a.type)return;this.map.setPaintProperty(s,`${a.type}-opacity`,t)}}))}removeModelHandler(){window.LayerModel&&this.waterDy&&window.LayerModel.removeModel(this.waterDy)}}class zp extends Rp{constructor(t,e){super(t,e),this.styleURL="",this.init(),this.layerType="StyleLayer",this.mapid=t._container.id,this.layerInitOpacityTemp={}}async init(){const{id:t,layer:e,url:i,_token:s}=this.options;this.styleURL=i,this.styleURL=this.formatJsonToken(i,s),this.layer=e}async addToMap(){this.setStyleRemain(this.map,this.styleURL)}async setStyleRemain(t,e){const i={url:e,nocode:!0,nomessage:!0,notoken:!0,method:"get"},s=await dr.request(i);t.style.stylesheet=s;const a=s.layers,n=Object.keys(s.sources),o=n.length;new Promise((e=>{n.forEach(((i,a)=>{t.getSource(i)||t.addSource(i,s.sources[i]),a==o-1&&e()}))})).then((()=>{a.forEach((e=>{t.getLayer(e.id)&&t.removeLayer(e.id),t.addLayer(e,"t_base")})),t.mapIsLoading=!1}))}getOpacity(){return 1}setOpacity(t){if("number"!=typeof t)return;var e=this.map.style.stylesheet;if(!e)return;e.layers.forEach((e=>{var i=e.id,s=e.type,a=s+"-opacity";if(this.map.getLayer(i)){if(void 0===this.layerInitOpacityTemp[i])if(this.layerInitOpacityTemp[i]={},"symbol"==s){var n=this.map.getPaintProperty(i,"icon-opacity"),o=this.map.getPaintProperty(i,"text-opacity");this.layerInitOpacityTemp[i]={"icon-opacity":void 0===n?1:n,"text-opacity":void 0===o?1:o}}else{var r=this.map.getPaintProperty(i,a);this.layerInitOpacityTemp[i][a]=void 0===r?1:r}if("symbol"==s){var l=this.calcOpacity(this.layerInitOpacityTemp[i]["icon-opacity"],t),h=this.calcOpacity(this.layerInitOpacityTemp[i]["text-opacity"],t);this.map.getLayoutProperty(i,"icon-image")&&this.map.setPaintProperty(i,"icon-opacity",l),this.map.getLayoutProperty(i,"text-field")&&this.map.setPaintProperty(i,"text-opacity",h)}else{var c=this.calcOpacity(this.layerInitOpacityTemp[i][a],t);this.map.setPaintProperty(i,a,c)}}}))}calcOpacity(t,e){var i=t-(1-e);return i<0&&(i=0),i>1&&(i=1),i}clear(){var t=this.map.style.stylesheet;if(!t)return;t.sprite,t.glyphs;const e=t.layers,i=Object.keys(t.sources),s=e.length;new Promise((t=>{0==s&&t(),e.forEach(((e,i)=>{this.map.getLayer(e.id)&&this.map.removeLayer(e.id),i==s-1&&t()}))})).then((()=>{i.forEach((t=>{this.map.getSource(t)&&this.map.removeSource(t)})),this.map.ExAPI.addDefaultStyle2Map(this.map,this.oneMapConfig.mapmostStyleJson),this.map.baseMapStyleSheetChange=!0}))}}class jp extends Rp{constructor(t,e){super(t,e),this.styleURL="",this.init(),this.mapid=t._container.id,this.sources=null}async init(){const{id:t,layer:e,url:i}=this.options,s=this.options._token;this.styleURL=i,this.styleURL=this.formatJsonToken(i,s),this.layer=e}async addSource(){const t={url:this.styleURL,method:"get",nocode:!0,nomessage:!0,notoken:!0},e=await dr.request(t);return e&&(this.sources=e.sources,this.layer.layers=e.layers),new Promise((t=>{var e=Object.keys(this.sources),i=e.length;0==i&&t(),e.forEach(((e,s)=>{!this.map.getSource(e)&&this.map.addSource(e,this.sources[e]),s==i-1&&t()}))}))}async addToMap(t){this.loadSources?this.addLayer(t):this.addSource().then((()=>{this.addLayer(t)}))}addLayer(t){this.layer.layers&&this.layer.layers.forEach((e=>{this.map.addLayer(e,t)}))}getOpacity(){return 1}setOpacity(){}clear(t=!1){if(this.layer.layers){const e=this.layer.layers.length;new Promise((t=>{0==e&&t(),this.layer.layers.forEach(((i,s)=>{let a=i.id;this.map.removeLayer(a),e-1==s&&t()}))})).then((()=>{t&&Object.keys(this.sources).forEach((t=>{this.map.getSource(t)&&this.map.removeSource(t)}))}))}}}class Up extends Rp{constructor(t,e){super(t,e);const i=t.M.view.get();this.epsg4528="4528"==i.srid,this.epsg4527="4527"==i.srid,this.isProjection=!!t.projection,this.zoomOffset=i.zoomOffset,this.layersIndexArr=[]}async init(){const{source:t,layer:e,tileInfo:i,projection:s,serverType:a,url:n,legendService:o,layersIndex:r,visible:l}=this.options;this.visible=l,this.layersIndex=r||"0",this.legendService=o,this.layersIndexArr=["0"];const h=this.options._token,c=Object.assign(t||{},i),p=await this.formateTileUrlXYZ(n?[n]:c.tiles,a);c.tiles=this.formatToken(p,h),this.isProjection&&this.zoomOffset&&Object.assign(c,{zoomOffset:this.zoomOffset}),s&&(delete e.source,e.project=s);const u=Object.assign({source:c},e);if(this.epsg4528&&Object.assign(u,{project:4528}),this.layer=u,this.map.M.layerManager.layersLegend[this.id]&&"Arcgis"!=a)return;let d=this.layer.source.tiles[0];await this.getLegend(d.replace("/tile/{z}/{y}/{x}","").replace(".png","")),this.sourceMaxZoom=Yo.getQueryString("maxzoom",d),this.sourceMinZoom=Yo.getQueryString("minzoom",d)}addToMap(t){!1===this.visible&&(this.layer.layout?this.layer.layout.visibility="none":this.layer.layout={visibility:"none"}),this.options.minzoom&&(this.layer.minzoom=this.options.minzoom),this.options.maxzoom&&(this.layer.maxzoom=this.options.maxzoom);const{map:e}=this;let i;if("number"==typeof this.options.opacity&&this.layer.paint){const t=`${this.layer.type}-opacity`;this.layer.paint[t]=this.options.opacity}t&&(i=e.getLayer(t)),i?this.addLayer(this.layer,t):this.addLayer(this.layer)}addLayer(t,e){if(t.source&&void 0!==t.source.zoomOffset){var i=Math.abs(t.source.zoomOffset),s=t.source.resolutions.length;t.source.minZoom=i,t.source.maxZoom=t.source.minZoom+(s-i)-1,i>0&&i<s&&(t.source.resolutions=t.source.resolutions.splice(i));var a=this.getDefineProjectZoomOffset(t.project);if(a){t.source.zoomOffset=a;i=Math.abs(a);t.source.minZoom=i,t.source.maxZoom=i+(s-i)}this.setResolutions(t.project,t.source.resolutions)}const{map:n}=this;if(t){if("4527"===t.project?n.defineProject("4527","+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=39500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs"):this.setDefineProject(n,t.project),n.getSource(t.id)&&n.removeSource(t.id),"arcgis-tile-iis"==t.type&&(t.transformRequest=(e,i,s,a)=>{var n=t.source.tiles[0].replace("/tile/{z}/{y}/{x}","/_alllayers/{z}/{y}/{x}.png");return n=this.transformRequestByUrl(n,e,i,s,a)}),"arcgis-tile-iis10"==t.type&&(t.source.tiles[0]=t.source.tiles[0].replace("/tile/{z}/{y}/{x}","/_alllayers/{z}/{y}/{x}.png"),this.options.minzoom&&this.options.minzoom>t.source.minZoom&&(t.source.minZoom=this.options.minzoom),this.options.maxzoom&&this.options.maxzoom<t.source.maxZoom&&(t.source.maxZoom=this.options.maxzoom)),"wmts"==t.type){var o=t.source.tiles[0];const e=t.source.style||"default";o+=`${o.indexOf("?")>-1?"&":"?"}service=WMTS&request=GetTile&format=image/png&layer=${this.layersIndex}&style=${e}&tilematrix={z}&tilerow={y}&tilecol={x}`,t.source.tiles[0]=o}n.sz2000sdk&&(t.project="SZ2000"),t.requestMode="image",t.source&&"object"==typeof t.source&&(t.source.requestMode="image"),this.sourceMaxZoom&&"object"==typeof t.source&&(t.source.maxZoom=Number(this.sourceMaxZoom)),this.sourceMinZoom&&"object"==typeof t.source&&(t.source.minZoom=Number(this.sourceMinZoom)),e?n.sz2000sdk||t.project&&!["3857","local","sz2000"].includes(t.project.toString().toLowerCase())?(n.addRasterLayer2(t,e),"number"==typeof this.options.opacity&&this.setOpacity(this.options.opacity)):n.addLayer(t,e):n.sz2000sdk||t.project&&!["3857","local","sz2000"].includes(t.project.toString().toLowerCase())?(n.addRasterLayer2(t),"number"==typeof this.options.opacity&&this.setOpacity(this.options.opacity)):n.addLayer(t),this.onAddedLayerCallback()}}getOpacity(t){const e=t||this.getId(),i=this.map.getLayer(e);if(i.project)return i.paint["raster-opacity"]||1;if(i.implementation)return i.implementation.opacity||1;const s=this.map.getPaintProperty(e,"raster-opacity");return"number"==typeof s?s:1}setOpacity(t,e){const i=e||this.getId();this.map.getLayer(i)&&this.map.setPaintProperty(i,"raster-opacity",t)}setVisible(t,e){const i=e||this.getId();this.map.getLayer(i)&&this.map.setLayoutProperty(i,"visibility",t?"visible":"none"),this.visible=t}}class Vp extends Rp{constructor(t,e){super(t,e),this._queryParams={format:"PNG32",transparent:!0},this.layersIndexArr=[]}async init(){const{source:t,layer:e,tileInfo:i,_token:s,projection:a,url:n,layersIndex:o,layerDefs:r,geometryType:l,legendService:h}=this.options;this.legendService=h,this.layersIndexArr=o?o.split(","):["0"];const c=ir(n)?Object.fromEntries(new URL(n).searchParams):{},{srid:p}=this.map.M.view.data,u=this._renderParams(Object.assign({bbox:this.getBbox(a),bboxSR:a||p,imageSR:a||p},c,o?{layers:o}:{},r?{layerDefs:r}:{}));i.query=u;const d=Object.assign(i,t||{});d.tiles=this.formatToken(d.tiles,s),this.map.projection&&Object.assign(d,{bboxSR:3857,tileSize:512}),c.size&&(d.tileSize=parseInt(c.size.split(",")[0]));const m=Object.assign({source:d},e);if(this.layer=m,this.layer.project=a||this.map.projection||this.map.M.view.data.srid||"4490","点"===l&&(this.rasterPaint["raster-saturation"]=0),this.map.M.layerManager.layersLegend[this.id])return;let g=this.layer.source.tiles[0];await this.getLegend(g),this.bindZoomEvent()}addToMap(t){this.options.minzoom&&(this.layer.minzoom=this.options.minzoom),this.options.maxzoom&&(this.layer.maxzoom=this.options.maxzoom);const{map:e}=this;let i;t&&(i=e.getLayer(t)),i?this.addLayer(this.layer,t):this.addLayer(this.layer)}addLayer(t,e){const{map:i}=this;this.setDefineProject(i,t.project);let s=t.source.tiles[0];s=Qo(s,"size");const a=this._queryParams.layerDefs;var n="";a&&(n=window.encodeURIComponent(a));const o=this._queryParams.layers,r=Object.assign(this.rasterPaint,t.paint||{}),l={url:s,layerDefs:n,format:this._queryParams.format,layers:o,transparent:!0,useExtent:t.useExtent||!1},h=this.getDefineProjectBoxSR(t.project);Object.assign(l,h);const c=this.getResolutions(t.project);c&&(l.resolutions=c);const p={id:t.id,project:t.project,paint:r,type:"raster",source:l};i.sz2000sdk&&(p.project="SZ2000"),this.beforeId=e,this.layerOpt=p,this.zoomEvent?this.zoomEvent():e?i.addArcGISDynamicLayer(p,e):i.addArcGISDynamicLayer(p),"number"==typeof this.options.opacity&&this.setOpacity(this.options.opacity)}getOpacity(){const t=this.getId();var e,i=this.map.getLayer(t);return"number"==typeof(e=i?i.implementation?i.implementation.opacity:this.map.getPaintProperty(t,"raster-opacity"):1)?e:1}setOpacity(t){const e=this.getId();try{var i=this.map.getLayer(e);i&&(i.implementation?i.implementation.opacity=t:this.map.setPaintProperty(e,"raster-opacity",t))}catch(t){}}_renderParams(t={}){const{srid:e}=this.map.M.view.data,i=Object.assign({f:"image",format:"PNG32",transparent:!0,layers:"",size:"512,512",bbox:this.getBbox(),dpi:96,bboxSR:e,imageSR:e},t);i.layers&&(i.layers="show:"+i.layers);const s=[];return Object.keys(i).forEach((t=>i[t]&&s.push(`${t}=${i[t]}`))),this._queryParams=i,`${s.join("&")}`}getBbox(t="3857"){let e=`{bbox-epsg-${t}}`;this.setDefineProject(this.map,t);switch(t||this.map.M.view.data.srid){case"local":e="{bbox-epsg-cgcs2000sz}";break;case"4490":e="{bbox-epsg-4490}";break;case"4528":e="{bbox-epsg-4528}";break;case"3857":e="{bbox-epsg-3857}"}return e}_formatQuery(t,e){let i=[];if(null===e)i=t;else for(const s of t)s.indexOf("?")>-1?i.push(`${s}&${e}`):i.push(`${s}?${e}`);return i}_getResolutions(){const t=[];for(let e=0;e<25;e++)t[e]=1.40625/Math.pow(2,e);return t}setVisible(t){var e=this.map.getLayer(this.layer.id);e&&!t?this.map.removeLayer(this.layer.id):!e&&t&&this.map.addArcGISDynamicLayer(this.layerOpt),this.visible=t}}class qp extends Rp{constructor(t,e){super(t,e),this.init()}init(){const{id:t}=this.options,e=this.map.getLayer(t);this.layer=e}addToMap(){this.map.setLayoutProperty(this.options.id,"visibility","visible")}getOpacity(){const t=this.getId();return this.map.getPaintProperty(t,`${this.layerFormat.getGeometryType()}-opacity`)||1}setOpacity(t){const e=this.getId();this.map.setPaintProperty(e,`${this.layerFormat.getGeometryType()}-opacity`,t)}clear(){this.map.setLayoutProperty(this.options.id,"visibility","none")}}class Hp extends Rp{constructor(t,e){super(t,e);var i=t.getOnemapConfig();this.dracoUrl=i.draco,this.layerRender=null,this.groupRender=null,this.analysisRender=[],this.models={color:"rgba(255, 153, 0)",opacity:.5,baseHeight:0,stretchHeight:1e3},this.iQueryIdList=[],this.propertyName="",this.paintOptions,this.highlightColor=i.iqueryBuffer.highlightColorTo3dtiles||"#FF9900",this.init(),this.beforeId,this.underground}init(){const{layer:t,iQueryIdList:e,propertyName:i,label:s,layerLabel:a}=this.options;this.layer=t,this.iQueryIdList=e||[],this.propertyName=i||"",this.label=s||a,this.paintOptions=this.layer.paint}addToMap(t){this.beforeId=t;const{map:e}=this;this.layer.dracoUrl=this.dracoUrl,this.layer.callback=(t,e)=>{this.groupRender=t,this.layerRender=e};var i=this.getMatrix(this.paintOptions);i&&(this.layer.transform=i),Object.assign(this.layer,this.paintOptions||{}),this.layer.ktx2ParseUrl&&(this.layer.encoding=I.default.ColorSpace.LinearEncoding,this.layer.ktx2ParseUrl=this.layer.dracoUrl||this.dracoUrl),this.layer.type="3DTiles",1===this.layer.underground&&(this.underground=1,this.beforeId="t_underground"),e.addLayer(JSON.parse(JSON.stringify(this.layer)),this.beforeId)}getInstanceLayer(){return this.layerRender||this.map.getLayer(this.layer.id)}onLayerDownMost(){this.map.getLayer(this.layer.id)&&1===this.underground&&this.map.moveLayer(this.layer.id,this.beforeId)}getMatrix(t){if(!this.paintOptions)return null;let e,i=this.map.GLSDK.matrix4.clone();return t.translate&&(e=i.translate(t.translate)),t.rotateXYZ&&(e=e.rotateXYZ(t.rotateXYZ)),t.scale&&(e=e.scale(t.scale)),e}query3DTiles(t,e){var i=e||this.propertyName;let s=this.map.query3DTiles({point:t,layerIds:[this.layer.id],propertyName:i});return s&&this.highlight3DTiles(s,i),s}highlight3DTiles(t,e,i){var s={layerIds:[this.layer.id],propertyValue:t,propertyName:e||this.propertyName,color:i||this.highlightColor};this.map.highlight3DTiles(s)}unhighlight3DTiles(){this.map.GLSDK.unhighlight3DTiles()}IQueryHighLight3Dtiles(t,e){var i=Object.assign(this.models,e||{});let s=fp(t,e.buffer3Dtiles,this.map.M.isGeographical);this.ClassifyAnalysis(s.geometry.coordinates[0],i)}ClassifyAnalysis(t,e){this.analysisRender=[],this.clearAllAnalysis((()=>{let i=t,s=Object.assign({coordinate:i},e),a=new I.default.ClassifyAnalysis(this.map);a.analyse(s),this.analysisRender.push(a)}))}clearAllAnalysis(t){new Promise((t=>{const e=this.analysisRender.length;0==e&&t(),this.analysisRender.forEach(((i,s)=>{i.clear(),s==e-1&&t()}))})).then((()=>{t&&t()}))}clearBefore(){this.clearAllAnalysis()}pickCoordinate(t){return this.layerRender.pickCoordinate(t)}getOpacity(){return 1}setOpacity(){return 1}}class $p extends Rp{constructor(t,e){super(t,e),this.material={metalness:0,roughness:1,alphaTest:.25,skipLevelOfDetail:!0,exposure:1,color:"#ffffff",opacity:1,dracoUrl:this.oneMapConfig.draco},this.token=void 0,this.init()}async init(){const{layer:t,iqueryApis:e,propertyName:i,label:s,layerLabel:a,url:n,projection:o}=this.options;o&&(t.project=o),this.minzoom=this.options.minzoom,this.maxzoom=this.options.maxzoom,this.layer=t,Object.assign(this.material,t),this.dataUrl=await this.formateTileUrlXYZ(n,"scene"),this.dataUrl=await this.formatJsonToken(this.dataUrl,this.options._token||null);const r=this.dataUrl.split("?");this.dataUrl=r[0],this.token=r[1]?`&${r[1]}`:this.token,this.iqueryApis=e||[],this.propertyName=i||"",this.label=s||a,this.bindZoomEvent()}addToMap(){this.layer.type="i3s";var t={id:this.layer.id,type:"i3s",skipLevelOfDetail:this.material.skipLevelOfDetail,data:this.dataUrl,token:this.token,material:{metalness:this.material.metalness,roughness:this.material.roughness,alphaTest:this.material.alphaTest,color:this.material.color,opacity:this.material.opacity},exposure:this.material.exposure,dracoUrl:this.material.dracoUrl,project:this.layer.project};this.layerOpt=t,this.zoomEvent?this.zoomEvent():this.map.addLayer(this.layerOpt)}getInstanceLayer(){return this.map.getLayer(this.layer.id)}setVisible(t){var e=this.map.getLayer(this.layer.id);e&&!t?this.map.removeLayer(this.layer.id):!e&&t&&this.map.addLayer(this.layerOpt),this.visible=t}getOpacity(){return 1}setOpacity(){return 1}}window.THREE=I.default.THREE;class Wp extends Rp{constructor(t,e){super(t,e),this.sceneMapLayerAll=null,this.sceneGroupAll=null,this.sceneThreeAll=null,this.models_obj=[],this.light1=null,this.light2=null,this.opacity=1,this.isEffect=!1,this.center=null,this.iQueryIdList=[],this.propertyName="";var i=this.oneMapConfig;this.highlightColor=i.iqueryBuffer.highlightColorTo3dtiles||"#FF9900",this.init(),this.stateModelInfo={},this.beforeId,this.underground}clearBefore(){if(this.map&&(this.light1&&this.map.removeLight(this.light1),this.light2&&this.map.removeLight(this.light2),window.transformControlLayer)){var t=window.transformControlLayer.bindLayerId;this.id==t&&(window.transformControlLayer.destory(),window.transformControlLayer.quit(),delete window.transformControlLayer)}}init(){const{layer:t,projection:e,iQueryIdList:i,propertyName:s,label:a,layerLabel:n}=this.options;e&&(t.project=e);var o=t.paint["model-mtl"];if(Array.isArray(t.models)?this.models_obj=t.models:this.models_obj=[t.models].map((t=>{const e=this.getModelType(t);var i={type:e,url:t,dracoUrl:this.oneMapConfig.draco};return 0!=o&&(i.mtl=this.getModelMtl(t,e)),i})),this.layer=t,this.iQueryIdList=i||[],this.propertyName=s||"",this.label=a||n,this.center=this.layer.paint["model-center"],this.map.sz2000sdk){var r=this.map.MapmostSDKConvert.fromDefinedProj(this.center);r&&(this.center=r),this.layer.project="SZ2000"}}getInstanceLayer(){return this.sceneMapLayerAll||this.map.getLayer(this.layer.id)}getModelMtl(t,e){return"obj"!=e?"":t.replace(".obj",".mtl")}getModelType(t){return t.indexOf(".obj")>-1?"obj":t.indexOf(".gltf")>-1?"gltf":t.indexOf(".glb")>-1?"glb":t.indexOf(".fbx")>-1?"fbx":void 0}async getData(){const t={url:this.layer.models,nocode:!0,nomessage:!0,method:"get"},e=await dr.request(t);return e.data?e.data:e}async addToMap(t){if(this.beforeId=t,this.underground=this.layer.paint.underground,1===this.underground&&(this.underground=1,this.beforeId="t_underground"),this.isEffect=this.layer.paint["model-effect"],"geojson"==this.layer.source&&(this.layer.data=await this.getData(),this.layer.heightProp=this.layer["height-prop"]||"ztykgd"),"effect1"==this.isEffect||1==this.isEffect)return void this.AddBuildlingsEffectLayer(this.beforeId);if("effect2"==this.isEffect)return void this.AddBuildlingsEffect2Layer(this.beforeId);const{map:e}=this;var i=this.center,s=this.layer.paint["model-opacity"],a=this.layer.project,n=this.layer.paint["model-exposure"]||2.8;let o;Object.assign(this.layer,{name:this.layer.id,sky:this.oneMapConfig.hdr,center:i,exposure:n,project:a||"3857",models:this.models_obj,outline:!0,callback:(t,e)=>{const i=e;this.sceneMapLayerAll=i,this.sceneGroupAll=t,t.setScale(this.layer.paint["model-scale"]||1),t.setRotation(this.getRotation(this.layer.paint));var a=this.getTranslate(this.layer.paint);t.setTranslate(a),this.layer.center[2]&&(i.height=this.layer.center[2]);const n=t.children[0];if(n.animations.length>0){const t=new window.THREE.AnimationMixer(n).clipAction(n.animations[0]);t.setLoop(window.THREE.LoopOnce),t.play()}n.traverse((t=>{const e=t;if(e.isMesh){e.castShadow=!0,e.receiveShadow=!0,e.frustumCulled=!1;let t=this.layer.paint["model-color"];t&&(t=new window.THREE.Color(t),e.material.color=t,e.children&&e.children.forEach((e=>{const i=e;this.layer.paint["model-color"]&&(i.material.color=t)})))}})),"number"==typeof s&&this.setOpacity(s)}}),this.beforeId&&(o=e.getLayer(this.beforeId)),o?e.addLayer(this.layer,this.beforeId):e.addLayer(this.layer)}onLayerDownMost(){this.map.getLayer(this.layer.id)&&1===this.underground&&this.map.moveLayer(this.layer.id,this.beforeId)}AddBuildlingsEffectLayer(t){const{map:e}=this,i={id:this.layer.id,type:"model",models:this.models_obj,sky:this.oneMapConfig.hdr,exposure:this.layer.paint["model-exposure"]||3,project:this.layer.project||"3857",center:this.center,material:{top:{opacity:this.layer.paint["model-opacity"]||.8,overdraw:!0},wall:{opacity:this.layer.paint["model-opacity"]||.8,overdraw:!0}},outline:!0,callback:(t,e)=>{this.sceneMapLayerAll=e,this.sceneGroupAll=t,t.setScale(this.layer.paint["model-scale"]||1),t.setRotation(this.getRotation(this.layer.paint)),t.setTranslate(this.getTranslate(this.layer.paint));let i=this.layer.paint["model-color"]||"#339bf6",s=this.layer.paint["gradient-color"]||"#002ea6";e.addModelEffect(t,[{type:"gradient",startColor:s,endColor:"#FFFFFF",opacity:1,percent:.1},{type:"flow",speed:1,color:i||"#339bf6",opacity:1,percent:.01}]);t.children[0].traverse((t=>{const e=t;e.isMesh&&(e.castShadow=!0,e.receiveShadow=!0,e.frustumCulled=!1,i&&(i=new window.THREE.Color(i),e.material.color=i),i&&e.children&&e.children.forEach((t=>{t.material.color=i})))}))}};let s;t&&(s=e.getLayer(t)),s?e.addLayer(i,t):e.addLayer(i)}AddBuildlingsEffect2Layer(t){const{map:e}=this;this.light1=new I.default.AmbientLight({color:this.layer.paint["model-ambient-light"]||"#ccccff",intensity:2}),this.light2=new I.default.DirectionalLight({color:"#ffffff",intensity:.25,position:[0,8e3,1e4]}),e.addLight(this.light1),e.addLight(this.light2);const i={id:this.layer.id,type:"buildings",models:this.models_obj,sky:this.oneMapConfig.hdr,images:[`${this.oneMapConfig.images}/material/top.png`,`${this.oneMapConfig.images}/material/wall_reverse.png`],defaultLights:!1,center:this.center,lights:[{id:"light1",type:"ambient",color:this.layer.paint["model-ambientLight"]||13421823,intensity:2},{id:"light2",type:"directional",color:16777215,intensity:.25,position:[0,8e3,1e4]}],material:{top:{opacity:this.layer.paint["model-opacity"]||.8},wall:{opacity:this.layer.paint["model-opacity"]||.8}},outline:!0,callback:(t,e)=>{this.sceneMapLayerAll=e,this.sceneGroupAll=t,t.setScale(this.layer.paint["model-scale"]||1),t.setRotation(this.getRotation(this.layer.paint)),t.setTranslate(this.getTranslate(this.layer.paint))}};let s;this.layer.data&&this.layer.heightProp&&(i.data=this.layer.data,i.heightProp=this.layer.heightProp,delete i.models),t&&(s=e.getLayer(t)),s?e.addLayer(i,t):e.addLayer(i)}getOpacity(){return this.isEffect?null:this.opacity}setOpacity(t=1){return this.sceneGroupAll&&!this.isEffect&&this.setGroupOpacity(this.sceneGroupAll.children[0],t),t}setGroupOpacity(t,e){t.traverse((t=>{t.isMesh&&(t.material.transparent=1!==this.opacity,t.material.opacity=e,t.material.depthWrite=!1,void 0!==t.renderOrder&&(t.renderOrder=-Math.floor(255*e)))})),this.opacity=e}mapmostTransformControls(){}selectModel(t){if(!this.sceneMapLayerAll)return null;this.map.unhighlightModelLayer&&this.map.unhighlightModelLayer();let e=this.sceneMapLayerAll.selectModel(t)[0];if(e&&e.point&&e.object){let t=e.object;this.selectedObj=t.parent;var i=this.highlightColor;this.selectedObj.traverse((function(t){t instanceof THREE.Mesh&&(t.baseMaterial=t.material,t.material=t.material.clone(),t.material.color=new THREE.Color(i))}));var s,a=this.selectedObj;return a.userData&&(s=a.userData[this.propertyName]),this.map.unhighlightModelLayer=this.unLightModel,s}return this.unLightModel(),null}unLightModel(){this.sceneMapLayerAll&&this.selectedObj&&(this.selectedObj.traverse((function(t){t.material=t.baseMaterial})),this.selectedObj=void 0,this.map.unhighlightModelLayer=void 0)}}var Kp={props:["cdata"],data:()=>({filterEmpty:!1,emptyReplaceStr:"",domid:"mappopup-container-Panel",position:"",filesList:{},refreshImgage:!0,activeIndex:0,featuresTabPage:[],showType:"mapPopup"}),mounted(){this.cdata&&(this.data=this.cdata),this.initData(),this.featuresTabPage=this.data.featuresTab||[]},methods:{changeActive(t){this.activeIndex=t,this.data=this.featuresTabPage[t]},initData(){(this.data.iQueryList||[]).forEach((t=>{["FilesPath","MinioFiles"].includes(t.type)&&t.value&&this.ImageList(JSON.parse(JSON.stringify(t)))}))},judageType:t=>!["FilesPath","MinioFiles"].includes(t.type),mapPopupActions(t){this.map.$MapEventBus.$emit("map-popup-trigger-action",t,this.data)},close(){this.map.$MapEventBus.$emit("map-popup-close")},ImageList(t){var e=t.value,i=t.key;"FilesPath"==t.type?this.filesList[i]=e?e.split(","):[]:"MinioFiles"==t.type&&this.getPathList(t)},async getPathList(t){if(!t.value)return;var e=t.key;const i={url:this.map.GLSDK.getOnemapConfig().customURL_Minio,method:"post",addheaders:{},addtimeout:2e4,data:{groupCode:t.value}},s=await dr.request(i);var a=[];s.data.forEach((t=>{t.url&&a.push(t.url)})),this.filesList[e]=a,this.refreshImgage=!1,this.$nextTick((()=>{this.refreshImgage=!0}))},isImage(t){if(!t)return!1;var e=t.split(",")[0];return!!/\.(gif|jpg|jpeg|png|GIF|JPEG|JPG|PNG)$/.test(e)},setPosition(t){this.position=t}},destroyed(){this.map&&(this.map.$MapEventBus.$off("map-popup-trigger-action"),this.map.$MapEventBus.$off("map-popup-close"))},computed:{attributeList(){return this.data.iQueryList||[]},extraList(){return this.data.extras||[]},styleCss(){let t={"z-index":2};return this.position&&Object.assign(t,this.position),t}}};const Yp=Kp;var Jp=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mappopup-container mappopup-bottom",style:t.styleCss,attrs:{id:t.domid}},["dialog"!=t.showType?i("div",{staticClass:"mappopup-header"},[i("div",{staticClass:"title"},[t._v(t._s(t.data.name))]),t._v(" "),i("div",{staticClass:"close",on:{click:t.close}},[i("i",{staticClass:"el-icon-close"})])]):i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"mappopup-header",attrs:{id:t.domid}},[i("div",{staticClass:"title"},[t._v(t._s(t.data.name))]),t._v(" "),i("div",{staticClass:"close",on:{click:t.close}},[i("i",{staticClass:"el-icon-close"})])]),t._v(" "),t.attributeList?i("div",{staticClass:"mappopup-content"},[t._l(t.attributeList,(function(e,s){return[1!=t.filterEmpty||e.value?i("div",{key:s,staticClass:"mappopup-item"},[i("span",{staticClass:"mappopup-label"},[t._v(t._s(null==e.label?"":e.label))]),t._v(" "),i("div",{staticClass:"mappopup-divider"},[t._v(":")]),t._v(" "),t.judageType(e)?i("span",{staticClass:"mappopup-value"},[t._v(t._s(e.value?e.value+(null==e.unit?"":e.unit):t.emptyReplaceStr))]):i("div",{staticClass:"mappopup-value mappopup-imagelist"},[e.value?t._e():i("span",{staticClass:"mappopup-value"},[t._v(t._s(t.emptyReplaceStr))]),t._v(" "),t.refreshImgage&&e.value?i("div",{staticClass:"mappopup-imagelist-content"},[t._l(t.filesList[e.key],(function(s,a){return[i("el-image",{key:a,staticClass:"mappopup-image",attrs:{lazy:"","preview-src-list":t.filesList[e.key],src:s}},[i("div",{staticClass:"image-slot",attrs:{slot:"error"},slot:"error"},[i("i",{staticClass:"el-icon-picture-outline"})])])]}))],2):t._e()])]):t._e()]}))],2):t._e(),t._v(" "),t.extraList.length>0?i("div",{staticClass:"mappopup-btn"},t._l(t.extraList,(function(e,s){return i("div",{key:s,staticClass:"mappopup-btn-item",on:{click:function(i){return i.stopPropagation(),t.mapPopupActions(e)}}},[i("span",{staticClass:"mappopup-btn-label"},[t._v(t._s(e.extraName))])])})),0):t._e(),t._v(" "),t.featuresTabPage.length>1?i("div",{staticClass:"mappopup-tab-btn"},t._l(t.featuresTabPage,(function(e,s){return i("span",{key:s,class:{current:s==t.activeIndex},on:{click:function(e){return t.changeActive(s)}}},[t._v(t._s(e.name))])})),0):t._e(),t._v(" "),"dialog"!=t.showType?i("div",{staticClass:"mappopup-tip"}):t._e()])};Jp._withStripped=!0;const Xp=bi({render:Jp,staticRenderFns:[]},undefined,Yp,"data-v-02a2a2a2",false,undefined,!1,void 0,void 0,void 0);var Qp={props:["data","emptyReplaceStr","customUrlMinio","column"],data:()=>({filesList:{},refreshImgage:!0,size:"small",labelStyle:{"text-align":"right","min-width":"120px",color:"#323332","font-size":"14px"},contentStyle:{"text-align":"left","min-width":"180px",color:"#627382"}}),mounted(){this.initData()},methods:{initData(){(this.data||[]).forEach((t=>{["FilesPath","MinioFiles"].includes(t.type)&&t.value&&this.ImageList(JSON.parse(JSON.stringify(t)))}))},ImageList(t){var e=t.value,i=t.key;"FilesPath"==t.type?this.filesList[i]=e?e.split(","):[]:"MinioFiles"==t.type&&this.getPathList(t)},judageType:t=>!["FilesPath","MinioFiles"].includes(t.type),async getPathList(t){if(!t.value)return;var e=t.key;const i={url:this.customUrlMinio,method:"post",addheaders:{},addtimeout:2e4,nocode:!0,nomessage:!0,data:{groupCode:t.value}},s=await dr.request(i);var a=[];s.data.forEach((t=>{t.url&&a.push(t.url)})),this.filesList[e]=a,this.refreshImgage=!1,this.$nextTick((()=>{this.refreshImgage=!0}))}}};const Zp=Qp;var tu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-form-container"},[i("el-descriptions",{attrs:{column:t.column||2,size:t.size,border:""}},t._l(t.data,(function(e,s){return i("el-descriptions-item",{key:s,attrs:{contentStyle:t.contentStyle,labelStyle:t.labelStyle,"label-class-name":"map-form-label","content-class-name":"map-form-content",label:null==e.label?"":e.label}},[t.judageType(e)?[t._v("\n "+t._s(null==e.value?t.emptyReplaceStr:e.value)),i("span",[t._v(t._s(null==e.unit?"":e.unit))])]:[i("div",{staticClass:"mappopup-value mappopup-imagelist"},[e.value?t._e():i("span",[t._v(t._s(t.emptyReplaceStr))]),t._v(" "),t.refreshImgage&&e.value?i("div",{staticClass:"mappopup-imagelist-content"},[t._l(t.filesList[e.key],(function(s,a){return[i("el-image",{key:a,staticClass:"mappopup-image",attrs:{lazy:"","preview-src-list":t.filesList[e.key],src:s}},[i("div",{staticClass:"image-slot",attrs:{slot:"error"},slot:"error"},[i("i",{staticClass:"el-icon-picture-outline"})])])]}))],2):t._e()])]],2)})),1)],1)};tu._withStripped=!0;const eu={name:"mapMoreInfo",components:{mapForm:bi({render:tu,staticRenderFns:[]},undefined,Zp,"data-v-32433054",false,undefined,!1,void 0,void 0,void 0)},data:()=>({customUrlMinio:"",column:2,area_s:[850,550],dialogVisible:!0,data_test:{id:"单元编码",name:"单元编码",detaillist:[{unit:null,label:"objectid",value:"4629",key:"objectid"},{unit:null,label:"单元编码",value:"174200",key:"cell_code"},{unit:null,label:"备注",value:"",key:"textstring"},{unit:null,label:"部件类型",value:"污水井",key:"bjlx"},{unit:null,label:"数据来源",value:"竣工图整理",key:"sjly"},{unit:null,label:"shape",value:"POINT (118.21601575300008 33.93268778300006)POINT (118.21601575300008 33.93268778300006)POINT (118.21601575300008 33.93268778300006)POINT (118.21601575300008 33.93268778300006)",key:"shape"}]},srcUrl:"",xtype:!1,domid:"map-moreinfo-container",actionData:{id:"9dce6dc567a188a0365adffc6f11cedd",templateId:"d8c6055a0b6abcaea5a4a443cb752d07",extraCode:"dialogOpen",extraName:"对话框地址",extraMethod:"https://www.baidu.com/",isFull:0,isIquery:1},cssOpt:{minHeight:"300px",maxHeight:"560px",overflow:"auto"},emptyReplaceStr:""}),created(){this.area&&(this.area_s=this.area),"dialogopen"==this.actionData.extraCode.toLowerCase()&&(this.xtype=!0,this.srcUrl=this.actionData.srcUrl)},mounted(){this.$nextTick((()=>{this.cssOpt.maxHeight=`${this.area_s[1]||550}px`||"560px",this.cssOpt.overflow="auto"}))},methods:{handleClose(){this.dialogVisible=!1},handlerFullScreen(){A.default.toggle(document.getElementById("iframe"))}},computed:{styleCss(){const t={width:"auto",top:`calc(50% - ${parseFloat(this.cssOpt.maxHeight)/2}px)`};return this.area_s[0]&&(t.width=`${this.area_s[0].toString()}px`),t},detailList(){return this.data.detailList||this.data.detaillist||[]}}};var iu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.dialogVisible?i("div",{ref:"dialog",staticClass:"map-moreinfo-container",attrs:{id:t.domid}},[i("div",{staticClass:"map-moreinfo-dialog",class:{dialogopen:t.xtype},style:t.styleCss,attrs:{id:"map-moreinfo-dialog"}},[i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"map-moreinfo-header",attrs:{id:"map-moreinfo-dialog"}},[i("div",{staticClass:"title"},[t._v(t._s(t.data.name||"更多信息"))]),t._v(" "),i("div",{staticClass:"map-moreinfo-hedaer-btn"},[t.xtype?i("i",{staticClass:"el-icon-full-screen",attrs:{title:"全屏"},on:{click:function(e){return e.stopPropagation(),t.handlerFullScreen.apply(null,arguments)}}}):t._e(),t._v(" "),i("i",{staticClass:"el-icon-close",on:{click:function(e){return e.stopPropagation(),t.handleClose.apply(null,arguments)}}})])]),t._v(" "),i("div",{staticClass:"map-moreinfo-g",style:t.cssOpt},[t.xtype?i("div",{staticClass:"map-more-content-iframe"},[i("iframe",{staticClass:"iframe",attrs:{id:"iframe",src:t.srcUrl,frameborder:"0"}})]):i("div",{staticClass:"map-more-content"},[t.detailList.length?i("mapForm",{attrs:{data:t.detailList,emptyReplaceStr:t.emptyReplaceStr,column:t.column,customUrlMinio:t.customUrlMinio}}):t._e()],1)])])]):t._e()};iu._withStripped=!0;const su=bi({render:iu,staticRenderFns:[]},undefined,eu,"data-v-5bc8cd4e",false,undefined,!1,void 0,void 0,void 0);const au={props:{data:{type:Array,default:()=>[]},searchValue:{type:String,default:""},clearAble:{type:Boolean,default:!1},emptyReplaceStr:{type:String,default:""}},inject:{getMap:{from:"map",default:()=>null}},data:()=>({mouseHoverIndex:""}),mounted(){this.map=this.getMap(),this.searchValue&&(this.reg=new RegExp(this.searchValue,"gm"))},methods:{deleteData(t,e){this.$emit("deleteData",e,t)},getTitleArr(t){var e=t.toString();return this.searchValue&&e?(e=e.replace(new RegExp(this.searchValue,"gm"),"||"+this.searchValue+"||")).split("||"):[e]},handlerMapLocation(t){this.$emit("handlerMapLocation",t)},mousemove(t,e){this.mouseHoverIndex=e,this.map.$MapEventBus.$emit("map-left-list-mousemove",this.setPoiIndex(t,e))},mouseleave(t,e){this.mouseHoverIndex="--",this.map.$MapEventBus.$emit("map-left-list-mouseleave",this.setPoiIndex(t,e))},setPoiIndex(t,e){const i=t;return i.poiindex=(e+1).toString(),i}}};var nu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-list-gl"},t._l(t.data,(function(e,s){return i("div",{key:s,staticClass:"map-list-gl-container",class:{mapNoShape:!e.shape},on:{mouseover:function(i){return t.mousemove(e,s)},mouseleave:function(i){return t.mouseleave(e,s)}}},[i("div",{staticClass:"map-list-gl-header",on:{click:function(i){return t.handlerMapLocation(e)}}},[i("div",{staticClass:"map-list-gl-header-title"},[i("span",{staticClass:"map-list-index"},[t._v(t._s(s+1+"."))]),t._v(" "),e.shape?i("span",[i("i",{staticClass:"el-icon-location-outline"})]):t._e(),t._v(" "),e.name?t._e():i("span",{staticClass:"header-value",class:{headerValueH:t.searchValue==t.emptyReplaceStr}},[t._v(t._s(t.emptyReplaceStr))]),t._v(" "),t._l(t.getTitleArr(e.name||""),(function(e,s){return[i("span",{key:s,staticClass:"header-value",class:{headerValueH:t.searchValue==e}},[t._v(t._s(e))])]}))],2),t._v(" "),t.clearAble&&t.mouseHoverIndex==s?i("i",{staticClass:"el-icon-delete",attrs:{title:"删除"},on:{click:function(i){return i.stopPropagation(),t.deleteData(e,s)}}}):t._e()]),t._v(" "),i("div",{staticClass:"map-list-gl-form",on:{click:function(i){return t.handlerMapLocation(e)}}},[t._l(e.qQueryList,(function(e,s){return["MinioFiles"!=e.type?i("div",{key:s,staticClass:"map-list-gl-item"},[i("span",{staticClass:"map-list-label"},[t._v(t._s(e.label))]),t._v(" "),i("div",{staticClass:"map-list-divider"},[t._v(":")]),t._v(" "),i("div",{staticClass:"map-list-value"},[e.value?t._e():i("span",[t._v(t._s(t.emptyReplaceStr))]),t._v(" "),t._l(t.getTitleArr((null==e.value?"":e.value)+(null==e.unit?"":" "+e.unit)),(function(e,s){return[i("span",{key:s,class:{headerValueH:t.searchValue==e}},[t._v(t._s(e))])]}))],2)]):t._e()]}))],2)])})),0)};nu._withStripped=!0;const ou=bi({render:nu,staticRenderFns:[]},undefined,au,"data-v-13fbf303",false,undefined,!1,void 0,void 0,void 0);const ru={name:"mapListRebuild",props:["cdata","cposition","cmap","cSearchValue"],components:{mapList:ou},provide(){return{map:this.getMap}},data:()=>({showVisible:!0,domid:"mx-map-search-result",count:0,total:0,list:[],dataList:[],pagerCount:5,maxHeight:"720px",currentPage:1,currentSize:10,pageSizesAll:[10,20,30,50],maxCount:1e3,all:!1,activeDataList:null,apiId:null,currentListIndex:0,searchValue:"",axiosOptions:"",pageSize:10,getAxiosSearchData:"",tempTabPageInfo:{},tabName:"",emptyReplaceStr:"",styleDynamicCss:{}}),mounted(){this.cdata&&(this.data=this.cdata),this.data&&("object"==typeof this.axiosOptions&&(this.pageSize=this.axiosOptions.size||this.pageSize,this.currentSize=this.pageSize,this.getAxiosSearchData=this.axiosOptions.getAxiosSearchData),this.cposition&&(this.position=this.cposition),this.cSearchValue&&(this.searchValue=this.cSearchValue),this.cmap&&(this.map=this.cmap),this.tempTabPageInfo[this.currentListIndex]={currentPage:this.currentPage,currentSize:this.currentSize},Array.isArray(this.data)?this.activeDataList=this.data[this.currentListIndex]:this.activeDataList=this.data,this.setTotal(this.activeDataList),this.apiId=this.activeDataList.apiId||"",this.list=this.activeDataList.records||[],this.getDataList(),this.$nextTick((()=>{this.setMaxHeight()})))},methods:{setTotal(t){t.total?(this.count=t.total||0,this.total=this.count,this.getAxiosSearchData||(this.count=t.records.length)):(this.count=t.records.length,this.total=this.count)},getMap(){return this.map},mapShowTabChange(t){this.currentListIndex=t.index,this.tabName=t.name,this.apiId=t.apiId,this.tempTabPageInfo[this.currentListIndex]||(this.tempTabPageInfo[this.currentListIndex]={currentPage:1,currentSize:this.currentSize}),this.currentPage=this.tempTabPageInfo[this.currentListIndex].currentPage,this.currentSize=this.pageSize,this.activeDataList=this.data[this.currentListIndex],null==this.activeDataList.records&&(this.activeDataList.records=[]),this.setTotal(this.activeDataList),this.map.$MapEventBus.$emit("map-left-list-all",this.activeDataList),this.list=this.activeDataList.records,this.changeData()},mapShowAll(){if(this.all=!this.all,this.all)if(this.getAxiosSearchData){const t={input_value:this.axiosOptions.input_value||"",current:1,size:this.total,tabName:this.tabName};this.getAxiosSearchData(this.axiosOptions,t,(t=>{var e=t.data[0];this.map.$MapEventBus.$emit("map-left-list-all",e)}))}else this.map.$MapEventBus.$emit("map-left-list-all",{axiosOptions:this.axiosOptions,list:this.activeDataList,apiId:this.apiId,currentListIndex:this.currentListIndex})},mapListLocation(t){this.map.$MapEventBus.$emit("map-left-list-click",t)},close(){this.map.$MapEventBus.$emit("map-left-list-close"),this.$emit("close")},setMaxHeight(){const t=this.map._container.id,e=document.getElementById(t);if(e){var i=document.getElementById(this.domid),s=i?i.offsetTop:0;this.maxHeight=e.clientHeight-120-s-(this.tabBtn.length>1?36:0)+"px",window.onresize=()=>{const t=this.map._container.id,e=document.getElementById(t);var i=document.getElementById(this.domid),s=i?i.offsetTop:0;this.maxHeight=e.clientHeight-120-s-(this.tabBtn.length>1?36:0)+"px"}}},handleSizeChange(t){this.currentSize=t,this.changeData()},handleCurrentChange(t){this.currentPage=t,this.changeData()},changeData(){if(this.tempTabPageInfo[this.currentListIndex]&&(this.tempTabPageInfo[this.currentListIndex].currentPage=this.currentPage),this.getAxiosSearchData){const t={input_value:this.axiosOptions.input_value||"",current:this.currentPage,size:this.currentSize,tabName:this.tabName};this.getAxiosSearchData(this.axiosOptions,t,(t=>{this.dataList=t.data[0].records,this.setTotal(t.data[0]),this.addLocationsLayerMap(JSON.parse(JSON.stringify(this.dataList)))}))}else this.getDataList()},addLocationsLayerMap(t){this.map.$MapEventBus.$emit("map-left-list-locations-layer",t)},getDataList(){let t=[];if(0==this.count||void 0===this.list)return this.addLocationsLayerMap(JSON.parse(JSON.stringify(t))),void(this.dataList=t);const e=(this.currentPage-1)*this.currentSize;let i=this.currentPage*this.currentSize;(this.count<=this.currentSize||i>=this.count)&&(i=this.count),t=this.list.slice(e,i),this.addLocationsLayerMap(JSON.parse(JSON.stringify(t))),this.dataList=t},getExistIcxCode(t){return t=this.tabBtn.find((e=>e.apiId==t))},reSetDataList(t,e){this.data[e]=t,this.list=t.records,this.activeDataList=this.data[e],this.setTotal(t)}},computed:{tabBtn(){const t=[];return Array.isArray(this.data)?(this.data.forEach(((e,i)=>{t.push({name:this.data[i].name||`列表${i+1}`,apiId:this.data[i].apiId||`apiId${i+1}`,index:i})})),t):t},styleCss(){let t=JSON.parse(JSON.stringify(this.styleConfig.position||{}));if(this.position&&(t=this.position),0==document.getElementsByClassName("mx-map-search").length&&t.top){var e=parseFloat(t.top)-40;e=e<=0?20:e,t.top=`${e}px`}return parseInt(this.count/this.currentSize)+1>6&&(t.maxWidth="360px",t.width="auto"),Object.assign(t,this.styleDynamicCss||{}),t}},destroyed(){this.map&&(this.map.$MapEventBus.$off("map-left-list-locations-layer"),this.map.$MapEventBus.$off("map-left-list-close"),this.map.$MapEventBus.$off("map-left-list-click"))}};var lu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.count>=0||t.tabBtn.length>1?i("div",{directives:[{name:"show",rawName:"v-show",value:t.showVisible,expression:"showVisible"}],staticClass:"mx-map-search-result",style:t.styleCss,attrs:{id:t.domid}},[i("el-card",{staticClass:"card-container"},[i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"mx-map-search-header",attrs:{slot:"header",id:t.domid},slot:"header"},[t._v("\n 查询到\n "),i("span",{on:{click:t.mapShowAll}},[t._v(t._s(t.total))]),t._v("\n 条结果\n "),i("div",{staticClass:"close",on:{click:t.close}},[i("i",{staticClass:"el-icon-close"})])]),t._v(" "),t.tabBtn.length>1?i("div",{staticClass:"mx-map-search-tabbtn"},t._l(t.tabBtn,(function(e,s){return i("div",{key:s,staticClass:"tabbtn-item",class:{active:t.currentListIndex==e.index},on:{click:function(i){return t.mapShowTabChange(e)}}},[i("span",[t._v(t._s(e.name))])])})),0):t._e(),t._v(" "),i("div",{staticClass:"mx-map-search-list",style:{maxHeight:t.maxHeight}},[t.dataList.length>0?i("map-list",{attrs:{searchValue:t.searchValue,data:t.dataList,emptyReplaceStr:t.emptyReplaceStr},on:{handlerMapLocation:t.mapListLocation}}):i("div",[i("el-empty",{attrs:{description:"暂无数据"}})],1)],1),t._v(" "),i("div",{staticClass:"mx-map-search-fonter"},[i("el-pagination",{attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizesAll,"page-size":t.currentSize,"pager-count":t.pagerCount,layout:"prev, pager, next, jumper",total:t.count,small:"",background:"","hide-on-single-page":!1},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}}),t._v(" "),i("span",{staticClass:"medo-pagesize",attrs:{title:this.currentSize}},[t._v(" "+t._s("/"+this.currentSize))])],1)])],1):t._e()};lu._withStripped=!0;const hu=bi({render:lu,staticRenderFns:[]},undefined,ru,"data-v-669865ad",false,undefined,!1,void 0,void 0,void 0);const cu={props:["cdata","cmap","cposition","cdomid","showList"],components:{mapList:ou},provide(){return{map:this.getMap}},data:()=>({count:0,list:[],dataList:[],pagerCount:5,maxHeight:"720px",currentPage:1,currentSize:10,pageSizesAll:[10,20,30,50],maxCount:1e3,all:!1,activeDataList:null,currentListIndex:0,clientHeightOffset:0,maxInitHeight:0,changeTop:!1,domid:"map-search-result-c",deleteListAll:[],showListControls:{clear:!0,refresh:!0,return:!0,clearItem:!0}}),mounted(){this.mapP&&(this.map=this.mapP()),this.cdata&&(this.data=this.cdata),this.cmap&&(this.map=this.cmap),this.data&&(Array.isArray(this.data)?this.activeDataList=this.data[this.currentListIndex]:this.activeDataList=this.data,this.activeDataList.total?this.count=(this.activeDataList.total,this.activeDataList.total):this.count=this.activeDataList.records.length,this.list=this.activeDataList.records||[],this.getDataList(),this.$nextTick((()=>{this.setMaxHeight()})),"object"==typeof this.showList&&Object.assign(this.showListControls,this.showList))},methods:{refreshData(){this.getDataList()},returnDelete(){const t=this.deleteListAll.length;if(0==t)return;const e=t-1,i=this.deleteListAll[e];this.dataList.splice(i.index,0,i.item),this.deleteListAll.splice(e,1),this.addLocationsLayerMap(JSON.parse(JSON.stringify(this.dataList)),!1)},deleteData(t,e){this.dataList.splice(t,1),this.addLocationsLayerMap(JSON.parse(JSON.stringify(this.dataList)),!1),this.deleteListAll.push({index:t,item:e})},clear(){this.$emit("clear")},changeTopHandler(){this.changeTop=!this.changeTop,this.$emit("changeTopPanel",this.changeTop)},getMap(){return this.map},mapShowTabChange(t){this.currentListIndex=t.index,this.currentPage=1,this.currentSize=10,this.activeDataList=this.data[this.currentListIndex],null==this.activeDataList.records&&(this.activeDataList.records=[]),this.activeDataList.total?this.count=this.activeDataList.total||0:this.count=this.activeDataList.records.length,this.list=this.activeDataList.records,this.getDataList()},mapShowAll(){this.all=!this.all,this.all?this.currentSize=this.count:this.currentSize=10,this.currentPage=1,this.getDataList()},mapListLocation(t){this.map.$MapEventBus.$emit("map-left-list-click",t)},close(){this.map.$MapEventBus.$emit("map-left-list-close"),this.$emit("close")},setMaxHeightChange(t){const e=parseFloat(this.maxInitHeight);this.maxHeight=t?`${e}px`:e+this.clientHeightOffset-10+"px"},setMaxHeight(){const t=this.map._container.id,e=document.getElementById(t);if(e){var i=document.getElementById(this.cdomid),s=e.getElementsByClassName("mx-map-search")[0];this.clientHeightOffset=i?i.clientHeight+10:0;var a=s?s.offsetTop:0;this.maxHeight=e.clientHeight-200-a-this.clientHeightOffset-(this.tabBtn.length>1?36:0)+"px",this.maxInitHeight=1*parseFloat(this.maxHeight),window.onresize=()=>{var t=document.getElementById(this.cdomid);this.clientHeightOffset=t?t.clientHeight+10:0;const i=this.map._container.id,s=document.getElementById(i);var a=e.getElementsByClassName("mx-map-search")[0],n=a?a.offsetTop:0;this.maxHeight=s.clientHeight-200-n-this.clientHeightOffset-(this.tabBtn.length>1?36:0)+"px",this.maxInitHeight=1*parseFloat(this.maxHeight)}}},handleSizeChange(t){this.currentSize=t,this.getDataList()},handleCurrentChange(t){this.currentPage=t,this.getDataList()},addLocationsLayerMap(t,e=!0){this.map.$MapEventBus.$emit("map-left-file-list-locations-layer",{data:t,option:{fitBounds:e}})},getDataList(){this.deleteListAll=[];let t=[];if(0==this.count||void 0===this.list)return this.addLocationsLayerMap(JSON.parse(JSON.stringify(t))),void(this.dataList=t);const e=(this.currentPage-1)*this.currentSize;let i=this.currentPage*this.currentSize;(this.count<=this.currentSize||i>=this.count)&&(i=this.count),t=this.list.slice(e,i),this.addLocationsLayerMap(JSON.parse(JSON.stringify(t))),this.dataList=t}},computed:{tabBtn(){const t=[];return Array.isArray(this.cdata)?(this.cdata.forEach(((e,i)=>{t.push({name:this.cdata[i].name||`列表${i+1}`,index:i})})),t):t}}};var pu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.count>=0||t.tabBtn.length>1?i("div",{staticClass:"mx-map-search-result",attrs:{id:t.domid}},[i("el-card",{staticClass:"card-container"},[i("div",{staticClass:"mx-map-search-header",attrs:{slot:"header"},slot:"header"},[t._v("\n 共\n "),i("span",{on:{click:t.mapShowAll}},[t._v(t._s(t.count))]),t._v("\n 条结果\n "),i("div",{staticClass:"map-list-clear"},[t.showListControls.return&&t.showListControls.clearItem?i("el-button",{attrs:{type:"text",size:"mini"},on:{click:t.returnDelete}},[t._v("撤销")]):t._e(),t._v(" "),t.showListControls.refresh&&t.showListControls.clearItem?i("el-button",{attrs:{type:"text",size:"mini"},on:{click:t.refreshData}},[t._v("刷新")]):t._e(),t._v(" "),t.showListControls.clear?i("el-button",{attrs:{type:"text",size:"mini"},on:{click:t.clear}},[t._v("清除")]):t._e()],1),t._v(" "),i("i",{staticClass:"arrow",class:[t.changeTop?"el-icon-bottom":"el-icon-top"],on:{click:function(e){return e.stopPropagation(),t.changeTopHandler.apply(null,arguments)}}})]),t._v(" "),t.tabBtn.length>1?i("div",{staticClass:"mx-map-search-tabbtn"},t._l(t.tabBtn,(function(e,s){return i("div",{key:s,staticClass:"tabbtn-item",class:{active:t.currentListIndex==e.index},on:{click:function(i){return t.mapShowTabChange(e)}}},[i("span",[t._v(t._s(e.name))])])})),0):t._e(),t._v(" "),i("div",{staticClass:"mx-map-search-list",style:{maxHeight:t.maxHeight}},[t.dataList.length>0?i("map-list",{attrs:{clearAble:t.showListControls.clearItem,data:t.dataList},on:{handlerMapLocation:t.mapListLocation,deleteData:t.deleteData}}):i("div",[i("el-empty",{attrs:{description:"暂无数据"}})],1)],1),t._v(" "),i("div",{staticClass:"mx-map-search-fonter"},[i("el-pagination",{attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizesAll,"page-size":t.currentSize,"pager-count":t.pagerCount,layout:"prev, pager, next, jumper",total:t.count,small:"",background:"","hide-on-single-page":!1},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}})],1)])],1):t._e()};pu._withStripped=!0;var uu={props:{visible:{type:Boolean,default:()=>!1},activeName:{type:String,default:"文件上图"}},components:{ResultList:bi({render:pu,staticRenderFns:[]},undefined,cu,"data-v-96f476ae",false,undefined,!1,void 0,void 0,void 0)},mounted(){},data:()=>({domid:"mx-map-importfiles-panel",title:"",srid:"",extent:"",repairMethod:"",coordinateFlag:0,topologyFlag:0,count:0,showList:!1,activeNames:"1",fileList:[],resultListData:[],currentFileuid:"",actionsUrl:"",fileIconClass:{txt:"iconClassTxt",dwg:"iconClassDwg",zip:"iconClassZip",mdb:"iconClassMdb",shp:"iconClassShp"},fileTip:"",customURLReadGeoJSONByFile:""}),methods:{changeTopPanel(t){this.activeNames=t?"":"1",this.changeCollapse(this.activeNames)},changeCollapse(t){this.$refs.ResultList&&this.$refs.ResultList.setMaxHeightChange(!!t)},onSubmit(t,e){window.MapMessage.ShowLoading({text:"正在读取文件...."});const i=t.name.split(".").pop().toLowerCase();switch(i){case"zip":case"dwg":case"shp":this.showImportMapByShapefiles(t,i);break;case"txt":this.showImportMapTxt(t)}this.fileList=[e[e.length-1]],this.resetDomUploadFileIcon()},resetDomUploadFileIcon(){this.$nextTick((()=>{const t=R.default(".el-upload-list__item-name");this.fileList.forEach(((e,i)=>{const s=e.name.split(".").pop().toLowerCase();if(t[i]&&s){t[i].getElementsByTagName("i")[0].className=`self_fileIcon ${this.fileIconClass[s]}`}}))}))},handleSuccess(){},clearList(){this.map.$MapEventBus.$emit("map-Importfiles-Panel-locationslayer",null),this.count=0,this.currentFileuid="",this.fileList=[]},handleRemove(t){this.currentFileuid==t.uid&&(this.map.$MapEventBus.$emit("map-Importfiles-Panel-locationslayer",null),this.count=0)},showImportMapTxt(t){const e=this,i=new FileReader,s=t.raw;i.readAsText(s),i.onload=async function(){const i=this.result.split(";").map((t=>({WKT:t})));e.showMapLocationsResult(i,t,i.length)}},showImportMapByShapefiles(t,e){switch(e){case"shpJS":As.read_shapefiles(t).then((e=>{this.showMapLocations(t,e,"geojson")}));break;case"zip":case"shp":case"dwg":this.showImportMapCommonByJava(t,e);break;case"zip前端js调用":As.read_shapefiles_zip(t).then((e=>{this.showMapLocations(t,e,"geojson")}))}},showImportMapCommonByJava(t,e){const i=this.customURLReadGeoJSONByFile,s=this.getParams?this.getParams():{srid:this.srid,extent:this.extent,coordinateFlag:this.coordinateFlag,topologyFlag:this.topologyFlag,repairMethod:this.repairMethod};dr.postShape({url:i,files:t,extras:s}).then((e=>{Array.isArray(e)||200==e.code?this.showMapLocations(t,e.data[0].Collection,"geojson"):(window.MapMessage.ShowMessage({type:"warning",message:`文件读取失败:${e.msg}`||"未知"}),this.map.$MapEventBus.$emit("map-show-readfiles-callback",""))}))},showMapLocationsResult(t,e,i){const s=[];new Promise((e=>{0==i&&e(),t.forEach(((t,a)=>{const n=t.WKT;try{if(O.default.parse(n)){const t={shape:n,name:"索引",label:(a+1).toString(),id:Math.random(),poiindex:(a+1).toString(),qQueryList:[],iQueryList:[],extras:[]};s.push(JSON.parse(JSON.stringify(t)))}}catch(t){}a==i-1&&e()}))})).then((()=>{this.showMapLocations(e,s)}))},showMapLocations(t,e,i="qdata"){window.MapMessage.CloseLoading();const s="geojson"==i?e.features.length:e.length,a=t.name;if(0==s)return void window.MapMessage.ShowMessage({type:"warning",duration:5e3,message:`文件:${a}未检测到空间要素!请重新上传!`});const n={data:e,formateType:i},o=JSON.parse(JSON.stringify(n));this.showList?(this.count=0,Pp.st_geojson2qdata(n.data,"mapLocationsLayer").then((t=>{this.resultListData={records:t,name:this.title,total:t.length,size:1e3,current:1},this.count=t.length}))):(s>1e3&&(n.options={layerType:"symbol",layerLabelPoi:!1}),this.map.$MapEventBus.$emit("map-Importfiles-Panel-locationslayer",n)),this.currentFileuid=t.uid,window.MapMessage.ShowMessage({type:"success",duration:5e3,message:`成功导入! 文件:${a}检测到${s}个空间要素!`}),this.map.$MapEventBus.$emit("map-show-readfiles-callback",o)},clear(){},close(){this.map.$MapEventBus.$emit("map-Importfiles-Panel-close")}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};const du=uu;var mu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-importfiles-panel",style:t.styleCss,attrs:{id:t.domid}},[i("div",{attrs:{id:"mx-map-importfiles-upload"}},[i("el-collapse",{on:{change:t.changeCollapse},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[i("el-collapse-item",{attrs:{title:t.title,name:"1"}},[i("template",{slot:"title"},[i("span",{staticClass:"title"},[t._v(t._s(t.title))])]),t._v(" "),i("transition",{attrs:{name:"el-zoom-in-top"}},[i("div",{staticClass:"mx-content-parm"},[i("el-upload",{staticClass:"mx-myupload-files",attrs:{drag:"","auto-upload":!1,action:t.actionsUrl,"on-change":t.onSubmit,"file-list":t.fileList,"on-remove":t.handleRemove,"on-success":t.handleSuccess,accept:".dwg,.mdb,.zip,.shp"}},[i("i",{staticClass:"el-icon-upload"}),t._v(" "),i("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),i("em",[t._v("点击上传")])]),t._v(" "),t.fileTip?[i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[i("div",{domProps:{innerHTML:t._s(t.fileTip)}})])]:i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("\n 请上传\n "),i("h3",[t._v("shp/zip/dwg")]),t._v("\n 文件,且不超过\n "),i("h3",[t._v("20M")])])],2)],1)])],2)],1)],1),t._v(" "),t.showList&&t.count>0?i("div",{staticClass:"file-result"},[i("ResultList",{ref:"ResultList",attrs:{cdomid:"mx-map-importfiles-upload",cdata:t.resultListData,cmap:t.map,showList:t.showList},on:{changeTopPanel:t.changeTopPanel,clear:t.clearList}})],1):t._e()])};mu._withStripped=!0;const gu=bi({render:mu,staticRenderFns:[]},undefined,du,"data-v-39c9e174",false,undefined,!1,void 0,void 0,void 0);const yu={data:()=>({domid:"map-coordinate-control",position:"",positiondefault:[null,"2px","0px",null],coordinate:"",currentZoom:""}),mounted(){this.positionStyleDefalut();const{map:t}=this;this.map.on("mousemove",(e=>{let i="";if(t.projection){const[t,s]=e.coordinate;i=`x:${t.toFixed(2)} y:${s.toFixed(2)}`}else{var{lng:s,lat:a}=e.lngLat;if(t.sz2000sdk){var n=t.MapmostSDKConvert.toDefinedProj([s,a]);Array.isArray(n)&&(s=n[0]||s,a=n[1]||a)}if(t.enableTransform){const[e,i]=t.M.projTransform(null,t.enableTransform.srid,[s,a]);s=e,a=i}i=s>180?`x: ${s.toFixed(2)} y: ${a.toFixed(2)}`:`lng: ${s.toFixed(6)} lat: ${a.toFixed(6)}`}this.coordinate=i})),this.currentZoom=` z:${parseFloat(t.getZoom().toFixed(2))}`,this.map.on("zoomend",(()=>{this.currentZoom=` z:${parseFloat(t.getZoom().toFixed(2))}`}))},methods:{handlerShowExtent(){const{map:t}=this;if(t){let i=t.getCenter();i.lng&&(i=[i.lng,i.lat]),i.x&&(i=[i.x,i.y]),t.sz2000sdk&&(i=t.MapmostSDKConvert.toDefinedProj(i));var e=JSON.parse(JSON.stringify(i));e.push(t.getZoom()),t.enableTransform&&(i=t.M.projTransform(null,t.enableTransform.srid,i)),i.push(t.getZoom()),alert(`获取地图范围(中心点+层级):[${i}];其他:[${e}]`)}},setPosition(t){this.position=t},positionStyleDefalut(){this.position={top:null==this.positiondefault[0]?"auto":this.positiondefault[0],right:null==this.positiondefault[1]?"auto":this.positiondefault[1],bottom:null==this.positiondefault[2]?"auto":this.positiondefault[2],left:null==this.positiondefault[3]?"auto":this.positiondefault[3]}}},computed:{positionStyle(){return this.position}}};var fu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-control-self mx-map-coordinate rb",style:t.positionStyle,attrs:{id:t.domid},on:{dblclick:function(e){return e.stopPropagation(),t.handlerShowExtent.apply(null,arguments)}}},[i("div",[t._v(t._s(t.coordinate))]),t._v(" "),i("div",{staticClass:"map-zoom"},[i("span",[t._v(t._s(t.currentZoom))])])])};fu._withStripped=!0;const _u=bi({render:fu,staticRenderFns:[]},undefined,yu,"data-v-3d103c68",false,undefined,!1,void 0,void 0,void 0);const vu={data:()=>({domid:"map-weather-control"}),methods:{setPosition(t){this.position=t}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var xu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-control-self map-weather",style:t.styleCss,attrs:{id:t.domid}},[t.weather.icon?i("img",{staticClass:"weather-common",attrs:{src:t.weather.icon}}):t._e(),t._v(" "),i("span",[t._v(t._s(t.weather.value))])])};xu._withStripped=!0;const Cu=bi({render:xu,staticRenderFns:[]},undefined,vu,"data-v-4a18dffa",false,undefined,!1,void 0,void 0,void 0);var Lu={data:()=>({domid:"mapmost-traceSlider-ui",traceDate:"",startTime:0,endTime:1,stepValue:1,stepArr:[1,5,10,20,60,120,300],sliderValue:0,sliderCount:100,traceLineSliderData:[],sliderVisible:!1,playState:!1,dataLastTime:"",activedataLastTime:"",timer:"",customAxios:dr.get,urlPath:"",showSearchBtn:!1}),mounted(){if(this.data&&this.data.length){this.initData(this.data);const t=this.data[0].time,e=this.data[this.data.length-1].time;this.traceDate=t,this.startTime=new Date(t).getHours(),this.endTime=new Date(e).getHours(),this.endTime===this.startTime&&24!=this.endTime&&(this.endTime+=1)}else this.traceDate=new Date},methods:{change(){this.eventCallback&&this.eventCallback("change")},getQueryParams(){return{url:this.urlPath,date:Yo.getDateFormate(this.traceDate,"yyyy-MM-dd"),startTime:this.startTime,startTimeR:this.startTimeR,endTime:this.endTime,endTimeR:this.endTimeR,step:this.stepValue,slider:this.sliderValue}},handlerSearchBtn(){this.searchEventCallback&&this.searchEventCallback()},handlerSearch(){if(!this.url)return void window.MapMessage.ShowMessage({type:"warning",message:"警告:轨迹服务未绑定...",duration:3e3});this.playState&&(this.playState=!1,this.timer&&clearInterval(this.timer));const t=Yo.getDateFormate(this.traceDate,"yyyy-MM-dd");let e="",i="";e=this.startTime<10?`${t} 0${this.startTime}:00:00`:`${t} ${this.startTime}:00:00`,i=this.endTime<=10?`${t} 0${this.endTime-1}:59:59`:`${t} ${this.endTime-1}:59:59`,this.startTimeR=e,this.endTimeR=i;const s=Object.fromEntries(new URL(this.url).searchParams),a=Object.assign(s,{startTime:e,endTime:i});let n=this.url.split("?")[0],o=function(t){let e=new URLSearchParams;for(let i in t)t.hasOwnProperty(i)&&e.append(i,t[i]);return e.toString()}(a);var r=n+"?"+o;this.urlPath=r,this.searchEventCallback(),this.customAxios({url:r,method:"get",nomessage:!0}).then((t=>{let e=t.data;this.initData(e),this.renderTraceLine&&this.renderTraceLine({visible:!0,data:this.traceLineSliderData})}))},initData(t){if(this.traceLineSliderData=t,this.sliderCount=this.traceLineSliderData.length-1,0==this.traceLineSliderData.length)return this.sliderVisible=!1,window.MapMessage.ShowMessage({type:"warning",message:"警告:服务未查询到轨迹数据...",duration:3e3}),!0;this.sliderValue=0,this.sliderVisible=!0,this.activedataLastTime=this.traceLineSliderData[this.sliderValue].time.split(" ")[1].trim(),this.dataLastTime=this.traceLineSliderData[this.sliderCount].time.split(" ")[1].trim()},handlerDelete(){this.timer&&clearInterval(this.timer),this.closeBack()},handlerPlay(){this.playState?(this.playState=!1,this.timer&&clearInterval(this.timer)):(this.playState=!0,this.timer&&clearInterval(this.timer),this.timer=setInterval((()=>{if(this.sliderValue>=this.sliderCount)return this.sliderValue=0,this.activedataLastTime=this.traceLineSliderData[this.sliderValue].time.split(" ")[1].trim(),clearInterval(this.timer),void(this.playState=!1);this.traceLineSliderData[this.sliderValue]&&(this.activedataLastTime=this.traceLineSliderData[this.sliderValue].time.split(" ")[1].trim(),this.sliderValue+=this.stepValue)}),1e3))},closeBack(){this.close&&this.close()},inputSlider(t){this.renderTraceLine&&this.renderTraceLine({num:t}),this.activedataLastTime=this.traceLineSliderData[t].time}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}},beforeDestroy(){this.timer&&clearInterval(this.timer),this.close&&this.close()}};const Mu=Lu;var bu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"w-map-traceplay",style:t.styleCss,attrs:{id:t.domid}},[i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"trace-box-card"},[i("div",{staticClass:"apanel1"},[i("el-date-picker",{staticClass:"paneldate",attrs:{size:"mini",type:"date",placeholder:"选择日期",format:"yyyy 年 MM 月 dd 日","value-format":"yyyy-MM-dd"},on:{change:t.change},model:{value:t.traceDate,callback:function(e){t.traceDate=e},expression:"traceDate"}}),t._v(" "),i("el-select",{staticClass:"paneltime",attrs:{size:"mini",filterable:"",placeholder:"请选择"},on:{change:t.change},model:{value:t.startTime,callback:function(e){t.startTime=e},expression:"startTime"}},t._l(25,(function(t){return i("el-option",{key:t-1,attrs:{label:t-1,value:t-1}})})),1),t._v(" "),i("div",{staticClass:"splitetip"},[t._v("时 至")]),t._v(" "),i("el-select",{staticClass:"paneltime",attrs:{size:"mini",filterable:"",placeholder:"请选择"},on:{change:t.change},model:{value:t.endTime,callback:function(e){t.endTime=e},expression:"endTime"}},[t._l(24,(function(e){return[e>t.startTime?i("el-option",{key:e,attrs:{label:e,value:e}}):t._e()]}))],2),t._v(" "),i("div",{staticClass:"splitetip"},[t._v("时")]),t._v(" "),i("el-select",{staticClass:"panelstep",attrs:{size:"mini",filterable:"",placeholder:"请选择"},model:{value:t.stepValue,callback:function(e){t.stepValue=e},expression:"stepValue"}},t._l(t.stepArr,(function(t,e){return i("el-option",{key:e,attrs:{label:"x"+t,value:t}})})),1),t._v(" "),i("el-row",{staticClass:"trace-el-row"},[t.url?i("el-button",{attrs:{size:"mini",icon:"el-icon-search",type:"primary",circle:""},on:{click:t.handlerSearch}}):t._e(),t._v(" "),!t.url&&t.showSearchBtn?i("el-button",{attrs:{size:"mini",icon:"el-icon-search",type:"primary",circle:""},on:{click:t.handlerSearchBtn}}):t._e(),t._v(" "),i("el-button",{attrs:{size:"mini",type:"danger",icon:"el-icon-delete",circle:""},on:{click:t.handlerDelete}})],1)],1),t._v(" "),t.sliderVisible?i("el-divider",{staticClass:"tracediver"}):t._e(),t._v(" "),t.sliderVisible?i("div",{staticClass:"apanel1"},[i("div",{staticClass:"tiptime"},[i("span",[t._v(" "+t._s(t.activedataLastTime+" -"))]),t._v(" "),i("span",[t._v(" "+t._s(t.dataLastTime))])]),t._v(" "),i("i",{staticClass:"traceplaybtn",class:[t.playState?"el-icon-video-pause":"el-icon-video-play"],on:{click:t.handlerPlay}}),t._v(" "),i("el-slider",{staticClass:"traceLineside",attrs:{min:0,max:t.sliderCount,step:1,"show-tooltip":!1},on:{input:t.inputSlider},model:{value:t.sliderValue,callback:function(e){t.sliderValue=e},expression:"sliderValue"}})],1):t._e()],1)])};bu._withStripped=!0;const wu=bi({render:bu,staticRenderFns:[]},undefined,Mu,"data-v-23074635",false,undefined,!1,void 0,void 0,void 0);var Su={name:"MapSwitchMap2",components:{MapStyle:Ii},props:{data:{type:Array,default:()=>[]},MapSwitch:{type:[Boolean,Object],default:()=>!1}},data:()=>({selectIndex:"",refreshPopover:!1,mouseOverDrop:!1,baseLayerStyles:{},visibleState:{},defaultLayer:null,localData:[],baseLayer:{},opacity:0,layers:[],showLayerTool:!1,showIsCheck:!1,defaultIndex:"0"}),created(){this.localData=JSON.parse(JSON.stringify(this.data)),this.map=this.$parent.getMap(),this.map1=this.$parent.getMap1(),this.defaultIndex=this.map1.getMapSwitchSelectIndex()},mounted(){if(this.showLayerTool=!1,0==this.localData.length)return;let t=this.localData.filter((t=>t.default))[0];var e=this.defaultIndex.split("-");!t&&this.localData.length>0&&(t=this.localData[e[0]]),t.styleURL&&(this.showIsCheck=!0),this.showIsCheck||(e.length>1&&0!=e[1]?this.changeBaseMap({styleIndex:e[1],index:e[0]}):this.changeLayer(t,0!=e[0]?e[0]:0)),this.map.getMapSwitchSelectIndex=()=>this.selectIndex},methods:{mouseLeaveDrop(){this.mouseOverDrop=!1,this.refreshPopover=!1},changeDropStyle(t,e){this.visibleState[e.id]&&(this.mouseOverDrop=t,t?this.refreshPopover=t:setTimeout((()=>{this.mouseOverDrop||(this.refreshPopover=!1)}),200))},changeStyle(t,e,i){this.refreshPopover=!0,this.$nextTick((()=>{this.refreshPopover=!1}));let s=JSON.parse(JSON.stringify(t));const a=s.mapResourceList[e];s.mapResourceList=[a],this.baseLayer.id==s.id&&(this.baseLayer={}),this.changeLayer(s,i),this.selectIndex=i+"-"+e},styleDropdown(t){var e=!1;const i=t.mapResourceList;return i.length>1&&(e="style"==i[1].layerType),this.visibleState[t.id]=e,e},getIco:t=>JSON.parse(t.icon).icon,changeBaseMap(t){"object"==typeof t?this.changeStyle(this.localData[t.index],t.styleIndex,t.index):this.changeLayer(this.localData[t])},changeLayer(t,e=0){if(this.baseLayer.id==t.id)return this.showIsCheck?(this.layerIds&&this.layerIds.length>0&&this.layerIds.forEach((t=>{this.map.M.layerManager.removeLayerById(t)})),this.layerIds=[],this.baseLayer={},this.selectIndex="",void setTimeout((()=>{this.map.M.layerManager.initBaseMapStyleSheet(this.map)}),200)):void 0;this.baseLayer.id&&(this.layerIds&&this.layerIds.length>0&&this.layerIds.forEach((t=>{this.map.M.layerManager.removeLayerById(t)})),this.layerIds=[]),this.layerIds&&this.layerIds.length>0&&this.layerIds.forEach((t=>{this.map.M.layerManager.removeLayerById(t)})),this.layerIds=[],this.addLayerHandler(t),this.selectIndex=e+"-0"},addLayerHandler(t){this.baseLayer=t;const{mapResourceList:e}=t;e.length>0&&this.addBaseMapCallBack(e,0)},addBaseMapCallBack(t,e){const i=t[e];this.map.M.layerManager.addBaseLayer(i,(()=>{let s=e+1;this.layerIds.push(i.id),t[s]&&this.addBaseMapCallBack(t,s)}))},removeLayerById(t){this.map.M.layerManager.removeLayerById(t)},addBaseLayer(t){this.map.M.layerManager.addBaseLayer(t)},onOpacityChange(){for(const t of this.layers)t.setOpacity(parseFloat(this.opacity))},getLayerById(t){return this.map.M.layerManager.getLayerById(t)},onPopoverShow(){if(this.layers=[],this.baseLayer)for(const t of this.baseLayer.mapResourceList){const e=this.getLayerById(t.id);this.layers.push(e),this.opacity=e.getOpacity()}},toggleLayer(){const t=this.localData.filter((t=>t.id!=this.baseLayer.id))[0];t&&this.changeLayer(t)}}};const Iu=Su;var Eu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-switch"},t._l(t.localData,(function(e,s){return i("div",{key:s,staticClass:"mx-map-btn",class:{active:t.baseLayer.id==e.id},on:{click:function(i){return t.changeLayer(e)},mouseover:function(i){return t.changeDropStyle(!0,e)},mouseleave:function(i){return t.changeDropStyle(!1,e)}}},[e.icon?i("i",{class:e.icon}):i("i",{class:"地图"==e.label?"icon-map-o":"icon-earth"}),t._v(" "),t.styleDropdown(e)?i("div",{staticClass:"mx-map-switch-drop"},[i("div",{staticClass:"drop-style"},[i("span",[t._v(t._s(e.label)),i("i",{staticClass:"el-icon-arrow-down"})])]),t._v(" "),t.refreshPopover&&t.styleDropdown(e)?i("div",{staticClass:"mx-popver-style el-popover",on:{mouseover:function(e){t.mouseOverDrop=!0},mouseleave:t.mouseLeaveDrop}},[i("map-style",{attrs:{data:e,selectIndex:t.selectIndex,baseIndex:s},on:{change:t.changeStyle}})],1):t._e()]):i("span",[t._v(t._s(e.label))]),t._v(" "),t.showLayerTool&&t.baseLayer.id==e.id?i("el-popover",{attrs:{placement:"bottom",trigger:"hover"},on:{show:t.onPopoverShow}},[i("a",{attrs:{slot:"reference"},slot:"reference"},[i("i",{staticClass:"el-icon-arrow-down"})]),t._v(" "),i("div",[i("label",[t._v("透明度")]),t._v(" "),i("div",[i("input",{directives:[{name:"model",rawName:"v-model",value:t.opacity,expression:"opacity"}],staticStyle:{width:"100%"},attrs:{type:"range",min:"0",max:"1",step:"0.1"},domProps:{value:t.opacity},on:{input:function(e){return t.onOpacityChange()},change:function(e){return t.onOpacityChange()},__r:function(e){t.opacity=e.target.value}}})])])]):t._e()],1)})),0)};Eu._withStripped=!0;const Tu=bi({render:Eu,staticRenderFns:[]},undefined,Iu,"data-v-0e3202c8",false,undefined,!1,void 0,void 0,void 0);class Du{constructor(t){this.flat={},this.data=null,this.dataItem=null,this.render(t)}render(t){const e=t=>{for(const i of t)this.flat[i.id]=i,i.layerIds=(i.mapResourceList||[]).map((t=>t?t.id:(console.error("图层配置错误"),""))),i.children&&e(i.children)};for(const i of t)this.dataItem=i,e(t);this.data=t}getCheckedIds(){const t=[];for(const e in this.flat)if(Object.prototype.hasOwnProperty.call(this.flat,e)){const i=this.flat[e]||void 0;i&&i.isChecked&&!i.children&&t.push(i.id)}return t}getCheckedNodes(){const t=[];for(const e in this.flat)if(Object.prototype.hasOwnProperty.call(this.flat,e)){const i=this.flat[e]||void 0;i&&i.isChecked&&!i.children&&t.push(i)}return t}getExpandIds(){const t=[];for(const e in this.flat)if(Object.prototype.hasOwnProperty.call(this.flat,e)){const i=this.flat[e]||void 0;i&&i.expand&&t.push(i.id)}return t}getSources(){const t=[];for(const e in this.flat)if(Object.prototype.hasOwnProperty.call(this.flat,e)){const i=this.flat[e]||void 0;""!=i.serviceUrl&&["vector","raster"].includes(i.memo)&&t.push(i)}return t}}var Pu={props:{layerIds:Array},inject:["mapP2"],data:()=>({opacity:1,layers:[],layersidsArr:[],baseLayerType:["background","sky"]}),mounted(){this.map=this.mapP2(),this.init()},methods:{init(){for(const t of this.layerIds){const e=this.map.M.layerManager.getLayerById(t);this.layers.push(e);const i=e.layer.layers;Array.isArray(i)&&0!=i.length?i.forEach((t=>{this.layersidsArr.push(t.id)})):this.layersidsArr.push(e.id),this.layersidsArr.length>0&&(this.opacity=e.getOpacity(this.layersidsArr[0]))}},onLayerUp(){const t=this.layersidsArr.length;if(t>0){const e=this.layersidsArr[t-1];this._getSiblings(e,(t=>{const{nextId:i,next2Id:s}=t;i==e||null==i&&null==s?this.$message({message:"图层已置顶!",type:"warning"}):this.layersidsArr.forEach((t=>{this.map.getLayer(t)&&(s?this.map.moveLayer(t,s):this.map.moveLayer(t))}))}))}},onLayerUpMost(){this.layersidsArr.forEach((t=>{this.map.getLayer(t)&&this.map.moveLayer(t)}))},onLayerDown(){if(this.layersidsArr.length>0){const t=this.layersidsArr[0];this._getSiblings(t,(e=>{const{preId:i}=e;i!=t?this.layersidsArr.forEach((t=>{this.map.getLayer(t)&&this.map.moveLayer(t,i)})):this.$message({message:"图层已置底!",type:"warning"})}))}},onLayerDownMost(){if(this.layersidsArr.length>0){const t=this.layersidsArr[0],e=this.map.getStyle().layers.filter((t=>!this.baseLayerType.includes(t.type)&&"g_source"!=t.source));if(e.length){const i=e[0].id;i!=t?this.layersidsArr.forEach((t=>{this.map.getLayer(t)&&this.map.moveLayer(t,i)})):this.$message({message:"图层已置底!",type:"warning"})}}},onChange(){for(const t of this.layers)t.setOpacity(parseFloat(this.opacity)),this.layersidsArr.length>0&&t.setOpacity(parseFloat(this.opacity),this.layersidsArr[0])},_getSiblings(t,e){let i=null,s=null,a=null;const n=this.map.getStyle().layers.filter((t=>!this.baseLayerType.includes(t.type)&&"g_source"!=t.source)),o=n.length;for(let r=0;r<o;r++){if(n[r].id===t){const o=n[r-1];i=o?o.id:t,s=n[r+1]?n[r+1].id:t,a=n[r+2]?n[r+2].id:"",e({preId:i,nextId:s,next2Id:a});break}}}}};const Ou=Pu;var ku=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-layer-tools"},[i("span",{staticClass:"mx-map-layer-tools__arrow"}),t._v(" "),i("ul",[i("li",{on:{click:t.onLayerUp}},[i("el-icon",[i("SortUp")],1),t._v("上移一层\n ")],1),t._v(" "),i("li",{on:{click:t.onLayerUpMost}},[t._v("置顶")]),t._v(" "),i("li",{on:{click:t.onLayerDown}},[i("el-icon",[i("SortDown")],1),t._v("下移一层\n ")],1),t._v(" "),i("li",{on:{click:t.onLayerDownMost}},[t._v("置底")]),t._v(" "),i("li",[i("div",[t._v("透明度")]),t._v(" "),i("div",[i("input",{directives:[{name:"model",rawName:"v-model",value:t.opacity,expression:"opacity"}],staticStyle:{width:"85%"},attrs:{type:"range",min:"0",max:"1",step:"0.1"},domProps:{value:t.opacity},on:{input:function(e){return t.onChange()},change:function(e){return t.onChange()},__r:function(e){t.opacity=e.target.value}}})])])])])};ku._withStripped=!0;const Nu=bi({render:ku,staticRenderFns:[]},undefined,Ou,undefined,false,undefined,!1,void 0,void 0,void 0);var Au={props:{data:{type:Array,default:()=>[]},checkboxParent:{type:Boolean,default:!0},closeDefaultExpand:{type:Boolean,default:!1},allCheckedIds:{type:Array,default:()=>[]},showSearchEnable:{type:Boolean,default:!0},showToolsEnable:{type:Boolean,default:!0},closeDefaultLayer:{type:Boolean,default:!1},closeFillOutLineOpacity:{type:Boolean,default:!1},layerDomid:{type:String,default:""}},components:{LayerTools2:Nu},inject:["mapP2"],filters:{showCount:t=>t.childNodes.length?`(${t.childNodes.length})`:""},data:()=>({expandAll:!1,layerData:[],checkedKeys:[],expandedKeys:[],popoverVisible:!1,popoverLayerIds:[],popoverTop:0,popoverRight:30,setStyleAllCheckedIds:[],maxHeightStyle:{maxHeight:"600px"},filterText:""}),mounted(){this.map=this.mapP2(),this.data.length>0&&(this.treeStore=new Du(this.data),this.init()),this.funToken=this.map.M.pubsub.subscribe("clearAllLayer",(()=>{this.clearAllLayer()})),this.map.M.destorySubscribe=()=>{this.map.M.pubsub.remove("clearAllLayer",this.funToken)},this.map.M.getDefaultLayerKeys=()=>this.checkedKeys,this.$nextTick((()=>{this.initHeight()})),this.map.M.getTreeObj=()=>this.getTreeObj(),this.map.M.getAllCheckedIds=()=>this.getAllCheckedIds(),this.map.M.setAllCheckedIds=t=>this.setAllCheckedIds(t)},beforeDestroy(){this.map.M.destorySubscribe()},methods:{initHeight(){var t=document.getElementById(this.layerDomid).getBoundingClientRect(),e=this.map.getCanvas().getBoundingClientRect();const i=t.top-e.top;e&&(this.maxHeightStyle.maxHeight=.6*(e.height-i)+"px")},clearAllLayer(){this.setIsCheckLayer(),this.map.setStyleInitAddCheckLayer=()=>{this.setStyleAllCheckedIds.forEach((t=>{this.setMapLayerChecked(t,!1),setTimeout((()=>{this.setMapLayerChecked(t,!0)}),100)}))}},setIsCheckLayer(){this.setStyleAllCheckedIds=this.getAllCheckedIds()},setMapLayerChecked(t,e=!0){const i=this.$refs.tree;Array.isArray(t)?t.forEach((t=>{i.setChecked(t,e,!0)})):i.setChecked(t,e,!0)},filterNode:(t,e)=>!t||-1!==e.label.indexOf(t),setExpand(t){const e=this.$refs.tree;for(var i=0;i<e.store._getAllNodes().length;i++)e.store._getAllNodes()[i].expanded=t},setExpandById(t,e){this.$refs.tree.getNode(t).expanded=e},init(){this.layerData=this.treeStore.data,1!=this.closeDefaultExpand?this.expandedKeys=this.treeStore.getExpandIds():this.expandedKeys=[],this.$nextTick((()=>{this.allCheckedIds.forEach((t=>{this.setMapLayerChecked(t,!0)}))}))},async layerCheckedT(t,e){return t?await this.map.M.layerManager.addLayer(e):await this.map.M.layerManager.removeLayerById(e.id)},legendCheckedT(t,e){""!==e.legend&&(t?this.map.M.pubsub.publish("add-legend",{id:e.id,url:e.legend}):this.map.M.pubsub.publish("remove-legend",e.id))},nodeClick(t,e){if(!e.disabled&&!t.children){this.$refs.tree.setChecked(t.id||t.ID,!e.checked,!0)}},async onNodeChecked(t,e){this.legendCheckedT(e,t);const{mapResourceList:i}=t;if(i.length>0)for(const t of i)await this.layerCheckedT(e,t);this.$emit("node-checked",t,e),this.map.M.layerManager.mapLayerChangeCheck(t,e)},onLayerTools(t,e){this.popoverVisible=!0,this.popoverLayerIds=e.layerIds,this.popoverTop=t.clientY+15},onMouseLeave(){this.popoverVisible=!1},setChecked(t,e){this.$refs.tree.setChecked(t.id,e)},clearAll(){this.$refs.tree.setCheckedKeys([])},getAllCheckedIds(){return this.$refs.tree.getCheckedKeys()}},watch:{filterText(t){this.$refs.tree.filter(t)},data(t){this.treeStore=new Du(t),this.init()}}};const Ru=Au;var Fu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-layer"},[t.showSearchEnable?i("el-input",{staticClass:"mx-map-filter-search",attrs:{placeholder:"输入【图层名称】进行过滤",clearable:""},model:{value:t.filterText,callback:function(e){t.filterText=e},expression:"filterText"}}):t._e(),t._v(" "),i("el-tree",{ref:"tree",staticClass:"mx-treecontainer",class:[0==t.checkboxParent?"mx-tree-disabled-checkbox":""],style:t.maxHeightStyle,attrs:{data:t.layerData,"show-checkbox":"","node-key":"id","default-expand-all":t.expandAll,"default-checked-keys":t.checkedKeys,"default-expanded-keys":t.expandedKeys,"show-icon":!0,"render-after-expand":!1,"auto-expand-parent":!1,"filter-node-method":t.filterNode},on:{"check-change":t.onNodeChecked,"node-click":t.nodeClick},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.node,a=e.data;return[i("div",{staticClass:"mx-title-box"},[i("div",[a.imgSrc?i("img",{staticStyle:{"margin-right":"6px"},attrs:{src:"./assets/legend/"+a.imgSrc,height:"12"}}):t._e()]),t._v(" "),i("div",{staticClass:"mx-treelabel",staticStyle:{flex:"1","text-align":"left"},attrs:{title:s.label}},[i("span",{class:s.data.children?"mx-tree-group-icon":"mx-tree-child-icon"},[t._v(t._s(s.label)+t._s(t._f("showCount")(s))+"\n "),i("svg",{directives:[{name:"show",rawName:"v-show",value:1==s.data.supportIQuery,expression:"node.data.supportIQuery == 1"}],staticClass:"tree-issupport-iquery",attrs:{t:"1701323451083",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"23012",width:12,height:12}},[i("path",{attrs:{d:"M464 800H199.776L96 928h468.288L464 800z m0-32C649.568 768 800 617.568 800 432S649.568 96 464 96 128 246.432 128 432 278.432 768 464 768z",fill:"#FFFFFF","p-id":"23013","data-spm-anchor-id":"a313x.search_index.0.i19.52d33a81tQsosi"}}),t._v(" "),i("path",{attrs:{d:"M464 800H199.776L96 928h468.288L464 800z m34.56 96H163.136l51.904-64h233.376l50.144 64z",fill:"#808FA1","p-id":"23014"}}),t._v(" "),i("path",{attrs:{d:"M464 736a304 304 0 1 1 0-608 304 304 0 0 1 0 608z m0 32C649.568 768 800 617.568 800 432S649.568 96 464 96 128 246.432 128 432 278.432 768 464 768z m235.776-94.08a48 48 0 0 0 0 67.904l158.4 158.4a48 48 0 0 0 67.872-67.904l-158.4-158.4a48 48 0 0 0-67.84 0z",fill:"#5D6D7E","p-id":"23015"}}),t._v(" "),i("path",{attrs:{d:"M470.72 705.28a176 176 0 1 0-270.816-1.728h-0.128L335.84 896l134.848-190.72z m-134.72-25.28a88 88 0 1 1 0-176 88 88 0 0 1 0 176z",fill:"#30AD98","p-id":"23016","data-spm-anchor-id":"a313x.search_index.0.i18.52d33a81tQsosi"}}),t._v(" "),i("path",{attrs:{d:"M358.432 198.72c-2.88 12.608-4.832 25.6-5.76 38.88a224 224 0 0 1 323.968 265.12c12.704-3.552 25.056-8.064 36.928-13.44A256 256 0 0 0 358.4 198.72z",fill:"#808FA1","p-id":"23017"}})])])]),t._v(" "),t._e()])]}}],null,!0)}),t._v(" "),t.popoverVisible?i("layer-tools2",{style:{top:t.popoverTop+"px",right:t.popoverRight+"px"},attrs:{layerIds:t.popoverLayerIds},nativeOn:{mouseleave:function(e){return t.onMouseLeave.apply(null,arguments)}}}):t._e()],1)};Fu._withStripped=!0;const Bu=bi({render:Fu,staticRenderFns:[]},undefined,Ru,"data-v-5c9b0aff",false,undefined,!1,void 0,void 0,void 0);var Gu={props:{data:{type:Array,default:()=>[]},layerDomid:{type:String,default:""},showToolsEnable:{type:Boolean,default:!0}},components:{LayerToolMap2:Nu},data:()=>({popoverVisible:!1,popoverLayerIds:[],popoverTop:0,popoverRight:30}),mounted(){},methods:{onNodeChecked(t,e){this.$emit("node-checked",t,e)},onLayerTools(t,e){var i;this.popoverVisible=!0,this.popoverLayerIds=e.layerIds,this.layerDomid&&(i=document.getElementById(this.layerDomid).getBoundingClientRect()),this.popoverTop=t.clientY-i.top+15,this.popoverRight=20},setCheckedKeys(t){this.$refs.tree.setCheckedKeys(t)},setChecked(t,e){var i=t;"object"==typeof t&&(i=t.id),this.$nextTick((()=>{this.$refs.tree.setChecked(i,e)}))},onMouseLeave(){this.popoverVisible=!1}}};const zu=Gu;var ju=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-layer"},[i("el-tree",{ref:"tree",attrs:{data:t.data,"show-checkbox":"","node-key":"id","show-icon":!0},on:{"check-change":t.onNodeChecked},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.node;return e.data,[i("div",{staticClass:"mx-title-box"},[i("div",{staticStyle:{flex:"1","text-align":"left"}},[i("span",[t._v(t._s(s.label))])]),t._v(" "),t._e()])]}}],null,!0)}),t._v(" "),i("layer-tool-map2",{directives:[{name:"show",rawName:"v-show",value:t.popoverVisible,expression:"popoverVisible"}],style:{top:t.popoverTop+"px",right:t.popoverRight+"px"},attrs:{layerIds:t.popoverLayerIds},nativeOn:{mouseleave:function(e){return t.onMouseLeave.apply(null,arguments)}}})],1)};ju._withStripped=!0;var Uu={inject:{adapter:{from:"adapter2",default:()=>null},mapP2:{from:"mapP2",default:()=>null}},props:{data:{type:Array,default:()=>[],required:!0},allCheckedIds:{type:Array,default:()=>[]},MapLayerManager:{type:[Boolean,Object],default:()=>!1}},created(){this.layerDomid="layer"+Math.floor(999*Math.random()),this.adapter?Object.assign(this,this.adapter().LM.props):this.localData=this.data,"object"==typeof this.MapLayerManager&&(this.showImportData=void 0!==this.MapLayerManager.showImportData&&this.MapLayerManager.showImportData,this.showSearchEnable=void 0!==this.MapLayerManager.showSearchEnable&&this.MapLayerManager.showSearchEnable,this.closeDefaultExpand=void 0!==this.MapLayerManager.closeDefaultExpand&&this.MapLayerManager.closeDefaultExpand,this.closeOthersControls=void 0!==this.MapLayerManager.closeOthersControls&&this.MapLayerManager.closeOthersControls,this.selectedLayerControls=void 0===this.MapLayerManager.selectedLayerControls||this.MapLayerManager.selectedLayerControls,this.showToolsEnable=void 0===this.MapLayerManager.showToolsEnable||this.MapLayerManager.showToolsEnable,this.layerDragOrder=void 0===this.MapLayerManager.layerDragOrder||this.MapLayerManager.layerDragOrder,this.checkboxParent=0!=this.MapLayerManager.checkboxParent,this.layout=void 0!==this.MapLayerManager.layout?this.MapLayerManager.layout:this.layout)},components:{MapLayerMap2:Bu,LayerViewMap2:bi({render:ju,staticRenderFns:[]},undefined,zu,undefined,false,undefined,!1,void 0,void 0,void 0)},data:()=>({showImportData:!1,expandAll:!1,visible:!1,activeTab:"layer",favourData:[],localData:[],localDataCopy:[],recentData:[],selectedData:[],layerDragOrder:!0,showSearchEnable:!1,closeOthersControls:!1,selectedLayerControls:!0,closeDefaultExpand:!1,showToolsEnable:!0,checkboxParent:!0,layout:"horizontal"}),mounted(){const t=this.localData.length;t>0&&0==this.showImportData&&"自定义图层"==this.localData[t-1].label&&this.localData.splice(t-1,1),this.localDataCopy=JSON.parse(JSON.stringify(this.localData)),setTimeout((()=>{var t=document.getElementById("topRightBar");if(t){var e=t.getElementsByClassName("mx-layer-manager");if(e[0]){e[0].getElementsByClassName("activebtn")[0]&&(this.visible=!0)}}}),100)},methods:{ShowExpandTree(){this.$refs.mapLayer.setExpand&&(this.expandAll=!this.expandAll,this.$refs.mapLayer.setExpand(this.expandAll))},onClick(t){const e=this.recentData.findIndex((e=>e.id==t.id));-1!==e?(this.recentData.splice(e,1),this.recentData.unshift(Object.assign(t,{isChecked:!0}))):(this.recentData.unshift(Object.assign(t,{isChecked:!0})),this.$nextTick((()=>{}))),this.changeSelectedLayerData(t)},changeSelectedLayerData(t){const e=this.selectedData.findIndex((e=>e.id==t.id));-1!==e?this.selectedData.splice(e,1):(this.selectedData.unshift(Object.assign(t,{isChecked:!0})),this.$nextTick((()=>{this.$refs.selectedView.setChecked(t.id,!0)})))},onCollect(t){const e=1==t.data.favourite;if(this.$set(t.data,"favourite",!e),e){const e=this.favourData.findIndex((e=>e.id==t.data.id));this.favourData.splice(e,1)}else this.favourData.push(Object.assign(t.data,{isChecked:!0})),this.$nextTick((()=>{this.$refs.favourView.setChecked(t.data.id,!0)}))},onSelectedNodeChcked(t,e){this.$refs.mapLayer.setChecked(t,e),this.$refs.favourView.setChecked(t,e),this.$refs.recentView.setChecked(t,e)},onRecentNodeChcked(t,e){this.$refs.mapLayer.setChecked(t,e),this.$refs.favourView.setChecked(t,e)},onViewNodeChcked(t,e){this.$refs.mapLayer.setChecked(t,e),this.$refs.recentView.setChecked(t,e)},onLayerNodeChecked(t,e){const i=t;i.children||(this.onClick(i),i.isChecked=e),this.$refs.favourView.setChecked(i,e),this.$refs.recentView.setChecked(i,e)},clearAll(){this.$refs.mapLayer.clearAll()}},computed:{},watch:{visible:{handler(t){t&&this.$nextTick((()=>{var t=this.$refs.mapLayer;t&&t.initHeight()}))},immediate:!0,deep:!0}}};const Vu=Uu;var qu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-layer-manager mx-manager-container"},[i("div",{staticClass:"mx-map-btn",class:{activebtn:t.visible},on:{click:function(e){t.visible=!t.visible}}},[i("i",{staticClass:"icon-layer"}),t._v("图层"),t.visible?i("i",{staticClass:"el-icon-arrow-down"}):i("i",{staticClass:"el-icon-arrow-up"})]),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"mx-layer-panel",class:["vertical"===t.layout?"isVertical":"isHorizontal"],attrs:{id:t.layerDomid}},["vertical"===t.layout?i("div",{staticClass:"mx-panel-header"},[i("i",{staticClass:"icon-layer"})]):t._e(),t._v(" "),i("div",{staticClass:"mx-layer-container-panel"},[i("div",{staticClass:"mx-layer-panel-header"},[i("div",{class:{active:"layer"==t.activeTab},on:{click:function(e){t.activeTab="layer"}}},[i("span",[t._v("图层")])]),t._v(" "),!t.closeOthersControls&&t.selectedLayerControls?i("div",{class:{active:"selectedLayer"==t.activeTab},on:{click:function(e){t.activeTab="selectedLayer"}}},[i("span",[t._v("已选")])]):t._e(),t._v(" "),t._e(),t._v(" "),t._e()]),t._v(" "),i("div",{staticClass:"mx-layer-panel-content"},[i("div",{directives:[{name:"show",rawName:"v-show",value:"layer"==t.activeTab,expression:"activeTab == 'layer'"}],attrs:{label:"图层",name:"layer"}},[i("map-layer-map2",{ref:"mapLayer",attrs:{data:t.localDataCopy,closeDefaultExpand:t.closeDefaultExpand,showSearchEnable:t.showSearchEnable,showToolsEnable:t.showToolsEnable,checkboxParent:t.checkboxParent,allCheckedIds:t.allCheckedIds,layerDomid:t.layerDomid},on:{"node-checked":t.onLayerNodeChecked},scopedSlots:t._u([{key:"extra-tool",fn:function(e){return e.node,[t._e(),t._v(" "),t._t("extra-tool")]}}],null,!0)})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"favour"==t.activeTab,expression:"activeTab == 'favour'"}],attrs:{label:"收藏",name:"favour"}},[i("layer-view-map2",{ref:"favourView",attrs:{layerDomid:t.layerDomid,data:t.favourData},on:{"node-checked":t.onViewNodeChcked},scopedSlots:t._u([{key:"extra-tool",fn:function(e){var s=e.node;return[i("a",{staticStyle:{"margin-left":"2px"},on:{click:function(e){return e.stopPropagation(),t.onCollect(s)}}},[i("i",{class:{"icon-star-empty":!s.data.favourite,"icon-star-full":s.data.favourite}})]),t._v(" "),t._t("extra-tool")]}}],null,!0)})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"recent"==t.activeTab,expression:"activeTab == 'recent'"}],attrs:{label:"最近",name:"recent"}},[i("layer-view-map2",{ref:"recentView",attrs:{layerDomid:t.layerDomid,data:t.recentData},on:{"node-checked":t.onRecentNodeChcked},scopedSlots:t._u([{key:"extra-tool",fn:function(e){var s=e.node;return[i("a",{staticStyle:{"margin-left":"2px"},on:{click:function(e){return e.stopPropagation(),t.onCollect(s)}}},[i("i",{class:{"icon-star-empty":!s.data.favourite,"icon-star-full":s.data.favourite}})]),t._v(" "),t._t("extra-tool")]}}],null,!0)})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"selectedLayer"==t.activeTab,expression:"activeTab == 'selectedLayer'"}],attrs:{label:"已选",name:"recent"}},[i("layer-view-map2",{ref:"selectedView",attrs:{layerDomid:t.layerDomid,draggable:t.layerDragOrder,data:t.selectedData},on:{"node-checked":t.onSelectedNodeChcked},scopedSlots:t._u([{key:"extra-tool",fn:function(t){t.node}}],null,!0)})],1)])]),t._v(" "),i("div",{staticClass:"mx-layer-tool"},[i("el-tooltip",{attrs:{content:"关闭图层"}},[i("a",{staticClass:"mx-btn-tool",on:{click:t.clearAll}},[i("i",{staticClass:"el-icon-brush"})])])],1),t._v(" "),i("div",{staticClass:"mx-tree-expand"},["layer"==t.activeTab?i("el-tooltip",{attrs:{content:t.expandAll?"收起":"展开",placement:"left"}},[i("span",[i("i",{class:[t.expandAll?"el-icon-s-unfold":"el-icon-s-fold"],on:{click:t.ShowExpandTree}})])]):t._e()],1)])])};qu._withStripped=!0;const Hu={props:["baseMaps","mapConfig","option","layerData","mapControls","allCheckedIds","styleCssSwitch","styleCssLayerManager","MapLayerManager"],components:{MapSwitchMap2:Tu,LayerManagerMap2:bi({render:qu,staticRenderFns:[]},undefined,Vu,"data-v-20214584",false,undefined,!1,void 0,void 0,void 0)},inject:{adapter:{from:"adapter2",default:()=>null},mapP:{from:"mapP",default:()=>null}},provide(){return{mapP2:this.getMap,mapP1:this.getMap1}},data:()=>({refresh:!1,baseMapsData:!1,localData:[]}),created(){this.adapter?Object.assign(this,this.adapter().MS.props):this.localData=this.data},mounted(){this.map=this.mapP(),this.map.GLSDK.MapSyncMoveControlPlugins.loadMap(this.mapConfig,((t,e)=>{this.baseMapsData=this.localData,this.refresh=!0,this.$nextTick((()=>{if(1==e){const t=document.getElementById("mx-map-compare").offsetLeft;document.getElementById("mapex").style.left=`${t+30}px`}}))}))},methods:{getMap1(){return this.map},getMap(){return this.map.GLSDK.MapSyncMoveControlPlugins.getMap2()}}};var $u=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.refresh?i("div",{staticClass:"mapex",staticStyle:{left:"0px"},attrs:{id:"mapex"}},[i("map-switch-map2",{directives:[{name:"show",rawName:"v-show",value:t.baseMapsData&&0!=t.mapControls.MapSwitch&&("object"!=typeof t.mapControls.MapSwitch||0!=t.mapControls.MapSwitch.show),expression:"\n baseMapsData &&\n mapControls.MapSwitch != false &&\n (typeof mapControls.MapSwitch == 'object'\n ? mapControls.MapSwitch.show == false\n ? false\n : true\n : true)\n "}],style:t.styleCssSwitch,attrs:{data:t.baseMapsData,MapSwitch:t.mapControls.MapSwitch}}),t._v(" "),i("layer-manager-map2",{directives:[{name:"show",rawName:"v-show",value:0!=t.mapControls.MapLayerManager&&(t.option.MapLayers.length||t.option.MapOptions.showLayers)&&("object"!=typeof t.mapControls.MapLayerManager||0!=t.mapControls.MapLayerManager.show),expression:"\n mapControls.MapLayerManager != false &&\n (option.MapLayers.length || option.MapOptions.showLayers) &&\n (typeof mapControls.MapLayerManager == 'object'\n ? mapControls.MapLayerManager.show == false\n ? false\n : true\n : true)\n "}],style:t.styleCssLayerManager,attrs:{allCheckedIds:t.allCheckedIds,MapLayerManager:t.MapLayerManager,data:t.layerData}})],1):t._e()};$u._withStripped=!0;const Wu=bi({render:$u,staticRenderFns:[]},undefined,Hu,"data-v-00b0cc19",false,undefined,!1,void 0,void 0,void 0);const Ku={props:["barType"]};var Yu=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[1==t.barType?i("div",{ref:"mx-map-compare",staticClass:"mx-map-compare",attrs:{id:"mx-map-compare"}},[i("div",{directives:[{name:"mapcomparexdrag",rawName:"v-mapcomparexdrag"}],staticClass:"mx-map-compare-swiper animate__animated animate__zoomIn",attrs:{id:"mx-map-compare"}})]):t._e(),t._v(" "),2==t.barType?i("div",{ref:"mx-map-compare",staticClass:"mx-map-compare",attrs:{id:"mx-map-compare"}},[i("div",{directives:[{name:"mapcmpxdrag",rawName:"v-mapcmpxdrag"}],staticClass:"mx-map-compare-swiper animate__animated animate__zoomIn",attrs:{id:"mx-map-compare"}})]):t._e()])};Yu._withStripped=!0;const Ju=bi({render:Yu,staticRenderFns:[]},undefined,Ku,undefined,false,undefined,!1,void 0,void 0,void 0);const Xu={name:"MapWaterMark",props:{MapWaterMark:{type:[Boolean,Object],default:function(){return{}}}},created(){"object"==typeof this.MapWaterMark&&(this.waterMark=Object.assign(this.waterMark,this.MapWaterMark||{}))},data:()=>({domid:"idwater"+Math.floor(999*Math.random()),waterMark:{text:"sipsg-medox map",xtype:1,width:800,height:400,font:"38px 微软雅黑",rotate:-.3,fillStyle:"rgba(255, 255, 255, 0.3)",strokeStyle:"rgba(0,0,0,.2)",shadowColor:"rgba(0,0,0,0.4)",textOffsetWidth:6,textOffsetHeight:2,shadowBlur:10,shadowOffsetX:7,shadowOffsetY:7,colorStop:[{stop:0,color:"rgba(255, 255, 255, 0.4)"},{stop:.5,color:"rgba(255, 255, 255, 0.2)"},{stop:1,color:"rgba(0, 0, 0, 0.1)"}]}}),mounted(){this.init()},methods:{init(){const t=document.createElement("canvas");t.width=this.waterMark.width,t.height=this.waterMark.height;const e=t.getContext("2d");switch(e.font=this.waterMark.font,e.rotate(this.waterMark.rotate),this.waterMark.xtype){case 1:e.fillStyle=this.waterMark.fillStyle,e.shadowColor=this.waterMark.shadowColor,e.shadowBlur=this.waterMark.shadowBlur,e.shadowOffsetX=this.waterMark.shadowOffsetX,e.shadowOffsetY=this.waterMark.shadowOffsetY,e.fillText(this.waterMark.text,t.width/this.waterMark.textOffsetWidth,t.height/this.waterMark.textOffsetHeight);break;case 2:e.strokeStyle=this.waterMark.strokeStyle,e?.strokeText(this.waterMark.text,t.width/this.waterMark.textOffsetWidth,t.height/this.waterMark.textOffsetHeight);break;case 3:const i=e.createLinearGradient(0,0,t.width,0);this.waterMark.colorStop.forEach((t=>{i.addColorStop(t.stop,t.color)})),e.fillStyle=i,e.shadowColor=this.waterMark.shadowColor,e.shadowBlur=this.waterMark.shadowBlur,e.shadowOffsetX=this.waterMark.shadowOffsetX,e.shadowOffsetY=this.waterMark.shadowOffsetY,e.fillText(this.waterMark.text,t.width/this.waterMark.textOffsetWidth,t.height/this.waterMark.textOffsetHeight)}const i=t.toDataURL();document.getElementById(this.domid).style.backgroundImage=`url(${i})`,this.$emit("success",i)}}};var Qu=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"medo-mapwatermark mapwatermark",attrs:{id:t.domid}})};Qu._withStripped=!0;const Zu=bi({render:Qu,staticRenderFns:[]},undefined,Xu,"data-v-5af9c697",false,undefined,!1,void 0,void 0,void 0);var td=new class{constructor(){}addPlugins(t){if("MapWaterMark"===t.name)this.addMapWaterMark(t)}addMapWaterMark(t){const{propsData:e,mapId:i,target:s,mapControls:a,that:n}=t;if(0!=a&&a){var o=document.createElement("div");o.id=s;var r=document.getElementById(i);r.insertBefore(o,r.children[0]);const t=new(w.default.extend(Zu))({propsData:e});t.$on("success",(t=>{n.loadWaterMark(t)})),t.$mount("#"+s)}}},ed={name:"MapBaseView",props:{extraOptions:{type:Object,default:()=>{}},option:{require:!0,type:Object,default:()=>({MapOptions:{},MapTools:[],MapLayers:[],BaseMap:[],QuickSearch:[],CommonOptions:[],Container:"container"})},customAxios:{default:""},apiRoot:{type:String,default:""},appCode:{type:String,default:""}},components:{mapExSyncMove:Wu,mapDragBar:Ju},data(){return{mapControlsShow:{MapTools:!0,MapSwitch:!0,MapLayerManager:!0,MapSearch:!0},mapSyncConfig:{show:!0},baseMapsTemp:[],changeRoleState:!0,popupTemplate:{getData:t=>{const e=t;return this.option.MapOptions.customAxios?this.option.MapOptions.customAxios({method:"post",url:this.customURL,data:e,"Content-Type":"application/json"}):mr({method:"post",url:this.customURL,data:e})},actionHandler(t){window.eval(t.action)}},baseMaps:[],layerData:[],layerDataEx:[],layerDataMap2:[],mapTools:[],axios:"",customURL:"",customURL_QQuery:"",mapOptions:{epsg4528:!0},geojson:{},mapLayer:[],mapView:[],loaded:!1,adapterData:{LM:{props:{localData:[]}},MS:{props:{localData:[]}},MT:{props:{localData:[]}},MV:{props:{localData:[]}}},geometryMapping:{polygon:"面",point:"点",line:"线","面":"面","点":"点","线":"线"},mapSyncMoveVisible:!1,mapSyncMoveBarType:1,mapContainerId2:"map2",mapControls:{},mapState:"",mapControlsState:{MapToolsStateCount:1,MapSearchStateCount:1,MapSwitchStateCount:1,MapLayerManagerStateCount:1},allCheckedIds:[],styleCssSwitchClone:{},styleCssLayerManagerClone:{},waterMarkImg:"",componentsIds:{},successSwitch:!1,oneMapConfig:{}}},computed:{tokens(){return this.oneMapConfig.mapTokens=this.option.CommonOptions.tokens,this.option.CommonOptions.tokens},styleCssTools(){return this.mapState=this.mapControlsState.MapToolsStateCount,this.oneMapConfig.getPositionCss(this.mapControls.MapTools)},styleCssSearch(){return this.mapState=this.mapControlsState.MapSearchStateCount,this.oneMapConfig.getPositionCss(this.mapControls.MapSearch)},styleCssSwitch(){return this.mapState=this.mapControlsState.MapSwitchStateCount,this.oneMapConfig.getPositionCss(this.mapControls.MapSwitch)},styleCssLayerManager(){return this.mapState=this.mapControlsState.MapLayerManagerStateCount,setTimeout((()=>{this.$refs.layerManager&&this.$refs.layerManager.initHeight()}),2e3),this.oneMapConfig.getPositionCss(this.mapControls.MapLayerManager)}},watch:{option(){this.mapInit()},deep:!0},provide(){return{adapter:this.getAdapter,adapter2:this.getAdapter2,mapP:this.getMap}},created(){this.oneMapConfig=lr.getConfig(this.option.Container),this.componentsIds=this.oneMapConfig.initComponentsIds(this.option.Container),this.option.mapStyleConfig&&(this.mapControls=this.option.mapStyleConfig.controls||{},this.oneMapConfig.customURL=this.option.MapOptions.customURL,this.oneMapConfig.setConfig(this.option.mapStyleConfig)),this.mapInit(),this.axios=this.option.MapOptions.customAxios,this.customURL=`${this.option.MapOptions.customURL?this.option.MapOptions.customURL:""}/onemap/geoApiQuery/iQuery`,this.extraOptions&&Object.keys(this.extraOptions).length&&(this.option.MapOptions.customAxios=this.extraOptions.customAxios,this.option.MapOptions.customURL=this.extraOptions.customURL,this.axios=this.extraOptions.customAxios,this.customURL=`${this.extraOptions.customURL?this.extraOptions.customURL:""}/onemap/geoApiQuery/iQuery`),this.customURL_QQuery=this.oneMapConfig.customURL_QQuery},mounted(){},methods:{changeToolbox(t){this.map.GLSDK.changeToolbox&&this.map.GLSDK.changeToolbox(t)},loadWaterMark(t){this.waterMarkImg=t},async mapChangeLayersByRole(t,e){this.option.extents=t.extents,this.option.MapLayers=t.MapLayers,this.option.CommonOptions=t.CommonOptions,await this.getLayerData(),await this.setRebuildData(),this.changeRoleState=!1,this.$nextTick((()=>{this.changeRoleState=!0,this.$refs.map.changeRole(this.option.MapOptions),setTimeout((()=>{e.callback&&e.callback()}),200)})),this.cloneMapOptions()},getMap(){return this.map},closeMapCompare(){this.map.M.pubsub.publish("mapCloseCloneMap")},getZoomOffset(){},cloneMapOptions(){this.optionEx=JSON.parse(JSON.stringify(this.option)),this.layerDataEx=JSON.parse(JSON.stringify(this.layerData)),this.mapConfigCopy=JSON.parse(JSON.stringify({popupTemplate:this.popupTemplate,tokens:this.tokens,options:this.option.MapOptions,adapter:this.getAdapter,container:this.mapContainerId2})),this.adapterDataEx=JSON.parse(JSON.stringify(this.adapterData))},onMapLoadedBefore(t){this.$emit("success-before",t)},onMapLoaded(t){this.$nextTick((()=>{td.addPlugins({name:"MapWaterMark",that:this,mapId:this.option.Container,target:this.componentsIds.MapWaterMark,mapControls:this.mapControls.MapWaterMark,propsData:{MapWaterMark:this.mapControls.MapWaterMark}})})),this.map=t,this.map.$MapEventBus=new w.default,this.cloneMapOptions(),this.bindEventBus();const e=document.getElementById(this.option.Container);new ResizeObserver((()=>{setTimeout((()=>{this.map&&1!=this.mapSyncMoveVisible&&this.map.resize()}),10)})).observe(e),this.$nextTick((()=>{this.$emit("success",this.map)})),this.map.getWaterMarkImg=()=>({MapWaterMark:this.mapControls.MapWaterMark||!1,img:this.waterMarkImg})},handleResize(){this.timerSize&&clearTimeout(this.timerSize),this.timerSize=setTimeout((()=>{this.map&&1!=this.mapSyncMoveVisible&&this.map.resize()}),10)},bindEventBus(){this.map.$MapEventBus.$on("onemap-mapcontrols-visible",(t=>{const e=t?t.key:null;e&&(this.mapControlsShow[e]=t.visible)})),this.map.$MapEventBus.$on("onemap-map-layer-manager-visible",(t=>{var e=this.$refs.layerManager;e&&e.setVisible(t)})),this.map.$MapEventBus.$on("set-maptools-visible",(t=>{this.mapControls.MapTools=t})),this.map.$MapEventBus.$on("onemap-change-sync-move",(t=>{if(this.allCheckedIds=this.$refs.layerManager&&this.$refs.layerManager.getAllCheckedIds()||[],this.mapSyncMoveBarType=t.barType,this.mapSyncMoveVisible&&(this.layerDataMap2=JSON.parse(JSON.stringify(this.layerDataEx))),this.mapSyncMoveVisible=t.state,this.mapSyncConfig.show=!this.mapSyncMoveVisible,this.$nextTick((()=>{t.callback()})),this.mapSyncMoveVisible){this.mapControlsOld=JSON.parse(JSON.stringify(this.mapControls));const t=this.styleCssLayerManager,i=this.styleCssSwitch;var e="90px";(this.option.MapLayers.length||this.option.MapOptions.showLayers)&&0!=this.mapControls.MapLayerManager&&("object"!=typeof this.mapControls.MapLayerManager||0!=this.mapControls.MapLayerManager.show)||(e="0px");const s=i.top||t.top||"21px",a=[s,"0px",null,null],n=[s,e,null,null];this.map.GLSDK.setUIPosition("MapLayerManager",{position:a}),this.map.GLSDK.setUIPosition("MapSwitch",{position:n}),this.styleCssSwitchClone=this.map.ExAPI.getPositionStyle([s,null,null,1==this.mapSyncMoveBarType?`calc(50% + ${e})`:`${parseFloat(e)+30}px`]),this.styleCssLayerManagerClone=this.map.ExAPI.getPositionStyle([s,null,null,1==this.mapSyncMoveBarType?"calc(50% + 0px)":"30px"])}else{var i=this.oneMapConfig.getPositionArr(this.mapControlsOld.MapLayerManager),s=this.oneMapConfig.getPositionArr(this.mapControlsOld.MapSwitch);i?this.map.GLSDK.setUIPosition("MapLayerManager",{position:i}):this.map.GLSDK.setUIPosition("MapLayerManager",{position:["21px","15px",null,null]}),s?this.map.GLSDK.setUIPosition("MapSwitch",{position:s}):this.map.GLSDK.setUIPosition("MapSwitch",{position:["21px","105px",null,null]})}})),this.map.M.pubsub.subscribe("clearAllLayer",(()=>{this.$refs.layerManager&&this.$refs.layerManager.clearAll()})),this.map.$MapEventBus.$on("onemap-change-basemap",(t=>{this.$refs.mapSwitch.changeBaseMap(t)})),this.map.$MapEventBus.$on("onemap-change-maplayer",(t=>{this.$refs.layerManager.setMapLayerChecked(t.id,t.visible)})),this.map.$MapEventBus.$on("onemap-get-layerids",(t=>{this.$refs.layerManager.getMapLayerIds(t)})),this.map.$MapEventBus.$on("setUIPosition",(t=>{var e=!0;if("object"==typeof this.mapControls[t.keys]){e=this.mapControls[t.keys].show;var i=JSON.parse(JSON.stringify(this.mapControls[t.keys]));this.mapControls[t.keys]=Object.assign(i,{show:e,position:t.position})}else e=0!=this.mapControls[t.keys],this.mapControls[t.keys]={show:e,position:t.position};this.mapControlsState[`${t.keys}StateCount`]+=1}))},async mapInit(){this.loaded=!1,await this.getMapView(),await this.getLayerData(),this.initMapTools(),this.loaded=!0},getAdapter(){return this.adapterData},getAdapter2(){return this.adapterDataEx},initMapTools(){this.adapterData.MT.props.localData=this.option.MapTools},async getLayerData(){const t=this.option.MapLayers,e=(t,i="")=>{const s=[];for(let a=0;a<t.length;a++){const n=t[a],o={iconSrc:n.iconSrc,id:n.id,label:n.mapLayerName,pidlabel:i,isChecked:void 0!==n.defaultCheck?n.defaultCheck:0,disabled:0===n.status||!(n.children||!n.mapResourceList||0!==n.mapResourceList.length),mapResourceList:[],opacity:1,expand:1==n.expand,legend:n.legend||"",supportIQuery:n.supportIQuery,favourite:n.favourite};n.children&&n.children.length>0?o.children=e(n.children,o.label):n.mapResourceList&&n.mapResourceList.length>0&&(o.mapResourceList=n.mapResourceList.map((t=>this.convertLayer(t,n)))),s.push(o)}return s},i=e(t);this.adapterData.LM.props={localData:i}},async getMapView(){const t=t=>{let{icon:e}=t;if(!e)switch(t.leafCode){case"baseLayer":e="icon-map-o";break;case"baseLayerImg":e="icon-earth"}return e};this.option.MapOptions.styleURL,this.baseMapsTemp=this.option.BaseMap.map((e=>({id:e.id,label:e.mapLayerName,icon:t(e),styleURL:this.option.MapOptions.styleURL,mapResourceList:e.mapResourceList.map((t=>this.convertLayer(t,e)))}))),await this.setRebuildData()},setRebuildData(){this.adapterData.MS.props={localData:this.baseMapsTemp},this.option.CommonOptions.options.center||delete this.option.CommonOptions.options.center;const t=this.option.CommonOptions.tokens||[];this.adapterData.MV={props:{options:this.option.CommonOptions.options,tokens:t.map((t=>Object.assign(t,{name:t.tokenCode,url:t.requestUrl})))}}},getLayerType(t,e){let i=t||"";switch(t){case"wmts":i="wmts";break;case"wmts_tdt":i="raster";break;case"tile":i=e?"raster":"arcgis-tile";break;case"3dtiles":i="3dtile";break;case"dynamic":i="arcgis-dynamic";break;case"geojson":case"geojson_isrequest":i="geojson";break;case"style":i="style";break;case"style_business":i="style-business";break;case"tile_iis":i="arcgis-tile-iis";break;case"tile_iis10":i="arcgis-tile-iis10";break;case"scene":i="scene";break;case"3DGS":case"3DGS-LOD":i="3DGS";break;case"common":i="common"}return i},insertStr:(t,e,i)=>t.slice(0,e)+i+t.slice(e),replaceLocalhost:t=>t.replace("{origin}",window.location.origin).replace("{localhost}",window.location.host),getServerUrl(t){let{serverUrl:e}=t;if(e)if("wmts_tdt"==t.mapLayerType)t.serverUrl.indexOf("&x={x}&y={y}&l={z}")<0&&(e=`${t.serverUrl}&x={x}&y={y}&l={z}`);else if("tile"==t.mapLayerType){if(t.serverUrl.indexOf("/tile/{z}/{y}/{x}")<0)if(t.serverUrl.indexOf("?")>-1){const i=t.serverUrl.split("?");if(i.length>2){const i=t.serverUrl.lastIndexOf("?");e=this.insertStr(e,i,"/tile/{z}/{y}/{x}")}else e=`${i[0]}/tile/{z}/{y}/{x}?${i[1]}`}else e=`${t.serverUrl}/tile/{z}/{y}/{x}`}else if("vector"==t.mapLayerType){const i=t.serverType||"";t.serverUrl.indexOf(".pbf")<0&&"mapmost"!=i.toLowerCase()&&(e=`${t.serverUrl}/{z}/{x}/{y}.pbf`)}else"3dtiles"==t.mapLayerType||"scene"==t.mapLayerType?e=t.serverUrl:"geojson_isrequest"==t.mapLayerType?(e=t.serverUrl,-1!=t.serverUrl.indexOf("?")?e=e.replace("?","?isrequest=1"):e+="?isrequest=1"):"style"==t.mapLayerType||"style_business"==t.mapLayerType||"dynamic"==t.mapLayerType?e=t.serverUrl:t.mapLayerType;return e},getTokenCode(t){if(this.tokens){const e=this.tokens.filter((e=>e.id==t))[0];if(e)return e.tokenCode}return""},convertLayer(t,e){let{serverUrl:i,serverType:s,mapLayerType:a}=t;i&&"vector"!=a&&"mapmost"!=(s||"").toLowerCase()&&(t.serverUrl=this.replaceLocalhost(i));const n={iQueryIdList:t.iQueryIdList,propertyName:t.propertyName,id:t.id,label:e.mapLayerName,layerLabel:t.mapResourceName,layerType:this.getLayerType(t.mapLayerType),geometryType:this.geometryMapping[t.geometryType],token:this.getTokenCode(t.tokenId),serverType:t.serverType||"",url:t.serverUrl,supportIQuery:!0,geoMapMarkerList:t.geoMapMarkerList||[],minzoom:t.minLevel,maxzoom:t.maxLevel,sourceCache:t.sourceCache,layersIndex:t.layersIndex||"",layerDefs:t.layerDefs||"",mapResourceCode:t.mapResourceCode,fileId:t.fileId,legendService:t.legendService};e&&(n.supportIQuery=1==e.supportIQuery,n.virtualId=e.id,e.projection?n.projection=e.projection:n.projection=t.projection||t.sridType,n.opacity=e.opacity);let o=!1;switch(n.layerType){case"raster":n.source={id:t.id,type:this.getLayerType(t.mapLayerType,!0),tiles:[this.getServerUrl(t)],tileSize:256},n.layer={id:t.id,type:this.getLayerType(t.mapLayerType,!0),source:t.id,paint:{"raster-opacity":1}},this.option.MapOptions&&"4527"===this.option.MapOptions.srid&&(n.layer.project=this.option.MapOptions.srid);break;case"arcgis-tile":case"wmts":case"arcgis-tile-iis":case"arcgis-tile-iis10":n.source={id:t.id,type:this.getLayerType(t.mapLayerType,!0),tiles:[this.getServerUrl(t)],tileSize:256},n.layer={id:t.id,type:this.getLayerType(t.mapLayerType,!0),paint:{"raster-opacity":1}};break;case"vector":n.source={id:t.id,type:this.getLayerType(t.mapLayerType,!0),tiles:[this.getServerUrl(t)]},n.layer={id:t.id,type:this.getLayerType(t.mapLayerType,!0),source:t.id};break;case"3dtile":case"scene":case"3DGS":case"3DGS-LOD":case"common":n.layer={id:t.id,data:this.getServerUrl(t)};break;case"style":case"style-business":n.layer={id:t.id,type:this.getLayerType(t.mapLayerType,!0),data:this.getServerUrl(t)};break;case"model":n.layer={id:t.id,type:"model",models:t.serverUrl};break;case"arcgis-dynamic":n.source={id:t.id,type:"raster",tiles:[this.getServerUrl(t)],tileSize:256},n.layer={id:t.id,type:"raster",paint:{"raster-opacity":1}};break;case"geojson":case"geojson_isrequest":n.source={id:t.id,type:this.getLayerType(t.mapLayerType,!0),data:this.getServerUrl(t)},n.layer={id:t.id,type:this.getLayerType(t.mapLayerType,!0),source:t.id};break;default:console.log(t),console.error(`暂不支持${t.mapLayerType}类型`),o=!0}if(!o){var r=t.expandProList||"";if(Array.isArray(r)){0===r.length&&(r="")}return Object.assign(n.layer,this.getStyle(t),{layers:r}),n}},getStyle(t){let e={};if(t.expandPro)try{e=JSON.parse(t.expandPro)}catch(t){e={}}else e={};return e}},beforeDestroy(){this.observer&&this.observer.disconnect()},destroyed(){this.map&&this.map.$MapEventBus&&this.map.$MapEventBus.$off("onemap-change-sync-move")}};const id=ed;var sd=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-onemap-adapter"},[i("div",{staticClass:"mx-onemap-container",attrs:{id:"mx-onemap-container"}},[t.mapSyncMoveVisible?i("div",{staticClass:"mx-map-before",attrs:{id:"mx-map-before"}},[i("div",{ref:"map2",staticClass:"map",attrs:{id:t.mapContainerId2}}),t._v(" "),i("div",{staticClass:"mx-onemap-sync-control",attrs:{id:"mx-onemap-sync-control"}},[i("map-ex-sync-move",{attrs:{mapControls:t.mapControls,baseMaps:t.baseMaps,mapConfig:t.mapConfigCopy,option:t.optionEx,layerData:t.layerDataEx,allCheckedIds:t.allCheckedIds,styleCssSwitch:t.styleCssSwitchClone,styleCssLayerManager:t.styleCssLayerManagerClone,MapLayerManager:t.mapControls.MapLayerManager}})],1)]):t._e(),t._v(" "),t.mapSyncMoveVisible?i("map-drag-bar",{class:[1==t.mapSyncMoveBarType?"mx-map-compare-sync":"mx-map-compare-sync-double"],attrs:{barType:t.mapSyncMoveBarType}}):t._e(),t._v(" "),t.mapSyncMoveVisible?i("div",{staticClass:"mx-map-compare-close",on:{click:function(e){return e.stopPropagation(),t.closeMapCompare.apply(null,arguments)}}},[i("i",{staticClass:"el-icon-error",attrs:{title:"退出"}})]):t._e(),t._v(" "),i("div",{staticClass:"map mx-map-after",attrs:{id:"map"}},[t.loaded?i("map-viewer",{ref:"map",attrs:{options:t.option.MapOptions,srid:t.option.MapOptions.srid,styleURL:t.option.MapOptions.styleURL,accessToken:t.option.accessToken,popupTemplate:t.popupTemplate,id:t.option.Container},on:{"on-loaded":t.onMapLoaded,"on-loaded-before":t.onMapLoadedBefore}},[i("div",{staticClass:"mx-map-slot"},[t._t("default")],2),t._v(" "),i("div",{staticClass:"mx-onemap-old-control"},[i("div",{staticClass:"mx-top-right-bar",attrs:{id:"topRightBar"}},[i("map-switch",{directives:[{name:"show",rawName:"v-show",value:t.mapControlsShow.MapSwitch&&0!=t.mapControls.MapSwitch&&t.option.BaseMap.length&&("object"!=typeof t.mapControls.MapSwitch||0!=t.mapControls.MapSwitch.show),expression:"\n mapControlsShow.MapSwitch &&\n mapControls.MapSwitch != false &&\n option.BaseMap.length &&\n (typeof mapControls.MapSwitch == 'object'\n ? mapControls.MapSwitch.show == false\n ? false\n : true\n : true)\n "}],ref:"mapSwitch",style:t.styleCssSwitch,attrs:{MapSwitch:t.mapControls.MapSwitch,data:t.baseMaps}}),t._v(" "),t.changeRoleState?[!t.option.MapLayers.length&&!t.option.MapOptions.showLayers||0==t.mapControls.MapLayerManager||"object"==typeof t.mapControls.MapLayerManager&&0==t.mapControls.MapLayerManager.show?t._e():i("layer-manager",{directives:[{name:"show",rawName:"v-show",value:t.mapControlsShow.MapLayerManager,expression:"mapControlsShow.MapLayerManager"}],ref:"layerManager",staticStyle:{"margin-left":"6px"},style:t.styleCssLayerManager,attrs:{MapLayerManager:t.mapControls.MapLayerManager,mapSyncConfig:t.mapSyncConfig,data:t.layerData},scopedSlots:t._u([t._l(t.$scopedSlots,(function(e,i){return{key:i,fn:function(e){return[t._t(i,null,null,e)]}}}))],null,!0)})]:t._e()],2),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:!t.mapSyncMoveVisible,expression:"!mapSyncMoveVisible"}],staticClass:"mx-map-tools"},[0!=t.mapControls.MapTools?i("map-tools",{directives:[{name:"show",rawName:"v-show",value:t.mapControlsShow.MapTools,expression:"mapControlsShow.MapTools"}],staticClass:"lt",style:t.styleCssTools,attrs:{data:t.mapTools,MapTools:t.mapControls.MapTools},on:{changeToolbox:t.changeToolbox},scopedSlots:t._u([t._l(t.$scopedSlots,(function(e,i){return{key:i,fn:function(e){return[t._t(i,null,null,e)]}}}))],null,!0)}):t._e()],1),t._v(" "),t.option.QuickSearch.length&&0!=t.mapControls.MapSearch&&!t.mapSyncMoveVisible?i("map-search",{directives:[{name:"show",rawName:"v-show",value:t.mapControlsShow.MapSearch,expression:"mapControlsShow.MapSearch"}],staticClass:"ltr",style:t.styleCssSearch,attrs:{data:t.option.QuickSearch,MapSearch:t.mapControls.MapSearch,customAxios:t.option.MapOptions.customAxios,customURL:t.customURL_QQuery}}):t._e()],1)]):t._e()],1)],1)])};sd._withStripped=!0;const ad=bi({render:sd,staticRenderFns:[]},undefined,id,"data-v-3e44e5ae",false,undefined,!1,void 0,void 0,void 0);class nd{constructor(t){this.map=t.map,this.mapid=this.map._container.id,this.MapMessage=bo,this.activeCursor=""}setCursor(t="",e){e&&(this.map=e),"old"==t&&(t=this.activeCursor);let i=t||"default";if(this.map&&this.map.M){const e=this.map.M.iqueryManager.active;i="help"==t?e?"help":"default":t||(e?"help":"default")}this.map.getCanvas().style.cursor=i,"move"!=i&&(this.activeCursor=i),"grab"==i?this.initCursor():this.mouseDown&&this.map.off("mousedown",this.mouseDown)}initCursor(){this.mouseDown&&this.map.off("mousedown",this.mouseDown),this.mouseUp=()=>{this.map.getCanvas().style.cursor="default"},this.mouseDown=()=>{this.map.getCanvas().style.cursor="grabbing",this.map.once("mouseup",this.mouseUp)},this.map.on("mousedown",this.mouseDown)}getOffectTop(){return(document.getElementById(this.mapid).offsetTop||0)+10}getPositionStyle(t){if(t){return{position:"absolute",top:null==t[0]?"auto":t[0],right:null==t[1]?"auto":t[1],bottom:null==t[2]?"auto":t[2],left:null==t[3]?"auto":t[3]}}return""}appendMapControlContainer(t,e){t.domid&&this.removeMapControlContainer(t.domid);const i="mapmostgl-control-container";setTimeout((()=>{if(e)e.append?e.append(t.$mount().$el):e.appendChild(t.$mount().$el);else{var s=window.jqueryMap(`#${this.mapid} .${i}`);if(0==s.length){(s=document.getElementById(this.mapid).getElementsByClassName(i)[0]).appendChild(t.$mount().$el)}else s.append(t.$mount().$el)}}),100)}removeMapControlContainer(t){const e=window.jqueryMap(`#${this.mapid} #${t}`);e&&e.remove();const i=document.getElementById(t);return i&&i.parentNode.removeChild(i),!0}getArea(t){let e=Yo.getQueryString("layer_w",t)||.4*document.documentElement.clientWidth,i=Yo.getQueryString("layer_h",t)||.5*document.documentElement.clientHeight;e<300&&(e=800),i<300&&(i=500);return[e,i]}setClassPosition(t,e,i){if(i){const s=document.getElementsByClassName(t)[0];s.classList.contains(e)||s.classList.add(e);const a=document.getElementsByClassName(e)[0];a.style.position=i.position,a.style.top=i.top,a.style.right=i.right,a.style.bottom=i.bottom,a.style.left=i.left}}flyToCenter(t,e,i){var s=Pp.st_getcenterbywkt(e),a=this.map.enableTransform;this.map.sz2000sdk&&(s=this.map.MapmostSDKConvert.fromDefinedProj(s)),a&&s[0]>180&&(s=Pp.projTransform(a.srid,null,s)),t.flyTo(Object.assign({center:JSON.parse(JSON.stringify(s)),zoom:t.getZoom(),pitch:t.getPitch(),duration:500},i))}addDefaultStyle2Map(t,e,i="t_base"){if(e){var s=e.sources||[];const a=Object.keys(s),n=a.length;new Promise((e=>{0==n&&e(),a.forEach(((i,a)=>{!t.getSource(i)&&t.addSource(i,s[i]),a==n-1&&e()}))})).then((()=>{(e.layers||[]).forEach((e=>{var s=e.id;t.getLayer(s)||t.addLayer(e,i)}))}))}}}function od(t){return od="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},od(t)}function rd(t){var e=function(t,e){if("object"!=od(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=od(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==od(e)?e:String(e)}class ld{constructor(t){this.oneMapConfig=t,this.plotselfsymbol={symbolSize:1,glyphsFonts:this.oneMapConfig.glyphsFonts||["Noto Sans Hans Regular"],pointStyle:"default",pointColor:"rgba(255, 0, 0, 0.8)",pointLightColor:"rgba(255, 153, 0, 0.8)",pointRadius:4,lineStyle:"soild",lineWidth:2,lineColor:"rgba(255, 0, 0, 0.8)",lineLightColor:"rgba(255, 153, 0, 0.8)",fillColor:"rgba(255, 0, 0, 0.25)",fillOutLineColor:"rgba(255, 0, 0, 0.8)",fillOutLineWidth:2,fillLightColor:"rgba(255, 153, 0, 0.25)",fillOutLineLightColor:"rgba(255,153 , 0, 0.8)",text:"文本",textColor:"rgb(0, 0, 0)",textHaloColor:"rgb(255, 255, 255)",textHaloWidth:1,textLightColor:"rgb(255,153 , 0)",textFontSize:"14px"}}getDrawStyle(t,e,i=null){let s,a;this.plotselfsymbol=null!=t?Object.assign(this.plotselfsymbol,t):{symbolSize:1,glyphsFonts:this.oneMapConfig.glyphsFonts,pointStyle:"default",pointColor:"rgba(255, 0, 0, 0.8)",pointLightColor:"rgba(255, 153, 0, 0.8)",pointRadius:4,lineStyle:"soild",lineWidth:2,lineColor:"rgba(255, 0, 0, 0.8)",lineLightColor:"rgba(255, 153, 0, 0.8)",fillColor:"rgba(255, 0, 0, 0.25)",fillOutLineColor:"rgba(255, 0, 0, 0.8)",fillOutLineWidth:2,fillLightColor:"rgba(255, 153, 0, 0.25)",fillOutLineLightColor:"rgba(255,153 , 0, 0.8)",text:"文本",textColor:"rgb(0, 0, 0)",textHaloColor:"rgb(255, 255, 255)",textHaloWidth:1,textLightColor:"rgb(255,153 , 0)",textFontSize:"14px"};const{plotselfsymbol:n}=this;"polyline"==i?(s=this.plotselfsymbol.lineColor,a=this.plotselfsymbol.lineWidth/4):"polygon"==i&&(s=this.plotselfsymbol.fillOutLineColor,a=this.plotselfsymbol.fillOutLineWidth);return{circle:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},tipsource:{type:"geojson",data:{type:"FeatureCollection",features:[]}},stickysource:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"circle_line",type:"line",source:"circle",layout:{},paint:{"line-color":["case",["boolean",["feature-state","hover"],!1],this.plotselfsymbol.fillOutLineLightColor,this.plotselfsymbol.fillOutLineColor],"line-opacity":1,"line-dasharray":"dash"==this.plotselfsymbol.lineStyle?[this.plotselfsymbol.fillOutLineWidth,this.plotselfsymbol.fillOutLineWidth]:[this.plotselfsymbol.fillOutLineWidth,0],"line-width":this.plotselfsymbol.fillOutLineWidth}},{id:"circle_fill",type:"fill",source:"circle",layout:{},paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],this.plotselfsymbol.fillLightColor,this.plotselfsymbol.fillColor],"fill-opacity":.35}},{id:"circle_tipline",type:"line",source:"tipsource",layout:{},paint:{"line-color":this.plotselfsymbol.fillOutLineColor,"line-dasharray":[2,2],"line-opacity":.6,"line-width":this.plotselfsymbol.fillOutLineWidth}},{id:"circle_stickypoint",source:"stickysource",type:"circle",paint:{"circle-stroke-color":"#FFFFFF","circle-stroke-width":this.plotselfsymbol.pointRadius/4,"circle-color":this.plotselfsymbol.pointColor,"circle-radius":this.plotselfsymbol.pointRadius+1}}]},rectangle:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"rectangle_line",type:"line",source:"rectangle",layout:{},paint:{"line-color":this.plotselfsymbol.fillOutLineColor,"line-width":this.plotselfsymbol.fillOutLineWidth,"line-dasharray":"dash"==this.plotselfsymbol.lineStyle?[this.plotselfsymbol.fillOutLineWidth,this.plotselfsymbol.fillOutLineWidth]:[this.plotselfsymbol.fillOutLineWidth,0]}},{id:"rectangle_fill",type:"fill",source:"rectangle",layout:{},paint:{"fill-color":this.plotselfsymbol.fillColor,"fill-opacity":.25}}]},text:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"text-symbol",type:"symbol",source:"text",layout:{"text-font":this.plotselfsymbol.glyphsFonts,"symbol-placement":"point","text-field":"{MC}","text-max-angle":45,"text-letter-spacing":.1,"text-pitch-alignment":"viewport","text-anchor":"bottom","text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":parseInt(this.plotselfsymbol.textFontSize.replace(/[^0-9]/gi,""),10)},paint:{"text-color":["case",["boolean",["feature-state","hover"],!1],this.plotselfsymbol.textLightColor,this.plotselfsymbol.textColor],"text-halo-color":this.plotselfsymbol.textHaloColor,"text-halo-width":this.plotselfsymbol.textHaloWidth}}]},point:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"point",source:"point",type:"circle",paint:{"circle-stroke-color":"#FFFFFF","circle-stroke-width":this.plotselfsymbol.pointRadius/4,"circle-color":["case",["boolean",["feature-state","hover"],!1],this.plotselfsymbol.pointLightColor,this.plotselfsymbol.pointColor],"circle-radius":this.plotselfsymbol.pointRadius}}]},point_canvas:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"point_canvas",source:"point_canvas",type:"symbol",layout:{"icon-image":this.plotselfsymbol.symbolname,"icon-size":this.plotselfsymbol.symbolSize,"icon-anchor":"bottom","icon-offset":[0,6],"icon-allow-overlap":!0,"icon-ignore-placement":!0}}]},polyline:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},tipsource:{type:"geojson",data:{type:"FeatureCollection",features:[]}},stickysource:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"polyline",type:"line",source:"polyline",layout:{"line-cap":"round","line-join":"round"},paint:this.getPolylineStyle()},{id:"polyline_point",source:"polyline",type:"circle",paint:{"circle-stroke-color":"#FFFFFF","circle-stroke-width":this.plotselfsymbol.pointRadius/4,"circle-color":this.plotselfsymbol.pointColor,"circle-radius":this.plotselfsymbol.pointRadius+1}},{id:"polyline_tipline",type:"line",source:"tipsource",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.plotselfsymbol.lineColor,"line-dasharray":[2,2],"line-opacity":.6,"line-width":this.plotselfsymbol.lineWidth}},{id:"polyline_tippoint",source:"tipsource",type:"circle",paint:{"circle-stroke-color":"#FFFFFF","circle-stroke-width":this.plotselfsymbol.pointRadius/4,"circle-color":this.plotselfsymbol.pointColor,"circle-radius":this.plotselfsymbol.pointRadius+1}},{id:"polyline_stickypoint",source:"stickysource",type:"circle",paint:{"circle-stroke-color":"#FFFFFF","circle-stroke-width":this.plotselfsymbol.pointRadius/4,"circle-color":this.plotselfsymbol.pointColor,"circle-radius":this.plotselfsymbol.pointRadius+1}}]},polygon:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},tipsource:{type:"geojson",data:{type:"FeatureCollection",features:[]}},stickysource:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"polygon",type:"fill",source:"polygon",paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],this.plotselfsymbol.fillLightColor,this.plotselfsymbol.fillColor]}},{id:"polygon_fill",type:"line",source:"polygon",paint:{"line-color":["case",["boolean",["feature-state","hover"],!1],this.plotselfsymbol.fillOutLineLightColor,this.plotselfsymbol.fillOutLineColor],"line-dasharray":"dash"==this.plotselfsymbol.lineStyle?[this.plotselfsymbol.fillOutLineWidth,this.plotselfsymbol.fillOutLineWidth]:[this.plotselfsymbol.fillOutLineWidth,0],"line-width":this.plotselfsymbol.fillOutLineWidth}},{id:"polygon_tipline",type:"line",source:"tipsource",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.plotselfsymbol.fillOutLineColor,"line-dasharray":[2,2],"line-opacity":.6,"line-width":this.plotselfsymbol.fillOutLineWidth}},{id:"polygon_stickypoint",source:"stickysource",type:"circle",paint:{"circle-stroke-color":"#FFFFFF","circle-stroke-width":this.plotselfsymbol.pointRadius/4,"circle-color":this.plotselfsymbol.pointColor,"circle-radius":this.plotselfsymbol.pointRadius+1}}]},measureLength:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"measureLength",type:"line",source:"measureLength",layout:{"line-cap":"round","line-join":"round"},paint:this.getPolylineStyle()}]},measureArea:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"measureArea",type:"fill",source:"measureArea",paint:{"fill-color":n.fillColor,"fill-opacity":.1}},{id:"measureArea",type:"line",source:"measureArea",paint:{"line-color":n.fillOutLineColor,"line-width":n.fillOutLineWidth}}]},drawStyles:[{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:this.getPolylineStyle()},{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":n.fillColor,"fill-outline-color":n.fillOutLineColor,"fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":n.fillOutLineWidth,"circle-color":n.fillOutLineColor}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":n.fillOutLineColor,"line-width":n.fillOutLineWidth}},{id:"gl-draw-polygon-and-line-vertex-halo-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":a,"circle-stroke-color":"#FFFFFF","circle-stroke-width":a/3,"circle-color":s}},{id:"gl-draw-polygon-and-line-vertex-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":a,"circle-stroke-color":"#FFFFFF","circle-stroke-width":a/3,"circle-color":s}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","$type","LineString"],["==","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":3}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","$type","Polygon"],["==","mode","static"]],paint:{"fill-color":"#000","fill-outline-color":"#000","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","$type","Polygon"],["==","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":3}}],traceLine:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},source_point:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"traceLine",type:"line",source:"traceLine",layout:{"line-cap":"round","line-join":"round"},paint:this.getPolylineStyle()},{id:"traceLine_crow",type:"line",source:"traceLine",layout:{"symbol-placement":"line","symbol-spacing":50,"icon-image":"crow","icon-size":.5},paint:{}},{id:"traceLine_point",type:"symbol",source:"source_point",layout:{"icon-image":"{fclass}","icon-size":.8,"icon-anchor":"bottom","symbol-placement":"point","icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-pitch-alignment":"viewport"},paint:{}}],mapStyleMarker:[{name:"crow",label:"箭头",url:"./images/箭头2.png"},{name:"traceLine_sp",label:"起点",url:"./images/起点.png"},{name:"traceLine_ep",label:"终点",url:"./images/终点.png"}]}}[e]}getTraceLineStyle(t,e="traceLine"){this.plotselfsymbol=Object.assign(this.plotselfsymbol,t);return{traceLine:{source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},source_point:{type:"geojson",data:{type:"FeatureCollection",features:[]}},layer:[{id:"traceLine",type:"line",source:"source",layout:{"line-cap":"round","line-join":"round"},paint:this.getPolylineStyle()},{id:"traceLine_crow",type:"symbol",source:"source",layout:{"symbol-placement":"line","symbol-spacing":40,"icon-image":"crow","icon-size":.28},paint:{}},{id:"traceLine_point",type:"symbol",source:"source_point",layout:{"icon-image":"{fclass}","icon-size":1,"icon-anchor":"bottom","symbol-placement":"point","icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-pitch-alignment":"viewport"},paint:{}}],mapStyleMarker:[{name:"crow",label:"箭头",url:"./images/箭头.png"},{name:"traceLine_sp",label:"起点",url:"./images/起点.png"},{name:"traceLine_ep",label:"终点",url:"./images/终点.png"}]}}[e]}getPolylineStyle(){const t={"line-color":["case",["boolean",["feature-state","hover"],!1],this.plotselfsymbol.lineLightColor,this.plotselfsymbol.lineColor],"line-width":this.plotselfsymbol.lineWidth};let e={};return"dash"==this.plotselfsymbol.lineStyle&&(e={"line-dasharray":[.2,2]}),Object.assign(t,e)}}var hd=TypeError,cd=String,pd=TypeError,ud=function(t){if(function(t){return Ct(t)||null===t}(t))return t;throw new pd("Can't set "+cd(t)+" as a prototype")},dd=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=Ni(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,s){return me(i),ud(s),e?t(i,s):i.__proto__=s,i}}():void 0),md=function(t,e){return void 0===t?arguments.length<2?"":e:Oo(t)},gd={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},yd=Error,fd=lt("".replace),_d=String(new yd("zxcasd").stack),vd=/\n\s*at [^:]*:[^\n]*/,xd=vd.test(_d),Cd=Le.f,Ld="DOMException",Md=Lt("Error"),bd=Lt(Ld),wd=function(){!function(t,e){if(Mt(e,t))return t;throw new hd("Incorrect invocation")}(this,Sd);var t,e,i,s,a,n=arguments.length,o=md(n<1?void 0:arguments[0]),r=md(n<2?void 0:arguments[1],"Error"),l=new bd(o,r),h=new Md(o);return h.name=Ld,Cd(l,"stack",at(1,function(t,e){if(xd&&"string"==typeof t&&!yd.prepareStackTrace)for(;e--;)t=fd(t,vd,"");return t}(h.stack,1))),t=l,e=this,i=wd,dd&&xt(s=e.constructor)&&s!==i&&Ct(a=s.prototype)&&a!==i.prototype&&dd(t,a),l},Sd=wd.prototype=bd.prototype,Id="stack"in new Md(Ld),Ed="stack"in new bd(1,2),Td=bd&&J&&Object.getOwnPropertyDescriptor(K,Ld),Dd=!(!Td||Td.writable&&Td.configurable),Pd=Id&&!Dd&&!Ed;_i({global:!0,constructor:!0,forced:Pd},{DOMException:Pd?wd:bd});var Od=Lt(Ld),kd=Od.prototype;if(kd.constructor!==Od)for(var Nd in Cd(kd,"constructor",at(1,Od)),gd)if($t(gd,Nd)){var Ad=gd[Nd],Rd=Ad.s;$t(Od,Rd)||Cd(Od,Rd,at(6,Ad.c))}var Fd=new class{constructor(){this.defaultColor="#326EF0",this.loadImageColor={},this.tempMarkerGroupList={},this.tempMarkerGroup={},this.defaultGroup="tempGroupList"}async add(t,e={},i=!1){if(!e.location)return null;const s=Object.assign({id:Math.random(),group:this.defaultGroup,offset:[0,0],clickTolerance:10,color:this.defaultColor},e);var a=await this.getPointArr(s.location);const n=s.id,o=s.group;this.tempMarkerGroup[n]=o;let r;return r="local"==(t.projection?t.projection.toLowerCase():"")?new I.default.Marker(s).setCoordinate(a).setOffset(s.offset):new I.default.Marker(s).setLngLat(a).setOffset(s.offset),s.popup&&r.setPopup(s.popup),r.addTo(t),this.tempMarkerGroupList[o]||(this.tempMarkerGroupList[o]={}),this.tempMarkerGroupList[o][n]=r,i&&t.flyTo({center:a,zoom:t.getZoom()}),r}get(t){return this.tempMarkerGroup[t]?this.tempMarkerGroupList[this.tempMarkerGroup[t]][t]:null}remove(t){if(this.tempMarkerGroup[t]){this.tempMarkerGroupList[this.tempMarkerGroup[t]][t].remove()}}removeAll(t){let e=[];e=t?[t]:Object.keys(this.tempMarkerGroupList),e.forEach((t=>{const e=this.tempMarkerGroupList[t];Object.keys(e).forEach((i=>{e[i].remove(),delete this.tempMarkerGroupList[t][i]}))}))}getPointArr(t){return Array.isArray(t)?t:"object"==typeof t?"Feature"==t.type&&t.geometry?Pp.st_getcenterbyfeature(t):null:Pp.st_getcenterbywkt(t)}addMarker(t,e){return"coordinate"==e.type?new I.default.Marker({color:e.color||this.defaultColor,clickTolerance:10}).setCoordinate(e.location).setOffset(e.offset||[0,-15]).addTo(t):new I.default.Marker({color:e.color||this.defaultColor,clickTolerance:10}).setLngLat(e.location).setOffset(e.offset||[0,-15]).addTo(t)}addMapSymbolImage(t,e){if(null!=e&&0!=e.length){var i=t.getOnemapConfig?t.getOnemapConfig():{};e.forEach((e=>{let s=e.url||e.markerUrl;const a=e.name||e.markerName;let n;if(Array.isArray(s)){s.length>1&&(n={url:s[1],name:`${a}_light`,sdf:e.sdf||!1}),s=s[0]}t.loadImage(e.default?i.images+s:s,(function(i,s){if(i)throw i;t.hasImage(a)?(t.removeImage(a),t.addImage(a,s,{sdf:e.sdf||!1})):t.addImage(a,s,{sdf:e.sdf||!1})})),n&&t.loadImage(e.default?i.images+n.url:n.url,(function(e,i){if(e)throw e;t.hasImage(n.name)?(t.removeImage(a),t.addImage(a,i,{sdf:n.sdf||!1})):t.addImage(n.name,i,{sdf:n.sdf||!1})}))}))}}remove(t,e){t&&e&&e.hasImage(t)&&e.removeImage(t)}createMarkerCanvas(t,e,i){let s=e;if(this.loadImageColor[s]&&t.hasImage(s))return;let a=this.getMarkerElement(i).querySelector("svg"),n=document.createElement("canvas");const o=(new XMLSerializer).serializeToString(a),r="data:image/svg+xml;base64,"+window.btoa(o),l=new Image;l.onload=()=>{n.getContext("2d").drawImage(l,0,0),t.hasImage(s)||(t.addImage(s,l),this.loadImageColor[s]=i)},l.src=r}getMarkerElement(t){return new I.default.Marker({color:t||this.defaultColor}).getElement()}addImageSvgToMap(t,e,i=!1){const s=e.url||e.markerUrl;fetch(s).then((t=>t.text())).then((s=>{var a;if(i){const t=(new DOMParser).parseFromString(s,"image/svg+xml").querySelector("svg");t.setAttribute("style",`fill: ${e.color||"#ffffff"};`);s=(new XMLSerializer).serializeToString(t);a="data:image/svg+xml;base64,"+window.btoa(s)}else a="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(s)));const n=new Image,o=e.name||e.markerName;n.onload=()=>{t.hasImage(o)?(t.removeImage(o),t.addImage(o,n,{sdf:e.sdf||!1})):t.addImage(o,n,{sdf:e.sdf||!1})},n.src=a}))}};class Bd{constructor(){!function(t,e,i){(e=rd(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"showTipsPopup",((t,e,i)=>{let s=e,a="measure-convert"+this.activeLayerid,n=this.dynamicPopup[this.activeLayerid];if(n)n.setHTML(`<div class="medo-popup-measure">${s}</div>`),this.map.projection?n.setCoordinate(t):n.setLngLat(t);else{var o=i&&i.anchor||"center";this.map.projection?(this.dynamicPopup[this.activeLayerid]=new I.default.Popup(Object.assign({closeOnClick:!1,closeButton:!1,anchor:o,className:"map-popup-measure"},i||{})).setHTML(`<div class="medo-popup-measure">${s}</div>`),this.dynamicPopup[this.activeLayerid].setCoordinate(t)):(this.dynamicPopup[this.activeLayerid]=new I.default.Popup({closeOnClick:!1,closeButton:!1,anchor:o,className:"map-popup-measure"}).setHTML(`<div class="medo-popup-measure">${s}</div>`),this.dynamicPopup[this.activeLayerid].setLngLat(t)),this.dynamicPopup[this.activeLayerid].addTo(this.map)}var r=document.getElementById(a);this.measure.unitList&&r&&(r.onclick&&r.removeEventListener("click",r.onclick),r.addEventListener("click",(t=>{let e;t&&t.target&&(e=r.getAttribute("data-layerId")),this.convertMeasureValue(e)})))})),this.active="",this.activeLayerid="",this.activeLayerTipid="",this.activeLayerStickyid="",this.activeMapDrawLayerid=[],this.activeMapDrawLayerid_old={},this.endCallback=null,this.map=null,this.pointMarkerAll=[],this.pointMarker="",this.drawResultWKT="",this.drawLineCoorsArr=[],this.drawPointCoorsArr=[],this.mapCoordinateType="lngLat",this.subscribe=null,this.hoveredStateId=null,this.hoverSourceId=null,this.indexS=1,this.snappedCoordinates=null,this.snappedDrawLayerid=[],this.allGeoJSONFeatures=[],this.tempAllGeoJSONFeatures={},this.isDoingDraw=!1,this.isBindEvent=!1,this.selectedMarker="",this.selectedLightMarker="",this.activePointCanvasLayerid="",this.activePointCanvasLayerFeatures={},this.isVaild=!1,this.measure=!1,this.measureConfig={},this.dynamicPopup={},this.dynamicMarkers={},this.dynamicMarkersMoveTips=null,this.selectedCallback=null,this.sourceIdTemp={},this.sourceIdLayerIdTemp={},this.removeSourceFeatureCallback=null,this.drawStyle,this.enableTransform}initConfig(t){var e=new ld(t);this.drawStyle=e}subscribeMapClear(t){this.isBindEvent=!0,this.map.M.pubsub.subscribe("clear",(()=>{this.isDoingDraw=!1,this.clear(),this.destory()})),!0===t.selected&&this.bindMapIquery2LocationsLayers()}getCenterByWkt(t){return Pp.st_getcenterbywkt(t)}bindMapIquery2LocationsLayers(){this.mouseQueryClick=async t=>{if(this.isDoingDraw)return;const e=t.originalEvent.target;if(this.selectedCallback&&this.selectedCallback(null),"path"==e.tagName||"circle"==e.tagName)return this.pointMarkerAll.forEach(((i,s)=>{let a=i.getElement();(e===a||a.contains(e))&&(this.selectedMarker=i,this.showMarkerSelected(t.coordinate?"coordinate":"lngLat"))})),void this.removeFeatureState();this.removeMarkerSelected();const i=JSON.parse(JSON.stringify(this.activeMapDrawLayerid)),s=this.map.queryRenderedFeatures(t.point,{layers:i});if(s.length>0){const t=s[0];if(await this.removeStateIconImage(),await this.removeFeatureState(t.source),this.hoverSourceId=t.source,!this.map.getSource(this.hoverSourceId))return;this.selectedCallback&&this.selectedCallback(JSON.parse(JSON.stringify(t))),this.hoverSourceId.indexOf("point_canvas")>-1&&this.setChangeStateIconImage(this.hoverSourceId,t),this.setChangeFeatureState(this.hoverSourceId,t.id)}else await this.removeStateIconImage(),await this.removeFeatureState()},this.map.on("click",this.mouseQueryClick)}getClickSelectFeatures(t){if(!t)return!1;if(!this.mouseQueryClick)return!1;if(this.isDoingDraw)return!1;const e=JSON.parse(JSON.stringify(this.activeMapDrawLayerid));return this.map.queryRenderedFeatures(t.point,{layers:e}).length>0}on(t,e){switch(t){case"selected":this.selectedCallback=e;break;case"remove-selected":this.removeSourceFeatureCallback=e}}off(t){switch(t){case"selected":this.selectedCallback=null;break;case"remove-selected":this.removeSourceFeatureCallback=null}}showMarkerSelected(t){this.removeMarkerSelected();var e=[];if("coordinate"==t)e=this.selectedMarker.getCoordinate();else{const t=this.selectedMarker.getLngLat();e=[t.lng,t.lat]}const i={color:this.drawStyle.plotselfsymbol.pointLightColor,type:t,location:e};this.selectedLightMarker=Fd.addMarker(this.map,i),this.pointMarkerAll.push(this.selectedLightMarker)}refreshSelectText(t){if(!this.hoverSourceId)return;if(-1==this.hoverSourceId.indexOf("text"))return;const e=this.map.getSource(this.hoverSourceId)._data;e.features[0].properties.MC=t,this.map.getSource(this.hoverSourceId).setData(e)}removeMarkerSelected(){this.selectedLightMarker&&(this.selectedLightMarker.remove(),this.selectedLightMarker="")}showMeasureDistance(t,e,i=!1){const s=Pp.getLineDistance(this.map,t);var a="object"==typeof this.measure&&(["米","千米","公里","里","尺"].includes(this.measure.unit)?this.measure.unit:"千米")||"千米",n="object"==typeof this.measure&&void 0!==this.measure.precision?this.measure.precision:3,o="object"==typeof this.measure&&void 0!==this.measure.template?this.measure.template:"";this.measure.precision=n,this.measure.resultm2=s;var r=`${this.formateTipValue(s,a,n)} ${a||"千米"}`;o&&(this.measure.template=o,r=o.replace("{value}",r));const l=t.geometry.coordinates.length;this.showLabelIndex&&(r=r.indexOf("{index}")>-1?r.replace("{index}",l):`<span class="measure-labelindex">${l}</span>${r}`);var h=e,c=[0,-5];return i?this.showTipsMarker(h,r,{anchor:"bottom-left",offset:c},i):this.showTipsPopup(h,r,{anchor:"bottom-left",offset:c}),r}showTipsMarker(t,e,i,s){var a,n,o=e,r="measure-convert-distance"+this.activeLayerid;"起点"==e&&"object"==typeof this.measure&&this.measure.unitList&&(e=(n=`<div id="${r}" data-layerId = "${this.activeLayerid}" class="measure-convert-distince measure-convert"></div>`)+e);var l=`<div class="medo-popup-measure">${e}</div>`;return this.map.projection?(a=new I.default.Popup(Object.assign({closeOnClick:!1,closeButton:!1,anchor:"center",className:"map-popup-measure"},i||{})).setCoordinate(t).setHTML(l).addTo(this.map)).setCoordinate(t).addTo(this.map):(a=new I.default.Popup(Object.assign({closeOnClick:!1,closeButton:!1,anchor:"center",className:"map-popup-measure"},i||{})).setLngLat(t).setHTML(l).addTo(this.map)).setLngLat(t).addTo(this.map),a.addTo(this.map),this.dynamicMarkers[this.activeLayerid]||(this.dynamicMarkers[this.activeLayerid]=[]),s?this.dynamicMarkers[this.activeLayerid].push(a):this.dynamicMarkersMoveTips=a,a.msgZ=o,a.unit=this.measure.unit,a.showLabelIndex=this.showLabelIndex,a.distance="起点"==o?0:this.measure.resultm2,n&&this.addEventListenerConvert(r),a}addEventListenerConvert(t){var e=document.getElementById(t);this.measure.unitList&&e&&(e.onclick&&e.removeEventListener("click",e.onclick),e.addEventListener("click",(t=>{let i;t&&t.target&&(i=e.getAttribute("data-layerId")),this.convertMeasureDistanceValue(i)})))}showMeasureArea(t){const e=Pp.getPolygonArea(this.map,t),i=Pp.st_centroid(t),s=[i[0],i[1]];var a="";let n="measure-convert"+this.activeLayerid,o=this.measureConfig[this.activeLayerid];o||(this.measureConfig[this.activeLayerid]=JSON.parse(JSON.stringify(this.measure)),o=this.measureConfig[this.activeLayerid]);var r="object"==typeof o&&(["亩","公顷","平方千米","平方米"].includes(o.unit)?o.unit:"平方米")||"平方米";"object"==typeof o&&o.unitList&&(a=`<div id="${n}" data-layerId="${this.activeLayerid}" class="measure-convert"></div>`);var l="object"==typeof o&&void 0!==o.precision?o.precision:3,h="object"==typeof o&&void 0!==o.template?o.template:"";o.precision=l,o.resultm2=e;var c=`${this.formateTipValue(e,r,l)} ${r||"平方米"}`;return h&&(o.template=h,c=h.replace("{value}",c)),this.showTipsPopup(s,a+c),c}convertMeasureDistanceValue(t){let e=t||this.activeLayerid;var i=this.dynamicMarkers[e];if(!i)return;let s=this.measureConfig[e];s||(this.measureConfig[e]=JSON.parse(JSON.stringify(this.measure)),s=this.measureConfig[e]);var a=s.unitList.length,n=s.unitIndex;n==a-1?n=0:n+=1,s.unitIndex=n,s.unit=s.unitList[n],i.forEach(((t,e)=>{let i=t.distance,a=t.showLabelIndex;if(void 0!==i&&"起点"!=t.msgZ){var n=s.unit||"千米",o=`${this.formateTipValue(i,n,s.precision)} ${n}`;s.template&&(o=s.template.replace("{value}",o));const r=e+1;a&&(o=o.indexOf("{index}")>-1?o.replace("{index}",r):`<span class="measure-labelindex">${r}</span>${o}`),t.setHTML(`<div class="medo-popup-measure">${o}</div>`),t.unit=n}}))}convertMeasureValue(t){let e=t||this.activeLayerid,i="measure-convert"+e,s=this.measureConfig[e];s||(this.measureConfig[e]=JSON.parse(JSON.stringify(this.measure)),s=this.measureConfig[e]);var a=s.resultm2,n=s.unitList.length,o=s.unitIndex;o==n-1?o=0:o+=1,s.unitIndex=o,s.unit=s.unitList[o];var r=s.unit,l=`${this.formateTipValue(a,r,s.precision)} ${r||"平方米"}`;s.template&&(l=s.template.replace("{value}",l));var h=`<div id="${i}" data-layerId = "${e}" class="measure-convert"></div>`;this.dynamicPopup[e].setHTML(`<div class="medo-popup-measure">${h+l}</div>`);var c=document.getElementById(i);s.unitList&&c&&(c.onclick&&c.removeEventListener("click",c.onclick),c.addEventListener("click",(t=>{let e;t&&t.target&&(e=c.getAttribute("data-layerId")),this.convertMeasureValue(e)})))}formateTipValue(t,e,i=3){var s;switch(e){case"米":case"平方米":case"m":case"m²":default:s=t;break;case"亩":s=.0015*t;break;case"公顷":case"ha":s=1e-4*t;break;case"平方千米":case"km²":s=1e-6*t;break;case"千米":case"km":case"公里":s=.001*t;break;case"里":s=.002*t;break;case"尺":s=3*t}return Number.isInteger(s)&&(i=0),s=s.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:i})}start(t,e,i){const s=Object.assign({clear:!0,isVaild:!1,measure:!1,immediate:!1,enableTransform:null,showLabelIndex:!1},e);if(this.map=t,!this.isBindEvent&&this.map&&this.subscribeMapClear(s),this.endCallback=i,this.active=s.type,this.isVaild=s.isVaild,this.measure=s.measure,this.immediate=s.immediate,this.enableTransform=s.enableTransform,this.showLabelIndex=s.showLabelIndex,"object"==typeof this.measure&&Array.isArray(this.measure.unit)){var a=this.measure.unit[0];this.measure.unitList=JSON.parse(JSON.stringify(this.measure.unit)),this.measure.unit=a,this.measure.unitIndex=0}s.clear&&this.clear("persistent"==s.mode),this.destory(),this.changeModeDraw(s)}async setDrawFeatures(t){const e=t.type;let i=JSON.parse(JSON.stringify(t.data));i.features.map(((i,s)=>(i.id=this.indexS.toString(),t.data.features[s].id=i.id,this.indexS+=1,i.properties="map_draw_point_canvas"==e?{poiindex:i.id,color:t.renderStyle.pointColor,symbolname:t.renderStyle.symbolname,symbolself:t.renderStyle.symbolself,data:JSON.stringify(i)}:{poiindex:i.id,data:JSON.stringify(i)},i)));var s=this.map.enableTransform;if(s&&(i=await sp(s.srid,null,i)),this.map.sz2000sdk&&(i=this.map.MapmostSDKConvert.convertGeojson(i)),this.map.getSource(this.activeLayerid).setData(i),t.cursor="grab",await this.endDrawHandler(t),t.fitBounds){const e=t.zoom||void 0;Pp.st_fitBoundsToMap(this.map,i,e,t.fitBounds)}this.endCallback&&this.endCallback(t.data)}changeModeDraw(t){const e=t;if(e.sticky&&!["map_draw_point","map_draw_point_geo","map_draw_text","map_draw_point_canvas"].includes(e.type)){this.snappedDrawLayerid=JSON.parse(JSON.stringify(this.activeMapDrawLayerid)),this.map=this.map.GLSDK.mapLocationsLayerControl.getMap();const t=this.map.GLSDK.mapLocationsLayerControl.getLayersidDraw();if(this.snappedDrawLayerid=this.snappedDrawLayerid.concat(t),e.sticky.target){const t=this.map.M.layerManager.getLayerById(e.sticky.target);if(t){const{layerType:i,url:s}=t.options;if("geojson"!=i)window.MapMessage.ShowMessage({message:"无法开启此图层的几何捕捉,仅支持geojson服务类型",type:"warning"});else{const i=t.layer.layers;let a=[t.layer.id];i&&(a=[],i.forEach((t=>{a.push(t.id)}))),this.snappedDrawLayerid=this.snappedDrawLayerid.concat(a),this.getFeatures(s),e.sticky.layers=!0}}else window.MapMessage.ShowMessage({message:"图层不存在,请先打开要捕捉的图层;",type:"warning"})}this.stickyLayersFeatures(e.sticky)}else this.mouseMoveSticky&&this.map.off("mousemove",this.mouseMoveSticky),this.removeStickyMouseMove();switch(this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.isDoingDraw=!0,e.type){case"map_draw_point":this.drawPoint(e);break;case"map_draw_text":this.drawText(e);break;case"map_draw_point_canvas":this.drawPointLayer(e);break;case"map_draw_point_geo":this.drawPointGeo(e);break;case"map_draw_line":this.drawPolyline(e,2);break;case"map_draw_polyline":this.drawPolyline(e);break;case"map_draw_polygon":this.drawPolygon(e);break;case"map_draw_circle":this.drawCircle(e);break;case"map_draw_rectangle":this.drawRectangle(e)}this.map.ExAPI.setCursor("crosshair",this.map)}endDrawHandler(t){this.setActiveMapDrawLayerid_old(),this.removeStickyMouseMove(t),"persistent"==t.mode?this.destoryMouseBind((()=>{this.changeModeDraw(t)})):this.destoryMouseBind()}async endTransformCallback(t,e,i,s={}){if(this.endCallback){var a=e||Pp.st_wkt2geojson(t);let n=JSON.parse(JSON.stringify(a)),o=this.enableTransform||(this.map.enableTransform?this.map.enableTransform.srid:"");this.map.sz2000sdk&&(a=await this.map.MapmostSDKConvert.convertGeoSDKToSZ2000(a),t=Pp.st_geojson2wkt(a)),o&&t&&"object"!=typeof t&&(a.coordinates=this.map.M.projTransform(this.map.sz2000sdk?1002:null,o,a.coordinates),t=Pp.st_geojson2wkt(a)),i&&(this.sourceIdTemp[i]=this.activeLayerid),this.endCallback(t,a,{id:i,shape:t,geojson:a,geoDraw:n,sourceId:this.activeLayerid,measure:this.measure||null,properties:s})}}immediateCallback(t,e){if(this.endCallback&&t){var i=t.geometry;this.drawResultWKT=Pp.st_geojson2wkt(i),this.endTransformCallback(this.drawResultWKT,i,e)}}back(){}drawText(t){this.loadDrawStyleSourceAndLayer("text",(()=>{this.endDraw=()=>{this.map.ExAPI.setCursor(""),this.map.off("click",this.mouseDown),this.endCallback?this.endTransformCallback(this.drawResultWKT,null,undefined):alert(`地图拾取几何:${this.drawResultWKT}`),this.endDrawHandler(t)},this.mouseDown=e=>{e.preventDefault(),t.clear&&this.clearBefore(),this.map.ExAPI.setCursor("");const i={type:e.coordinate?"coordinate":"lngLat",location:[e.lngLat.lng,e.lngLat.lat]};"coordinate"==i.type&&(i.location=e.coordinate),this.drawResultWKT=`POINT(${i.location[0]} ${i.location[1]})`;const s={id:"",type:"Feature",geometry:{type:"Point",coordinates:i.location}};s.id=this.indexS.toString(),this.indexS+=1,s.properties={poiindex:s.id,drawType:t.type,MC:t.renderStyle.text,data:JSON.stringify(s)};const a={type:"FeatureCollection",features:[s]};this.map.getSource(this.activeLayerid).setData(a),this.endDraw()},this.map.on("click",this.mouseDown)}),t)}drawPointLayer(t){const e="color_"+this.drawStyle.plotselfsymbol.pointLightColor;Fd.createMarkerCanvas(this.map,e,this.drawStyle.plotselfsymbol.pointLightColor);let i="#326EF0";t.renderStyle?i=t.renderStyle.pointColor||i:t.renderStyle={};const s="color_"+i;Fd.createMarkerCanvas(this.map,s,i),1!=t.renderStyle.symbolself&&(t.renderStyle.symbolname=s),t.renderStyle.pointColor=i,this.loadDrawStyleSourceAndLayer("point_canvas",(()=>{var e;this.endDraw=()=>{this.map.ExAPI.setCursor(""),this.map.off("click",this.mouseDown),this.endCallback?this.endTransformCallback(this.drawResultWKT,null,e):alert(`地图拾取几何:${this.drawResultWKT}`),this.endDrawHandler(t)},this.mouseDown=i=>{i.preventDefault(),t.clear&&this.clearBefore(),this.map.ExAPI.setCursor();const s={type:i.coordinate?"coordinate":"lngLat",location:[i.lngLat.lng,i.lngLat.lat]};"coordinate"==s.type&&(s.location=i.coordinate),this.drawResultWKT=`POINT(${s.location[0]} ${s.location[1]})`;const a={id:"",type:"Feature",geometry:{type:"Point",coordinates:s.location}};a.id=this.indexS.toString(),this.indexS+=1,a.properties={poiindex:a.id,color:t.renderStyle.pointColor,symbolname:t.renderStyle.symbolname,symbolself:t.renderStyle.symbolself,data:JSON.stringify(a)};const n={type:"FeatureCollection",features:[a]};this.map.getSource(this.activeLayerid).setData(n),e=a.id,this.endDraw()},this.map.on("click",this.mouseDown),t.data&&this.setDrawFeatures(t)}),t)}drawPointGeo(t){this.loadDrawStyleSourceAndLayer("point",(()=>{var e;this.endDraw=()=>{this.map.ExAPI.setCursor(""),this.map.off("click",this.mouseDown),this.endCallback?this.endTransformCallback(this.drawResultWKT,null,e):alert(`地图拾取几何:${this.drawResultWKT}`),this.endDrawHandler(t)},this.mouseDown=i=>{i.preventDefault(),t.clear&&this.clearBefore(),this.map.ExAPI.setCursor();const s={type:i.coordinate?"coordinate":"lngLat",location:[i.lngLat.lng,i.lngLat.lat]};"coordinate"==s.type&&(s.location=i.coordinate),this.drawResultWKT=`POINT(${s.location[0]} ${s.location[1]})`;const a={id:"",type:"Feature",geometry:{type:"Point",coordinates:s.location}};a.id=this.indexS.toString(),this.indexS+=1,a.properties={poiindex:a.id,data:JSON.stringify(a)};const n={type:"FeatureCollection",features:[a]};this.map.getSource(this.activeLayerid).setData(n),e=a.id,this.endDraw()},this.map.on("click",this.mouseDown)}),t)}drawPoint(t){var e;this.endDraw=()=>{this.map.ExAPI.setCursor(""),this.map.off("click",this.mouseDown),this.endCallback?this.endTransformCallback(this.drawResultWKT,null,e):alert(`地图拾取几何:${this.drawResultWKT}`),this.endDrawHandler(t)},this.mouseDown=i=>{i.preventDefault(),t.clear&&this.clearBefore(),this.map.ExAPI.setCursor();let s="#326EF0";t.renderStyle&&(s=t.renderStyle.pointColor||s);const a={color:s,type:i.coordinate?"coordinate":"lngLat",location:[i.lngLat.lng,i.lngLat.lat]};"coordinate"==a.type&&(a.location=i.coordinate),this.indexS+=1,this.pointMarker=Fd.addMarker(this.map,a),this.pointMarkerAll.push(this.pointMarker),this.drawResultWKT=`POINT(${a.location[0]} ${a.location[1]})`,this.endDraw(),e=this.indexS.toString()},this.map.on("click",this.mouseDown)}drawPolyline(t,e){this.loadDrawStyleSourceAndLayer("polyline",(()=>{let i,s=null,a=null;this.drawPointCoorsArr=[],this.drawLineCoorsArr=[];let n=!0;this.endDraw=()=>{if(n=!0,this.dynamicMarkersMoveTips&&(this.dynamicMarkersMoveTips.remove(),this.dynamicMarkersMoveTips=null),this.dynamicPopup[this.activeLayerid]&&(this.dynamicPopup[this.activeLayerid].remove(),delete this.dynamicPopup[this.activeLayerid]),this.map.ExAPI.setCursor(""),this.map.off("click",this.mouseDown),this.map.off("mousemove",this.mouseMove),this.map.off("dblclick",this.doubleClick),this.endCallback){const t=this.map.getSource(this.activeLayerid)._data.features[0],e=t.id,i=t.geometry;this.drawResultWKT=Pp.st_geojson2wkt(i),this.endTransformCallback(this.drawResultWKT,i,e),this.drawLineCoorsArr=[],this.drawPointCoorsArr=[]}else alert(`地图拾取几何:${this.drawResultWKT}`);this.endDrawHandler(t)};const o=()=>{if(!s&&!a)return void this.map.getSource(this.activeLayerTipid).setData({type:"FeatureCollection",features:[]});const t={type:"FeatureCollection",features:[T.lineString([s,a])]};this.map.getSource(this.activeLayerTipid).setData(t);var e=T.lineString(this.drawLineCoorsArr.concat([a]));this.measure&&this.showMeasureDistance(e,a)};this.mouseMove=t=>{t.preventDefault(),null!=s&&(a=this.getLocation(t),o())};const r=()=>{var t=this.drawLineCoorsArr.length;if(this.drawLineCoorsArr.length>1){const i=T.lineString(this.drawLineCoorsArr);i.id=this.indexS.toString(),this.indexS+=1,i.properties={poiindex:i.id,data:JSON.stringify(i)};const a={type:"FeatureCollection",features:[i]};this.map.getSource(this.activeLayerid).setData(a),this.measure&&this.showMeasureDistance(i,s,!0),void 0!==e&&t==e&&(this.map.off("mousemove",this.mouseMove),setTimeout((()=>{this.doubleClick()}),200))}else{this.measure&&this.showTipsMarker(s,"起点",{anchor:"bottom-left",offset:[0,-5]},!0);const t={type:"FeatureCollection",features:[]};this.map.getSource(this.activeLayerid).setData(t)}this.drawPointCoorsArr.length>=2&&this.immediate&&(i=setTimeout((()=>{const t=JSON.parse(JSON.stringify(this.drawPointCoorsArr)),e=T.lineString(t);this.immediate&&this.immediateCallback(JSON.parse(JSON.stringify(e)),this.activeLayerid)}),600))};this.mouseDown=async e=>{e.preventDefault(),i&&clearTimeout(i),t.clear&&n&&(await this.clearBefore(),n=!1);let a=this.getLocation(e);t.sticky&&this.snappedCoordinates&&(a=this.snappedCoordinates),s=a;var o=this.drawLineCoorsArr.length;if(o>1){var l=this.drawLineCoorsArr[o-1];if(l[0]==a[0]&&l[1]==a[1])return}this.drawLineCoorsArr.push(a),this.drawPointCoorsArr.push(a),r()},this.doubleClick=()=>{i&&clearTimeout(i),this.removeStickyMouseMove(),this.map.getSource(this.activeLayerTipid)&&this.map.getSource(this.activeLayerTipid).setData({type:"FeatureCollection",features:[]}),this.endDraw()},this.back=()=>{var t=this.drawLineCoorsArr.length;0!=t?(this.drawLineCoorsArr.pop(),this.drawPointCoorsArr.pop(),0==(t=this.drawLineCoorsArr.length)?(s=null,a=null):s=this.drawLineCoorsArr[this.drawLineCoorsArr.length-1],r(),o()):window.MapMessage.ShowMessage({message:"无法撤销,节点不存在!",type:"warning"})},this.map.on("click",this.mouseDown),this.map.on("mousemove",this.mouseMove),this.map.on("dblclick",this.doubleClick),t.data&&this.setDrawFeatures(t)}),t)}drawPolygon(t){this.loadDrawStyleSourceAndLayer("polygon",(()=>{let e=null;this.drawLineCoorsArr=[],this.drawPointCoorsArr=[];var i,s=!0;this.endDraw=()=>{if(this.map.ExAPI.setCursor(""),this.map.off("click",this.mouseDown),this.map.off("mousemove",this.mouseMove),this.endCallback){const t=this.map.getSource(this.activeLayerid)._data.features[0],e=t.geometry,i=t.id;this.drawResultWKT=Pp.st_geojson2wkt(e),this.endTransformCallback(this.drawResultWKT,e,i),this.drawLineCoorsArr=[],this.drawPointCoorsArr=[]}else alert(`地图拾取几何:${this.drawResultWKT}`);this.endDrawHandler(t)},this.mouseMove=i=>{if(i.preventDefault(),null==e)return;let a=this.getLocation(i);t.sticky&&this.snappedCoordinates&&(a=this.snappedCoordinates);const n=this.drawLineCoorsArr.length;if(n>1){const t=JSON.parse(JSON.stringify(this.drawLineCoorsArr));t.push(a),t.push(e);const i=Pp.st_coordiates2geojson(t,this.mapCoordinateType);i.id=this.indexS.toString(),this.indexS+=1;const n=T.lineString(t);n.id=i.id,i.properties={poiindex:i.id,data:JSON.stringify(n)};var o={type:"FeatureCollection",features:[i]};this.map.getSource(this.activeLayerid).setData(o),this.isVaild&&(s=ep(i.geometry)),this.map.getCanvas().style.cursor=s?"crosshair":"not-allowed",this.measure&&this.showMeasureArea(i)}else if(1==n){const t={type:"FeatureCollection",features:[T.lineString(this.drawLineCoorsArr.concat([a]))]};this.map.getSource(this.activeLayerTipid).setData(t)}},this.mouseDown=a=>{if(a.preventDefault(),!s)return;i&&clearTimeout(i),t.clear&&this.clearBefore();let n=this.getLocation(a);t.sticky&&this.snappedCoordinates&&(n=this.snappedCoordinates),null==e&&(e=n),this.drawLineCoorsArr.push(n),this.drawPointCoorsArr.push(n);this.drawPointCoorsArr.length>=3&&this.immediate&&(i=setTimeout((()=>{const t=JSON.parse(JSON.stringify(this.drawPointCoorsArr));t.push(e);const i=Pp.st_coordiates2geojson(t,this.mapCoordinateType);this.immediate&&this.immediateCallback(JSON.parse(JSON.stringify(i)),this.activeLayerid)}),600))},this.doubleClick=()=>{s&&(i&&clearTimeout(i),this.removeStickyMouseMove(),this.map.off("click",this.mouseDown),this.map.off("mousemove",this.mouseMove),this.map.getSource(this.activeLayerTipid)&&this.map.getSource(this.activeLayerTipid).setData({type:"FeatureCollection",features:[]}),this.endDraw())},this.map.on("click",this.mouseDown),this.map.on("mousemove",this.mouseMove),this.map.on("dblclick",this.doubleClick),t.data&&this.setDrawFeatures(t)}),t)}drawCircle(t){this.loadDrawStyleSourceAndLayer("circle",(()=>{let e=null;this.endDraw=()=>{if(this.map.off("click",this.mouseDown),this.map.off("mousemove",this.mouseMove),this.map.ExAPI.setCursor(""),this.endCallback){const t=this.map.getSource(this.activeLayerid)._data.features[0],e=t.id,i=t.geometry;this.drawResultWKT=Pp.st_geojson2wkt(i),this.endTransformCallback(this.drawResultWKT,i,e,t.properties)}else alert(`地图拾取几何:${this.drawResultWKT}`);this.endDrawHandler(t)},this.mouseMove=i=>{i.preventDefault();let s=0;if(null==e)return;let a=this.getLocation(i);t.sticky&&this.snappedCoordinates&&(a=this.snappedCoordinates);const n=T.lineString([e,a]),o={type:"FeatureCollection",features:[n]};this.map.getSource(this.activeLayerTipid).setData(o),s="coordinate"==this.mapCoordinateType?Math.sqrt(Math.pow(Math.abs(e[0]-a[0]),2)+Math.pow(Math.abs(e[1]-a[1]),2)):T.length(n,{units:"meters"});const r=Pp.st_c_circle2geojson(e,s,this.mapCoordinateType);r.id=this.indexS.toString(),this.indexS+=1;const l=T.polygonToLine(JSON.parse(JSON.stringify(r)));l.id=r.id,r.properties={poiindex:r.id,data:JSON.stringify(l),distinceValue:s,centerPoint:e};const h={type:"FeatureCollection",features:[r]};this.map.getSource(this.activeLayerid).setData(h),this.measure&&this.showMeasureArea(r)},this.mouseDown=i=>{i.preventDefault(),null!=e?(this.map.getSource(this.activeLayerTipid)&&this.map.getSource(this.activeLayerTipid).setData({type:"FeatureCollection",features:[]}),this.endDraw()):(t.clear&&this.clearBefore(),e=this.getLocation(i),t.sticky&&this.snappedCoordinates&&(e=this.snappedCoordinates))},this.map.on("click",this.mouseDown),this.map.on("mousemove",this.mouseMove)}),t)}drawRectangle(t){this.loadDrawStyleSourceAndLayer("circle",(()=>{let e=null;this.endDraw=()=>{if(this.map.off("click",this.mouseDown),this.map.off("mousemove",this.mouseMove),this.map.ExAPI.setCursor(""),this.endCallback){const t=this.map.getSource(this.activeLayerid)._data.features[0],e=t.id,i=t.geometry;this.drawResultWKT=Pp.st_geojson2wkt(i),this.endTransformCallback(this.drawResultWKT,i,e)}else alert(`地图拾取几何:${this.drawResultWKT}`);this.endDrawHandler(t)},this.mouseMove=i=>{if(i.preventDefault(),null==e)return;let s=this.getLocation(i);t.sticky&&this.snappedCoordinates&&(s=this.snappedCoordinates);const a=T.bboxPolygon(e.concat(s));a.id=this.indexS.toString(),this.indexS+=1;const n=T.polygonToLine(JSON.parse(JSON.stringify(a)));n.id=a.id,a.properties={poiindex:a.id,data:JSON.stringify(n)};const o={type:"FeatureCollection",features:[a]};this.map.getSource(this.activeLayerid).setData(o),this.measure&&this.showMeasureArea(a)},this.mouseDown=i=>{i.preventDefault(),null!=e?this.endDraw():(t.clear&&this.clearBefore(),e=this.getLocation(i),t.sticky&&this.snappedCoordinates&&(e=this.snappedCoordinates))},this.map.on("click",this.mouseDown),this.map.on("mousemove",this.mouseMove)}),t)}getFeatures(t){dr.get({url:t,nomessage:!0}).then((t=>{t.features?this.allGeoJSONFeatures=t.features:window.MapMessage.ShowMessage({message:"图层数据暂时只支持geojson类型",type:"warning"})}))}getFeatureById(t,e){new Promise((e=>{const i=this.allGeoJSONFeatures.length;0==i&&e();for(let s=0;s<i;s++){const i=this.allGeoJSONFeatures[s];if(i.id==t||i.properties.objectid==t||i.properties.id==t){i.type="Feature",["LineString","MultiLineString"].includes(i.geometry.type)?e(i):e(T.polygonToLine(JSON.parse(JSON.stringify(i))));break}}})).then((t=>{e(t)}))}stickyLayersFeatures(t){this.mouseMoveSticky&&this.map.off("mousemove",this.mouseMoveSticky),this.mouseMoveSticky=e=>{let i=[];if(i=this.map.queryRenderedFeatures(e.point,{layers:this.snappedDrawLayerid}).filter((t=>t.source!=this.activeLayerStickyid)),i.length){const s=i[0];if(null!=this.hoverSourceId&&this.hoverSourceId!=s.source&&this.map.getSource(this.hoverSourceId)&&(this.map.removeFeatureState({source:this.hoverSourceId}),this.hoveredStateId=null),this.hoverSourceId=s.source,!this.map.getSource(this.hoverSourceId))return;const a=T.point(this.getLocation(e));if(s.geometry.type.indexOf("point")>-1)return;if(!s.properties.poiindex)return t.layers?void this.calcSnappedPointToLayers(a,s):void 0;let n=JSON.parse(s.properties.data);if(n.shape)if(n.shape.toLowerCase().indexOf("polygon")>-1){const t=Pp.st_shape2geojson2(n.shape);n=T.polygonToLine(JSON.parse(JSON.stringify(t)))}else n=Pp.st_shape2geojson2(n.shape);this.nearestPointOnLineToLayers(n,a)}else this.removeStickyMouseMove()},this.map.on("mousemove",this.mouseMoveSticky)}calcSnappedPointToLayers(t,e){const i=e.properties.id||e.properties.objectid;this.tempAllGeoJSONFeatures[`${this.hoverSourceId}_${i}`]?this.nearestPointOnLineToLayers(this.tempAllGeoJSONFeatures[`${this.hoverSourceId}_${i}`],t):this.getFeatureById(i,(e=>{e&&(this.tempAllGeoJSONFeatures[`${this.hoverSourceId}_${i}`]=e,this.nearestPointOnLineToLayers(e,t))}))}nearestPointOnLineToLayers(t,e){let i,s=5;if(this.map.projection?(i=Pp.jsts_DistanceToPoint(e,t),s=200):t&&t.geometry&&"Point"!=t.geometry.type&&(i=T.nearestPointOnLine(t,e,{units:"miles"})),i){if(i.properties.dist<s){const e={type:"FeatureCollection",features:[i]};this.map.getSource(this.activeLayerStickyid).setData(e),this.snappedCoordinates=i.geometry.coordinates,t.id&&this.setChangeFeatureState(this.hoverSourceId,t.id)}else this.removeStickyMouseMove()}else this.removeStickyMouseMove()}removeStateIconImage(){if(this.activePointCanvasLayerid){const t=this.activePointCanvasLayerFeatures[this.activePointCanvasLayerid]||"";if(t&&1==t.symbolself)return this.activePointCanvasLayerid="",void(this.activePointCanvasLayerFeatures[this.activePointCanvasLayerid]="");this.map.getLayer(this.activePointCanvasLayerid)&&this.map.setLayoutProperty(this.activePointCanvasLayerid,"icon-image",["concat","color_",["get","color"]]),this.activePointCanvasLayerid=""}}setChangeStateIconImage(t,e){var i=e.layer.id;this.activePointCanvasLayerid=i;var s="color_"+this.drawStyle.plotselfsymbol.pointLightColor,a="color_"+e.properties.color,n=e.properties.poiindex;this.activePointCanvasLayerFeatures[i]=e.properties,1!=e.properties.symbolself&&this.map.hasImage(s)&&this.map.setLayoutProperty(i,"icon-image",["match",["to-string",["get","poiindex"]],n,s,a])}setChangeStateIconImageById(t,e){const i=this.sourceIdTemp[t];if(!i)return;const s=this.sourceIdLayerIdTemp[i];if(s.length>0){const i=s[0];if(this.map.getLayer(i))if(e){var a="color_"+this.drawStyle.plotselfsymbol.pointLightColor;this.map.setLayoutProperty(i,"icon-image",["match",["to-string",["get","poiindex"]],t,a,"color_#326EF0"])}else this.map.setLayoutProperty(i,"icon-image","color_#326EF0")}}setChangeFeatureState(t,e){null!==this.hoveredStateId&&this.map.setFeatureState({source:t,id:this.hoveredStateId},{hover:!1}),this.hoveredStateId=e,this.map.setFeatureState({source:t,id:this.hoveredStateId},{hover:!0})}removeFeatureState(t){null!=this.hoverSourceId&&this.hoverSourceId!=t&&this.map.getSource(this.hoverSourceId)&&(this.map.removeFeatureState({source:this.hoverSourceId}),this.hoveredStateId=null)}removeStickyMouseMove(t={}){this.map.ExAPI.setCursor(t.cursor||"old"),this.snappedCoordinates=null,this.activeLayerStickyid&&this.map.getSource(this.activeLayerStickyid)&&(this.map.getSource(this.activeLayerStickyid).setData({type:"FeatureCollection",features:[]}),this.hoverSourceId&&this.map.getSource(this.hoverSourceId)&&(this.map.removeFeatureState({source:this.hoverSourceId}),this.hoveredStateId=null))}getLocation(t){let e=[t.lngLat.lng,t.lngLat.lat];return t.coordinate?(this.mapCoordinateType="coordinate",e=t.coordinate):this.mapCoordinateType="lngLat",e}loadDrawStyleSourceAndLayer(t,e,i={}){this.activeLayerid=t+this.guid();const s=this.drawStyle.getDrawStyle(i.renderStyle||null,t);this.map.addSource(this.activeLayerid,s.source),this.sourceIdLayerIdTemp[this.activeLayerid]||(this.sourceIdLayerIdTemp[this.activeLayerid]=[]),s.tipsource&&(this.activeLayerTipid=t+this.guid(),this.map.addSource(this.activeLayerTipid,s.tipsource)),s.stickysource&&(this.activeLayerStickyid=t+this.guid(),this.map.addSource(this.activeLayerStickyid,s.stickysource)),s.layer.forEach((t=>{const e=t;e.id=this.guid(),"tipsource"==e.source?e.source=this.activeLayerTipid:"stickysource"==e.source?e.source=this.activeLayerStickyid:e.source=this.activeLayerid,this.map.addLayer(e),this.activeMapDrawLayerid.includes(e.id)||this.activeMapDrawLayerid.push(e.id),this.sourceIdLayerIdTemp[this.activeLayerid].includes(e.id)||this.sourceIdLayerIdTemp[this.activeLayerid].push(e.id)})),e&&e()}setActiveMapDrawLayerid_old(){this.activeMapDrawLayerid_old={layers:JSON.parse(JSON.stringify(this.activeMapDrawLayerid)),sources:JSON.parse(JSON.stringify([this.activeLayerTipid,this.activeLayerid,this.activeLayerStickyid]))}}removeById(t){const e=this.sourceIdTemp[t];e&&this.removeSourceFeature(e,t)}async selectedFeature(t){await this.removeStateIconImage(),await this.removeFeatureState();const e=this.sourceIdTemp[t];e&&(this.hoverSourceId=e,this.map.getSource(this.hoverSourceId)&&this.setChangeFeatureState(e,parseInt(t)))}removeSelectedFeature(){if(this.selectedLightMarker)return this.selectedMarker&&this.selectedMarker.remove(),void this.removeMarkerSelected();const t=this.hoveredStateId,e=this.hoverSourceId;this.removeSourceFeature(e,t)}removeSourceFeature(t,e){if(e&&this.map.getSource(t)){let i=this.map.getSource(t)._data.features;i=i.filter((t=>t.id!=e||t.id.toString()!=e.toString())),this.map.getSource(t).setData({type:"FeatureCollection",features:i}),this.removeSourceFeatureCallback&&this.removeSourceFeatureCallback(e)}}clear(){this.map&&(this.setActiveMapDrawLayerid_old(),this.pointMarker&&this.pointMarker.remove(),this.drawResultWKT=null,this.activeMapDrawLayerid=[],this.snappedDrawLayerid=[],this.allGeoJSONFeatures=[],this.removeStickyMouseMove(),this.removeOldDrawLayerIds(),this.removeMarkerSelected(),this.measure&&this.removeDynamicPopup(),this.selectedCallback&&(this.selectedCallback=null))}removeOldDrawLayerIds(){new Promise((t=>{const e=this.activeMapDrawLayerid_old.layers.length;0==e&&t(),this.activeMapDrawLayerid_old.layers.forEach(((i,s)=>{this.map.getLayer(i)&&this.map.removeLayer(i),e-1==s&&t()}))})).then((()=>{this.activeMapDrawLayerid_old.sources.forEach((t=>{t&&(this.map.getSource(t)&&this.map.removeSource(t),this.removeDynamicPopup(t))}))}));const t=this.pointMarkerAll.length;0!=t&&new Promise((e=>{this.pointMarkerAll.forEach(((i,s)=>{i.remove(),s==t-1&&e()}))})).then((()=>{this.pointMarkerAll=[]}))}clearBefore(){var t=this.activeMapDrawLayerid_old.sources[1];this.measure&&t&&t!=this.activeLayerid&&this.removeDynamicPopup(t),this.pointMarker&&this.pointMarker.remove(),this.activeMapDrawLayerid=this.activeMapDrawLayerid.filter((t=>!this.activeMapDrawLayerid_old.layers.includes(t))),this.drawResultWKT=null,this.snappedDrawLayerid=[],this.allGeoJSONFeatures=[],this.removeStickyMouseMove(),this.removeOldDrawLayerIds()}guid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}destoryMouseBind(t){this.isDoingDraw=!1,this.mouseDown&&(this.map.off("click",this.mouseDown),this.mouseDown=null),this.mouseMove&&this.map.off("mousemove",this.mouseMove),this.doubleClick&&this.map.off("dblclick",this.doubleClick),this.mouseMoveSticky&&this.map.off("mousemove",this.mouseMoveSticky),t&&t()}offQueryClick(){this.mouseQueryClick&&this.map.off("click",this.mouseQueryClick)}removeDynamicPopup(t){if(this.removeDynamicMarker(t),t)this.dynamicPopup[t]&&(this.dynamicPopup[t].remove(),this.dynamicPopup[t]=null,delete this.dynamicPopup[t]);else for(let t in this.dynamicPopup)this.dynamicPopup.hasOwnProperty(t)&&(this.dynamicPopup[t].remove(),this.dynamicPopup[t]=null,delete this.dynamicPopup[t])}removeDynamicMarker(t){if(t)this.dynamicMarkers[t]&&this.dynamicMarkers[t].forEach((t=>{t.remove()}));else for(let t in this.dynamicMarkers){if(this.dynamicMarkers.hasOwnProperty(t))this.dynamicMarkers[t].forEach((t=>{t.remove()}))}}destory(){this.map&&this.map.ExAPI.setCursor(""),this.map&&(this.activeLayerStickyid="",this.destoryMouseBind())}}var Gd,zd,jd,Ud=require("@tweenjs/tween.js");class Vd{constructor(t,e,i,s={}){this.map=t,this.guid=parseInt(1e5*Math.random()),this.optionsIcon=s.icon||{},this.eventCallback=s.eventCallback||null,this.closeUI=!0===s.closeUI,this.bezierSpline=!0===s.bezierSpline,this.showSearchBtn=!0===s.showSearchBtn,this.showIconBearing=!0===s.showIconBearing,this.showIconAnimationBearing=void 0===s.showIconAnimationBearing||s.showIconAnimationBearing,this.bearingDuration=s.bearingDuration||100,this.showAnimationPoint=void 0!==s.showAnimationPoint&&s.showAnimationPoint,this.pointDuration=s.pointDuration||100,this.beforeId=s.beforeId||"",this.layerStyle=s.layerStyle||{},this.position=s.position||[null,null,"60px","100px"],this.actionData=e||s,this.mapControlClass="mapmostgl-control-container",this.mapTraceSliderContainerID="mapmost-traceSlider-ui",this.data=i,this.traceLineSourceData=[],this.traceLineSourceId="traceLineSourceId"+this.guid,this.traceLineLayerId="traceLineLayerId"+this.guid,this.traceLineLayerIdCrow="traceLineLayerIdCrow"+this.guid,this.trace_s_e_PointlayerId="trace_s_e_PointLayerId"+this.guid,this.tracePointSourceId="tracePointSourceId"+this.guid,this.tracePointLayerId="tracePointLayerId"+this.guid,this.trace_s_e_PointSourceId="trace_s_e_PointSourceId"+this.guid,this.traceAnimateSourceId="traceAnimateSourceId"+this.guid,this.traceAnimateLayerId="traceAnimateLayerId"+this.guid,this.traceSplitTime=[0],this.maxMinutes=s.maxtime||5,this.intanceDom=null,this.fitBounds=void 0===s.fitBounds||s.fitBounds,this.customAxios=void 0!==s.customAxios?s.customAxios:dr.get,this.init(),this.playParams={counter:0,coordinates:[],duration:1e4},this.tempPoint,this.tempBearing=0,this.bearing=0,this.minBearing=s.minBearing||3,this.iconPoint=null}subscribeMapClear(){this.map.M.pubsub.subscribe("clear",(()=>{this.destory()}))}init(){return this.subscribeMapClear(),this.mapid=this.map._container.id,this.closeUI||(this.intanceDom=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_TRACESLIDER_DEFAULT",{domid:this.mapTraceSliderContainerID,data:this.data,url:this.actionData.url,showSearchBtn:this.showSearchBtn,position:this.map.ExAPI.getPositionStyle(this.position),customAxios:this.customAxios,renderTraceLine:t=>{this.addTraceLineToMap(t)},close:()=>{this.eventCallback&&this.eventCallback("close"),this.destory()}}),this.intanceDom.searchEventCallback=()=>{this.eventCallback&&this.eventCallback("search")},this.intanceDom.change=()=>{this.eventCallback&&this.eventCallback("change")},this.map.ExAPI.appendMapControlContainer(this.intanceDom)),this.addTraceLineToMap({visible:!0,data:this.data}),this.eventCallback&&this.eventCallback("init",this),this}getQueryParams(){return this.intanceDom.getQueryParams()}play(){}pause(){}stop(){}addTraceLineToMap(t){let e=0;if(void 0!==t.num){this.eventCallback&&this.eventCallback("slider-change",t.num);const n=t.num;var i={type:"FeatureCollection",features:[]};const o=this.traceSplitTime.filter((t=>t<n));if(0!=n&&o.push(n+1),o.forEach(((t,e)=>{e>0&&i.features.push(this.getFeaturesByTimeSplit(t,e))})),this.showIconBearing){let t=n,i=n+1;this.traceLineSourceData[i]||(t=n-1,i=n),e=Pp.st_calc2bearing(this.traceLineSourceData[t],this.traceLineSourceData[i],90)}var s={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:this.traceLineSourceData[n]},geometry_name:"shape",properties:{bearing:e}}]};if(this.map.getSource(this.traceAnimateSourceId)){if(this.map.sz2000sdk&&(i=this.map.MapmostSDKConvert.convertGeojson(i),s=this.map.MapmostSDKConvert.convertGeojson(s)),this.map.getSource(this.traceAnimateSourceId).setData(i),this.showAnimationPoint){var a=this.map.getSource(this.tracePointSourceId)._data;this.animateTracePoint(a.features[0].geometry.coordinates,s.features[0].geometry.coordinates,s.features[0].properties)}else this.map.getSource(this.tracePointSourceId).setData(s);this.showIconBearing&&this.showIconAnimationBearing&&this.animateTracePointBearing(e)}}else if(t.visible){const i=[];let s=null;if(0==t.data.length)return void this.remove();const a=t.data.length-1;new Promise((e=>{t.data.forEach(((n,o)=>{i.push(n.shape),s=t.data[o-1],o>0&&this.calcTraceTimeSplit(n.time,s.time,o),this.calcTraceTimeSplit(),o==a&&e()}))})).then((()=>{this.traceSplitTime.push(a+1),this.traceLineSourceData=i;var s={type:"FeatureCollection",features:[]};this.traceSplitTime.forEach(((t,e)=>{e>0&&s.features.push(this.getFeaturesByTimeSplit(t,e))})),this.showIconBearing&&this.traceLineSourceData[1]&&(e=Pp.st_calc2bearing(this.traceLineSourceData[0],this.traceLineSourceData[1],90)),this.tempBearing=e,this.iconPoint=this.traceLineSourceData[0];var n={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:this.traceLineSourceData[0]},geometry_name:"shape",properties:{bearing:e}}]},o={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:this.traceLineSourceData[0]},geometry_name:"shape",properties:{fclass:"traceStartPoint"}},{type:"Feature",geometry:{type:"Point",coordinates:this.traceLineSourceData[this.traceLineSourceData.length-1]},geometry_name:"shape",properties:{fclass:"traceEndPoint"}}]},r={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"LineString",coordinates:[this.traceLineSourceData[0],this.traceLineSourceData[0]]},geometry_name:"shape",properties:{}}]};if(this.map.sz2000sdk&&(s=this.map.MapmostSDKConvert.convertGeojson(s),n=this.map.MapmostSDKConvert.convertGeojson(n),o=this.map.MapmostSDKConvert.convertGeojson(o),r=this.map.MapmostSDKConvert.convertGeojson(r)),this.map.getSource(this.traceLineSourceId)?(this.map.getSource(this.traceLineSourceId).setData(s),this.map.getSource(this.tracePointSourceId).setData(n),this.map.getSource(this.trace_s_e_PointSourceId).setData(o),this.map.getSource(this.traceAnimateSourceId).setData({type:"FeatureCollection",features:[]})):(Fd.addMapSymbolImage(this.map,[{name:"traceline",default:void 0===this.optionsIcon.traceline,url:this.optionsIcon.traceline||"/箭头.png"},{name:"tracePoint",default:void 0===this.optionsIcon.tracePoint&&!this.showIconBearing,url:this.optionsIcon.tracePoint||(this.showIconBearing?require("./assets/source_images_car.png"):"/移动点.png")},{name:"traceStartPoint",default:void 0===this.optionsIcon.traceStartPoint,url:this.optionsIcon.traceStartPoint||"/起点.png"},{name:"traceEndPoint",default:void 0===this.optionsIcon.traceEndPoint,url:this.optionsIcon.traceEndPoint||"/终点.png"}]),this.map.addSource(this.traceLineSourceId,{type:"geojson",data:s}),this.map.addSource(this.tracePointSourceId,{type:"geojson",data:n}),this.map.addSource(this.traceAnimateSourceId,{type:"geojson",lineMetrics:!0,data:r}),this.map.addSource(this.trace_s_e_PointSourceId,{type:"geojson",data:o}),this.map.addLayer({id:this.traceLineLayerId,type:"line",source:this.traceLineSourceId,layout:{"line-join":"round","line-cap":"round"},paint:Object.assign({"line-width":5,"line-color":"#0048ff"},this.layerStyle.traceLinePaint)},this.beforeId),this.map.addLayer({id:this.traceAnimateLayerId,type:"line",source:this.traceAnimateSourceId,layout:{"line-cap":"round","line-join":"round"},paint:Object.assign({"line-width":6,"line-color":"#0048ff","line-gradient":["interpolate",["linear"],["line-progress"],0,"#FFCC66",1,"#FF9900"]},this.layerStyle.traceAnimateLinePaint)},this.beforeId),this.map.addLayer({id:this.traceLineLayerIdCrow,type:"symbol",source:this.traceLineSourceId,layout:Object.assign({"symbol-placement":"line","symbol-spacing":40,"icon-image":"traceline","icon-size":.28,"icon-allow-overlap":!0,"icon-ignore-placement":!0},this.layerStyle.traceLineCrowLayout),paint:{}},this.beforeId),this.map.addLayer({id:this.tracePointLayerId,type:"symbol",source:this.tracePointSourceId,layout:Object.assign({"icon-image":"tracePoint","icon-size":.8,"icon-anchor":this.showIconBearing?"center":"bottom","symbol-placement":"point","icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-pitch-alignment":"viewport","icon-rotate":this.showIconBearing?["get","bearing"]:0,"icon-rotation-alignment":this.showIconBearing?"map":"auto"},this.layerStyle.traceAnimatePointLayout),paint:{}},this.beforeId),this.map.addLayer({id:this.trace_s_e_PointlayerId,type:"symbol",source:this.trace_s_e_PointSourceId,layout:Object.assign({"icon-image":"{fclass}","icon-size":1,"icon-anchor":"bottom","symbol-placement":"point","icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-pitch-alignment":"viewport"},this.layerStyle.tracePointLayout),paint:{}},this.beforeId)),0!=this.fitBounds){const e=t.zoom||void 0;Pp.st_fitBoundsToMap(this.map,s,e,this.fitBounds)}}))}else this.remove()}animateTracePointBearing(t){var e=t;if(this.tempBearing==e)return;if(Math.abs(e-this.tempBearing)<this.minBearing)return;this.tempBearing=e,!Gd&&qd();var i={val:this.bearing};const s=this.bearingDuration;zd&&Ud.remove(zd),zd=new Ud.Tween(i).to({val:e},s).easing(Ud.Easing.Cubic.InOut).onUpdate((()=>{this.bearing=i.val,this.map.getLayer(this.tracePointLayerId)&&this.map.setLayoutProperty(this.tracePointLayerId,"icon-rotate",i.val)})).onComplete((()=>{})).start()}animateTracePoint(t,e,i){var s=JSON.parse(JSON.stringify(e));if(s&&this.tempPoint){const t=this.tempPoint[0],e=this.tempPoint[1],i=s[0],a=s[1];if(t==i&&e==a)return}this.tempPoint=s,!Gd&&qd();var a={x:t[0],y:t[1]};const n=this.pointDuration;jd&&Ud.remove(jd),jd=new Ud.Tween(a).to({x:e[0],y:e[1]},n).easing(Ud.Easing.Cubic.InOut).onUpdate((()=>{this.iconPoint=[a.x,a.y],this.map.getSource(this.tracePointSourceId)&&this.map.getSource(this.tracePointSourceId).setData(this.getSourceDataForamte(this.iconPoint,i))})).onComplete((()=>{})).start()}getSourceDataForamte(t,e){return{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:t},properties:e||{}}]}}getFeaturesByTimeSplit(t,e){const i=t;let s=this.traceLineSourceData.slice(this.traceSplitTime[e-1],i);return this.bezierSpline,{type:"Feature",geometry:{type:"LineString",coordinates:s},geometry_name:"shape",properties:{}}}calcTraceTimeSplit(t,e,i){const s=new Date(t),a=new Date(e);parseInt(s-a,10)/1e4/60>=this.maxMinutes&&this.traceSplitTime.push(i)}remove(t){Gd&&(cancelAnimationFrame(Gd),zd&&Ud.remove(zd),jd&&Ud.remove(jd),Gd=null),this.map.getLayer(this.traceLineLayerId)&&this.map.removeLayer(this.traceLineLayerId),this.map.getLayer(this.traceLineLayerIdCrow)&&this.map.removeLayer(this.traceLineLayerIdCrow),this.map.getLayer(this.tracePointLayerId)&&this.map.removeLayer(this.tracePointLayerId),this.map.getLayer(this.traceAnimateLayerId)&&this.map.removeLayer(this.traceAnimateLayerId),this.map.getLayer(this.trace_s_e_PointlayerId)&&this.map.removeLayer(this.trace_s_e_PointlayerId),this.map.getSource(this.traceLineSourceId)&&this.map.removeSource(this.traceLineSourceId),this.map.getSource(this.tracePointSourceId)&&this.map.removeSource(this.tracePointSourceId),this.map.getSource(this.traceAnimateSourceId)&&this.map.removeSource(this.traceAnimateSourceId),this.map.getSource(this.trace_s_e_PointSourceId)&&this.map.removeSource(this.trace_s_e_PointSourceId),t&&t()}destory(t){this.intanceDom&&this.intanceDom.timer&&clearInterval(this.timer),this.map&&this.map.ExAPI.removeMapControlContainer(this.mapTraceSliderContainerID),this.remove(t)}}function qd(){Gd=requestAnimationFrame(qd),Ud.update()}class Hd{constructor(){this.map=null,this.activePopup=null,this.mapCoordinateType="lngLat",this.subscribe=null,this.eventCallback=null,this.poiindex=null,this.poitextindex="-1",this.mapControlClass="mapmostgl-control-container",this.mapControlActionClass="map-moreinfo-container",this.mapPopupDomid="map-popup",this.mapMoreInfoDomid="map-moreinfo",this.mapDialogDomid="mappopup-container-Panel",this.showType="mapPopup",this.MapPopupConfig={},this.popupCurrentData="",this.filterEmpty=!1,this.emptyReplaceStr="",this.fitBounds=!1,this.dialogTarget=null,this.initControls()}initControls(t){if(t){var e=t.controls;this.fitBounds=!1,e.MapPopup&&(this.filterEmpty="object"==typeof e.MapPopup&&void 0!==e.MapPopup.filterEmpty?e.MapPopup.filterEmpty:this.filterEmpty,this.emptyReplaceStr="object"==typeof e.MapPopup&&void 0!==e.MapPopup.emptyReplaceStr?e.MapPopup.emptyReplaceStr:this.emptyReplaceStr,this.fitBounds="object"==typeof e.MapPopup&&void 0!==e.MapPopup.fitBounds?e.MapPopup.fitBounds:this.fitBounds,this.dialogTarget="object"==typeof e.MapPopup&&void 0!==e.MapPopup.dialogTarget?e.MapPopup.dialogTarget:this.dialogTarget)}}getAppendTarget(t){if(!t)return null;let e;if("string"===typeof t)e="body"==t?document.body:document.getElementById(t);else e=t;return e}subscribeMapClear(t){this.map=t;const e=this.map.getOnemapConfig();this.initControls(e),this.map.M.pubsub.subscribe("clear",(()=>{this.destory()})),this.bindPopupActionsEvent(),e.controls.MapPopup&&!document.getElementById("mx-map-search-result")&&(this.MapPopupConfig=e.controls.MapPopup)}bindPopupActionsEvent(){this.map.$MapEventBus.$on("map-popup-close",(()=>{this.close()})),this.map.$MapEventBus.$on("map-popup-trigger-action",((t,e)=>{this.eventActionFun(t,e)}))}add(t,e,i){this.map=t;var{data:s,fitBounds:a}=e;void 0===a&&(e.fitBounds=this.fitBounds);var n=Math.random();if(s=Object.assign({id:n,name:n,label:n,shape:"",iQueryList:[],qQueryList:[],detaillist:[],sysData:{},extras:[]},s),this.popupCurrentData=s,this.poiindex=s.poiindex,e.type&&(this.showType=e.type),document.getElementsByClassName("mx-map-search-result")[0]&&(this.showType="mapPopup"),"dialog"==this.showType&&this.map.ExAPI.removeMapControlContainer(this.mapDialogDomid),null!=this.activePopup&&this.activePopup.remove(),this.poiindex==this.poitextindex&&this.clearText(),s.extras.length>0&&"justmapactioncallback"==s.extras[0].extraCode.toLowerCase())return void this.eventJustMapActionCallbackPopupFun(s.extras[0],s,s);if(this.eventCallback=i,null==s||""==s.shape||null==s.shape)return void window.MapMessage.ShowMessage({message:"定位几何信息不存在!",type:"warning"});let o={domid:this.mapDialogDomid,position:this.map.ExAPI.getPositionStyle(e.position||this.MapPopupConfig.position||"")};const r=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_POPUP_DEFAULT",Object.assign({data:s,showType:this.showType,filterEmpty:this.filterEmpty,emptyReplaceStr:this.emptyReplaceStr},"dialog"==this.showType?o:{}));r.map=this.map;const l="bottom";var h=this.transformShapeCenter(s.shape);const c=[0,-10];if(s.pointClick&&(h=s.pointClick),s.iQueryList.length>0)if("dialog"==this.showType)this.map.ExAPI.appendMapControlContainer(r);else{this.map.projection?(this.activePopup=new I.default.Popup({closeOnClick:!1,closeButton:!1,offset:c,anchor:l,className:"map-popup"}).setCoordinate(h).setOffset([0,-10]).setHTML(`<div id="${this.mapPopupDomid}"></div>`).addTo(this.map),this.activePopup.setCoordinate(h).addTo(this.map)):(this.activePopup=new I.default.Popup({closeOnClick:!1,closeButton:!1,anchor:l,className:"map-popup"}).setLngLat(h).setOffset([0,-10]).setHTML(`<div id="${this.mapPopupDomid}"></div>`).addTo(this.map),this.activePopup.setLngLat(h).addTo(this.map));const t=document.getElementById(`${this.mapPopupDomid}`);r.$mount(t)}this.fitBoundsHandler(e,s,h)}transformShapeCenter(t){if(!t)return null;var e=Pp.st_getcenterbywkt(t),i=this.map.enableTransform;return e[0]>180&&i&&(e=Pp.projTransform(i.srid,null,e)),this.map.sz2000sdk&&(e=this.map.MapmostSDKConvert.fromDefinedProj(e)),e}fitBoundsHandler(t,e,i){t.closeAllFitBounds||e.closeAllFitBounds||(t.fitBounds?Pp.st_fitBoundsToQData(this.map,[e],null,null,t.fitBounds):this.map.flyTo({center:JSON.parse(JSON.stringify(this.getTransformCenter(i))),zoom:this.map.getZoom(),pitch:this.map.getPitch(),duration:500}))}getTransformCenter(t){const e=this.map.enableTransform,i=t[0]||0;return e&&i>180&&(t=this.map.M.projTransform(e.srid,null,t)),t}addDom(t,e){this.map=t;const{html:i}=e;if(null!=this.activePopup&&this.activePopup.remove(),!e)return;let s=e.shape||(e.data?e.data.shape:"");if(!s)return;const a="bottom";var n=Pp.st_getcenterbywkt(s);this.map.sz2000sdk&&(n=this.map.MapmostSDKConvert.fromDefinedProj(n)),this.map.projection?(this.activePopup=new I.default.Popup({closeOnClick:!1,closeButton:!1,anchor:a,className:"map-popup"}).setCoordinate(n).setOffset([0,-10]).setHTML('<div id="map-popup"></div>').addTo(this.map),this.activePopup.setCoordinate(n).addTo(this.map)):(this.activePopup=new I.default.Popup({closeOnClick:!1,closeButton:!1,anchor:a,className:"map-popup"}).setLngLat(n).setOffset([0,-10]).setHTML('<div id="map-popup"></div>').addTo(this.map),this.activePopup.setLngLat(n).addTo(this.map));const o=this.map._container.id;window.jqueryMap(`#${o} #map-popup`).append(i),this.map.flyTo({center:JSON.parse(JSON.stringify(this.getTransformCenter(n))),zoom:this.map.getZoom(),pitch:this.map.getPitch(),duration:500})}addTextPopup(t,e){if(this.map=t,this.clearText(),this.poitextindex=e.poiindex,null!=this.activePopup&&this.poiindex==this.poitextindex)return;var i=Pp.st_getcenterbywkt(e.shape);this.map.sz2000sdk&&(i=this.map.MapmostSDKConvert.fromDefinedProj(i));const s=e.label;""!=s&&null!=s&&(this.map.projection?(this.activePopupText=new I.default.Popup({closeOnClick:!1,closeButton:!1}).setOffset([0,-25]).setText(s).addTo(this.map),this.activePopupText.setCoordinate(i).addTo(this.map)):(this.activePopupText=new I.default.Popup({closeOnClick:!1,closeButton:!1}).setOffset([0,-25]).setLngLat(i).setText(s).addTo(this.map),this.activePopupText.setLngLat(i).addTo(this.map)))}eventActionFun(t,e){switch(t.extraCode){case"open":window.open(t.extraMethod||"");break;case"moreinfo":case"dialogOpen":this.actionMoreInfo(t,e,this.dialogTarget);break;case"mapTraceLineSlider":this.mapPopupTraceLineSlider(t);break;case"mapActionCallback":this.eventCallback&&this.eventCallback(t,e);break;case"mapPostMessageCallback":var i=JSON.parse(JSON.stringify({type:t.extraMethod||"mapPostMessageCallback",data:JSON.parse(JSON.stringify(e)),actionData:JSON.parse(JSON.stringify(t))}));window.postMessage(i,"*");break;default:this.map.$MapEventBus.$emit("map-popup-action-callback",t,e)}}eventJustMapActionCallbackPopupFun(t,e,i){this.map.$MapEventBus.$emit("map-popup-action-callback",t,e,i)}actionMoreInfo(t,e,i){const s=t,a=s.extraMethod.replace("*","#");s.srcUrl=a;const n=this.map.getOnemapConfig().customURL_Minio,o=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_MOREINFO_DEFAULT",{domid:this.mapMoreInfoDomid,data:e,area:this.getArea(a),column:this.getColumn(a),customUrlMinio:n,actionData:s,emptyReplaceStr:this.emptyReplaceStr}),r=this.getAppendTarget(i);this.map.ExAPI.appendMapControlContainer(o,r)}removeMoreInfoDialog(){this.map.ExAPI.removeMapControlContainer(this.mapDialogDomid)}mapPopupTraceLineSlider(t,e,i){const s=t,a=s.extraMethod;s.url=a,a?dr.get({url:a,nomessage:!0}).then((t=>{200==t.code&&(this.mapTraceLineSlider(s,t.data,i),0==t.data.length&&window.MapMessage.ShowMessage({message:"警告:服务未查询到轨迹数据...",type:"warning"}))})):e?this.mapTraceLineSlider(s,e,i):window.MapMessage.ShowMessage({message:"警告:轨迹服务或数据未绑定...",type:"warning"})}mapTraceLineSlider(t,e,i){this.close(),this.traceSliderPlugin?this.traceSliderPlugin.destory((()=>{this.traceSliderPlugin=void 0,this.traceSliderPlugin=new Vd(this.map,t,e,i)})):this.traceSliderPlugin=new Vd(this.map,t,e,i)}removeTracelineslidePlugins(t){this.traceSliderPlugin&&this.traceSliderPlugin.destory(t)}getArea(t){let e=Yo.getQueryString("layer_w",t)||.4*document.documentElement.clientWidth,i=Yo.getQueryString("layer_h",t)||.5*document.documentElement.clientHeight;e<300&&(e=800),i<300&&(i=500);return[e,i]}getColumn(t){if(!t)return 2;let e=Yo.getQueryString("column",t);return e?Number(e):2}clear(){null!=this.activePopup&&this.activePopup.remove(),this.poiindex=null,this.clearText(),"dialog"==this.showType&&this.map.ExAPI.removeMapControlContainer(this.mapDialogDomid)}clearText(){null!=this.activePopupText&&this.activePopupText.remove(),this.poitextindex="-1"}close(){this.clear(),this.eventCallback=null,this.map.GLSDK.mapLocationsLayerControl.removeHighLightFeatures(this.popupCurrentData),this.showType="mapPopup",this.popupCurrentData.highlight3DTiles&&this.map.GLSDK.unhighlight3DTiles()}destoryByIcxCode(t){this.popupCurrentData&&this.popupCurrentData.apiId===t&&this.destory()}destory(){this.close()}}class $d{constructor(t){this.map=null,this.options=t,this.featuresData=JSON.parse(JSON.stringify(t)),this.featureId=this.options.id,this.findId=this.options.findId,this.layerId=this.options.layer.id,this.sourceId=this.options.source,this.geometry=this.options.geometry,this.properties=this.options.properties,this.geoType=this.geometry.type.toLowerCase(),this.geoPoint=null,this.geoPointFictitious=null,this.dragLayerPointId="dragLayerPointId",this.enableTransform=this.options.enableTransform,this.colorDrag="#326EF0",this.hoveredStateId=null,this.activeDragIndex=null,this.resultWkt=null,this.callback=null,this.measureUpdate=null,this.mapLocationLayerStyle}async start(t,e){this.map=t;var i=this.map.GLSDK.getLocationLayerStyle();this.mapLocationLayerStyle=i.getCurrentSymbolStyle(),this.callback=e;let s={type:"Feature",geometry:this.geometry,properties:this.properties};this.geoPoint=T.explode(JSON.parse(JSON.stringify(s)));const a=this.geoPoint.features.length;"polygon"==this.geoType&&(this.geoPoint.features=this.geoPoint.features.splice(0,a-1));const n=this.geoPoint.features.length,o=this.geoPoint.features[n-1].geometry.coordinates;for(let t=n-1;t>=1;t--){const e=this.geoPoint.features[t-1].geometry.coordinates,i=this.geoPoint.features[t].geometry.coordinates,s=await this.getCenterPoint(e,i,t);if(this.geoPoint.features.splice(t,0,s),n-1==t&&"polygon"==this.geoType){const e=this.geoPoint.features[0].geometry.coordinates,i=o,s=await this.getCenterPoint(e,i,t+1);this.geoPoint.features.push(s)}}await this.rebuildIndex(),this.map.addSource(this.dragLayerPointId,{type:"geojson",data:this.geoPoint});const r=this.mapLocationLayerStyle.pointRadius+2;this.map.addLayer({id:this.dragLayerPointId,source:this.dragLayerPointId,type:"circle",paint:{"circle-stroke-color":["case",["boolean",["feature-state","hover"],!1],"#FFFFFF",["case",["get","fictitious"],"#FFFFFF",this.mapLocationLayerStyle.pointLightColor]],"circle-stroke-width":r/4,"circle-color":["case",["boolean",["feature-state","hover"],!1],this.mapLocationLayerStyle.pointLightColor,["case",["get","fictitious"],this.mapLocationLayerStyle.pointLightColor,"#FFFFFF"]],"circle-radius":r,"circle-opacity":["case",["boolean",["feature-state","hover"],!1],1,["case",["get","fictitious"],.6,1]]}}),this.onMouseenter=t=>{if(this.map.ExAPI.setCursor("move",this.map),t.features.length){this.activeDragIndex=t.features[0].id,this.setChangeFeatureState(this.activeDragIndex);this.geoPoint.features[this.activeDragIndex].properties.fictitiousTemp?this.activeDragIndexFictitious=!0:this.activeDragIndexFictitious=!1}},this.map.on("mouseenter",this.dragLayerPointId,this.onMouseenter),this.onMouseleave=t=>{this.map.ExAPI.setCursor("old"),this.removeFeatureState()},this.map.on("mouseleave",this.dragLayerPointId,this.onMouseleave),this.onMove=async t=>{const e=t.lngLat;if(null!=this.activeDragIndex){this.geoPoint.features[this.activeDragIndex];const o=t.coordinate?t.coordinate:[e.lng,e.lat];if(this.geoPoint.features[this.activeDragIndex].geometry.coordinates=o,this.activeDragIndexFictitious)this.geoPoint.features[this.activeDragIndex].properties.fictitious=!1;else{const t=this.geoPoint.features.length-1;var i=this.activeDragIndex+2,s=this.activeDragIndex+1,a=this.activeDragIndex-2,n=this.activeDragIndex-1;if(i>t&&(i=0),a<0&&(a=t-1,n=t),"polygon"!=this.geoType&&0==this.activeDragIndex&&(n=null),"polygon"!=this.geoType&&this.activeDragIndex==t&&(s=null),null!=s){const t=this.geoPoint.features[this.activeDragIndex].geometry.coordinates,e=this.geoPoint.features[i].geometry.coordinates,a=await this.getCenterPoint(t,e);this.geoPoint.features[s].geometry.coordinates=a.geometry.coordinates}if(n){const t=this.geoPoint.features[a].geometry.coordinates,e=this.geoPoint.features[this.activeDragIndex].geometry.coordinates,i=await this.getCenterPoint(t,e);this.geoPoint.features[n].geometry.coordinates=i.geometry.coordinates}}this.map.getSource(this.dragLayerPointId).setData(this.geoPoint),this.geometry.coordinates=await this.getCoordinateFromGeoPoint();let r={type:"Feature",geometry:this.geometry,properties:{}};if(this.properties.data){const t=JSON.parse(this.properties.data);t.shape=Pp.st_geojson2wkt(this.geometry),this.resultWkt=t.shape,this.properties.data=JSON.stringify(t),r.properties=this.properties}else r.properties=this.properties;const l=this.map.getSource(this.sourceId)._data;let h=this.featureId-1;this.findId&&(h=l.features.findIndex((t=>t.properties.id===this.findId))),r.id=l.features[h].id,l.features[h]=r,this.map.getSource(this.sourceId).setData(l),this.measureUpdate&&this.measureUpdate(this.geoPoint,this.activeDragIndex,this.activeDragIndexFictitious,r)}},this.onUp=async t=>{if(this.map.ExAPI.setCursor("old"),this.onMove&&this.map.off("mousemove",this.onMove),this.endTransformCallback(this.resultWkt),this.activeDragIndexFictitious){this.geoPoint.features[this.activeDragIndex].properties.fictitiousTemp=!1;var e=this.activeDragIndex+1;this.geoPoint.features.length-1==this.activeDragIndex&&(e=0);const t=this.geoPoint.features[this.activeDragIndex].geometry.coordinates,i=this.geoPoint.features[e].geometry.coordinates,s=await this.getCenterPoint(t,i);this.geoPoint.features.splice(this.activeDragIndex+1,0,s);const a=this.geoPoint.features[this.activeDragIndex-1].geometry.coordinates,n=this.geoPoint.features[this.activeDragIndex].geometry.coordinates,o=await this.getCenterPoint(a,n);this.geoPoint.features.splice(this.activeDragIndex,0,o)}await this.rebuildIndex(),this.map.getSource(this.dragLayerPointId).setData(this.geoPoint)},this.onMousedown=t=>{t.preventDefault(),this.map.on("mousemove",this.onMove),this.map.once("mouseup",this.onUp)},this.map.on("mousedown",this.dragLayerPointId,this.onMousedown)}async rebuildIndex(){this.geoPoint.features.map(((t,e)=>(t.id=e,t.properties={groupCode:this.findId||this.properties.id,dragIndex:e,fictitious:!!t.properties.fictitious,fictitiousTemp:!!t.properties.fictitiousTemp},t)))}getCoordinateFromGeoPoint(){var t=[];return this.geoPoint.features.forEach((e=>{0==e.properties.fictitious&&t.push(e.geometry.coordinates)})),"polygon"==this.geoType&&(t.push(t[0]),t=[t]),t}getCenterPoint(t,e){return{type:"Feature",geometry:{type:"Point",coordinates:[(t[0]+e[0])/2,(t[1]+e[1])/2]},properties:{fictitious:!0,fictitiousTemp:!0}}}getResultWkt(){return this.resultWkt}setChangeFeatureState(t){null!==this.hoveredStateId&&this.map.setFeatureState({source:this.dragLayerPointId,id:this.hoveredStateId},{hover:!1}),this.hoveredStateId=t,this.map.setFeatureState({source:this.dragLayerPointId,id:this.hoveredStateId},{hover:!0})}removeFeatureState(){this.map.getSource(this.dragLayerPointId)&&(this.map.removeFeatureState({source:this.dragLayerPointId}),this.hoveredStateId=null)}destory(){this.map&&(this.map.GLSDK.mapLocationsLayerControl.setClearChangeMouseState(),this.map.GLSDK.mapPopupControl.clearText(),this.onMove&&this.map.off("mousemove",this.onMove),this.onUp&&this.map.off("mouseup",this.onUp),this.onMousedown&&this.map.off("mousedown",this.dragLayerPointId,this.onMousedown),this.onMouseenter&&this.map.off("mouseenter",this.dragLayerPointId,this.onMouseenter),this.onMouseleave&&this.map.off("mouseleave",this.dragLayerPointId,this.onMouseleave),this.map.getLayer(this.dragLayerPointId)&&this.map.removeLayer(this.dragLayerPointId),this.map.getSource(this.dragLayerPointId)&&this.map.removeSource(this.dragLayerPointId))}startOnly(t,e){this.map=t;var i=this.map.GLSDK.getLocationLayerStyle();this.mapLocationLayerStyle=i.getCurrentSymbolStyle(),this.callback=e;let s={type:"Feature",geometry:this.geometry,properties:this.properties};this.geoPoint=T.explode(JSON.parse(JSON.stringify(s)));const a=this.geoPoint.features.length;"polygon"==this.geoType&&(this.geoPoint.features=this.geoPoint.features.splice(0,a-1)),this.geoPoint.features.map(((t,e)=>(t.id=e,t.properties={dragIndex:e},t))),this.map.addSource(this.dragLayerPointId,{type:"geojson",data:this.geoPoint}),this.map.addLayer({id:this.dragLayerPointId,source:this.dragLayerPointId,type:"circle",paint:{"circle-stroke-color":["case",["boolean",["feature-state","hover"],!1],"#FFFFFF",this.mapLocationLayerStyle.pointColor],"circle-stroke-width":2,"circle-color":["case",["boolean",["feature-state","hover"],!1],this.mapLocationLayerStyle.pointColor,"#FFFFFF"],"circle-radius":6}}),this.onMouseenter=t=>{this.map.ExAPI.setCursor("move"),t.features.length&&(this.activeDragIndex=t.features[0].id,this.setChangeFeatureState(this.activeDragIndex))},this.map.on("mouseenter",this.dragLayerPointId,this.onMouseenter),this.onMouseleave=t=>{this.map.ExAPI.setCursor("old"),this.removeFeatureState()},this.map.on("mouseleave",this.dragLayerPointId,this.onMouseleave),this.onMove=t=>{const e=t.lngLat;if(null!=this.activeDragIndex){const i=t.coordinate?t.coordinate:[e.lng,e.lat];if(this.geoPoint.features[this.activeDragIndex].geometry.coordinates=i,this.map.getSource(this.dragLayerPointId).setData(this.geoPoint),"polygon"==this.geoType){if(this.geometry.coordinates[0][this.activeDragIndex]=JSON.parse(JSON.stringify(i)),0==this.activeDragIndex&&"polygon"==this.geoType){const t=this.geometry.coordinates[0].length;this.geometry.coordinates[0][t-1]=JSON.parse(JSON.stringify(i))}}else if(this.geometry.coordinates[this.activeDragIndex]=JSON.parse(JSON.stringify(i)),0==this.activeDragIndex&&"polygon"==this.geoType){const t=this.geometry.coordinates.length;this.geometry.coordinates[t-1]=JSON.parse(JSON.stringify(i))}let s={type:"Feature",geometry:this.geometry,properties:{}};const a=JSON.parse(this.properties.data);a.shape=Pp.st_geojson2wkt(this.geometry),this.resultWkt=a.shape,this.properties.data=JSON.stringify(a),s.properties=this.properties;const n=this.map.getSource(this.sourceId)._data;let o=this.featureId-1;this.findId&&(o=n.features.findIndex((t=>t.properties.id===this.findId))),s.id=n.features[o].id,n.features[o]=s,this.map.getSource(this.sourceId).setData(n),this.measureUpdate&&this.measureUpdate(this.geoPoint,this.activeDragIndex,this.activeDragIndexFictitious,s)}},this.onUp=t=>{this.map.ExAPI.setCursor("old"),this.onMove&&this.map.off("mousemove",this.onMove),this.endTransformCallback(this.resultWkt)},this.onMousedown=t=>{t.preventDefault(),this.map.on("mousemove",this.onMove),this.map.once("mouseup",this.onUp)},this.map.on("mousedown",this.dragLayerPointId,this.onMousedown)}async endTransformCallback(t){if(!t)return;let e=t;var i=Pp.st_wkt2geojson(e);let s=this.enableTransform||(this.map.enableTransform?this.map.enableTransform.srid:"");this.map.sz2000sdk&&(i=await this.map.MapmostSDKConvert.convertGeoSDKToSZ2000(i),e=Pp.st_geojson2wkt(i)),s&&e&&"object"!=typeof e&&(i.coordinates=this.map.M.projTransform(this.map.sz2000sdk?1002:null,s,i.coordinates),e=Pp.st_geojson2wkt(i)),this.resultWkt=e,this.callback(this.resultWkt,this.featuresData)}}class Wd{constructor(){this.data=[],this.map=null,this.mapPopupControl=null,this.hoveredStateId=null,this.subscribe=!1,this.eventAble=!1,this.activeKey="mapLocationsLayer",this.activeLayersIds=[],this.activeLayerStyleType="",this.forceLightObj={},this.locationsDataAll={mapLocationsLayer:{data:[],apiId:"",sources:"",layers:[],closeMouseMoveTipLayers:[]}},this.defaultStyle={},this.isOnlyOne=!1,this.mapClickCallback={},this.dragEvent=null,this.options=null,this.lastLayerkey=null,this.popupConfig={},this.activeLayerPopupData={},this.clickFeaturesTab=[],this.show3DtilesClassifyAnalysis=!1,this.layer3DtilesLayerTemp={},this.closeClick={},this.locationsPoi=!1,this.symbolHighLightLayers=[],this.oneMapConfig={},this.locationLayerStyle}initConfig(t){this.oneMapConfig=t.getOnemapConfig();let e=new Ap(this.oneMapConfig);this.locationLayerStyle=e}getLocationLayerStyle(){return this.locationLayerStyle}getFeaturesTab(){return"object"==typeof this.oneMapConfig.controls.MapPopup&&this.oneMapConfig.controls.MapPopup.featuresTab}setFeaturesTab(t){this.clickFeaturesTab=[];var e=[];return t.forEach((t=>{const i=t.properties.data,s=JSON.parse(i),a=s.id+s.name+s.shape;e.includes(a)||(this.clickFeaturesTab.push(s),e.push(a))})),this.clickFeaturesTab}getMap(){return this.map}addDefaultMarkerImage(t,e){this.map=t,this.mapPopupControl=e,Fd.addMapSymbolImage(this.map,[{name:"locations_poisymbol",url:require("./assets/poi.png")},{name:"locations_poisymbol_light",url:require("./assets/poi_light.png")},{name:"locations_leftlist_poisymbol",url:require("./assets/poi_index.png")},{name:"locations_leftlist_poisymbol_light",url:require("./assets/poi_index_light.png")}])}subscribeMapClear(){this.map.M.pubsub.subscribe("clear",(()=>{this.destory(),this.dragEvent&&this.dragEvent.destory(),this.mouseClickDrag&&this.map.off("click",this.mouseClickDrag),this.removeSymbolLayerHighLight()})),this.subscribe=!0}bindeMapEvent(){this.bindMapIquery2LocationsLayers(),this.bindMouseMove(),this.eventAble=!0}bindMapIquery2LocationsLayers(){this.mouseClick&&this.map.off("click",this.mouseClick),this.mouseClick=t=>{if(this.map.stopPropagation())return;const e=this.getLayersidAll();var i=Pp.st_getLocation(t),s=e.filter((t=>-1==t.indexOf("polygon_poi")&&this.map.getLayer(t)));if(0==s.length)return void this.clearHighlight();const a=this.map.queryRenderedFeatures(t.point,{layers:s});if(a){const t=a.length;if(t>0){const e=a[0];this.activeLayerPopupData={layerid:e.layer.id};const s=JSON.parse(e.properties.data),o=e.properties.layerkey;if(this.closeClick[o])return;if(this.mapClickCallback[o]){const t=JSON.parse(JSON.stringify(e.properties));delete t.data,delete t.poiindex,delete t.layerkey;const i={type:"Feature",properties:t,geometry:e.geometry};return void this.mapClickCallback[o](i,o,s)}if(s.extras.length&&"justmapactioncallback"==s.extras[0].extraCode.toLowerCase())return void this.mapPopupControl.eventJustMapActionCallbackPopupFun(s.extras[0],s);if(!s.iQueryList.length)return;if(s.shape&&(-1!=s.shape.toLowerCase().indexOf("point")||s["3dtiles"]||(s.pointClick=i)),this.getFeaturesTab()&&t>1){var n=this.setFeaturesTab(a);s.featuresTab=n,this.showMapPopup(s,!0)}else this.showMapPopup(s,!0)}else this.clearHighlight()}else this.clearHighlight()},this.map.on("click",this.mouseClick)}dragEdit(t,e){this.mouseClick&&this.map.off("click",this.mouseClick),this.mouseClickDrag&&this.map.off("click",this.mouseClickDrag),this.map.GLSDK.mapDrawControl.isDoingDraw||this.map.M.isDoingDraw||(this.map.isDragEdit=!0,this.mouseClickDrag=i=>{i.preventDefault();const s=this.getLayersidAll(),a=this.map.queryRenderedFeatures(i.point,{layers:s});if(a.length){const i=a[0],s=i.geometry.type;["polygon","linestring"].includes(s.toLowerCase())?(this.dragEvent&&this.dragEvent.destory(),setTimeout((()=>{const s=i.id,a=i.source,n=JSON.parse(i.properties.data);this.setChangeMouseState(n,!0);const o=this.map.getSource(a)._data.features[parseFloat(s)-1];o&&(i.geometry=o.geometry);let r=JSON.parse(JSON.stringify(i));e.enableTransform&&(r.enableTransform=e.enableTransform),this.dragEvent=new $d(r),"all"==e.mode?this.dragEvent.start(this.map,t):this.dragEvent.startOnly(this.map,t)}),200)):this.dragEvent&&this.dragEvent.destory()}else this.dragEvent&&this.dragEvent.destory()},this.map.on("click",this.mouseClickDrag))}closeDragEdit(){this.map.isDragEdit=!1,this.dragEvent&&this.dragEvent.destory(),this.mouseClickDrag&&this.map.off("click",this.mouseClickDrag),this.bindMapIquery2LocationsLayers()}getDragEditResultWkt(){return this.dragEvent?this.dragEvent.getResultWkt():null}add(t,e){this.map=t,this.show3DtilesClassifyAnalysis=!1,this.options=e||{},void 0===this.options.locationsPoi&&(this.options.locationsPoi=this.oneMapConfig.locationsPoi);var i=this.options.options||{};void 0!==i.locationsPoi&&(this.options.locationsPoi=i.locationsPoi),(this.options.layerAll||this.map.GLSDK.drawCommonPickUpVisible)&&(this.options.locationsPoi=!1),this.map&&!this.subscribe&&this.subscribeMapClear(),!this.eventAble&&this.bindeMapEvent(),this.activeKey=e.layerkey||"mapLocationsLayer",e.layerkey=e.layerkey||"mapLocationsLayer";const s=this.locationsDataAll.mapLocationsLayer;if("mapLocationsLayerAll"==e.layerkey&&s){let t=s.layers[0];e.beforeId=null,this.map.getLayer(t)&&(e.beforeId=t)}"mapLocationsLayer"!=e.layerkey&&(this.closeClick[e.layerkey]=e.closeClick),this.locationsDataAll[e.layerkey]?this.clear((()=>{this.addLayer(e)}),e.layerkey):this.addLayer(e),this.popupConfig[e.layerkey]=e.popupConfig||{}}addLayer(t){const e=t.layerkey;t.click&&(this.mapClickCallback[e]=t.click),this.locationsDataAll[e]||(this.locationsDataAll[e]={data:[],sources:[],layers:[],closeMouseMoveTipLayers:[],onlyPickUp:!1,locationsPoi:t.locationsPoi,iqueryClearEnable:t.iqueryClearEnable});const i=t.apiId;this.locationsDataAll[e].data=t.data,this.locationsDataAll[e].apiId=i,this.locationsDataAll[e].onlyPickUp=t.onlyPickUp,this.locationsDataAll[e].iqueryClearEnable=t.iqueryClearEnable,this.locationsDataAll[e].locationsPoi=t.locationsPoi;const s=t.data.length,a=void 0===t.noOnlyOnePopup||t.noOnlyOnePopup,n=void 0!==t.closeAllFitBounds&&t.closeAllFitBounds;if(1!=s||t.click)this.isOnlyOne=!1;else{this.isOnlyOne=!0;const e=t.data[0];e.iQueryList=e.iQueryList?e.iQueryList:[],e.iQueryList.length>0&&!a&&(e.layerkey=t.layerkey,e.apiId=t.apiId,e.closeAllFitBounds=n,this.showMapPopup(e,!0))}var o=this.map.M.layerManager.getLayerHighLightEnable(i);if(o.length>0){var r=this.getDataIds(t.data);return this.map.M.layerManager.setLayerHighLight(o,r),void(this.symbolHighLightLayers=o)}this.removeSymbolLayerHighLight();var l=t.enableTransform?{srid:t.enableTransform}:this.map.enableTransform;if("geojson"==t.formateType)Pp.st_geojsonrebuild(t.data,e,t.locationsPoi,this.map.sz2000sdk,l).then((e=>{this.addResultdata(e,t)}));else{const i=t.data[0];if(i){const t=i["3dtiles"];if(t){var h=this.map.M.layerManager.getLayerById(t);h?(this.layer3DtilesLayerTemp[t]=h,this.show3DtilesClassifyAnalysis=!0):(delete this.layer3DtilesLayerTemp[t],this.show3DtilesClassifyAnalysis=!1)}}Pp.st_qdata2geojson(t.data,e,0,t.locationsPoi,this.map.sz2000sdk,l).then((e=>{if(this.show3DtilesClassifyAnalysis){const i=e.data.features.filter((t=>-1==t.geometry.type.toLowerCase().indexOf("point")));this.add3DtilesClassifyAnalysis(i,(()=>{t.options||(t.options={}),t.options.renderStyle={lineOpacity:.01,fillOpacity:.01,classifyAnalysis:!0},this.addResultdata(e,t)}))}else this.addResultdata(e,t)}))}}getDataIds(t){var e=[];return t.forEach((t=>{e.push(t.id)})),e}showMapPopup(t,e){this.mapPopupControl.add(this.map,Object.assign({data:t},this.popupConfig[t.layerkey]),((t,e)=>{this.map.$MapEventBus.$emit("map-popup-action-callback",t,e)}))}addResultdata(t,e){const i=t,s=e.layerkey;e.options&&"point"==i.shapeType&&(i.shapeType=e.options.layerType||i.shapeType);const a=Object.assign({layerLabel:!1,avoidance:!1,beforeId:e.beforeId,layerkey:s},e.options||{},this.popupConfig[s].options||{});if(this.popupConfig[s].options&&"point"==i.shapeType&&(i.shapeType=this.popupConfig[s].options.layerType||i.shapeType),"symbol"==i.shapeType&&a.symbol){a.symbolname=a.symbol.name;let t=[a.symbol];if(Array.isArray(a.symbolname))t=a.symbol.url;else if(a.symbolname.indexOf("{")>-1)t=a.symbol.url;else{const e=a.symbol.url;Array.isArray(e)&&"object"==typeof e[0]&&(t=e)}a.symbol.url&&Fd.addMapSymbolImage(this.map,t),this.forceLightObj[e.layerkey]=a.symbol.forceLight}0!=i.shapeType&&this.loadStyleSourceAndLayer(i.shapeType,a,(()=>{if(this.map.getSource(this.locationsDataAll[s].sources).setData(i.data),!e.closeAllFitBounds&&e.fitBounds){const t=e.zoom||void 0;Pp.st_fitBoundsToMap(this.map,i.data,t,e.fitBounds)}}))}add3DtilesClassifyAnalysis(t,e){const i=t.length;0==i&&e&&e(),new Promise((e=>{t.forEach(((t,s)=>{const a=t.geometry,n=t.properties,o=JSON.parse(n.data),r={buffer3Dtiles:n.buffer||1,opacity:n.opacity||.25,baseHeight:n.baseHeight||0,stretchHeight:n.stretchHeight||500},l=o["3dtiles"];this.layer3DtilesLayerTemp[l]&&this.layer3DtilesLayerTemp[l].IQueryHighLight3Dtiles(a,r),i-1==s&&e()}))})).then((()=>{e&&e()}))}loadStyleSourceAndLayer(t,e,i){const s=e.layerkey||this.activeKey;this.activeLayerStyleType=t;const a=t+Yo.guid();this.locationsDataAll[s].sources=a;const n={labelKey:this.getLayerLabelKey(e.layerLabel),symbolname:e.symbolname,beforeId:e.beforeId,avoidance:void 0!==e.avoidance&&e.avoidance,layerLabelPoi:e.layerLabelPoi};e.symbolname?n.symbolname=e.symbolname:"symbol_poi"==t?(n.symbolname="locations_leftlist_poisymbol",n.labelKey=0==e.layerLabelPoi?"":"{poiindex}"):n.symbolname="locations_poisymbol";const o=this.locationLayerStyle.getDrawStyle(e.renderStyle||null,t,n);this.map.addSource(a,o.source),new Promise((t=>{const i=o.layer.length;0==i&&t();for(let n=0;n<o.layer.length;n++){const r=o.layer[n],l=r.id;if(!this.show3DtilesClassifyAnalysis&&"polygon_fill_extrusion_3dtiles"==l)continue;const h=l.indexOf("_label")>-1;r.id=`${l}|${Yo.guid()}`,r.source=a,!e.layerLabel&&h||(this.map.getLayer(e.beforeId)?this.map.addLayer(r,e.beforeId):this.map.addLayer(r),this.locationsDataAll[s].layers.includes(r.id)||this.locationsDataAll[s].layers.push(r.id),!e.closeMouseMoveTip&&!e.layerLabel||this.locationsDataAll[s].closeMouseMoveTipLayers.includes(r.id)||this.locationsDataAll[s].closeMouseMoveTipLayers.push(r.id)),n==i-1&&t()}})).then((()=>{this.setLayersid(s)})),i&&i()}getLayerLabelKey(t){return t?!0!==t?t:"{name}":t?"{name}":""}bindMouseMove(){this.mouseMove&&this.map.off("mousemove",this.mouseMove),this.mouseMove=t=>{if(this.map.isDragEdit)return;const e=this.getLayersid(),i=this.map.queryRenderedFeatures(t.point,{layers:e});if(!i.length)return this.setClearChangeMouseState(),void this.mapPopupControl.clearText();const s=JSON.parse(i[0].properties.data);this.setChangeMouseState(s,!0)},this.map.on("mousemove",this.mouseMove)}setChangeMouseState(t,e){if(this.mapPopupControl.clearText(),e){const e=t.poiindex.toString()||"",n=(t.layerkey||"").toString()||"";if(e){const o=(n?this.getLayersByLayerkey(n):this.getLayersid())[0];if(!o)return;switch(this.activeLayerStyleType){case"symbol_poi":case"symbol":if("symbol"!=(this.map.getLayer(o)||{}).type)return;var i,s=this.map.getLayoutProperty(o,"icon-image");this.defaultStyle[o]?this.map.setLayoutProperty(o,"icon-image",this.defaultStyle[o]):this.defaultStyle[o]=s,i="string"==typeof this.defaultStyle[o]?`${this.defaultStyle[o].replace(/_light/g,"")}_light`:Array.isArray(this.defaultStyle[o])?["concat",this.defaultStyle[o],"_light"]:`${n}_light`,this.map.hasImage(i)||Array.isArray(this.defaultStyle[o])&&this.forceLightObj[n]?(this.map.setLayoutProperty(o,"icon-image",["match",["to-string",["get","poiindex"]],e,i,this.defaultStyle[o]]),this.lastLayerkey=n):this.lastLayerkey="";break;case"polygon":case"polyline":case"point":var a=this.locationsDataAll[this.activeKey].sources;null!==this.hoveredStateId&&this.map.setFeatureState({source:a,id:this.hoveredStateId},{hover:!1}),this.hoveredStateId=e,this.map.setFeatureState({source:a,id:this.hoveredStateId},{hover:!0})}if(this.map.isDragEdit)return;this.mapPopupControl.addTextPopup(this.map,t)}}else this.setClearChangeMouseState()}clearHighlight(){this.activeLayerPopupData={},this.setClearChangeMouseState()}setClearChangeMouseState(){const t=(this.lastLayerkey?this.getLayersByLayerkey(this.lastLayerkey):this.getLayersid())[0];switch(this.activeLayerStyleType){case"symbol_poi":case"symbol":if(this.defaultStyle[t]){if(this.activeLayerPopupData.layerid==t&&this.forceLightObj[this.lastLayerkey])return;this.map.getLayer(t)&&this.map.setLayoutProperty(t,"icon-image",this.defaultStyle[t])}break;case"polygon":case"polyline":case"point":if(this.locationsDataAll[this.activeKey]){var e=this.locationsDataAll[this.activeKey].sources;this.map.getSource(e)&&this.map.setFeatureState({source:e,id:this.hoveredStateId},{hover:!1})}this.hoveredStateId=null}}addDataByLayerkey(t,e){const i=this.getSourceByLayerkey(t||"mapLocationsLayer");if(i&&this.map.getSource(i)){const o=this.map.getSource(this.locationsDataAll[t].sources)._data;var s=o.features.length;const r=Array.isArray(e)?e:[e];this.locationsDataAll[t].data=this.locationsDataAll[t].data.concat(r);var a=void 0!==this.locationsDataAll[t].locationsPoi?this.locationsDataAll[t].locationsPoi:this.oneMapConfig.locationsPoi;(i.indexOf("polygon")>-1||i.indexOf("polyline")>-1)&&s%2==0&&(s/=2);var n=this.map.enableTransform;Pp.st_qdata2geojson(r,t,s,a,this.map.sz2000sdk,n).then((e=>{o.features=o.features.concat(e.data.features),this.map.getSource(this.locationsDataAll[t].sources).setData(o)}))}}getSourceByLayerkey(t){return this.locationsDataAll[t]?this.locationsDataAll[t].sources:""}getLayersByLayerkey(t){var e=[];return this.locationsDataAll[t]&&(e=this.locationsDataAll[t].layers),e}getSourcesidAll(t,e){if(t)return this.locationsDataAll[t]?[this.locationsDataAll[t].sources]:[];const i=Object.keys(this.locationsDataAll),s=[];return i.forEach((t=>{var i=this.locationsDataAll[t];let a=i.sources;("map-iquery-clear"!=e||0!=i.iqueryClearEnable)&&a&&s.push(a)})),s}getLayersidAll(t,e){if(t)return this.locationsDataAll[t]?this.locationsDataAll[t].layers:[];const i=Object.keys(this.locationsDataAll);let s=[];return i.forEach((t=>{var i=this.locationsDataAll[t];("map-iquery-clear"!=e||0!=i.iqueryClearEnable)&&(s=s.concat(i.layers||[]))})),s}getLayersid(){const t=Object.keys(this.locationsDataAll);let e=[];return t.forEach((t=>{e=e.concat(this.locationsDataAll[t].mouseLayers||[])})),e}getLayersidDraw(){if(!this.locationsDataAll[this.activeKey])return[];return this.locationsDataAll[this.activeKey].layers.filter((t=>-1==t.indexOf("_label")))||[]}setLayersid(t){let e=t||this.activeKey;this.locationsDataAll[e]&&this.locationsDataAll[e].layers&&(this.locationsDataAll[e].mouseLayers=this.locationsDataAll[e].layers.filter((t=>-1==t.indexOf("_label")&&!this.locationsDataAll[e].closeMouseMoveTipLayers.includes(t))))}clear(t,e,i){new Promise((t=>{const s=this.getLayersidAll(e,i),a=s.length;0==a&&t(),s.forEach(((e,i)=>{this.map.getLayer(e)&&this.map.removeLayer(e),a-1==i&&t()}))})).then((async()=>{this.getSourcesidAll(e,i).forEach((t=>{this.map.getSource(t)&&this.map.removeSource(t)})),this.mapPopupControl.clear(),await this.initLocationsDataAll(e,i),t&&t()})),this.clear3DtilesHigh()}initLocationsDataAll(t,e){if(t){const e=this.locationsDataAll[t];e&&e.sources&&(this.locationsDataAll[t]={data:[],sources:"",layers:[],closeMouseMoveTipLayers:[]},"mapLocationsLayer"!=t&&delete this.locationsDataAll[t])}else{Object.keys(this.locationsDataAll).forEach((t=>{var i=this.locationsDataAll[t];if("mapLocationsLayer"==t)this.locationsDataAll[t]={data:[],sources:"",layers:[],closeMouseMoveTipLayers:[]};else{("map-iquery-clear"!=e||0!=i.iqueryClearEnable)&&delete this.locationsDataAll[t]}}))}}clear3DtilesHigh(){Object.keys(this.layer3DtilesLayerTemp).forEach((t=>{this.layer3DtilesLayerTemp[t]&&(this.layer3DtilesLayerTemp[t].clearAllAnalysis(),delete this.layer3DtilesLayerTemp[t])}))}removeAddDataToLayerKey(t,e){var i=this.getSourceByLayerkey(t);if(i){var s=this.locationsDataAll[t].data;this.locationsDataAll[t].data=s.filter((t=>t.id!==e));var a=this.map.getSource(i)._data,n=a.features;a.features=n.filter((t=>(JSON.parse(t.properties.data)||{}).id!==e));const l=a.features.length;var o=0;for(let t=0;t<l;t++){var r=a.features[t].properties.poiindex;if(o++,t+1<l){r==a.features[t+1].properties.poiindex?(a.features[t].properties.poiindex=o.toString(),a.features[t+1].properties.poiindex=o.toString(),t++):a.features[t].properties.poiindex=o.toString()}else a.features[t].properties.poiindex=o.toString()}this.map.getSource(i).setData(a)}}removeHighLightFeatures(t){if(this.isOnlyOne,this.clearHighlight(),t){const e=t.layerkey;this.lastLayerkey=e,this.clearHighlight()}}destoryByIcxCode(t){Object.keys(this.locationsDataAll).forEach((e=>{this.locationsDataAll[e].apiId==t&&t&&this.clear(null,e)}))}removeSymbolLayerHighLight(){this.symbolHighLightLayers.length>0&&(this.map.M.layerManager.removeLayerHighLight(),this.symbolHighLightLayers=[])}destory(t,e){this.clear(t,null,e),1==this.map.activeToolsDp&&MedomapPopupDpFactory.removeAll(),this.mouseClick&&this.map.off("click",this.mouseClick),this.mouseMove&&this.map.off("mousemove",this.mouseMove),this.eventAble=!1,this.isOnlyOne=!1,this.mapClickCallback={}}}class Kd{constructor(t){this.opt=t||{},this.map=null,this.init()}init(){this.map=new I.default.Map(this.opt)}getMap(){return this.map}}var Yd=new class{getLayerEntity(t,e,i,s){let a=null;if(!i)return a;switch(t.mapLayerType){case"vector":case"geojson":case"raster":if(a=JSON.parse(i),a.source=t.id,a.id=e,void 0!==t.minLevel&&null!=t.minLevel&&(a.minzoom=t.minLevel),void 0!==t.maxLevel&&null!=t.maxLevel&&(a.maxzoom=t.maxLevel),void 0!==s.opacity&&null!=s.opacity){const{type:t}=a;a.paint&&(a.paint[`${t}-opacity`]=s.opacity)}}return a}};var Jd=new class{constructor(){this.map=null}async getSourceEntity(t,e){let i=null,s=t.serverUrl;const{tokenId:a}=t;if(s=this.getFormateUrl(s,t),a){const t=await e.tokenManager.getToken(a);s=this.getTokenUrl(s,t)}switch(t.mapLayerType){case"vector":i={type:"vector",tiles:[s]};break;case"geojson":i={type:"geojson",data:s};break;case"raster":i={type:"raster",tiles:[s],tileSize:t.tileSize||256},void 0!==t.zoomOffset&&(i.zoomOffset=t.zoomOffset);break;default:console.log("图层服务资源类型加工生产无")}return i}getFormateUrl(t,e){let i=t;if("arcgis"===(e.serverType||"").toLowerCase())if(i.indexOf("/tile/{z}/{y}/{x}")<0)if(i.indexOf("?")>-1){const t=i.split("?");i=`${t[0]}/tile/{z}/{y}/{x}?${t[1]}`}else i=`${i}/tile/{z}/{y}/{x}`;return i}getTokenUrl(t,e){let i=t;return i.indexOf("{token}")>-1&&(i=i.replace("{token}",e.value)),i=`${i}${i.indexOf("?")>-1?"&":"?"}${e.label}=${e.value}`,i}};class Xd{constructor(){this.map=null,this.layersAll={}}addLayer(t,e){if("object"==typeof e.data)this.addLayerEx(t,e);else{if(this.layersAll[e.id])return void this.addLayerEx(t,{id:e.id,data:this.layersAll[e.id],visible:e.visible});dr.get({url:e.data,nocode:!0,nomessage:!0}).then((i=>{i?this.addLayerEx(t,{id:e.id,data:i,visible:e.visible}):window.MapMessage.ShowMessage({message:"获取图层资源服务调用失败!",type:"warning"})}))}}addLayerEx(t,e){if(this.map=t,0==e.visible)this.removeLayer(e);else{const{id:t}=e;this.layersAll[t]=e.data,this.layersAll[t].tempSources=[],this.layersAll[t].tempLayers=[],this.layersAll[t].iQueryIdList=[];const{mapResourceList:i}=e.data,s=i.length,a={opacity:e.data.opacity,projection:e.data.projection};let n;s&&new Promise((e=>{i.forEach((async e=>{this.map.getSource(e.id)||(n=await Jd.getSourceEntity(e,this.map),n&&(a.projection&&!["3857","local","sz2000"].includes(a.projection.toLowerCase())||(n.data.indexOf("isrequest=1")>-1?(this.map.addSource(e.id,{type:"geojson",data:null}),this.setSourceByRequest(e.id,n.data)):this.map.addSource(e.id,n),this.layersAll[t].tempSources.push(e.id)))),Fd.addMapSymbolImage(this.map,e.geoMapMarkerList),this.addLayerCommonHandlerFun(t,n,e,a)})),e()})).then((()=>{}))}}setSourceByRequest(t,e){dr.get({url:e,nocode:!0,nomessage:!0}).then((e=>{let i=e;e.data&&(i=e.data),this.map.getSource(t)&&this.map.getSource(t).setData(i)}))}addLayerCommonHandlerFun(t,e,i,s){let a;s.projection&&!["3857","local","sz2000"].includes(s.projection.toLowerCase())?(a={id:i.id,project:s.projection,source:e},this.map.addRasterLayer2(a),void 0!==s.opacity&&this.setRasterLayer2Opacity(a.id,s.opacity),this.layersAll[t].tempLayers.push(a.id)):this.addLayerCommonHandlerFun2(t,i,s),this.addIqueryApis(t,i)}addLayerCommonHandlerFun2(t,e,i){let s=null;e.expandProList?e.expandProList.forEach((a=>{s=Yd.getLayerEntity(e,a.id,a.expandPro,i),s&&(this.map.addLayer(s),this.layersAll[t].tempLayers.push(s.id))})):(s=Yd.getLayerEntity(e,e.id,e.expandPro,i),s&&(this.map.addLayer(s),this.layersAll[t].tempLayers.push(s.id)))}addIqueryApis(t,e){this.layersAll[t].supportIQuery&&e.iQueryIdList&&e.iQueryIdList.length&&(this.layersAll[t].iQueryIdList=this.layersAll[t].iQueryIdList.concat(e.iQueryIdList))}getOpacity(t){const e=this.map.getLayer(t);if(e.project)return e.paint["raster-opacity"]||1;if(e.implementation)return e.implementation.opacity||1;return this.map.getPaintProperty(t,"raster-opacity")}setRasterLayer2Opacity(t,e){this.map.getLayer(t)&&this.map.setPaintProperty(t,"raster-opacity",e)}getQueryLayerIds(){const t=this.layersAll;let e=[];for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const s=t[i];s.supportIQuery&&s.iQueryIdList&&s.iQueryIdList.length&&(e=e.concat(s.iQueryIdList))}return e}removeLayer(t){this.layersAll[t.id].iQueryIdList=[];this.layersAll[t.id].tempLayers.forEach((t=>{this.map.removeLayer(t)}))}}class Qd{constructor(){this.map=null,this.mapid=null,this.mapPopupControl=null,this.mapLocationsLayerControl=null,this.activeList=null,this.mapControlClass="mapmostgl-control-container",this.mapLeftListContainerID="mx-map-search-result",this.layerType="symbol_poi",this.fitBounds=!0,this.fitBoundsPopup=!0,this.locationsPoi=!0,this.emptyReplaceStr="",this.maxSize=1e3,this.initControls(),this.iQueryApiIds="",this.styleDynamicCss={},this.closeAllFitBounds=!1,this.allToMapCount=0,this.listIntance=null}initControls(t){if(!t)return;const e=t.controls;e.MapSearch&&(this.fitBounds="object"==typeof e.MapSearch&&void 0!==e.MapSearch.fitBounds?e.MapSearch.fitBounds:this.fitBounds,this.fitBoundsPopup="object"==typeof e.MapSearch&&void 0!==e.MapSearch.fitBoundsPopup?e.MapSearch.fitBoundsPopup:this.fitBoundsPopup,this.emptyReplaceStr="object"==typeof e.MapSearch&&e.MapSearch.emptyReplaceStr||this.emptyReplaceStr,this.locationsPoi="boolean"!=typeof e.MapSearch.locationsPoi||e.MapSearch.locationsPoi,this.maxSize="object"==typeof e.MapSearch&&"number"==typeof e.MapSearch.maxSize?e.MapSearch.maxSize:1e3)}bindLeftListActionsEvent(t,e){this.map=t;var i=this.map.getOnemapConfig();this.initControls(i),this.mapPopupControl=e,this.map.$MapEventBus.$on("map-left-list-close",(()=>{this.close()})),this.map.M.pubsub.subscribe("clear",(()=>{this.close()})),this.map.$MapEventBus.$on("map-left-list-locations-layer",(t=>{this.addLocationsLayer(t)})),this.map.$MapEventBus.$on("map-left-file-list-locations-layer",(t=>{this.addLocationsLayer(t.data,t.option)})),this.map.$MapEventBus.$on("map-left-list-click",(t=>{this.addMapPopup(t)})),this.map.$MapEventBus.$on("map-left-list-mousemove",(t=>{this.mapLocationsLayerControl.setChangeMouseState(t,!0)})),this.map.$MapEventBus.$on("map-left-list-mouseleave",(t=>{this.mapLocationsLayerControl.setChangeMouseState(t,!1)})),this.map.$MapEventBus.$on("map-left-list-all",(t=>{t?this.addLocationsLayerAll(t):this.mapLocationsLayerControl.clear(null,"mapLocationsLayerAll")})),this.map.$MapEventBus.$on("remove-layer-iquery-locations",(t=>{this.removeIQueryData(t)})),this.map.$MapEventBus.$on("setUIPosition",(t=>{if(t&&"MapLeftList"===t.keys&&t.position){var e=this.map.ExAPI.getPositionStyle(t.position);this.styleDynamicCss=e,this.listIntance&&(this.listIntance.styleDynamicCss=this.styleDynamicCss,this.listIntance.$nextTick((()=>{this.listIntance.setMaxHeight&&this.listIntance.setMaxHeight()})))}}))}add(t,e){this.map=t,this.allToMapCount=0,this.listIntance=null,null!=this.activeList&&this.close();let i=e.data,s=0;Array.isArray(e.data)&&(s=e.data.length,i=e.data[0]);var a=i.records||[];this.iQueryApiIds=a.id;const n=a.length;var o=!1;if(n>0){const t=i.records[0];t.extras.length>0&&"justmapactioncallback"==t.extras[0].extraCode.toLowerCase()&&(o=!0)}if(this.closeAllFitBounds=!1,"object"==typeof e&&e.closeAllFitBounds&&(this.closeAllFitBounds=!0),1==n&&s<=1||o){var r=!0,l=!0;if("object"==typeof e&&(r=void 0===e.showShape||e.showShape,"search-list"==e.source&&(l=!1,r=!1)),l)return void setTimeout((()=>{var t=i.records[0];t.apiId=i.apiId||"",this.map.GLSDK.mapAddPopup({data:t,apiId:t.apiId,fitBounds:this.fitBoundsPopup,closeAllFitBounds:this.closeAllFitBounds,noOnlyOnePopup:!1,showShape:r})}),200)}const h=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_LIST_DEFAULT",{domid:this.mapLeftListContainerID,data:e.data,searchValue:e.searchValue||"",axiosOptions:e.axiosOptions||"",emptyReplaceStr:this.emptyReplaceStr,styleDynamicCss:this.styleDynamicCss});h.map=this.map,this.listIntance=h,this.map.ExAPI.appendMapControlContainer(h),this.activeList=e,e.axiosOptions&&e.axiosOptions.renderAxiosPage||this.addLocationsLayerAll(i)}getExistIcxCode(t){return!!t&&(!(!this.listIntance||!this.listIntance.getExistIcxCode)&&this.listIntance.getExistIcxCode(t))}setVisible(t){this.listIntance&&(this.listIntance.showVisible=t)}async addLocationsLayerAll(t,e){let i,s=t.axiosOptions;i=s?t.list:t;var a=i.records||[];if(this.activeApiId=i.apiId||"",!this.mapLocationsLayerControl.getLayersByLayerkey("mapLocationsLayerAll")||this.allToMapCount!=i.total){if(this.allToMapCount=a.length,this.activeApiId&&t.list){let e=t.currentListIndex,i=t.list;const s=i.total;if(i.records.length==s)return;const n=await this.map.M.iqueryManager.reGetIqueryDataByCode([this.activeApiId],{size:s});n&&(this.listIntance.reSetDataList(n,e),a=n.records)}if(!this.activeApiId&&s&&s.select_code&&!s.renderAxiosPage&&this.allToMapCount<i.total)return s.total=i.total,void(this.map.GLSDK.onSearchAll&&this.map.GLSDK.onSearchAll(s));var n=Object.assign({data:a,options:{layerType:"point",layerLabel:!1,layerLabelPoi:!1},apiId:this.activeApiId,layerAll:!0,layerkey:"mapLocationsLayerAll"},e||{});n.closeAllFitBounds=this.closeAllFitBounds,this.mapLocationsLayerControl.add(this.map,n)}}addLocationsLayer(t,e){var i=Object.assign({data:t,options:{layerLabel:!1,layerLabelPoi:!0,layerType:this.layerType},locationsPoi:this.locationsPoi,apiId:this.activeApiId,fitBounds:this.fitBounds},e||{});t.length>100?i.options.layerType="symbol":i.options.layerType="symbol_poi",i.closeAllFitBounds=this.closeAllFitBounds,this.mapLocationsLayerControl.add(this.map,i)}addMapPopup(t){this.mapPopupControl.add(this.map,{data:t,fitBounds:this.fitBoundsPopup,closeAllFitBounds:this.closeAllFitBounds},((t,e)=>{this.map.$MapEventBus.$emit("map-popup-action-callback",t,e)}))}removeIQueryData(t){this.iQueryApiIds&&Array.isArray(t)&&t.includes(this.iQueryApiIds)&&(this.destory(),this.iQueryApiIds="")}close(){this.map&&this.map.ExAPI.removeMapControlContainer(this.mapLeftListContainerID),this.activeList=null,this.listIntance=null,this.mapPopupControl.close(),this.mapLocationsLayerControl.clear(null,"mapLocationsLayerAll"),this.mapLocationsLayerControl.clear(null,"mapLocationsLayer"),this.map.GLSDK.removeAllHighLightLayer(),this.mapLocationsLayerControl.symbolHighLightLayers.length>0&&(this.map.M.layerManager.removeLayerHighLight(),this.mapLocationsLayerControl.symbolHighLightLayers=[])}destory(){this.close()}}var Zd={pdf:"application/pdf",zip:"application/zip",dwg:"application/autocad",dxf:"application/autocad",default:"image/png"};function tm(t,e){const i=t.split(","),s=i[0].match(/:(.*?);/),a=(s&&s.length>1?s[1]:e)||e,n=window.atob(i[1]),o=new ArrayBuffer(n.length),r=new Uint8Array(o);for(let t=0;t<n.length;t++)r[t]=n.charCodeAt(t);return new Blob([o],{type:a})}function em(t,e,i){const s=tm(t,i),a=document.createElement("a");let n=s;"string"==typeof s?a.target="_blank":n=window.URL.createObjectURL(s),a.href=n,a.download=`${e}.${i}`,document.body.appendChild(a),a.click(),document.body.removeChild(a),"string"!=typeof s&&window.URL.revokeObjectURL(n)}function im(t,e,i){var s=new Image,a=new Image;s.onload=function(){a.onload=function(){var t=document.createElement("canvas");t.width=s.width,t.height=s.height;var e=t.getContext("2d");e.drawImage(s,0,0),e.fillStyle=e.createPattern(a,"repeat"),e.fillRect(0,0,t.width,t.height);var n=t.toDataURL();i&&i(n)},a.src=e},s.src=t}function sm(t,e,i){var s=new Blob([t],{type:Zd[i]||Zd.default}),a=document.createElement("a"),n=window.URL.createObjectURL(s);a.href=n,a.download=`${e}.${i}`,document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(n)}function am(t,e,i,s="image/png"){var a=document.querySelector("#"+t);F.default(a,{logging:!0,width:a.clientWidth,height:a.clientHeight,useCORS:!0,allowTaint:!0,backgroundColor:null,ignoreElements:t=>function(t,e){var i=t.classList,s=t.id||"",a=["mx-map-slot","mx-onemap-old-control","topRightBar","mx-map-tools","mx-map-search","map-coordinate-control","mx-map-coordinate","mapmostgl-ctrl-bottom-left","medomap-lenged","medo-mapwatermark","mapmostgl-popup-close-button"];return(a=a.concat(e)).includes(s)||a.some((t=>i.contains(t)))}(t,i)}).then((function(t){setTimeout((()=>{var i=t.toDataURL();e&&e(i)}),500)})).catch((function(t){console.error("html2canvas错误:",t)}))}function nm(t,e,i,s){const a=i||{},n=a.dataUrl,o=t.getCanvas(),r=document.createElement("canvas");r.width=o.width,r.height=o.height;const l=r.getContext("2d");let h=0,c=0;if(a.fitBounds){var p={type:"FeatureCollection",features:e};const i=T.bbox(p),s={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]},a=t.project([s.minX,s.maxY]),n=t.project([s.maxX,s.minY]),o=Math.abs(n.x-a.x),l=Math.abs(n.y-a.y);r.width=o,r.height=l,h=a.x,c=a.y}else r.width=o.width,r.height=o.height;let u=null;return n?(u=new Image,u.src=n,u.onload=function(){e.forEach((e=>{const i=e.geometry.coordinates[0];if(i.length){const e=i.map((e=>t.project(e)));l.save(),l.globalCompositeOperation="source-over",l.beginPath(),l.moveTo(e[0].x-h,e[0].y-c);for(let t=1;t<e.length;t++)l.lineTo(e[t].x-h,e[t].y-c);l.closePath(),l.clip(),l.drawImage(u||o,h,c,r.width,r.height,0,0,r.width,r.height),l.restore()}})),s&&s(r.toDataURL("image/png"))}):e.forEach((e=>{const i=e.geometry.coordinates[0];if(i.length){const e=i.map((e=>t.project(e)));l.save(),l.globalCompositeOperation="source-over",l.beginPath(),l.moveTo(e[0].x-h,e[0].y-c);for(let t=1;t<e.length;t++)l.lineTo(e[t].x-h,e[t].y-c);l.closePath(),l.clip(),l.drawImage(u||o,h,c,r.width,r.height,0,0,r.width,r.height),l.restore()}})),r.toDataURL("image/png")}class om{constructor(t){this.options=t||{},this.controls=Object.assign({templatePage:!0,title:!0,subtitle:!0,copyRight:!0,date:!1,author:!0,iscenter:!0,legend:!0},this.options.controls||{}),this.form=Object.assign({templatePage:"A4_landscape",title:"某某专题图",date:this.controls.date?this.getDate():"",centerTitle:"",subtitle:"",copyRight:"",author:"",formate:"PDF",textContent:"文本标注",scale:"",dpi:96,iscenter:!1,isLegend:!1},this.options.form||{}),this.medoTemplate=this.options.medoTemplate||"",this.mapLegend=this.options.mapLegend,this.templatePageList=this.options.templatePageList||[{label:"A4 横向",value:"A4_landscape"},{label:"A4 纵向",value:"A4_portrait"},{label:"A3 横向",value:"A3_landscape"},{label:"A3 纵向",value:"A3_portrait"},{label:"A2 横向",value:"A2_landscape"},{label:"A2 纵向",value:"A2_portrait"}],this.map=null,this.mapPrint=null,this.mapid=null,this.domid="map-print-Panel",this.target=this.options.target||"",this.mask=void 0!==this.options.mask&&this.options.mask,this.position=this.options.position||"",this.intance=null,this.mapScaleNearValue=null,this.mapScaleNearFour=[],this.maxWidth=100,this.dpi=96,this.defaultDpi=96,this.mapOptions=this.options.mapOptions||null,this.htmlScreenShot=this.options.htmlScreenShot||!1,this.ignoreElementList=this.options.ignoreElementList||[],this.compass=this.options.compass||!1,this.compassPosition={},this.componentSlot=Object.assign({name:"",collapse:"2",title:"字段标注"},this.options.componentSlot||{}),this.dragResizeConfig={w:220,h:250,z:2,left:0,top:0,parentW:0,parentH:0}}getDate(){const t=new Date;return`${t.getFullYear()}年${t.getMonth()+1}月${t.getDate()}日`}bindZoomEndEvents(){this.zoomEndHandlers=()=>{this.calculateScale(this.mapPrint,this.mapPrint.getZoom())},this.mapPrint.on("zoomend",this.zoomEndHandlers)}calculateScale(t,e,i=100){this.maxWidth=i;const s=t._container.clientHeight/2,a=t._container.clientWidth/2-i/2,n=t.unproject([a,s]),o=t.unproject([a+i,s]),r=n.distanceTo(o),l=mp(r/i,96);this.intance.form.scale=l,this.mapScaleNearValue=this.getRoundNum(r),this.setScaleNearFourList()}setScaleNearFourList(){var t="m",e=this.mapScaleNearValue;this.mapScaleNearValue>=1e3&&(e=this.mapScaleNearValue/1e3,t="km"),this.mapScaleNearFour=["0",e.toString(),(2*e).toString(),(3*e).toString()+t]}addTo(t){if(this.map=t,this.destory(),this.position=this.map.ExAPI.getPositionStyle(this.options.position),this.compass){let t=this.compass.position||["10px","10px",null,null];this.compassPosition=this.map.ExAPI.getPositionStyle(t)}this.intance=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_WEBPRINT_DEFAULT",{map:null,title:void 0===this.options.title?"Web打印出图":this.options.title,domid:this.domid,position:this.position,mask:this.mask,form:this.form,controls:this.controls,templatePageList:this.templatePageList,componentSlot:this.componentSlot,compass:this.compass,compassPosition:this.compassPosition}),this.intance.initMap=()=>{this.initMap()},this.intance.close=()=>{this.map.GLSDK.removeWebPrintPlugins(),this.map.GLSDK.closeWebPrint&&this.map.GLSDK.closeWebPrint()},this.intance.changeScale=()=>{this.mapPrint&&this.changeScale()},this.intance.mapDraw=t=>{this.mapPrint&&this.mapDraw(t)},this.intance.closeDraw=()=>{this.mapPrint&&this.closeDraw()},this.intance.changeCollapse=t=>{"2"!=t&&this.mapPrint&&this.closeDraw()},this.intance.clearDraw=()=>{this.mapPrint&&(this.mapPrint.GLSDK.mapClearDraw(),this.mapPrint.GLSDK.removeMapLocationsData())},this.intance.changeDpi=t=>{this.changeDpi(t)},this.intance.removeSelectedDraw=()=>{this.mapPrint&&this.mapPrint.GLSDK.mapDrawControl.removeSelectedFeature()},this.intance.print=()=>{this.mapPrint.setBearing(0),setTimeout((()=>{this.print("print")}),500)},this.intance.exportPrint=()=>{this.mapPrint.setBearing(0),setTimeout((()=>{this.print("export")}),500)},this.intance.mapSuccessPrintMap=t=>{this.mapSuccessPrintMap(t)},this.intance.handleChangeUpload=(t,e)=>{this.handleChangeUpload(t,e)},this.intance.refreshSelectText=()=>{const t=this.intance.form.textContent;t&&this.mapPrint&&this.mapPrint.GLSDK.mapDrawControl.refreshSelectText(t)},this.intance.getWebPrintMapClone=()=>this.mapPrint,this.intance.getMapClone=()=>this.map,this.map.ExAPI.appendMapControlContainer(this.intance,this.target)}handleChangeUpload(t){window.MapMessage.ShowLoading({text:"正在读取文件...."});const e=t.name.split(".").pop().toLowerCase();switch(e){case"zip":case"dwg":case"shp":this.showImportMapCommonByJava(t,e)}}showImportMapCommonByJava(t){const e=this.map.GLSDK.getOnemapConfig().customURL_ReadGeoJSONByFile;dr.postShape({url:e,files:t}).then((e=>{Array.isArray(e)||200==e.code?this.showMapLocations(t,e.data[0].Collection,"geojson"):(window.MapMessage.ShowMessage({type:"warning",message:`文件读取失败:${e.msg}`||"未知"}),this.mapPrint.$MapEventBus.$emit("map-show-readfiles-callback",""))}))}showMapLocations(t,e,i="qdata"){window.MapMessage.CloseLoading();const s="geojson"==i?e.features.length:e.length,a=t.name;if(0==s)return void window.MapMessage.ShowMessage({type:"warning",duration:5e3,message:`文件:${a}未检测到空间要素!请重新上传!`});const n=this.getDrawType(e);if(!n)return;this.mapPrint.GLSDK.mapStartDraw({type:n,data:e,mode:"single",sticky:{target:""},renderStyle:this.getRenderStyle(),selected:!0,clear:!1,fitBounds:!0},(()=>{this.intance.activeDraw="",this.mapPrint.ExAPI.setCursor("grab",this.mapPrint),this.closeDraw()}))}getDrawType(t){var e;const i=t.features.filter((t=>t.geometry));if(i.length>0){const t=i[0].geometry.type.toLowerCase();t.indexOf("point")>-1?e="map_draw_point_canvas":t.indexOf("linestring")>-1?e="map_draw_polyline":t.indexOf("polygon")>-1&&(e="map_draw_polygon")}return e}getRenderStyle(){return{pointColor:this.intance.renderStyle.color,lineColor:this.intance.renderStyle.color,fillColor:this.intance.renderStyle.fillColor,fillOutLineColor:this.intance.renderStyle.color,lineWidth:this.intance.renderStyle.width,fillOutLineWidth:this.intance.renderStyle.width,pointRadius:this.intance.renderStyle.width,lineStyle:this.intance.renderStyle.lineStyle,textColor:this.intance.renderStyle.textColor,textFontSize:this.intance.renderStyle.textFontSize,textHaloWidth:this.intance.renderStyle.textHaloWidth,textHaloColor:this.intance.renderStyle.textHaloColor,text:this.intance.form.textContent}}mapDraw(t){this.intance.activeDraw=t;var e=this.getRenderStyle();const i=this.intance.renderStyle.drawTypeMode;this.mapPrint.GLSDK.mapStartDraw({type:t,mode:i,sticky:{target:""},renderStyle:e,selected:!0,clear:!1},(t=>{"single"==i&&(this.intance.activeDraw="",this.mapPrint.ExAPI.setCursor(""))}))}closeDraw(){this.mapPrint.GLSDK.mapCloseDraw(),this.intance.activeDraw="",this.mapPrint.ExAPI.setCursor("")}changeScale(){const t=dp(this.intance.form.scale,this.dpi);this.mapScaleNearValue=this.getRoundNum(t*this.maxWidth);const e=yp(t);this.zoomEndHandlers&&this.mapPrint.off("zoomend",this.zoomEndHandlers),this.mapPrint.setZoom(e),this.bindZoomEndEvents()}getDecimalRoundNum(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}getRoundNum(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:this.getDecimalRoundNum(i),e*i}changeDpi(t){if(t){const e=t/96;Object.defineProperty(window,"devicePixelRatio",{get:function(){return e}}),this.mapPrint&&this.mapPrint.resize()}}getCompassImage(t){am("mx-map-compass-container",(e=>{t(e)}),[],"image/png")}print(t){this.intance.activeLoadingPrint=!0,setTimeout((()=>{this.intance.activeLoadingPrint=!1}),1e4);const e={...this.intance.form};var i=!1;if(i=this.controls.isLegend?e.isLegend:this.mapPrint.MapLayerLegend&&this.mapPrint.MapLayerLegend.printMap,this.htmlScreenShot){var s=JSON.parse(JSON.stringify(this.ignoreElementList||[]));!i&&this.mapPrint.MapLayerLegend&&s.push(this.mapPrint.MapLayerLegend.domid),am(this.mapPrint.GLSDK.mapContainerID,(s=>{this.mapPrintHandlerBeforeCompass(i,e,s,t)}),s)}else{const s=this.mapPrint.getCanvas().toDataURL("image/png",1);this.mapPrintHandlerBeforeCompass(i,e,s,t)}}mapPrintHandlerBeforeCompass(t,e,i,s){this.compass?this.getCompassImage((a=>{im(i,a,(i=>{this.mapPrintHandlerBefore(t,e,i,s)}))})):this.mapPrintHandlerBefore(t,e,i,s)}mapPrintHandlerBefore(t,e,i,s){t&&this.mapPrint.MapLayerLegend?this.mapPrint.MapLayerLegend.getLengedImage((t=>{t?im(i,t,(t=>{this.mapPrintHandler(e,t,s)})):this.mapPrintHandler(e,i,s)})):this.mapPrintHandler(e,i,s)}mapPrintHandler(t,e,i){var s=e;const a=this.mapPrint.getWaterMarkImg();if("object"==typeof a.MapWaterMark&&!0===a.MapWaterMark.printMap){var n=a.img;if(n)return void im(s,n,(e=>{this.mapTailorHandler(t,e,i)}))}this.mapTailorHandler(t,s,i)}mapTailorHandler(t,e,i){t.dpi>600?function(t,e=null){var i=new Image;i.src=t,i.onload=function(){var t=document.createElement("canvas"),s=t.getContext("2d");t.width=i.width,t.height=i.height,s.drawImage(i,0,0);for(var a=s.getImageData(0,0,t.width,t.height).data,n=t.width,o=0,r=t.height,l=0,h=0;h<t.width;h++)for(var c=0;c<t.height;c++){var p=4*(h+t.width*c);255!=a[p]&&255!=a[p+1]&&255!=a[p+2]&&255!=a[p+3]||(l=Math.max(c,l),o=Math.max(h,o),r=Math.min(c,r),n=Math.min(h,n))}n++,o++,r++,l++;var u=document.createElement("canvas");u.width=o-n,u.height=l-r,u.getContext("2d").drawImage(i,n,r,u.width,u.height,0,0,u.width,u.height),e&&e(u.toDataURL())}}(e,(e=>{this.printHandler(t,e,i)})):this.printHandler(t,e,i)}printHandler(t,e,i){let s=this.mapPrint.getCanvas().style.width,a=this.mapPrint.getCanvas().style.height;const n=document.createElement("canvas"),o=n.getContext("2d");n.width=parseFloat(s),n.height=parseFloat(a);var r=new Image;r.src=e;var l=this;r.onload=async function(){o.drawImage(r,0,0,n.width,n.height);const e=n.toDataURL("image/png",1);t.iscenter&&(t.centerTitle=t.title,t.title=""),t.img=e,t.outType="print"==i?"PDF":t.formate,l.medoTemplate&&(t.templatePath=l.medoTemplate),t.scaleValue=l.mapScaleNearFour,l.compass&&(t.compass=1,t.templatePath||(t.templatePath="customTemplate")),l.intance.activeLoadingPrint=!1;const s=t.title||t.centerTitle;if("PNG(非模板)"==t.formate)return void em(e,s,"png");const a={url:l.map.GLSDK.getOnemapConfig().customURL_MapPdf,method:"post",addheaders:{},addtimeout:2e4,data:t,nocode:!0,nomessage:!0,addresponseType:"blob"},h=await dr.request(a);"export"==i?sm(h,s,t.outType.toLowerCase()):function(t,e,i,s,a){var n,o="printPdf";if("png"==a){const e=tm(t,i);n=e,"string"==typeof e||(n=window.URL.createObjectURL(e))}else{var r=new Blob([t],{type:"pdf"==i?"application/pdf":"image/png"});n=window.URL.createObjectURL(r)}document.getElementById(o)&&document.getElementById(o).remove();var l=document.createElement("iframe",{height:"0",width:"0",border:"0",wmode:"Opaque"});l.setAttribute("id",o),l.style.position="absolute",l.style.top="-999px",l.style.left="-999px",l.style.display="none",l.src=n,document.body.insertBefore(l,document.body.firstChild),l.contentWindow.focus();try{l.contentWindow.print(),window.URL.revokeObjectURL(l.src)}catch(t){console.log(t),l.remove()}}(h,0,t.outType.toLowerCase(),t.templatePage)}}initMap(){if(this.mapOptions)this.intance.mapOption=this.mapOptions;else{let s=JSON.parse(JSON.stringify(this.map.GLSDK.getOnemapConfig())).optionComponents[this.map._container.id];var t,e=JSON.parse(JSON.stringify(s));if(e.container=`map001${Math.floor(99*Math.random())}1`,e.mapStyleConfig||(e.mapStyleConfig={}),void 0!==this.mapLegend)t=this.mapLegend;else t=(e.mapStyleConfig.controls||{}).MapLegend;const a=this.map.getWaterMarkImg();var i=this.map.getMapSwitchSelectIndex();e.mapStyleConfig.controls={MapTools:!1,MapSearch:!1,MapCoordinate:!1,MapWeather:!1,MapAttri:!1,MapNav:!1,MapWaterMark:a.MapWaterMark||!1,MapLayerManager:{closeDefaultLayer:!0},MapSwitch:{defaultIndex:i},MapLegend:t},e.mapStyleConfig.theme=this.map.themesKey,e.observeMap=this.map.observeMap,this.intance.mapOption=e}this.intance.isShowMap=!0}mapSuccessPrintMap(t){this.mapPrint=t,this.mapPrint.jumpTo({center:this.map.getCenter(),pitch:this.map.getPitch(),zoom:this.map.getZoom()});const e=this.map.GLSDK.getAllCheckedIds()||[];this.mapPrint.GLSDK.setAllCheckedIds(e),this.mapPrint.GLSDK.setParamsToQuery(this.map.GLSDK.queryParamsExtra||{}),setTimeout((()=>{this.bindZoomEndEvents(),this.calculateScale(this.mapPrint,this.mapPrint.getZoom())}),1e3)}destory(){if(this.map){if(this.mapPrint){let e=this.mapPrint.getCanvas();var t=1==this.mapPrint._useWebGL2?"webgl2":"webgl";let i=e.getContext(t);i&&i.getExtension("WEBGL_lose_context")&&i.getExtension("WEBGL_lose_context").loseContext()}this.map.ExAPI.removeMapControlContainer(this.domid),this.changeDpi(this.defaultDpi)}}}class rm{constructor(t){this.options=t||{},this.domid=this.options.domid||"dom"+Math.floor(999*Math.random()),this.position=this.options.position||["20px",null,null,"80px"],this.map=null,this.intanceDom=null}subscribeMapClear(){this.map.M.pubsub.subscribe("clear",(()=>{this.destory()}))}}class lm{constructor(){this.map=null,this.mapid=null,this.mapControlClass="mapmostgl-control-container",this.mapImportfilesContainerID="mx-map-importfiles-panel",this.callbackData=null,this.mapPopupControl=null,this.mapLocationsLayerControl=null,this.extent=null,this.srid=null,this.coordinateFlag=0,this.topologyFlag=0,this.repairMethod="",this.customURL_ReadGeoJSONByFile}subscribeMapClear(t){this.map=t,this.map.M.pubsub.subscribe("clear",(()=>{this.destory()})),this.bindImportfilesActionsEvent()}bindImportfilesActionsEvent(){this.map.$MapEventBus.$on("map-Importfiles-Panel-close",(()=>{this.destory()})),this.map.$MapEventBus.$on("map-show-readfiles-callback",(t=>{this.callbackData&&this.callbackData(t)})),this.map.$MapEventBus.$on("map-Importfiles-Panel-locationslayer",(t=>{const e=t;null!=e?(e.fitBounds=!0,e.options=Object.assign({layerType:"symbol_poi",layerLabel:!1,closeMouseMoveTip:!0},t.options||{}),this.mapLocationsLayerControl.add(this.map,e)):this.mapLocationsLayerControl.clear()}))}setSrid(t){this.srid=t}setExtent(t){this.extent=t}setCoordinateFlag(t){this.coordinateFlag=t}setTopologyFlag(t){this.topologyFlag=t}setRepairMethod(t){this.repairMethod=t}add(t,e,i){this.map=e,this.callbackData=i,this.close(),this.srid=t.srid||"",this.extent=t.extent||"",this.repairMethod=t.repairMethod||"",this.coordinateFlag=void 0===t.coordinateFlag?this.coordinateFlag:t.coordinateFlag,this.topologyFlag=void 0===t.topologyFlag?this.topologyFlag:t.topologyFlag;var s=this.map.getOnemapConfig().customURL_ReadGeoJSONByFile;const a=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_IMPORTFILES_DEFAULT",{data:{},title:void 0===t.title?"文件上图":t.title,showList:void 0!==t.showList&&t.showList,srid:this.srid,extent:JSON.stringify(this.extent||""),coordinateFlag:this.coordinateFlag,topologyFlag:this.topologyFlag,repairMethod:this.repairMethod,domid:this.mapImportfilesContainerID,fileTip:t.fileTip||"",customURLReadGeoJSONByFile:s});a.map=this.map,a.getParams=()=>({extent:this.extent?JSON.stringify(this.extent):"",srid:this.srid,coordinateFlag:this.coordinateFlag,topologyFlag:this.topologyFlag,repairMethod:this.repairMethod}),this.map.ExAPI.appendMapControlContainer(a)}close(){this.map&&this.map.ExAPI.removeMapControlContainer(this.mapImportfilesContainerID),this.mapPopupControl.close(),this.mapLocationsLayerControl.destory(),this.callbackData=null}destory(){this.close()}}class hm{constructor(t){this.options=Object.assign({url:"",default:"",domid:"map-locationquery-container",position:["60px",null,null,"80px"]},t||{}),this.searchData="",this.domid=this.options.domid,this.map=null,this.intanceDom=null,this.position=this.options.position,this.searchUrl=this.options.url,this.closeLink=void 0===this.options.closeLink||this.options.closeLink}subscribeMapClear(){this.map.M.pubsub.subscribe("clear",(()=>{this.destory()}))}addTo(t){if(this.map=t,this.subscribeMapClear(),this.mapid=this.map._container.id,this.intanceDom=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_LOCATION_QUERY_DEFAULT",{default:this.options.default,domid:this.domid,position:this.map.ExAPI.getPositionStyle(this.position),close:()=>{this.intanceDom.visible=!1,this.map&&(this.map.$MapEventBus.$emit("map-left-list-close"),this.closeLink&&this.map.ExAPI.removeMapControlContainer(this.domid))}}),this.intanceDom.map=this.map,this.intanceDom.mapLocations=t=>{this.mapLocations(t)},this.intanceDom.getSearchUrl=()=>this.getSearchUrl(),this.map.ExAPI.appendMapControlContainer(this.intanceDom),!this.searchUrl){var e=this.map.GLSDK.getOptionData("QuickSearch");this.setQuickSearch(e)}return this}mapLocations(t){this.map.$MapEventBus.$emit("map-left-list-locations-layer",t.records)}setQuickSearch(t){var e=t.findIndex((t=>"地名地址"==t.apiName));if(e>-1){var i=t[e];if("地名地址"==i.apiName){this.searchData=i;const t=this.map.GLSDK.getOnemapConfig().customURL_QQuery+`/${this.searchData.apiCode}`;this.searchUrl=t,!this.options.default&&this.intanceDom&&(this.intanceDom.default=i.defaultValue||"")}}else{const t=this.map.GLSDK.getOnemapConfig(),e=t.customURL_QQuery+`/${t.locationQueryServiceCode}`;this.searchUrl=e}}getSearchUrl(){return this.searchUrl}remove(){this.destory()}destory(){this.map&&(this.map.$MapEventBus.$emit("map-left-list-close"),this.map.ExAPI.removeMapControlContainer(this.domid))}}const cm=new class{constructor(){this.map=null,this.map2=null}init(t,e){this.map=t,this.map2=e}};w.default.directive("mapcomparexdrag",{inserted(t){t.onmousedown=function(t){let{id:e}=t.target;""==e&&(e=t.currentTarget.id);const i=t.clientX-document.getElementById(e).offsetLeft;return document.onmousemove=function(t){const s=t.clientX-i,a=document.documentElement.clientWidth,n=document.getElementById("map").offsetWidth;if(s<a&&s>=280&&n-s>=280){document.getElementById(e).style.left=`${s}px`;const t=document.getElementById("map").offsetWidth,i=document.getElementById("map").offsetHeight;document.getElementById("map").style.clip=`rect(0px,${s}px,${i}px,0px)`,document.getElementById("topRightBar").style.right=t-s+30+"px",document.getElementById("mapex").style.left=`${s+30}px`}},document.onmouseup=function(){return document.onmousemove=null,document.onmouseup=null,!1},!1}}}),w.default.directive("mapcmpxdrag",{inserted(t){t.onmousedown=function(t){let{id:e}=t.target;""==e&&(e=t.currentTarget.id);const i=t.clientX-document.getElementById(e).offsetLeft;return document.onmousemove=function(t){const s=t.clientX-i,a=document.documentElement.clientWidth,n=document.getElementById("mx-onemap-container").offsetWidth;s<a&&s>=280&&n-s>=280&&(document.getElementById(e).style.left=`${s}px`,document.getElementById("map").style.width=`${s}px`,document.getElementById("mx-map-before").style.width=n-s+"px",cm.map&&cm.map.resize(),cm.map2&&cm.map2.resize())},document.onmouseup=function(){return document.onmousemove=null,document.onmouseup=null,!1},!1}}});var pm=function(){var t,e=arguments.length;if(1===e)t=arguments[0];else{t=[];for(var i=0;i<e;i++)t.push(arguments[i])}var s=[];function a(){t.forEach((function(t,e){t.on("move",s[e])}))}function n(){t.forEach((function(t,e){t.off("move",s[e])}))}function o(t,e){n(),function(t,e){var i=t.getCenter(),s=t.getZoom(),a=t.getBearing(),n=t.getPitch();e.forEach((function(t){t.jumpTo({center:i,zoom:s,bearing:a,pitch:n})}))}(t,e),a()}return t.forEach((function(e,i){s[i]=o.bind(null,e,t.filter((function(t,e){return e!==i})))})),a(),function(){n(),s=[],t=[]}};class um{constructor(){this.map=null,this.mapBeforeId=null,this.adapter=null,this.map2=null,this.mapSyncClass=null,this.options=null,this.tokens=null,this.localOptions={},this.localTokens=[],this.localPopupTemplate={},this.barType=null}open(t,e){this.map=t,this.mapBeforeId="map",this.barType!=e&&null!=this.barType?this.close((()=>{this.barType=null,setTimeout((()=>{this.openControl(e)}),100)})):this.openControl(e)}openControl(t){this.map.$MapEventBus.$emit("onemap-change-sync-move",{state:!0,barType:t,callback:()=>{switch(this.barType=t,t){case 1:this.map.M.pubsub.publish("mapCloseSyncMoveSplit"),this.syncMoveMap();break;case 2:this.map.M.pubsub.publish("mapCloseSyncMove"),this.syncMoveMapSplit()}}})}syncMoveMap(){const t=document.getElementById("mx-map-compare").offsetLeft,e=document.getElementById(this.mapBeforeId).offsetWidth,i=document.getElementById(this.mapBeforeId).offsetHeight;document.getElementById(this.mapBeforeId).style.clip=`rect(0px,${t}px,${i}px,0px)`,document.getElementById("topRightBar").style.right=e-t+30+"px",this.map.resize(),this.map2&&this.map2.once("load",(()=>{this.map2.resize()}))}syncMoveMapSplit(){const t=document.getElementById("mx-onemap-container").offsetWidth;document.getElementById(this.mapBeforeId).style.width=t/2+"px",document.getElementById("mx-map-before").style.width=`calc(100% - ${t/2}px)`,document.getElementById("topRightBar").style.right="30px",this.map.resize(),this.map2&&this.map2.once("load",(()=>{this.map2.resize()}))}loadMap(t,e){if(this.map2)return void e(this.map2,this.barType);this.adapter=t.adapter,this.options=t.options,this.tokens=t.tokens,this.popupTemplate=t.popupTemplate,this.adapter?(Object.assign(this.localOptions,this.options,this.adapter().MV.props.options),this.localTokens=this.tokens.concat(this.adapter().MV.props.tokens),Object.assign(this.localPopupTemplate,this.popupTemplate,this.adapter().MV.props.popupTemplate)):(this.localOptions=this.options,this.localTokens=this.tokens,this.localPopupTemplate=this.popupTemplate),this.map.localOptions&&(this.localOptions=this.map.localOptions);const i=Object.assign({...this.map.initMapOptions},{zoom:this.map.getZoom(),center:this.map.getCenter(),pitch:this.map.getPitch(),bearing:this.map.getBearing()});i.container=t.container;const s=new I.default.Map(i);this.map2=s,this.map2.initMapOptions=JSON.parse(JSON.stringify(this.map.initMapOptions)),this.bindFuncMap2FromMap1(),this.map2.once("style.load",(()=>{"2D"!=this.map.viewMode&&"2d"!=this.map.viewMode||(this.map2.setBearing(0),this.map2.setPitch(0),this.map2.dragRotate.disable(),this.map2.touchZoomRotate.disableRotation()),this.map.baseMapStyleSheet&&(this.map2.baseMapStyleSheet=JSON.parse(JSON.stringify(this.map.baseMapStyleSheet))),this.map2.$MapEventBus=new w.default,this.map2.ExAPI=new nd({map:this.map2});const t=new kg(this.map2,{popupTemplate:null});this.map2.M.view.set(this.localOptions),this.map2.M.tokenManager.register(this.localTokens),this.loaded=!0,cm.init(this.map,this.map2),this.map2.mapLegendVisible=!1,this.map2.mapCloneSync=!0,this.map2.GLSDK=this.map.GLSDK,this.map2.setStyleInit=()=>{t.initAddBaseLayerAll(this.map2)},e(this.map2,this.barType),this.bindEventListener()}))}bindFuncMap2FromMap1(){void 0!==this.map.sz2000sdk&&(this.map2.sz2000sdk=this.map.sz2000sdk,this.map.MapmostSDKConvert&&(this.map2.MapmostSDKConvert=this.map.MapmostSDKConvert)),this.map2.getOnemapConfig=this.map.getOnemapConfig,void 0!==this.map.isCoordinate&&(this.map2.isCoordinate=this.map.isCoordinate),void 0!==this.map.enableTransform&&(this.map2.enableTransform=this.map.enableTransform),void 0!==this.map.viewMode&&(this.map2.viewMode=this.map.viewMode),void 0!==this.map.projection&&(this.map2.projection=this.map.projection),void 0!==this.map.srid&&(this.map2.srid=this.map.srid)}bindEventListener(){this._clearSync=pm(this.map,this.map2)}getMap2(){return this.map2}reloadDom(){switch(this.barType){case 1:document.getElementById("topRightBar").style.right="0px",document.getElementById(this.mapBeforeId).style.clip="auto",this.map.resize();break;case 2:document.getElementById(this.mapBeforeId).style.width="100%",document.getElementById(this.mapBeforeId).style.clip="auto",this.map.resize(),document.getElementById("topRightBar").style.right="0px",document.getElementById("mx-map-before")&&(document.getElementById("mx-map-before").style.width="100%")}}close(t){null!=this.map2&&this.map.$MapEventBus.$emit("onemap-change-sync-move",{state:!1,barType:this.barType,callback:()=>{this.reloadDom(),this.map2&&this.destroyMap2(),this.map2=null,this.barType=null,this._clearSync(),t&&t()}})}destroyMap2(){if(this.map2){let e=this.map2.getCanvas();if(e){var t=1==this.map2._useWebGL2?"webgl2":"webgl";let i=e.getContext(t);i&&i.getExtension("WEBGL_lose_context")&&i.getExtension("WEBGL_lose_context").loseContext()}let i=document.getElementById(this.mapContainerId2);i&&i.parentNode.removeChild(i),console.warn("销毁map2地图WebGL")}}}class dm{constructor(t){this.options=Object.assign({position:[null,"0px","0px",null],domid:"map-coordinate-control"},t||{}),this.domid=this.options.domid,this.active=!1,this.position=this.options.position,this.mapid="map",this.instance=null,this.getPositionStyle=null}addTo(t){this.mapid=t._container.id,null!=this.active&&this.remove(),this.position=t.ExAPI.getPositionStyle(this.options.position),this.instance=t.MedomapTemplateFactory.getInstance("MEDOMAP_COORDINATE_DEFAULT",{position:this.position}),this.instance.map=t,t.ExAPI.appendMapControlContainer(this.instance),this.active=!0,this.getPositionStyle=t.ExAPI.getPositionStyle}setPosition(t){t&&(this.options.position=t,this.position=this.getPositionStyle(t),this.instance.setPosition(this.position))}remove(){if(!this.active)return;const t=window.jqueryMap(`#${this.mapid} #${this.domid}`);t&&t.remove(),this.active=!1;const e=document.getElementById(this.domid);e&&e.parentNode.removeChild(e)}}class mm{constructor(t){this.options=Object.assign({position:[null,null,"30px","10px"],domid:"map-weather-control"},t||{}),this.domid=this.options.domid,this.active=!1,this.position=this.options.position,this.mapid="map",this.getPositionStyle=null,this.instance=null,this.oneMapConfig={}}addTo(t){this.mapid=t._container.id,this.oneMapConfig=t.getOnemapConfig(),this.position=t.ExAPI.getPositionStyle(this.position),this.getPositionStyle=t.ExAPI.getPositionStyle,null!=this.active&&this.remove();var e=this.oneMapConfig.customURL_GaodeAPIWeatherByAdcode,i=t.initMapOptions.cityCode||"";i&&dr.get({url:e,addheaders:{"Content-Type":"x-www-form-urlencoded"},params:{city:i},nomessage:!0}).then((e=>{if(e&&200==e.code&&null!=e.data){const i=e.data,s={icon:this.getIcon(i.weather||""),value:`${i.temperature}℃`};this.instance=t.MedomapTemplateFactory.getInstance("MEDOMAP_WEATHER_DEFAULT",{position:this.position,weather:s}),t.ExAPI.appendMapControlContainer(this.instance),this.active=!0}}))}setPosition(t){t&&(this.options.position=t,this.position=this.getPositionStyle(t),this.instance.setPosition(this.position))}getIcon(t){let e="",i=t;switch(i.indexOf("云")>-1&&(i="阴"),i.indexOf("风")>-1&&(i="风"),i.indexOf("雨")>-1&&(i="雨"),i.indexOf("阵雨")>-1&&(i="阵雨"),i.indexOf("雪")>-1&&(i="雪"),i.indexOf("雾")>-1&&(i="雾"),i.indexOf("沙")>-1&&(i="沙"),i){case"晴":case"阴":case"云":case"雨":case"阵雨":case"雪":case"雾":case"沙":e=`${this.oneMapConfig.images}/weather/${i}.png`}return e}remove(){if(!this.active)return;const t=window.jqueryMap(`#${this.mapid} #${this.domid}`);t&&t.remove(),this.active=!1;const e=document.getElementById(this.domid);e&&e.parentNode.removeChild(e)}}const{NavigationControl:gm}=I.default,{AttributionControl:ym}=I.default,{ScaleControl:fm}=I.default;function _m(t,e,i){let s;switch(e){case"MapCoordinateControl":s=new dm(i);break;case"MapWeatherControl":s=new mm(i)}return s.addTo(t),s}function vm(t,e){e.addTo(t)}function xm(t,e){e&&(e.remove(),e.destory&&e.destory())}class Cm{constructor(t){this.options=t,this.BaseMap=Kd,this.GeoUtil=Pp,this.map=null,this.mapContainerID="",this.mapPopupActionCallback=null,this.scaleControl=null,this.navControl=null,this.attriControl=null,this.coordinateControl=null,this.weatherControl=null,this.mapDrawControl=null,this.mapLeftListControl=null,this.mapPopupControl=null,this.mapLocationsLayerControl=null,this.mapImportFilesPlugins=null,this.MapSyncMoveControlPlugins=null,this.mapLayerManagerAPI=null,this.activeIquery=!1,this.mapIQueryJustActionCallback="",this.addControl=vm,this.removeControl=xm,this.addControlByControlName=_m,this.NavigationControl=gm,this.AttributionControl=ym,this.MedoMapUIStyleControl={},this.mapWebPringPluginsControl="",this.extendMapmost(),this.mapStyleUrlLayer=null,this.layerCheckCallback=null,this.OpenMapSyncMoveControls=null,this.CloseMapSyncMoveControls=null,this.MapLocationQueryControl=null,this.changeMapLayerDefault=[],this.getIQueryDataCallback=null,this.getMapSearchData=null,this.setMapSearchData=null,this.changeToolbox=null,this.dataToMapLayers={},this.dataToMapPopup=null,this.dataToMapHighLayer=null,this.baseLayerTypeLayerId=["ground-bk","mapmost_default_sky","scene_default_layer","t_underground","t_base","t_line","t_point","t_polygon","g_lineLayer","g_pointLayer","g_polygonLayer","t_mask"],this.layerFilterData={},this.onClickEventObj={},this.highLightLayerTemp={},this.toolsOnClickCallback=null,this.queryParamsExtra={},this.onlyPickUpVisible=!1,this.drawCommonPickUpVisible=!1,this.haloSunInstance=null,this.matrix4=new I.default.Matrix4,this.baseMapOpacity=null,this.onAddedLayerCallback=null,this.onAddedSourceCallback=null,this.mapmostMeasure3D=null,this.oneMapConfig={},this.onSearchAll=null,this.mouseMoveTipsId="maptips",this.activeTools=null,this.changeLayerManagerEvent=null,this.pagePath=""}removeDataToMapPopup(t){this.dataToMapPopup&&(t?this.dataToMapPopup.layerId==t&&this.dataToMapPopup.remove():this.dataToMapPopup.remove())}getDataToMapLayers(t){return this.dataToMapLayers[t]}getDataToMapLayersIdAll(){var t=[];for(let e in this.dataToMapLayers)this.dataToMapLayers.hasOwnProperty(e)&&this.dataToMapLayers[e].onClickCallback&&(t=t.concat(this.dataToMapLayers[e].layers));return t}removeDataToMapLayersAll(){for(let t in this.dataToMapLayers)this.dataToMapLayers.hasOwnProperty(t)&&this.dataToMapLayers[t].remove()}unHighLight(t){this.dataToMapHighLayer&&(t?this.dataToMapHighLayer.id==t&&(this.dataToMapHighLayer.unHighLight(),this.dataToMapHighLayer=null):(this.dataToMapHighLayer.unHighLight(),this.dataToMapHighLayer=null))}getTreeObj(){return this.map.M.getTreeObj?this.map.M.getTreeObj():null}extendMapmost(){this.Popup=I.default.Popup}init(t){this.map=t,this.oneMapConfig=this.map.getOnemapConfig(),this.setTheme("common"),this.mapContainerID=this.map._container.id,this.map.ExAPI=new nd({map:this.map}),this.mapPopupControl=new Hd,this.mapLayerManagerAPI=new Xd,this.map.MedomapTemplateFactory=new wg,this.mapPopupControl.subscribeMapClear(this.map),this.mapLeftListControl=new Qd,this.mapLeftListControl.bindLeftListActionsEvent(this.map,this.mapPopupControl),this.mapLocationsLayerControl=new Wd,this.mapLocationsLayerControl.initConfig(this.map),this.mapLocationsLayerControl.addDefaultMarkerImage(this.map,this.mapPopupControl),this.mapLeftListControl.mapLocationsLayerControl=this.mapLocationsLayerControl,this.mapImportFilesPlugins=new lm,this.mapImportFilesPlugins.mapPopupControl=this.mapPopupControl,this.mapImportFilesPlugins.mapLocationsLayerControl=this.mapLocationsLayerControl,this.mapImportFilesPlugins.subscribeMapClear(this.map),this.MapSyncMoveControlPlugins=new um,this.mapDrawControl=new Bd,this.mapDrawControl.initConfig(this.oneMapConfig),this.map.$MapEventBus.$on("map-popup-action-callback",((t,e,i)=>{this.mapPopupActionCallback&&this.mapPopupActionCallback(t,e,i)})),this.map.$MapEventBus.$on("map-show-left-list",(t=>{this.mapAddQuickQueryListPlugins(t)})),this.addInitControl(),this.map.initMapOptions.styleURL&&(this.mapStyleUrlLayer={...this.map.style.stylesheet})}getLastlayerIdIndex(){var t=this.map.style.stylesheet;if(t){return t.layers.length}return 0}addInitControl(){0!=this.oneMapConfig.controls.MapScale&&this.addScaleControl(),0!=this.oneMapConfig.controls.MapAttri&&this.addAttriControl(),this.oneMapConfig.controls.MapNav&&this.addNavControl(),0!=this.oneMapConfig.controls.MapCoordinate&&(this.coordinateControl=this.addControlByControlName(this.map,"MapCoordinateControl",this.oneMapConfig.controls.MapCoordinate)),this.oneMapConfig.controls.MapWeather&&(this.weatherControl=this.addControlByControlName(this.map,"MapWeatherControl",this.oneMapConfig.controls.MapWeather))}async mapLayerManagerAddLayer(t,e){await this.mapLayerManagerAPI.addLayer(t,e)}async mapLayerManagerRemoveLayer(t){await this.mapLayerManagerAPI.removeLayer({id:t})}addNavControl(t={}){const e=t;if(!this.navControl&&this.oneMapConfig.controls.MapNav&&("object"==typeof this.oneMapConfig.controls.MapNav&&(e.position=this.oneMapConfig.getPositionCss(this.oneMapConfig.controls.MapNav)),!this.navControl))if(this.navControl=new gm({visualizePitch:!1,showCompass:!0,showZoom:!0}),this.map.addControl(this.navControl,"bottom-right"),e.position)this.map.ExAPI.setClassPosition("mapmostgl-ctrl-bottom-right","map-control-right",e.position);else{const{classList:t}=this.navControl._container;t.contains("map-control-nav")||t.add("map-control-nav")}}addAttriControl(t={}){const e=t;this.attriControl||0==this.oneMapConfig.controls.MapAttri||("string"==typeof this.oneMapConfig.controls.MapAttri&&(e.title=this.oneMapConfig.controls.MapAttri),"object"==typeof this.oneMapConfig.controls.MapAttri&&(e.title=this.oneMapConfig.controls.MapAttri.title,e.position=this.oneMapConfig.getPositionCss(this.oneMapConfig.controls.MapAttri)),this.attriControl||(this.attriControl=new ym({customAttribution:e.title||"Map design by sipsg-medox"}),this.map.addControl(this.attriControl,"bottom-left"),this.map.ExAPI.setClassPosition("mapmostgl-ctrl-bottom-left","map-control-left",e.position)))}addScaleControl(t={}){const e=t;this.scaleControl||0==this.oneMapConfig.controls.MapScale||("object"==typeof this.oneMapConfig.controls.MapScale&&(e.position=this.oneMapConfig.getPositionCss(this.oneMapConfig.controls.MapScale)),this.scaleControl=new fm({unit:"metric"}),this.map.addControl(this.scaleControl,"bottom-left"),this.map.ExAPI.setClassPosition("mapmostgl-ctrl-bottom-left","map-control-left",e.position))}addMarkerImage(t){Fd.addMapSymbolImage(this.map,t)}unhighlight3DTiles(){this.map.unhighlight3DTiles&&this.map.unhighlight3DTiles(),this.map.unhighlightModelLayer&&this.map.unhighlightModelLayer()}mapLocationsDataByICode(t,e,i={},s){this.unhighlight3DTiles();var a=i||{};gr({method:"post",url:`${this.oneMapConfig.customURL_IQuery}/${e}`,headers:{"Content-Type":"application/json"},data:{conditions:Object.assign({project_name:"1",current:1,size:10},t)}}).then((t=>{if(200==t.code){if(s)return void s(t.data);var e=t.data[0];if(0==e.total)return;var i=e.records.filter((t=>t.shape))[0],n=void 0===a.showShape||a.showShape;if(a.highlight3DTiles){var o=a.highlight3DTiles.layerIds[0];this.map.getLayer(o)&&(this.map.highlight3DTiles(a.highlight3DTiles),n=!1,i.highlight3DTiles=a.highlight3DTiles)}var r={data:i,html:a.html||"",showShape:n,popupConfig:Object.assign({type:"mapPopup"},a.popupConfig||{}),layerkey:a.layerkey||"mapLocationsLayer",options:Object.assign({layerLabel:!1,layerLabelPoi:!0,layerType:"symbol_poi",closeMouseMoveTip:!0},a.options),noOnlyOnePopup:void 0!==a.noOnlyOnePopup&&a.noOnlyOnePopup,fitBounds:void 0===a.fitBounds||a.fitBounds};0==n?(r=Object.assign(r,a.popupConfig||{}),this.mapAddPopup(r)):this.mapAddPopup(r)}else window.MapMessage.ShowMessage({message:t.msg,type:"warning"})}))}mapLocationsData(t){var e=t;!e.layerkey&&e.layerKey&&(e.layerkey=e.layerKey),e=this.formatLocationsData(e),0==t.clear&&this.isAddLayerkey(e.layerkey||"mapLocationsLayer")?this.mapLocationsLayerControl.addDataByLayerkey(e.layerkey,e.data):this.mapLocationsLayerControl.add(this.map,e)}getLocationLayerStyle(){return this.mapLocationsLayerControl.getLocationLayerStyle()}getLayersByLayerkey(t){return this.mapLocationsLayerControl.getLayersByLayerkey(t)}isAddLayerkey(t){return!!t&&this.mapLocationsLayerControl.getSourceByLayerkey(t)}formatLocationsData(t){var e;switch(typeof t){case"string":(e={data:[{shape:t}]}).options=Object.assign({layerLabel:!1,layerLabelPoi:!1,layerType:"symbol_poi",closeMouseMoveTip:!0},e.options||{}),e=Object.assign({fitBounds:!0},e);break;case"object":if(Array.isArray(t))(e={data:t}).data=e.data.map((t=>({shape:t}))),e.options=Object.assign({layerLabel:!1,layerLabelPoi:!1,layerType:"symbol_poi",closeMouseMoveTip:!0},e.options||{}),e=Object.assign({fitBounds:!0},e);else"string"==typeof t.data&&(t.data=[t.data]),"string"==typeof t.data[0]&&(t.data=t.data.map((t=>({shape:t})))),e=t;break;default:e=t}return e}removeHighLightFeatures(t){this.mapLocationsLayerControl.removeHighLightFeatures(t)}mapLocationsDragEdit(t,e={}){this.mapLocationsLayerControl.dragEdit(((e,i)=>{t&&t(e,i)}),e)}mapLocationsCloseDragEdit(){this.mapLocationsLayerControl.closeDragEdit()}removeMapLocationsData(t,e){t||(this.mapLocationsLayerControl.activeKey="mapLocationsLayer"),this.mapLocationsLayerControl.clear((()=>{e&&e()}),t)}setStyle(t,e){this.map.GLSDK.mapReload(),this.map.setStyle(t,e||{}),this.map.once("style.load",(()=>{this.map.setStyleInit&&this.map.setStyleInit(),this.map.M.layerManager.initData()}))}setStyleRemain(t,e){this.map.M.pubsub.publish("clearAllLayer");const i=this.map.M.iqueryManager.active;document.getElementById("map2")||this.map.M.clear(),this.mapLocationsLayerControl.addDefaultMarkerImage(this.map,this.mapPopupControl),this.map.setStyle(t,e||{}),this.map.mapIsLoading=!0,this.map.once("style.load",(()=>{this.map.mapIsLoading=!1,this.map.setStyleInit&&this.map.setStyleInit(),this.map.M.layerManager.initData(),this.map.setStyleInitAddCheckLayer&&this.map.setStyleInitAddCheckLayer(),i&&this.ChangeIQuery(i)}))}getSaveOrderLayersId(t="t_base"){var e={};let i=JSON.parse(JSON.stringify(this.map.style._order)),s=i.findIndex((e=>e===(t||"t_base")));return i=i.slice(s),i.forEach((t=>{e[t]=this.map.getLayer(t)})),e}setStyleMap2(t,e,i){i.M.pubsub.publish("clearAllLayer"),i.setStyle(t,e||{}),i.once("style.load",(()=>{i.setStyleInit&&i.setStyleInit(),i.M.layerManager.initData(),i.setStyleInitAddCheckLayer&&i.setStyleInitAddCheckLayer()}))}setMap2ViewMode(t){var e=this.getSyncMap();e&&("2D"==t||"2d"==t?(e.setBearing(0),e.setPitch(0),e.dragRotate.disable(),e.touchZoomRotate.disableRotation()):(e.setBearing(0),e.setPitch(45),e.dragRotate.enable(),e.touchZoomRotate.enableRotation()))}addDataByLayerkey(t,e){this.mapLocationsLayerControl.addDataByLayerkey(t,e)}mapStartDraw(t,e){return null==this.mapDrawControl?(this.mapDrawControl=new Bd,this.mapDrawControl.initConfig(this.oneMapConfig),setTimeout((()=>{this.mapDrawControl.start(this.map,t,((t,i,s)=>{e&&e(t,i)}))}),300)):this.mapDrawControl.start(this.map,t,((t,i,s)=>{e&&e(t,i,s)})),this.mapDrawControl}mapCloseDraw(){this.mapDrawControl&&this.mapDrawControl.destory()}mapClearDraw(){this.mapDrawControl&&(this.mapDrawControl.clear(),this.mapDrawControl.destory())}mapAddPopup(t){if(t.showShape)return t.shape&&(t.data=[{id:"定位点",name:"定位点",label:"定位点",shape:t.shape,iQueryList:[],extras:[]}]),void this.mapLocationsData({popupConfig:Object.assign({type:t.type||"mapPopup",position:t.position||"",options:t.options||{}},t.popupConfig||{}),options:Object.assign({layerLabel:!1,layerLabelPoi:!0,layerType:"symbol_poi",closeMouseMoveTip:!0},t.options||{}),layerkey:t.layerkey||"mapLocationsLayer",data:Array.isArray(t.data)?t.data:[t.data],fitBounds:void 0===t.fitBounds||t.fitBounds,closeAllFitBounds:void 0!==t.closeAllFitBounds&&t.closeAllFitBounds,apiId:void 0!==t.apiId?t.apiId:"",noOnlyOnePopup:void 0!==t.noOnlyOnePopup&&t.noOnlyOnePopup});t.html?this.mapPopupControl.addDom(this.map,t):this.mapPopupControl.add(this.map,t,((t,e)=>{this.mapPopupActionCallback&&this.mapPopupActionCallback(t,e)}))}removeMapPopup(){this.mapPopupControl.close(),this.unhighlight3DTiles()}mapAddPopupWindow(t,e,i=[850,600],s){t&&((e||{}).name=t),this.mapPopupControl.actionMoreInfo({id:Math.random(),templateId:Math.random(),extraCode:"moreinfo",extraName:t||"更多信息",extraMethod:`moreinfo?layer_w=${i[0]}&layer_h=${i[1]}`,isFull:0,isIquery:1},e,s)}mapAddQuickQueryListPlugins(t){if(1==this.map.activeToolsDp){new MedomapListDpPlugins({localData:t.data,showShape:void 0===t.showShape||t.showShape}).addTo(this.map)}else this.mapLeftListControl.add(this.map,t)}mapAddUploadShapefilesPlugins(t={},e){this.mapImportFilesPlugins.add(t,this.map,(t=>{e&&e(JSON.parse(JSON.stringify(t)))}))}getWebPrintMap(){return this.mapWebPringPluginsControl?this.mapWebPringPluginsControl.mapPrint:null}mapAddWebPrintPlugins(t,e){this.mapWebPringPluginsControl&&this.mapWebPringPluginsControl.destory(),setTimeout((()=>{this.mapWebPringPluginsControl=new om(t),this.mapWebPringPluginsControl.addTo(e||this.map)}),200)}removeWebPrintPlugins(){this.mapWebPringPluginsControl&&this.mapWebPringPluginsControl.destory()}mapAddTracelineslidePlugins(t){return this.timer001&&clearTimeout(this.timer001),this.timer001=setTimeout((()=>{this.mapPopupControl.mapPopupTraceLineSlider({extraMethod:t.url},t.data,t)}),200),this.mapPopupControl.traceSliderPlugin}removeTracelineslidePlugins(t){this.mapPopupControl.removeTracelineslidePlugins(t)}mapReload(){this.map.M.pubsub.publish("clearAllLayer"),this.map.M.pubsub.publish("mapReload"),this.map.M.clear();const t=this.map.M.view.get();var{enableTransform:e}=this.map,{center:i}=t;e&&i[0]>180&&(t.center=this.map.M.projTransform(this.map.enableTransform.srid,null,i));var s=JSON.parse(JSON.stringify(t));this.map.flyTo(s),this.mapLocationsLayerControl.addDefaultMarkerImage(this.map,this.mapPopupControl)}destoryWebgl(t){if(t){let i=t.getCanvas();var e=1==t._useWebGL2?"webgl2":"webgl";let s=i.getContext(e);s&&s.getExtension("WEBGL_lose_context")&&s.getExtension("WEBGL_lose_context").loseContext()}}changeBaseMap(t,e){var i=t;void 0!==e&&(i={styleIndex:e,index:t}),setTimeout((()=>{this.map.$MapEventBus.$emit("onemap-change-basemap",i)}),500)}changeMapLayer(t,e){this.map.$MapEventBus.$emit("onemap-change-maplayer",{id:t,visible:e}),this.changeMapLayerDefault.push({id:t,visible:e})}getLayerIdsByTreeid(t,e){this.map.$MapEventBus.$emit("onemap-get-layerids",{id:t,callback:e})}getQueryLayerRealIdsByMapLayerId(t){return this.map.M.layerManager.getQueryLayerRealIdsByMapLayerId(t)||[]}getQueryLayerRealIdsByTreeId(t,e){this.map.$MapEventBus.$emit("onemap-get-layerids",{id:t,render:!0,callback:e})}mapLayerChangeCheck(t,e,i){this.layerCheckCallback&&this.layerCheckCallback(JSON.parse(JSON.stringify(t)),e,i)}ChangeIQuery(t,e=!1){if(e&&this.map.M.pubsub.publish("ChangeIQueryActive",t),0==this.oneMapConfig.controls.MapTools||!document.getElementById("MapIQuery")&&!document.getElementById("IQuery")||e){if(!t)return this.map.M.iqueryManager.clear(),void(this.activeIquery=!1);if(this.activeIquery&&this.map.M.iqueryManager.active)return;this.map.M.iqueryManager.create(),this.activeIquery=!0}else this.map.M.pubsub.publish("ChangeIQuery",t)}getOptionData(t){const e=this.oneMapConfig.getOptionData(this.mapContainerID,t);return e?JSON.parse(JSON.stringify(e)):null}setUIStyle(t){const{UIStyle:e}=this.oneMapConfig.controlsUIStyle;if("BLUE-GREEN-ALGAE"===e){var i;if(this.map.UIStyle=e,0!=this.oneMapConfig.controlsUIStyle.MapSwitch){i=this.oneMapConfig.controlsUIStyle.MapSwitch;const t=new MedomapSwitchDpPlugins(Object.assign({domid:"medomap-switch-control"},"object"==typeof i?i:{}));t.addTo(this.map),this.MedoMapUIStyleControl.MedomapSwitchDpPlugins=t}if(0!=this.oneMapConfig.controlsUIStyle.MapTools){i=this.oneMapConfig.controlsUIStyle.MapTools;const t=new MedomapToolsDpPlugins(Object.assign({domid:"medomap-tools-control"},"object"==typeof i?i:{}));t.addTo(this.map),this.MedoMapUIStyleControl.MedomapToolsDpPlugins=t}if(0!=this.oneMapConfig.controlsUIStyle.MapSearch){i=this.oneMapConfig.controlsUIStyle.MapSearch;const t=new MedomapSearchDpPlugins(null,Object.assign({},"object"==typeof i?i:{}));t.addTo(this.map),this.MedoMapUIStyleControl.MedomapSearchDpPlugins=t}if(0!=this.oneMapConfig.controlsUIStyle.MapLayerManager){i=this.oneMapConfig.controlsUIStyle.MapLayerManager;const t=new MedomapLayerManagerDpPlugins(null,Object.assign({domid:"map_plugins_layertree"},"object"==typeof i?i:{}));t.addTo(this.map),this.MedoMapUIStyleControl.MedomapLayerManagerDpPlugins=t}this.setTheme("blue-algae")}t&&t(e)}setTheme(t="common"){this.oneMapConfig.setTheme(t),this.map.themesKey=t}getOnemapConfig(){return this.map.getOnemapConfig()}removeTheme(t){this.oneMapConfig.removeTheme(t)}setUIPosition(t,e){if(e.position)switch(t){case"MapTools":case"MapSearch":case"MapSwitch":case"MapLayerManager":case"MapLeftList":if(this.map.UIStyle){this.setUIPositionDp(t,e);break}this.map.$MapEventBus.$emit("setUIPosition",{keys:t,position:e.position}),"MapSearch"==t&&setTimeout((()=>{this.map.MedomapTemplateFactory.setMapListDefaultPosition()}),1e3),"MapTools"==t&&setTimeout((()=>{this.map.MedomapTemplateFactory.setMapImportFileDefaultPosition()}),1e3);break;case"MapCoordinate":this.coordinateControl.setPosition(e.position);break;case"MapWeather":this.weatherControl.setPosition(e.position);break;case"MapAttri":case"MapScale":var i=this.map.ExAPI.getPositionStyle(e.position);this.map.ExAPI.setClassPosition("mapmostgl-ctrl-bottom-left","map-control-left",i);break;case"MapNav":var s=this.map.ExAPI.getPositionStyle(e.position);this.map.ExAPI.setClassPosition("mapmostgl-ctrl-bottom-right","map-control-right",s)}}setUIPositionDp(t,e){switch(t){case"MapTools":this.MedoMapUIStyleControl.MedomapToolsDpPlugins.setPosition(e.position);break;case"MapSearch":this.MedoMapUIStyleControl.MedomapSearchDpPlugins.setPosition(e.position);break;case"MapSwitch":this.MedoMapUIStyleControl.MedomapSwitchDpPlugins.setPosition(e.position);break;case"MapLayerManager":this.MedoMapUIStyleControl.MedomapLayerManagerDpPlugins.setPosition(e.position)}}addLayerEx(t){if("popup_poi"===(t?t.type:"")){var e=t.layer.styleConfig||{},i=t.layer["text-field"]||"{name}",s=t.layer["icon-image"]||"";t.layer.popup_default&&(e=MedomapPopupDpFactory[t.layer.popup_default]),"geojson"==t.source.type&&MedomapPopupDpFactory.addDatasFromGeoJSON(this.map,t.source.data,e,t,{textField:i,iconImage:s,geoMapMarkerList:t.geoMapMarkerList})}}removeLayerEx(t){if("popup_poi"===t.type)MedomapPopupDpFactory.removeAll(t.id)}flyToCenter(t,e){this.map&&this.map.ExAPI.flyToCenter(this.map,t,e)}showMapCenter(){if(this.map){let t=this.map.getCenter();t.lng&&(t=[t.lng,t.lat]),t.x&&(t=[t.x,t.y]),t.push(this.map.getZoom()),alert(`获取地图范围(中心点+层级):[${t}]`)}}mapChangeLayersByRole(t){(t.roleId||t.mapOptions)&&(this.map.M.pubsub.publish("clearAllLayer"),this.map.M.clear(),this.mapLocationsLayerControl.addDefaultMarkerImage(this.map,this.mapPopupControl),this.map.$MapEventBus.$emit("map-change-layers-by-role",t))}addLocationQuery(t){this.MapLocationQueryControl&&this.MapLocationQueryControl.remove();const e=new hm(t);e.addTo(this.map),this.MapLocationQueryControl=e}removeLocationQuery(){this.MapLocationQueryControl&&(this.MapLocationQueryControl.destory(),this.MapLocationQueryControl=null)}clear(){this.map.M.clear()}clearOverlay(t,e){this.mapPopupControl.destory(),this.mapLocationsLayerControl.destory(t,e),this.mapClearDraw(),setTimeout((()=>{this.map.M.iqueryManager.active&&this.map.ExAPI.setCursor("help")}),1e3)}clearOverlayByIcxCode(t){var e=t;Array.isArray(e)&&e.forEach((t=>{this.mapPopupControl.destoryByIcxCode(t);this.mapLeftListControl.getExistIcxCode(t)||this.mapLocationsLayerControl.destoryByIcxCode(t)}))}setMapToolsVisible(t){this.map.$MapEventBus.$emit("set-maptools-visible",t)}setOnlyPickUp(t,e,i,s=!0){this.onlyPickUpVisible=t;var a=e||{};t&&s&&this.clearOverlay();var n=void 0===i||i;this.map.M.iqueryManager.onlyPickUp={visible:t,clear:n,renderStyle:a}}clearOnlyPickUpData(t,e){if(t&&e){var i=t+"_layersPickup";i=-1==t.indexOf("_layersPickup")?t+"_layersPickup":t,this.mapLocationsLayerControl.removeAddDataToLayerKey(i,e)}}getAllCheckedIds(){return this.map.M.getAllCheckedIds&&this.map.M.getAllCheckedIds()||[]}setAllCheckedIds(t){this.map.M.setAllCheckedIds&&this.map.M.setAllCheckedIds(t)}getSyncMap(){return this.MapSyncMoveControlPlugins?this.MapSyncMoveControlPlugins.getMap2():null}async fitBoundsToMapFromWkt(t,e){if(!t)return;var i=e||{};let s=await Ep(t);this.fitBounds(s,i)}fitBounds(t,e){var i=[[t[0],t[1]],[t[2],t[3]]];let s=Array.isArray(t[0])?t:i;var a=this.map.enableTransform;a&&(s=np(a.srid,null,s)),this.map.sz2000sdk&&(s[0]=this.map.MapmostSDKConvert.fromDefinedProj(s[0]),s[1]=this.map.MapmostSDKConvert.fromDefinedProj(s[1]));var n=this.map.getZoom();var o=.15*this.map.getContainer().clientWidth;o=o>=200?200:o;var r=Object.assign({padding:o,pitch:this.map.getPitch(),bearing:0,curve:1,maxZoom:n>=16.5?n:16.5,essential:!0},e);return this.map.fitBounds(s,{...r}),s}setLayerFilter(t){const e=t.id,i=t.name;e&&(this.layerFilterData[e]=t.filter),i&&(this.layerFilterData[i]=t.filter),this.map.M.layerManager.setLayerFilter(e||i,t.filter)}getLayerFilter(t,e){return this.layerFilterData[e.id]||this.layerFilterData[t.id]||this.layerFilterData[t.virtualId]||this.layerFilterData[t.label]||null}onClick(t,e){this.onClickEventObj[t]=e}offClick(t){delete this.onClickEventObj[t]}getOnClickFun(t){return this.onClickEventObj[t.layer.id]||this.onClickEventObj[t.layerName]}highLightLayer(t,e){var i=this.map.getLayer(t);if(i){const t=i.source;var s=this.map.M.layerManager.layers[t];s&&s.highLight(i,e)}this.highLightLayerTemp[t]=e}unHighLightLayer(t){var e=this.map.getLayer(t);if(e){const t=e.source;var i=this.map.M.layerManager.layers[t];i&&i.unHighLight({source:t,sourceLayer:e["source-layer"]})}delete this.highLightLayerTemp[t]}removeAllHighLightLayer(){for(var t in this.highLightLayerTemp)this.unHighLightLayer(t)}flyTo(t){var{enableTransform:e}=this.map,{center:i}=t;e&&i[0]>180&&(t.center=np(e.srid,null,i)),this.map.sz2000sdk&&(t.center=this.map.MapmostSDKConvert.fromDefinedProj(i));var s=JSON.parse(JSON.stringify(t));this.map.flyTo(s)}getLayerDataById(t){return Zo(this.oneMapConfig.getOptionData(this.mapContainerID,"MapLayers"),"id",t)}getImageCompareData(){return this.oneMapConfig.getOptionData(this.mapContainerID,"ImageCompareLayers")}addHaloSun(t){var e=Object.assign({sunBrightness:1,sunDir:[1,.5,0],sunColor:[.5,.6,.7],enabled:!0},t||{});return!this.haloSunInstance&&e.enabled&&(this.haloSunInstance=I.default.PostProcessStageLibrary.initHaloSun(this.map),map.addPostProcess(this.haloSunInstance)),this.haloSunInstance.sunBrightness=e.sunBrightness,this.haloSunInstance.sunDir=e.sunDir,this.haloSunInstance.sunColor=e.sunColor,this.haloSunInstance.enabled=e.enabled,this.haloSunInstance}toolsOnClick(t,e){this.map.GLSDK.toolsOnClickCallback&&this.map.GLSDK.toolsOnClickCallback(t,e),e&&t&&t.mapToolName&&this.writeLog("MAP_TOOL_CLICK",t.mapToolName)}setParamsToQuery(t){this.queryParamsExtra=t||{}}setMapLayerManagerVisible(t){this.map.$MapEventBus.$emit("onemap-map-layer-manager-visible",t)}setMapControlsVisible(t,e){var i={key:t,visible:e};if(this.map.$MapEventBus.$emit("onemap-mapcontrols-visible",i),"MapSearch"===i.key)this.mapLeftListControl&&this.mapLeftListControl.setVisible(i.visible)}getLayerInstanceByTreeId(t){return this.map.M.layerManager.getLayerInstanceByTreeId(t)}get3DLayerInterCoordinate(t,e,i){var s,a=t.point,n=t.pickPoint;const{altitude:o}=n;if(o>0)s=[n.lng,n.lat,n.altitude];else{var r=i||this.map.M.layerManager.getLayerInstanceFilter(["model","3dtiles"],e);r.length>0&&r.forEach((t=>{const e=t.layerType;var i;if("model"==e?i=this.getModelLayerIntersectCoordinate(a,null,[t]):"3dtiles"==e&&(i=this.get3DTileLayerPickCoordinate(a,null,[t])),i){const t=i[2];if(s){t>s[2]&&(s=i)}else s=i}})),s||(s=[n.lng,n.lat,n.altitude])}return s}getModelLayerIntersectCoordinate(t,e,i){var s=i||this.map.M.layerManager.getLayerInstanceByTreeId(e);if(s){if(s.length>0){var a=s[0].sceneMapLayerAll;if(a){let e=a.selectModel(t)[0];if(e&&e.point){return a.getIntersectCoordinate(e)}}}}return null}get3DTileLayerPickCoordinate(t,e,i){var s=i||this.map.M.layerManager.getLayerInstanceByTreeId(e);if(s){if(s.length>0){var a=s[0].layerRender;if(a){return a.pickCoordinate(t)}}}return null}showMouseMoveTips(t,e){var i=document.getElementById(this.mouseMoveTipsId);if(i)return i.style.left=`${t.x}px`,void(i.style.top=`${t.y}px`);let s=document.createElement("div");s.id=this.mouseMoveTipsId,s.className="map-tips-container";let a=document.createElement("div");a.className="map-tips-content",a.innerText=e,s.appendChild(a.cloneNode(!0)),s.style.left=`${t.x}px`,s.style.top=`${t.y}px`;const n=document.getElementById(this.mapContainerID);n?n.getElementsByClassName("mapmostgl-control-container")[0].appendChild(s):document.body.appendChild(s)}removeMouseMoveTips(){var t=document.getElementById(this.mouseMoveTipsId);t&&t.remove()}clipMapImageByData(t,e,i){let s=t,a=[];"string"==typeof s?(s=Pp.st_shape2geojson2(s),a.push(s)):a=Array.isArray(s)?s.map((t=>"object"==typeof t?t:Pp.st_shape2geojson2(t))):s.features;let n=Object.assign({fitBounds:!0,name:"map",format:"png",downloadEnable:!0,waterMarkEnable:!1},e);if(n.waterMarkEnable){const t=this.map.getWaterMarkImg();if(t&&t.img){var o=t.img;if(o){return void im(this.map.getCanvas().toDataURL(),o,(t=>{n.dataUrl=t,nm(this.map,a,n,(t=>{n.downloadEnable&&em(t,n.name,n.format),i&&i(t)}))}))}}}const r=nm(this.map,a,n);return n.downloadEnable&&em(r,n.name,n.format),r}mapActiveTools(t){this.activeTools&&t&&this.activeTools.name==t.name||(this.activeTools&&this.activeTools.close&&this.activeTools.close(),this.activeTools=null,this.activeTools=t)}readFilesToGeoJSON(t,e,i={}){if(!t||0==t.length||!e)return;const s=this.map.GLSDK.getOnemapConfig().customURL_ReadGeoJSONByFile;let a=i||{};dr.postShape({url:s,files:t,extras:a}).then((t=>{e&&e(t)}))}writeLog(t,e,i=""){if(this.oneMapConfig&&this.oneMapConfig.logEnable)try{var s={url:this.oneMapConfig.customURL_TrackingReport,params:{trackType:"MAP_OPERATION",subType:t,elementName:e,pageUrl:i||this.pagePath||""}};dr.post(s)}catch(t){console.log(t)}}}const Lm={name:"MapmostOnemapViewX",components:{MapBaseView:ad},provide(){return{onemapConfig:this.getOnemapConfig}},props:{container:{type:String,default:()=>"container"},appId:{type:String,default:()=>""},roleId:{type:String,default:()=>""},appCode:{type:String,default:()=>"web"},global:{type:String,default:()=>""},mapCustomURL:{type:String,default:()=>""},locationQueryServiceCode:{type:String,default:()=>""},mapStyleConfig:{type:Object,default:()=>({})},closeLoading:{type:Boolean,default:()=>!1},requestForcePost:{type:Boolean,default:()=>!1},observeMap:{type:Boolean,default:()=>!0},originReplace:{type:Boolean,default:()=>!1},repairClockLineToPolygon:{type:Boolean,default:()=>!1},mapOptions:{type:Object,default:()=>({})},mapmostOption:{type:Object,default:()=>({})},option:{type:Object,default:()=>({container:"",global:"medox",appId:"map_"+Math.random(),roleId:"",appCode:"web",mapCustomURL:"",locationQueryServiceCode:"",mapStyleConfig:{},mapOptions:"",mapmostOption:{},closeLoading:!1,requestForcePost:!1,observeMap:!0,originReplace:!1,repairClockLineToPolygon:!1})}},data(){return{loaded:!1,isShowMap:!1,mapBaseViewKey:"",mapOptionConfig:null,currentZoom:"",sysOptions:{container:this.container,appId:this.appId,global:this.global,roleId:this.roleId,appCode:this.appCode,mapCustomURL:this.mapCustomURL,mapStyleConfig:this.mapStyleConfig,mapOptions:this.mapOptions,mapmostOption:this.mapmostOption,customAxios:"",closeLoading:this.closeLoading,requestForcePost:this.requestForcePost,observeMap:this.observeMap,locationQueryServiceCode:this.locationQueryServiceCode,originReplace:this.originReplace,repairClockLineToPolygon:this.repairClockLineToPolygon},mapContainerDomId:null,oneMapConfig:{}}},created(){this.mapContainerDomId=this.option.container||"container"+Math.floor(999*Math.random()),this.oneMapConfig=lr.load(this.mapContainerDomId),this.oneMapConfig.initAllAPI(this.option.global,this.option.mapCustomURL)},mounted(){this.oneMapConfig.loadControl(),this.oneMapConfig.setOptionComponents(JSON.parse(JSON.stringify(this.option))),this.timer001=setTimeout((()=>{this.loaded=!0}),1e4),this.mapBaseViewKey=(new Date).getTime(),this.option&&Object.assign(this.sysOptions,this.option),this.sysOptions.mapCustomURL||(this.sysOptions.mapCustomURL=this.oneMapConfig.customURL_Init),this.sysOptions.closeLoading&&(this.loaded=!0),this.sysOptions.requestForcePost&&(this.oneMapConfig.requestForcePost=!0),void 0!==this.sysOptions.observeMap&&(this.oneMapConfig.observeMap=this.sysOptions.observeMap),this.sysOptions.locationQueryServiceCode&&!this.oneMapConfig.locationQueryServiceCode&&(this.oneMapConfig.locationQueryServiceCode=this.sysOptions.locationQueryServiceCode),this.sysOptions.originReplace&&(this.oneMapConfig.originReplace=!0),void 0!==this.sysOptions.repairClockLineToPolygon&&(this.oneMapConfig.repairClockLineToPolygon=this.sysOptions.repairClockLineToPolygon),this.sysOptions.mapmostOption&&(this.oneMapConfig.mapmostOption=this.sysOptions.mapmostOption),this.sysOptions.appCode&&(this.oneMapConfig.appCode=this.sysOptions.appCode),this.sysOptions.mapOptions&&"{}"!==JSON.stringify(this.sysOptions.mapOptions)?this.handlerMapOptions({code:200,data:JSON.parse(JSON.stringify(this.sysOptions.mapOptions))}):this.getData(),this.mapGL=new Cm},methods:{getOnemapConfig(){return lr.getConfig(this.mapContainerDomId)},mapChangeLayersByRole(t){t.roleId&&(this.sysOptions.roleId=t.roleId),t.mapOptions&&!t.roleId?this.changeRole(t.mapOptions,t):this.getData((e=>{this.changeRole(e.data,t)}))},changeRole(t,e){const i=t;this.mapOption.extents=i.extents,this.mapOption.MapLayers=i.mapLayers?i.mapLayers:[],this.mapOption.CommonOptions=i.commonOptions,this.oneMapConfig.setMapOptions(this.mapOption),this.$refs["map-base-view"].mapChangeLayersByRole(this.mapOption,e)},getData(t){const e=this.oneMapConfig.customURLMapConfig;dr.get({url:e,nomessage:!0,params:{roleId:this.sysOptions.roleId,appCode:this.sysOptions.appCode||"web",mapEngine:"mapmost"}}).then((e=>{const{code:i}=e;if(200==i){if(t)return void t(e);this.handlerMapOptions(e)}else this.$message({type:"warning",message:`${e.msg||"地图配置信息无返回!"}`,showClose:!0})}))},handlerMapOptions(t,e){const{code:i,data:s}=t;if(200==i){if(!this.isvaild(s))return;if(s.mapOptions.epsg4528&&delete s.mapOptions.epsg4528,s.mapOptions.projection&&(s.mapOptions.srid=s.mapOptions.projection,delete s.mapOptions.projection,this.sysOptions.projection&&(s.mapOptions.srid=this.sysOptions.projection)),null!=s.mapOptions.styleURL&&(s.mapOptions.epsg4528=!1),"object"==typeof this.sysOptions.mapStyleConfig){const{glyphsFonts:t,locationsPoi:e,enableTransform:i,mapmostStyleJson:a}=this.sysOptions.mapStyleConfig;if(t&&this.oneMapConfig.setGlyphsFonts(t),e&&(this.oneMapConfig.locationsPoi=e),a&&(this.oneMapConfig.mapmostStyleJson=a),i&&i.srid)this.oneMapConfig.enableTransform=i,delete s.mapOptions.projection,delete s.mapOptions.srid;else{const t=s.mapOptions.projection||s.mapOptions.srid||"";t&&!["4490","local","sz2000","sz2000sdk"].includes(t)&&(this.oneMapConfig.enableTransform={srid:t},delete s.mapOptions.projection,delete s.mapOptions.srid)}i&&i.defineProject&&vr.addDefineProject(i.defineProject)}this.mapOption={MapOptions:s.mapOptions,extents:s.extents||[],MapTools:s.mapTools||[],MapLayers:s.mapLayers?s.mapLayers:[],BaseMap:s.baseMap||[],QuickSearch:s.quickSearch||[],CommonOptions:s.commonOptions,mapStyleConfig:this.sysOptions.mapStyleConfig||"",Container:this.mapContainerDomId,styleURL:s.mapOptions.styleURL,accessToken:s.mapOptions.accessToken,ImageCompareLayers:s.imageCompareLayers||[]},this.oneMapConfig.accessToken=this.mapOption.accessToken,this.mapOption.mapStyleConfig&&("object"==typeof this.mapOption.mapStyleConfig.iqueryBuffer&&Object.assign(this.oneMapConfig.iqueryBuffer,this.mapOption.mapStyleConfig.iqueryBuffer),"object"==typeof this.mapOption.mapStyleConfig.renderDefaultStyle&&Object.assign(this.oneMapConfig.renderDefaultStyle,this.mapOption.mapStyleConfig.renderDefaultStyle)),this.mapOption.MapOptions.customURL=this.sysOptions.mapCustomURL,this.sysOptions.customAxios&&(this.mapOption.MapOptions.customAxios=this.sysOptions.customAxios),this.isShowMap=!0}},isvaild(t){return(t.baseMap||t.mapOptions)&&(null!=t.baseMap||t.mapOptions.styleURL)?!(null==t.extents||!t.commonOptions.options)||(this.$message({type:"warning",message:"地图范围未配置!",showClose:!0}),!1):(this.$message({type:"warning",message:"基础底图未配置!",showClose:!0}),!1)},mapSuccessBefore(t){this.loaded=!0,this.$emit("loadBefore",t)},mapSuccess(t){this.loaded=!0,this.map=t,this.mapGL.init(this.map),this.map.GLSDK=this.mapGL,this.oneMapConfig.setMapOptions(this.mapOption),this.map.GLSDK.setUIStyle(),this.map.M.layerManager.addDefaultCheckedLayerEx(),this.timer001&&clearTimeout(this.timer001),this.timer002&&clearTimeout(this.timer002),this.timer002=setTimeout((()=>{this.map.M.layerManager.mapLayerChangeDefaultChecked()}),200),this.map.$MapEventBus.$on("map-change-layers-by-role",(t=>{this.mapChangeLayersByRole(t)})),this.map.stopPropagation=t=>this.stopPropagation(t),this.$emit("success",this.map,this.mapGL),this.map.M.pubsub.publish("map-sucess");const e=this.$route?.path||"";this.map.GLSDK.pagePath=e},stopPropagation(t){if(this.map){if(this.map.DrawAction&&this.map.DrawAction.instance.active)return!0;if(this.map.MeasureAction&&this.map.MeasureAction.instance.active)return!0;if(this.map.Draw&&this.map.Draw.isDoingDraw)return!0;if(this.map.isDragEdit)return!0;if(this.map.GLSDK){if(this.map.M.isDoingDraw||this.map.GLSDK.mapDrawControl.isDoingDraw)return!0;if(this.map.GLSDK.mapDrawControl.getClickSelectFeatures(t))return!0}return!1}return!1},getMapGL(){return this.mapGL},getMap(){return this.map},getMapmostWebGL:()=>I.default}};var Mm=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.isShowMap?i("map-base-view",{directives:[{name:"loading",rawName:"v-loading",value:!t.loaded,expression:"!loaded"}],key:t.mapBaseViewKey,ref:"map-base-view",staticClass:"mx-map-container",attrs:{id:"mx-onemap-components","element-loading-text":"正在初始化地图......","element-loading-spinner":"el-icon-loading","element-loading-background":"rgba(0, 0, 0, 0.65)",option:t.mapOption},on:{success:t.mapSuccess,"success-before":t.mapSuccessBefore},scopedSlots:t._u([t._l(t.$scopedSlots,(function(e,i){return{key:i,fn:function(e){return[t._t(i,null,null,e)]}}}))],null,!0)},[t._t("default")],2):t._e()};Mm._withStripped=!0;const bm=bi({render:Mm,staticRenderFns:[]},undefined,Lm,"data-v-444f51fa",false,undefined,!1,void 0,void 0,void 0);bm.install=t=>{t.component(bm.name,bm)};var wm={props:{visible:{type:Boolean,default:()=>!1},activeName:{type:String,default:"地图打印"}},provide(){return{getMap:this.getMap,getWebPrintMap:this.getWebPrintMap}},components:{MapmostOnemapView:bm},mounted(){this.initMap(),this.changeMapSize()},data:()=>({componentSlot:{},acceptFileType:".dwg,.shp,.zip",mask:!1,loaded:!1,mapLegendVisible:!1,mapOption:{},isShowMap:!1,mapBaseViewKey:"",printPages:{A4_landscape:["1096px","606px"],A4_portrait:["730px","860px"],A3_landscape:["1534px","802px"],A3_portrait:["1074px","1220px"],A2_landscape:["2140px","1210px"],A2_portrait:["1486px","1850px"]},domid:"mx-map-webprint-panel",title:"Web打印出图",activeNames:"1",actionsUrl:"",styleConfig:{},position:"",activeDraw:"",lineStyleList:[{label:"虚线",value:"dash"},{label:"实线",value:"soild"}],drawTypeModeList:[{label:"单个绘制",value:"single"},{label:"连续绘制",value:"persistent"}],textFontSizeList:["10px","12px","14px","16px","18px","20px","22px","24px","26px","28px","30px","34px","36px","48px"],templatePageList:[{label:"A4 横向",value:"A4_landscape"},{label:"A4 纵向",value:"A4_portrait"},{label:"A3 横向",value:"A3_landscape"},{label:"A3 纵向",value:"A3_portrait"},{label:"A2 横向",value:"A2_landscape"},{label:"A2 纵向",value:"A2_portrait"}],dpiList:[{label:96,value:96},{label:300,value:300},{label:600,value:600},{label:960,value:960},{label:1200,value:1200}],activeLoadingPrint:!1,controls:{templatePage:!0,title:!0,subtitle:!0,copyRight:!0,date:!1,author:!0,iscenter:!0,isLegend:!0},form:{templatePage:"A4_landscape",title:"某某专题图",centerTitle:"",subtitle:"",copyRight:"",date:"",author:"",formate:"PDF",textContent:"文本标注",scale:"",dpi:96,iscenter:!1,isLegend:!0},renderStyle:{color:"rgba(255, 0, 0, 0.8)",fillColor:"rgba(255, 0, 0, 0.25)",width:2,textColor:"rgba(0, 0, 0, 1)",textFontSize:"14px",textHaloWidth:5,textHaloColor:"rgba(255, 255, 255, 1)",lineStyle:"soild",drawTypeMode:"single"},styleCss2:{},compass:!1,compassPosition:{},dragResizeConfig:{w:100,h:100,z:2,left:0,top:0,parentW:500,parentH:900},activeDrag:!1,refreshVisible:!1}),methods:{getMap(){return this.getMapClone()},getWebPrintMap(){return this.getWebPrintMapClone()},refreshSelectText(){},commandDrop(t){this.renderStyle.textFontSize=t},closeDom(){this.mask&&this.close()},changePage(t){this.changeMapSize()},mapSuccess(t){this.mapSuccessPrintMap(t),this.loaded=!0,this.setCompass(t)},setCompass(t){if(this.compass){this.refreshVisible=!1;let e=t.getContainer();this.dragResizeConfig.parentW=e.offsetWidth,this.dragResizeConfig.parentH=e.offsetHeight,this.dragResizeConfig.left=parseFloat(this.compassPosition.left),this.dragResizeConfig.top=parseFloat(this.compassPosition.top),this.refreshVisible=!0}},mapSuccessPrintMap(){},close(){},changeDpi(){},changeScale(){},mapDraw(){},closeDraw(){},clearDraw(){},changeCollapse(){},removeSelectedDraw(){},print(){},exportPrint(){},changeMapSize(){let t={},e=this.printPages[this.form.templatePage];t.width=e[0],t.height=e[1],this.styleCss2=t}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};const Sm=wm;var Im=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-webprint-tool-control animate__animated animate__fadeIn",attrs:{id:t.domid}},[t.mask?i("div",{staticClass:"mx-mask-print",on:{click:function(e){return e.stopPropagation(),t.closeDom.apply(null,arguments)}}}):t._e(),t._v(" "),i("div",{staticClass:"map-container-content",attrs:{id:"mx-map-container-drag"}},[i("div",{staticClass:"mx-map-webprint-panel"},[i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"mx-webprint-title",attrs:{id:"mx-map-container-drag"}},[t._v(t._s(t.title))]),t._v(" "),i("div",{staticClass:"mx-webprint-close"},[i("i",{staticClass:"el-icon-close",on:{click:t.close}})]),t._v(" "),i("el-form",{ref:"form",staticClass:"mx-print-form",attrs:{model:t.form,"label-width":"85px"}},[i("el-collapse",{attrs:{accordion:""},on:{change:t.changeCollapse},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[i("el-collapse-item",{attrs:{name:"1"}},[i("template",{slot:"title"},[i("span",{staticClass:"mx-collapse-title"},[t._v("基础信息")])]),t._v(" "),t.controls.templatePage?i("el-form-item",{attrs:{label:"布局模板"}},[i("el-select",{staticClass:"mx-print-select",attrs:{placeholder:"请选择布局模板"},on:{change:t.changePage},model:{value:t.form.templatePage,callback:function(e){t.$set(t.form,"templatePage",e)},expression:"form.templatePage"}},t._l(t.templatePageList,(function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})})),1)],1):t._e(),t._v(" "),t.controls.title?i("el-form-item",{attrs:{label:"标题"}},[i("el-input",{model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1):t._e(),t._v(" "),t.controls.subtitle?i("el-form-item",{attrs:{label:"副标题"}},[i("el-input",{model:{value:t.form.subtitle,callback:function(e){t.$set(t.form,"subtitle",e)},expression:"form.subtitle"}})],1):t._e(),t._v(" "),t.controls.date?i("el-form-item",{attrs:{label:"制图日期"}},[i("el-input",{model:{value:t.form.date,callback:function(e){t.$set(t.form,"date",e)},expression:"form.date"}})],1):t._e(),t._v(" "),t.controls.copyRight?i("el-form-item",{attrs:{label:"版权信息"}},[i("el-input",{model:{value:t.form.copyRight,callback:function(e){t.$set(t.form,"copyRight",e)},expression:"form.copyRight"}})],1):t._e(),t._v(" "),t.controls.author?i("el-form-item",{attrs:{label:"作者"}},[i("el-input",{model:{value:t.form.author,callback:function(e){t.$set(t.form,"author",e)},expression:"form.author"}})],1):t._e(),t._v(" "),t.controls.iscenter?i("el-form-item",{staticStyle:{"text-align":"left"},attrs:{label:"标题居中"}},[i("el-switch",{model:{value:t.form.iscenter,callback:function(e){t.$set(t.form,"iscenter",e)},expression:"form.iscenter"}})],1):t._e()],2),t._v(" "),i("el-collapse-item",{attrs:{name:"2"}},[i("template",{slot:"title"},[i("span",{staticClass:"mx-collapse-title"},[t._v("标注选项")])]),t._v(" "),i("el-form-item",{attrs:{label:"绘制模式"}},[i("el-select",{staticClass:"mx-print-select",attrs:{placeholder:"请选择绘制模式"},model:{value:t.renderStyle.drawTypeMode,callback:function(e){t.$set(t.renderStyle,"drawTypeMode",e)},expression:"renderStyle.drawTypeMode"}},t._l(t.drawTypeModeList,(function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),i("el-form-item",{attrs:{label:"标注类型"}},[i("span",{attrs:{slot:"label"},slot:"label"},[i("el-tooltip",{staticClass:"item",attrs:{effect:"light",placement:"top"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("div",[t._v("文件导入独立上图;")])]),t._v(" "),i("i",{staticClass:"el-icon-question"})]),t._v(" "),i("span",[t._v("标注类型")])],1),t._v(" "),i("div",{staticClass:"mx-draw-container"},[i("el-tooltip",{staticClass:"item",attrs:{content:"poi",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_point_canvas"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_point_canvas")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686208906464",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1483",width:"20",height:"20"}},[i("path",{attrs:{d:"M512 0C301.056 0 129.536 171.008 129.536 382.464 129.536 635.392 512 1024 512 1024s382.464-363.008 382.464-641.536C894.464 171.008 722.944 0 512 0z m0 557.568c-107.52 0-194.56-87.04-194.56-194.56s87.04-194.56 194.56-194.56 194.56 87.04 194.56 194.56-87.04 194.56-194.56 194.56z","p-id":"1484"}}),t._v(" "),i("path",{attrs:{d:"M512 363.52m-194.56 0a194.56 194.56 0 1 0 389.12 0 194.56 194.56 0 1 0-389.12 0Z",fill:"#FFFFFF","p-id":"1485"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"点",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_point_geo"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_point_geo")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686290675207",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"25777",width:"24",height:"24"}},[i("path",{attrs:{d:"M863.9 362c-19.2-45.5-46.8-86.3-81.8-121.3-35.1-35.1-75.9-62.6-121.3-81.8-47.1-19.9-97.1-30-148.6-30s-101.5 10.1-148.6 30c-45.5 19.2-86.3 46.8-121.3 81.8-35.1 35.1-62.6 75.9-81.8 121.3-19.9 47.1-30 97.1-30 148.6s10.1 101.5 30 148.6c19.2 45.5 46.8 86.3 81.8 121.3 35.1 35.1 75.9 62.6 121.3 81.8 47.1 19.9 97.1 30 148.6 30s101.5-10.1 148.6-30c45.5-19.2 86.3-46.8 121.3-81.8 35.1-35.1 62.6-75.9 81.8-121.3 19.9-47.1 30-97.1 30-148.6s-10.1-101.5-30-148.6zM512.1 852.4c-188.5 0-341.8-153.3-341.8-341.8s153.3-341.8 341.8-341.8 341.8 153.3 341.8 341.8-153.3 341.8-341.8 341.8z","p-id":"25778"}}),t._v(" "),i("path",{attrs:{d:"M512.1 510.6m-153.8 0a153.8 153.8 0 1 0 307.6 0 153.8 153.8 0 1 0-307.6 0Z","p-id":"25779"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"线",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_polyline"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_polyline")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686209349467",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3640",width:"24",height:"24"}},[i("path",{attrs:{d:"M243.616 650.08l113.696-214.288 42.4 22.496-113.696 214.272zM625.088 569.92l113.696-214.272 42.4 22.496-113.68 214.288zM455.248 455.472l42.656-21.984 67.36 130.704-42.672 21.984z","p-id":"3641"}}),t._v(" "),i("path",{attrs:{d:"M221.12 743.52m-71.04 0a71.04 71.04 0 1 0 142.08 0 71.04 71.04 0 1 0-142.08 0Z","p-id":"3642"}}),t._v(" "),i("path",{attrs:{d:"M588.32 590.24c-39.2 0-71.04 31.84-71.04 71.04s31.84 71.2 71.04 71.2a71.12 71.12 0 0 0 0-142.24zM496.64 363.2c0-39.2-31.84-71.2-71.04-71.2a71.12 71.12 0 0 0 0 142.24c39.2 0 71.04-31.84 71.04-71.04z","p-id":"3643"}}),t._v(" "),i("path",{attrs:{d:"M802.88 280.48m-71.04 0a71.04 71.04 0 1 0 142.08 0 71.04 71.04 0 1 0-142.08 0Z","p-id":"3644"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"面",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_polygon"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_polygon")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686209935389",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"29372",width:"24",height:"24"}},[i("path",{attrs:{d:"M792 826H232c-13.28 0-24-10.72-24-24V490.48c0-6.16 2.4-12.16 6.64-16.64l242.24-252.48c4.72-4.88 11.2-7.6 18.08-7.36 6.8 0.24 13.2 3.28 17.6 8.48l317.76 376.72c3.68 4.32 5.68 9.84 5.68 15.44v187.36c0 13.28-10.72 24-24 24z m-536-48h512V623.44l-294.96-349.6L256 500.16v277.84z","p-id":"29373"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"圆",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_circle"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_circle")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686212080974",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"36459",width:"24",height:"24"}},[i("path",{attrs:{d:"M512.000512 512m-81.864496 0a81.864496 81.864496 0 1 0 163.728992 0 81.864496 81.864496 0 1 0-163.728992 0Z","p-id":"36460"}}),t._v(" "),i("path",{attrs:{d:"M925.251464 337.411683c-22.590508-53.410444-54.926984-101.373829-96.108919-142.555763s-89.144296-73.517387-142.555763-96.107895c-55.311747-23.394826-114.050546-35.256992-174.587294-35.256992s-119.27657 11.862165-174.587293 35.256992c-53.411467 22.590508-101.373829 54.92596-142.556787 96.107895-41.181935 41.181935-73.517387 89.145319-96.107895 142.555763-23.394826 55.310723-35.256992 114.051569-35.256992 174.588317s11.862165 119.27657 35.256992 174.587294c22.591531 53.410444 54.926984 101.373829 96.107895 142.556786 41.182958 41.181935 89.145319 73.518411 142.556787 96.108918 55.310723 23.394826 114.050546 35.256992 174.587293 35.256992s119.27657-11.862165 174.587294-35.256992c53.410444-22.590508 101.372805-54.926984 142.555763-96.108918s73.518411-89.145319 96.108919-142.556786c23.394826-55.310723 35.256992-114.050546 35.256991-174.587294 0-60.537771-11.862165-119.277594-35.256991-174.588317zM511.999488 909.343657c-219.095997 0-397.343657-178.24766-397.343657-397.343657S292.903491 114.656343 511.999488 114.656343 909.343145 292.904003 909.343145 512 731.095485 909.343657 511.999488 909.343657z","p-id":"36461"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"矩形",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_rectangle"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_rectangle")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686212503737",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"40288",width:"24",height:"24"}},[i("path",{attrs:{d:"M876.4664713541666 302.9680989583333H776.4029947916665V202.90462239583334c0-11.865234374999998-9.8876953125-21.7529296875-21.7529296875-21.7529296875s-21.7529296875 9.8876953125-21.7529296875 21.7529296875v100.0634765625H632.8336588541666c-11.865234374999998 0-21.7529296875 9.8876953125-21.7529296875 21.7529296875s9.8876953125 21.7529296875 21.7529296875 21.7529296875h100.0634765625v100.0634765625c0 11.865234374999998 9.8876953125 21.7529296875 21.7529296875 21.7529296875s21.7529296875-9.8876953125 21.7529296875-21.7529296875V346.4739583333333H876.4664713541666c11.865234374999998 0 21.7529296875-9.8876953125 21.7529296875-21.7529296875 0-12.2607421875-9.8876953125-21.7529296875-21.7529296875-21.7529296875zM146.75455729166666 386.0247395833333c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625h0.7910156249999999v-21.7529296875h36.38671875c10.678710937499998 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-9.0966796875-19.775390625-19.775390625-19.775390625l-56.953125-0.39550781249999994c-11.07421875 0-19.775390625 8.701171874999998-19.775390625 19.775390625v42.71484374999999c0 9.8876953125 8.701171874999998 18.984374999999996 19.775390625 18.984374999999996z m135.26367187500003-41.92382812499999h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-8.701171874999998-19.775390625-19.775390625-19.775390625h-98.876953125c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625 0 11.07421875 9.0966796875 19.775390625 19.775390625 19.775390625z m177.1875 0h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-8.701171874999998-19.775390625-19.775390625-19.775390625h-98.876953125c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625 0.7910156249999999 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625zM774.8209635416665 560.8391927083335c0-11.07421875-8.701171874999998-19.775390625-19.775390625-19.775390625s-19.775390625 8.701171874999998-19.775390625 19.775390625v98.876953125c0 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625s19.775390625-8.701171874999998 19.775390625-19.775390625v-98.876953125z m-19.775390625 157.41210937500003c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625v64.072265625h-79.1015625v1.1865234374999998c-11.07421875 0-19.775390625 8.701171874999998-19.775390625 19.775390625s8.701171874999998 19.775390625 19.775390625 19.775390625h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625V738.8177083333334c0-11.865234374999998-9.0966796875-20.56640625-19.775390625-20.56640625zM581.0221354166666 802.0989583333333L166.52994791666666 801.3079427083333V423.2024739583333h-0.7910156249999999c0-11.07421875-8.701171874999998-19.775390625-19.775390625-19.775390625s-19.775390625 8.701171874999998-19.775390625 19.775390625V821.8743489583334c0 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625H579.8356119791666c11.07421875 0 19.775390625-9.0966796875 19.775390625-19.775390625 0-11.07421875-9.0966796875-19.775390625-18.5888671875-19.775390625z","p-id":"40289"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"文本",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_text"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_text")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686292575158",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"29443",width:"24",height:"24"}},[i("path",{attrs:{d:"M206.791111 76.572444c38.058667 0 68.892444 30.890667 68.892445 68.949334v2.844444h428.828444V217.315556H275.683556v4.835555c0 38.058667-30.833778 68.892444-68.892445 68.892445h-15.36v398.222222h15.36c38.058667 0 68.892444 30.890667 68.892445 68.949333v4.721778h428.828444v68.949333H275.683556v2.901334c0 38.115556-30.833778 68.949333-68.892445 68.949333H130.161778c-38.058667 0-68.892444-30.890667-68.892445-68.949333v-76.572445c0-38.115556 30.833778-68.949333 68.892445-68.949333h-7.623111v-398.222222h7.623111c-38.058667 0-68.892444-30.833778-68.892445-68.892445V145.521778c0-38.115556 30.833778-68.949333 68.892445-68.949334h76.629333z m566.670222 214.471112c-38.058667 0-68.892444-30.890667-68.892444-68.949334V145.521778c0-38.115556 30.833778-68.949333 68.892444-68.949334h76.572445c38.115556 0 68.949333 30.890667 68.949333 68.949334v76.572444c0 38.058667-30.890667 68.892444-68.949333 68.892445h7.68v398.222222h-7.68c38.115556 0 68.949333 30.890667 68.949333 68.949333v76.572445c0 38.115556-30.890667 68.949333-68.949333 68.949333h-76.572445c-38.058667 0-68.892444-30.890667-68.892444-68.949333v-76.572445c0-38.115556 30.833778-68.949333 68.892444-68.949333h15.303111v-398.222222h-15.303111z m-566.670222 467.057777H130.161778v76.629334h76.629333v-76.572445z m643.242667 0h-76.572445v76.629334h76.572445v-76.572445z m-241.208889-424.96a34.474667 34.474667 0 0 1 0 68.892445h-84.764445v237.397333a34.474667 34.474667 0 0 1-68.835555 0L455.111111 402.033778H371.427556a34.474667 34.474667 0 0 1 0-68.892445h237.397333zM206.791111 145.521778H130.161778v76.572444h76.629333V145.521778z m643.242667 0h-76.572445v76.572444h76.572445V145.521778z","p-id":"29444"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"文件导入",placement:"top"}},[i("el-upload",{ref:"elUpload",staticClass:"mx-upload-layer",attrs:{action:"#","on-change":t.handleChangeUpload,multiple:!0,accept:t.acceptFileType,"auto-upload":!1}},[i("div",{staticClass:"mx-print-draw-icon"},[i("svg",{staticClass:"icon",attrs:{t:"1702365604407",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1816",width:"24",height:"24"}},[i("path",{attrs:{d:"M426.666667 170.666667l85.333333 85.333333h341.333333a85.333333 85.333333 0 0 1 85.333334 85.333333v426.666667a85.333333 85.333333 0 0 1-85.333334 85.333333H170.666667a85.333333 85.333333 0 0 1-85.333334-85.333333V256a85.333333 85.333333 0 0 1 85.333334-85.333333h256z m426.666666 170.666666H170.666667v426.666667h682.666666V341.333333zM384 384v85.333333H298.666667v170.666667h85.333333v85.333333H213.333333V384h170.666667z m128 42.666667v88.32h128v80.213333h-128V682.666667l-128-128 128-128z","p-id":"1817"}})])])])],1)],1),t._v(" "),i("div",{staticClass:"mx-draw-btn"},[i("el-button",{staticClass:"mx-text-btn",attrs:{size:"mini"},on:{click:t.closeDraw}},[t._v("关闭")]),t._v(" "),i("el-button",{staticClass:"mx-text-btn",attrs:{size:"mini"},on:{click:t.clearDraw}},[t._v("清除")]),t._v(" "),i("el-button",{staticClass:"mx-text-btn",attrs:{size:"mini"},on:{click:t.removeSelectedDraw}},[t._v("删除选中要素")])],1)]),t._v(" "),i("el-form-item",{attrs:{label:"线型样式"}},[i("el-select",{staticClass:"mx-print-select",attrs:{placeholder:"请选择线样式"},model:{value:t.renderStyle.lineStyle,callback:function(e){t.$set(t.renderStyle,"lineStyle",e)},expression:"renderStyle.lineStyle"}},t._l(t.lineStyleList,(function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),i("el-form-item",{attrs:{label:"颜色"}},[i("span",{attrs:{slot:"label"},slot:"label"},[i("el-tooltip",{staticClass:"item",attrs:{effect:"light",placement:"top"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("div",[t._v("poi、点、面的边线、线型;")])]),t._v(" "),i("i",{staticClass:"el-icon-question"})]),t._v(" "),i("span",[t._v("颜色")])],1),t._v(" "),i("el-row",[i("el-col",{attrs:{span:20}},[i("el-input",{model:{value:t.renderStyle.color,callback:function(e){t.$set(t.renderStyle,"color",e)},expression:"renderStyle.color"}})],1),t._v(" "),i("el-col",{attrs:{span:2}},[i("el-color-picker",{staticClass:"mx-print-color",attrs:{"show-alpha":""},on:{"active-change":function(e){t.renderStyle.color=e}},model:{value:t.renderStyle.color,callback:function(e){t.$set(t.renderStyle,"color",e)},expression:"renderStyle.color"}})],1)],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"填充色"}},[i("el-row",[i("el-col",{attrs:{span:20}},[i("el-input",{model:{value:t.renderStyle.fillColor,callback:function(e){t.$set(t.renderStyle,"fillColor",e)},expression:"renderStyle.fillColor"}})],1),t._v(" "),i("el-col",{attrs:{span:2}},[i("el-color-picker",{staticClass:"mx-print-color",attrs:{"show-alpha":""},on:{"active-change":function(e){t.renderStyle.fillColor=e}},model:{value:t.renderStyle.fillColor,callback:function(e){t.$set(t.renderStyle,"fillColor",e)},expression:"renderStyle.fillColor"}})],1)],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"宽度"}},[i("span",{attrs:{slot:"label"},slot:"label"},[i("el-tooltip",{staticClass:"item",attrs:{effect:"light",placement:"top"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("div",[t._v("点半径、面边线宽、线宽;")])]),t._v(" "),i("i",{staticClass:"el-icon-question"})]),t._v(" "),i("span",[t._v("宽度")])],1),t._v(" "),i("el-slider",{staticClass:"mx-print-slider",attrs:{min:1,max:20},model:{value:t.renderStyle.width,callback:function(e){t.$set(t.renderStyle,"width",e)},expression:"renderStyle.width"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"文本标注"}},[i("el-row",[i("el-col",{attrs:{span:20}},[i("el-input",{attrs:{type:"textarea","show-word-limit":"",placeholder:"请输入文本内容",maxlength:100,clearable:""},model:{value:t.form.textContent,callback:function(e){t.$set(t.form,"textContent",e)},expression:"form.textContent"}})],1),t._v(" "),i("el-col",{attrs:{span:4}},[i("el-tooltip",{staticClass:"item",attrs:{effect:"light",placement:"top"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("div",[t._v("更新选中文本;")])]),t._v(" "),i("i",{staticClass:"el-icon-refresh el-icon--right",on:{click:t.refreshSelectText}})])],1)],1),t._v(" "),i("div",{staticClass:"print-text"},[i("el-color-picker",{staticClass:"mx-print-color2",attrs:{"show-alpha":""},on:{"active-change":function(e){t.renderStyle.textColor=e}},model:{value:t.renderStyle.textColor,callback:function(e){t.$set(t.renderStyle,"textColor",e)},expression:"renderStyle.textColor"}}),t._v(" "),i("el-input",{model:{value:t.renderStyle.textFontSize,callback:function(e){t.$set(t.renderStyle,"textFontSize",e)},expression:"renderStyle.textFontSize"}}),t._v(" "),i("el-dropdown",{on:{command:t.commandDrop}},[i("span",{staticClass:"el-dropdown-link"},[i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.textFontSizeList,(function(e,s){return i("el-dropdown-item",{key:s,attrs:{command:e}},[t._v(t._s(e))])})),1)],1)],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"描边宽度"}},[i("el-slider",{staticClass:"mx-print-slider",attrs:{min:1,max:20},model:{value:t.renderStyle.textHaloWidth,callback:function(e){t.$set(t.renderStyle,"textHaloWidth",e)},expression:"renderStyle.textHaloWidth"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"描边颜色"}},[i("el-row",[i("el-col",{attrs:{span:20}},[i("el-input",{model:{value:t.renderStyle.textHaloColor,callback:function(e){t.$set(t.renderStyle,"textHaloColor",e)},expression:"renderStyle.textHaloColor"}})],1),t._v(" "),i("el-col",{attrs:{span:2}},[i("el-color-picker",{staticClass:"mx-print-color",attrs:{"show-alpha":""},on:{"active-change":function(e){t.renderStyle.textHaloColor=e}},model:{value:t.renderStyle.textHaloColor,callback:function(e){t.$set(t.renderStyle,"textHaloColor",e)},expression:"renderStyle.textHaloColor"}})],1)],1)],1),t._v(" "),t.componentSlot.name&&"2"==t.componentSlot.collapse&&t.loaded?i(t.componentSlot.name,{tag:"component",attrs:{renderStyle:t.renderStyle}}):t._e()],2),t._v(" "),i("el-collapse-item",{attrs:{name:"3"}},[i("template",{slot:"title"},[i("span",{staticClass:"mx-collapse-title"},[t._v("导出选项")])]),t._v(" "),i("el-form-item",{attrs:{label:"出图格式"}},[i("el-select",{staticClass:"mx-print-select",attrs:{placeholder:"请选择导出格式"},model:{value:t.form.formate,callback:function(e){t.$set(t.form,"formate",e)},expression:"form.formate"}},t._l(["PDF","PNG","PNG(非模板)"],(function(t,e){return i("el-option",{key:e,attrs:{label:t,value:t}})})),1)],1),t._v(" "),i("el-form-item",{attrs:{label:"比例尺"}},[i("el-input",{on:{input:t.changeScale},model:{value:t.form.scale,callback:function(e){t.$set(t.form,"scale",e)},expression:"form.scale"}})],1),t._v(" "),"PNG(非模板)"==t.form.formate?i("el-form-item",{attrs:{label:"DPI"}},[i("el-select",{staticClass:"mx-print-select",attrs:{placeholder:"请选择DPI"},on:{change:t.changeDpi},model:{value:t.form.dpi,callback:function(e){t.$set(t.form,"dpi",e)},expression:"form.dpi"}},t._l(t.dpiList,(function(t,e){return i("el-option",{key:e,attrs:{label:t.value,value:t.value}})})),1)],1):t._e(),t._v(" "),t.controls.legend?i("el-form-item",{staticStyle:{"text-align":"left"},attrs:{label:"图例"}},[i("el-switch",{model:{value:t.form.isLegend,callback:function(e){t.$set(t.form,"isLegend",e)},expression:"form.isLegend"}})],1):t._e()],2),t._v(" "),t.componentSlot.name&&"4"==t.componentSlot.collapse&&t.loaded?i("el-collapse-item",{attrs:{name:"4"}},[i("template",{slot:"title"},[i("span",{staticClass:"mx-collapse-title"},[t._v(t._s(t.componentSlot.title))])]),t._v(" "),i(t.componentSlot.name,{tag:"component",attrs:{renderStyle:t.renderStyle}})],2):t._e()],1)],1),t._v(" "),i("el-row",{staticClass:"mx-row-btn"},[i("el-button",{staticClass:"btn",attrs:{type:"primary",disabled:"PNG(非模板)"==t.form.formate||t.activeLoadingPrint},on:{click:t.print}},[t._v(t._s("打印"))]),t._v(" "),i("el-button",{staticClass:"btn",attrs:{type:"primary",disabled:t.activeLoadingPrint},on:{click:t.exportPrint}},[t._v(t._s("出图"))])],1)],1),t._v(" "),i("div",{staticClass:"mx-map-container-over"},[i("div",{staticClass:"mx-map-print-mapcontainer",style:t.styleCss2},[t.compass&&t.refreshVisible?i("div",{staticClass:"mx-map-compass-container",attrs:{id:"mx-map-compass-container"}},[i("mx-vue-drag-resize",{ref:"dragResize2",attrs:{isActive:t.activeDrag,w:t.dragResizeConfig.w,h:t.dragResizeConfig.h,z:t.dragResizeConfig.z,isResizable:!0,aspectRatio:!1,sticks:["tl","tm","tr","mr","br","bm","bl","ml"],stickSize:12,minw:10,minh:10,parentW:t.dragResizeConfig.parentW,parentH:t.dragResizeConfig.parentH,parentLimitation:!1,y:t.dragResizeConfig.top,x:t.dragResizeConfig.left,preventActiveBehavior:!1}},[i("div",{staticClass:"mx-map-compass-content"},[i("el-image",{staticClass:"medomap-image",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAADZFJREFUeF7tnYGV5bYNRb8riV2J40qcVBK7EtuVJK4k6SQZZIezGi0pghIBguTVOT62dyWR86A7eCQh6rsXh4UCv71er79d3PiX1+v1a6Xhv75er38qOved4hxOuakA4t4UrnLZP94B+f7ivB/ezvnPxd8LIALa1T3kerkPh5ECAGIk7Pttrx5yebh/qkAitxFAEnCpt7+/Xq+/23adu4sCAGL/HFzZLY3VSj0UuyXAkTXsY/bRAoDYiy1jEYGkdNSsVrou3acFKvufbvEWAMQ+wDVAtFYrDdoBxD5mZBBHjY8PtjzcuUPz0MtY5N9vF2vOdfzx1m6KDGIf3wSIDMh/fH/Ac61qrNZ/AcQ+YMcWAMRe7yMg/3rPArmpW43VAhD7eH1qAUDsBT8DcjX1W7NPAGIfLwBx1vgMiDQv6xql8ciV1QIQ5+CRQewFzwEircqAu9VqAYh9vMggzhqXALljtQDEOXhkEHvBS4DcsVoAYh8vMoizxleAtFotAHEOHhnEXvAaIC1WC0Ds40UGcda4BkiL1QIQ5+CRQewF1wCitVoAYh8vMoizxlpANFYLQJyDRwaxF1wLiMZqUaxoHy8yiLPGLYDUrJYsLNbKUZx/vLWbI4PYx7cVEIFA3h4svYsOIPYx+2gBQOzFToDIO+TyLrnmuKrVAhCNgp3OAZBOQl7cJr1R2ALIldUCEPuYkUEcNU7ZoHUnkpLVAhDH4JFBbMVOr8mmVjRvDR57lLNaAGIbM2axHPSVccfPmd0V5a1B2VFR/p3+qXXnXBYPIDXFOv49GaSjmIdbld71OLamHZOcrRaA2MQse1cAsRH7arvQ1OLVtqPnXslA/y/vf/jn2wZy8m47h4MCAOIgMk3MqwCAzBs7eu6gAIA4iEwT8yoAIPPGjp47KAAgDiLTxLwKAMi8saPnDgoAiIPINDGvAgAyb+zouYMCAOIgsrIJWVxsWTxU3pbTnigAIE/U63utrJZr3xfp2zJ3KyoAIDEejlT121rtG6P3C/cCQGIEN5W1U4gYIx4fvQCQGAFJX7CV3pBFYsTk/70AkPHBOL9UpS2DH9/zDXoAIOODfH5rsPXV3PE/wcI9AJDxwc29XIXNGh8XLFaAGJztVeoSNitAcBiDjA9Caf8reWNQPhvNMVgBLNbYAMhm1KUDmzU2NliswfqnHRdL3WBNZHCAsFhjA3C1vaj0DJs1Nj5kkIH6lwbn5y5hswYGiQwyTvxa9kg9w2aNixEZZKD2x9KSq25I+btkEY5BCjCL5S+81l6lnsl0LxvF+ceJDDJIc629St2j9GRQoBiDjBH+at/e9EbheetSButjYkU1r7PuNXslVkogkbcLjwelJ86BSs0xBvEVvmavBBD5PIIM4o8HNss3Th+tAYiv8FelJdKTtDhIha9vXIqtAYhfIGr26ghILtNgs/xiRQYZoHXNXh0BydVpUXoyIGhkEB/RNdnjCIj8NzbLJzaXrQCITxA02eMMCB/w9IkNgATQ+bfM1G2uW0cblcs62CznYJJB7AXX2qtzBpH/z9VssWhoHzMG6Y4aa+1VDhBZMJTsczyo8HUMHhnEXmzNJ6FTL3IWisG6fYyKLQCIrfgt9iqXQeTPcuMXKnxt44bFctK3xV6VAMnZLEpPnAJIBrEVulZacm69NEuFzbKNExZrgL6t9qqUQUo2i9ITh6CSQexEbrVXV4BQemIXp8s7A4id8K326goQ+Ttsll2ssFjO2uYG1pouXK2UU+GrUbDzOWSQzoK+305bWqIdpMt52CybWGGxnHW9MzhPXazVWmGznINJBukv+J3BuRYQKnz7x4sM4qypdlO4XLdqGSQ3WGdzOcMAk0H6ivvEXtVmsVJPc+MbKnz7xvHjbgDSV9gn9koLCKUnfWOGxXLUs6Vy967Fytks+TOyiEGgySD9RH1qr7QZRM7L2SxKT/rFEotloOVTe9UCSG5NhApfg6CSQfqJeqe05Ny6ZhYrXcOaSL/YFe8EIH1E7mGvWjKInEvpSZ/YMUh30LGHvWoFhNITh8CSQZ6L3Ct7tALCbNbz2FXvACBViaon9MoedwCh9KQanmcnAMgz/eTqJ6UlTwbpci2byz2PH2MQQw172qs7GQSbZRhcuTUZ5JnAPe3VXUDYXO5ZDMkghvo9LS15arHS9ed+SIWv7J2VvnloKMHatyaD3I9vb3t1N4PIdWwudz+OZBAj7XrbqyeAUOFrFGQyyH1he5SW9LJYDNbvx5EMYqCdhb16kkFKNosK34fBJ4PcE9DCXj0FhArfe7EkgxjoZmGvngKCzTIINBmkXVSr7NEDECp82+NJBums2d1N4TTdaHkfJHc/Knw1KjecQwZpEKtQ+9R2h+uznwKCzeoZDUpNmtW0tFc9LJbcgwrf5rCWLyCDtInZu7Tk3HqPDJLLIr3u26bWAmcDiD6IVmsfxx70epD5fLQ+rgzSO2llba96WSy5DxW+nYJOBtELabX2YZFBGKzr40oG6aCVh73qmUHkXmwu1yHwZBCdiB72qjcglJ7oYksG6aCTh73qDQg2q0PgySB1Ee9+b7B+52/P6DWLle6MzboThcM1AFIX0LK05Nx6b0AoPanHF4v1QCOvwXnqYm9AsFkPgi+XkkGuBfQanFsCQunJA0gA5Fq8npvCacJkkUHYXE6jfOEcACmL522vLGax0k/HpxJuQgIgZeG87ZUlIJSeAMhNBcqXWVfu5lq2sFilLMLnoxWPDBkkL9IIe2WZQeTefD5aAcT5FADJizbCXlkDwuZyAHJDgfwlXqUl59YtLZa0xWC98REhg3wr2Ch7ZZ1BSjaLzeUuoAGQb8UZZa88AKHClwzSqMDn00dmDw9AsFmNjwcZ5LNgI7OHFyBsLtcACYB8Fsu7tMR7kC7tUeELIA0KfD11tL3yyiDYrIbHgwzyVazR9soTECp8lZAAyFehRpSWjLBY0qZkS7GT8u90WK/BKB/JWKcByJd4RLBXnhlE2mJzOQWLAPJFpAj2yhsQKnwBRKHAl1NGlZaMslipXT4fXXlEyCBx7JV3BpH2+Hw0gFSzSBR7NQIQSk8ApApIFHs1AhBpkwrfi0dkd4sVKXuMAoTN5QCkqIDnpnDVVPZWBjJiLYLSEwDJKhBl7ePYuRGAYLMAJKtANHs1ymKV1oF4kWrznRUjlJaMXgdJ7bO5XCGL7DpIj2ivRmYQbBaAfFIgor0aDQgVvhlIds0gEe3VaEByWWTUpIFmxs/lnB0BiWqvIgDC5nIn7HYEJKq9igAIFb4AEqZyN2cRIlgaSk8Okdktg+RWjV28rLKRCIBQerIxINFKS6Ksgxz7QYXvpoBEHpynkETIIKyJbApI5MF5NEDYXO49IjuNQUZvCqcZhkTJIFT4bgbIDPYqwjTvEWJmszYqVpzBXkUDhNKTjQCJWloScRYr9YnN5TYBZBZ7FS2DSH+231xuh0H6LPYqIiDbl57sAEikXUtqM1lRZrGuButbfT56dUBmslcRM4j0aevN5VYHZCZ7FRWQrT8fvTIgs2WPqIBsXXqyMiCzZY/IgGxb4bsyIDOUlkReB6HCd+F1kBntVeQMsq3NWjWDzGivogOyZYXvqoDMUlpytliyxiA7Gsp6SLRjywrfFQGZ1V4dgRBABBQBJtKxXYXvioDMaq9yIPz+Nk78NRAo21X4rgjITKUl2uyQbFeEjHLOIhHLY7S6Vs9bDZAV7FUpaAKHZBN5IEeCstXmcqsBspK9KoEigCRQqr8BDU7YqsJ3NUBmtVeSEeTBl5kiyYKaYyQo2wzWVwJk1uxx/FCNwCE/Ryso3jNe21T4rgRI9E3hzlnh6gtOAsjPb2MNsTPaw3PGa5vN5VYBZKbB+S/vYwjNgy8PYsoomvPlHK8Zry1s1iqAzGCv5De8PLx3jlZQPGa8tig9WQWQyKUlPa2PgCJWMsJAfovSkxUAiWqveoJxzjpRQFneZq0ASDR7JWD84VRwKIN4+flbMkrPGa/lbdYKgESxVyPXJVpB6ZXdlv989OyARLBXI8E4W69WUHrMeC29udzsgIy0V5HAOIMiuggsGuv1dMZr6dKT2QEZUVqSHiixKdEPmfHSrso/Af5sc5fZXG5mQEZ8b/Bq9TsqLK3lK3dAWbbCd2ZAPEtLZgTjDOwdULQzXstuLjcrIF6D85aykKgZJLeGInVeWuulnfFack1kVkCsB+dPykJmAqWlzqs247Xk5nKzAmK1KZz2t+UsEGj62VLndTXjtWSF74yAWNirHcHIWS9tRikN5JezWTMC0tNeeZaFaH6bRzinpc7rDMpypSczAtKjtOTOVGaEh9ezD62gyBglfdfw2M+pdz2ZDZCn9gow2hFrKV+RjJx7C/KHwTuxtP/U71fMBshdewUYtx+RjwtbQDm3Nu10+WyAtJaWzFQW8vwR9rlDS51X6tG0NmsmQFrt1Qqr3z6P/L1WWuq8pIUpbdZMgGjtFWDce+DvXqUFZUqbNQsgmuwxZQDuPpXBrtPUeYnd/Wm2wfosgFxljx3KQoLxUOxO2s+rVOclgET89knxB5oFkFxpCavfcbEpla9M98tsBkDO9gow4oKhKV+ZarA+AyDJXlEWMg8YV6BMNYkyAyAyS+K1jc68j+AcPRfr9WPD1qvDf6r/AfMRU/Y31bpGAAAAAElFTkSuQmCC",fit:"scale-down"}})],1)])],1):t._e(),t._v(" "),t.isShowMap?i("mapmost-onemap-view",{attrs:{option:t.mapOption},on:{success:t.mapSuccess}}):t._e()],1)])])])};Im._withStripped=!0;const Em=bi({render:Im,staticRenderFns:[]},undefined,Sm,"data-v-41c10f93",false,undefined,!1,void 0,void 0,void 0);const Tm={props:{showType:{type:String,default:function(){return"card"}},data:{type:Array|String,default:function(){return""}}}};var Dm=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.data?i("div",{staticClass:"mx-map-arcgis-legend",class:{"mx-map-arcgis-legend-default":"card"!=t.showType}},[t._l(t.data,(function(e,s){return[i("div",{key:s,staticClass:"mx-map-arcgis-group"},[i("div",{staticClass:"mx-map-arcgis-title"},[t._v(t._s(e.layerName))]),t._v(" "),i("div",{staticClass:"max-map-arcgis-content"},[t._l(e.legend,(function(e,s){return[i("div",{key:s,staticClass:"mx-map-arcgis-item"},[i("div",{staticClass:"mx-map-arcgis-label"},[t._v(t._s(e.label))]),t._v(" "),i("img",{attrs:{src:"data:"+e.contentType+";base64,"+e.imageData,width:e.width,height:e.height,alt:""}})])]}))],2)])]}))],2):t._e()};Dm._withStripped=!0;var Pm={components:{LegendArcgis:bi({render:Dm,staticRenderFns:[]},undefined,Tm,"data-v-83b74412",false,undefined,!1,void 0,void 0,void 0)},data:()=>({imagePageEnable:!0,visibleImagePage:!1,domid:"medomap-legend",position:"",legendObj:{},countState:0,collapsed:!0,titleMainEnable:!0,titleEnable:!0,collapsedEnable:!1,maxWidth:"auto",marginLeft:0,showType:"card",srcImage:"",selectLayerId:"",legendTitle:"图例",dragResizeEnable:!1,activeDrag:!1,dragResizeConfig:{w:200,h:200,z:1,left:0,top:Number(659),parentW:1720,parentH:859},legendArr:[]}),created(){this.collapsedEnable||(this.collapsed=!0)},mounted(){this.imagePageEnable&&(this.visibleImagePage=!0),this.setLegendArr()},methods:{changeImagePageUp(){if(this.legendArr.length>0&&this.selectLayerId){const t=this.getImagePageIndex(this.selectLayerId)-1;t>-1&&(this.selectLayerId=this.legendArr[t].id)}},changeImagePageNext(){const t=this.legendArr.length;if(t>0&&this.selectLayerId){const e=this.getImagePageIndex(this.selectLayerId)+1;e>-1&&e<t&&(this.selectLayerId=this.legendArr[e].id)}},getImagePageIndex(t){return this.legendArr.findIndex((e=>e.id==t))},removeImagePage(t){const e=this.legendArr.length;var i=t-1;(i=i<0?0:i)>-1&&i<e&&e>0&&(this.selectLayerId=this.legendArr[i].id)},deactivate(){this.dragResizeEnable&&"card"==this.showType&&(this.activeDrag=!this.activeDrag)},change(t){this.activeDrag=!1,t&&(this.selectLayerId=t.id,this.srcImage=t.legend,this.legendTitle=t.label)},addLenged(t,e){this.activeDrag=!1;var i={id:t.id||t.ID,label:t.label,legend:t.legend,legendInfoList:t.legendInfoList,type:t.legendInfoList?"arcgis":"image"},s=i.id;if(e)this.legendObj[s]=i;else if(this.legendObj[s]&&delete this.legendObj[s],s==this.selectLayerId&&"card"==this.showType){var a=Object.keys(this.legendObj);a.length>0?this.change(this.legendObj[a[0]]):(this.selectLayerId="",this.srcImage="",this.legendTitle="图例")}var n=this.getImagePageIndex(s);this.setLegendArr(),"card"==this.showType?this.change(this.legendObj[s]):this.imagePageEnable&&(e?this.selectLayerId=s:this.selectLayerId&&this.selectLayerId==s&&this.removeImagePage(n))},setLegendArr(){var t=[];this.activeDrag=!1,Object.keys(this.legendObj).forEach((e=>{e&&(this.legendObj[e].legend||"arcgis"==this.legendObj[e].type)&&t.push(this.legendObj[e])})),this.legendArr=t}}};const Om=Pm;var km=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"medomap-legend-container",attrs:{id:t.domid}},[i("mx-vue-drag-resize",{ref:"dragResize",class:{"medomap-drag-none":!t.dragResizeEnable,"medomap-drag-nodata":0==t.legendArr.length},style:t.dragResizeEnable&&"card"==t.showType?{}:this.position,attrs:{isActive:t.activeDrag,w:t.dragResizeConfig.w,h:t.dragResizeConfig.h,z:t.dragResizeConfig.z,isResizable:!0,aspectRatio:!1,sticks:["tl","tm","tr","mr","br","bm","bl","ml"],stickSize:12,minw:10,minh:10,parentW:t.dragResizeConfig.parentW,parentH:t.dragResizeConfig.parentH,parentLimitation:!0,y:t.dragResizeConfig.top,x:t.dragResizeConfig.left,preventActiveBehavior:!0}},[t.legendArr.length>0?i("div",{staticClass:"medomap-content-drag",class:{"medomap-drag-none":!t.dragResizeEnable}},[t.collapsedEnable?i("div",{staticClass:"medomap-collapsed",on:{mouseover:function(e){t.visibleImagePage=!0},mouseleave:function(e){t.visibleImagePage=!1}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:"image"==t.showType&&t.visibleImagePage&&t.legendArr.length>1,expression:"showType == 'image' && visibleImagePage && legendArr.length > 1"}],staticClass:"medomap-collapsed-page"},[i("i",{staticClass:"el-icon-arrow-up",on:{click:t.changeImagePageUp}}),t._v(" "),i("i",{staticClass:"el-icon-arrow-down",on:{click:t.changeImagePageNext}})]),t._v(" "),i("i",{class:[t.collapsed?"el-icon-d-arrow-left":"el-icon-s-operation"],on:{click:function(e){e.stopPropagation(),t.collapsed=!t.collapsed}}})]):t._e(),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.collapsed,expression:"collapsed"}]},["card"==t.showType?i("div",{staticClass:"medomap-legend-card",class:{collapsed:t.collapsedEnable},style:{width:"calc(100% - "+(t.collapsedEnable?"60px":"30px")+")",height:t.dragResizeEnable?"calc(100% - 8px)":"auto"},on:{dblclick:t.deactivate}},[t.titleMainEnable?i("div",{staticClass:"medomap-title medomap-title-main"},[i("span",[t._v("图例")])]):t._e(),t._v(" "),t.titleEnable?i("div",{staticClass:"medomap-title",class:{titlemain:!t.titleMainEnable}},[i("span",[t._v(t._s(t.legendTitle))])]):t._e(),t._v(" "),i("div",{staticClass:"medomap-image-container",style:{height:"calc(100% - "+(t.titleEnable?"60px":"30px")+" - "+(t.titleMainEnable?"30px":"0px")+")"}},[t._l(t.legendArr,(function(e,s){return[i("div",{directives:[{name:"show",rawName:"v-show",value:e.id==t.selectLayerId,expression:"item.id == selectLayerId"}],key:s},[e.legend?i("el-image",{key:e.legend,staticClass:"medomap-image",style:{maxWidth:t.maxWidth},attrs:{"preview-src-list":t.activeDrag&&t.dragResizeEnable&&"card"==t.showType?[]:[e.legend],src:e.legend,fit:"scale-down"}},[i("div",{staticClass:"image-slot",attrs:{slot:"error"},slot:"error"},[i("i",{staticClass:"el-icon-picture-outline"})])]):t._e(),t._v(" "),"arcgis"==e.type?i("LegendArcgis",{attrs:{showType:t.showType,data:e.legendInfoList}}):t._e()],1)]}))],2),t._v(" "),t.legendArr.length>1?i("div",{staticClass:"medomap-page"},[t._l(t.legendObj,(function(e,s){return[e.legend||"arcgis"==e.type?i("div",{key:s,staticClass:"medomap-page-item",class:{active:t.selectLayerId==e.id},on:{click:function(i){return t.change(e)}}}):t._e()]}))],2):t._e()]):i("div",{staticClass:"medomap-legend-image"},[t._l(t.legendArr,(function(e,s){return[t.legendArr.length>0?i("div",{directives:[{name:"show",rawName:"v-show",value:!t.imagePageEnable||e.id==t.selectLayerId,expression:"imagePageEnable ? item.id == selectLayerId : true"}],key:s,staticClass:"medomap-legend",class:{"meomap-absolute":0===t.marginLeft,collapsed:t.collapsedEnable},style:{marginLeft:0==s?0:t.marginLeft+"px"}},[e.legend?i("el-image",{key:e.legend,staticClass:"medomap-image",style:{maxWidth:t.maxWidth},attrs:{"preview-src-list":[e.legend],src:e.legend,fit:"scale-down"}},[i("div",{staticClass:"image-slot",attrs:{slot:"error"},slot:"error"},[i("i",{staticClass:"el-icon-picture-outline"})])]):t._e(),t._v(" "),"arcgis"==e.type?i("LegendArcgis",{attrs:{showType:t.showType,data:e.legendInfoList}}):t._e()],1):t._e()]}))],2)])]):t._e()])],1)};km._withStripped=!0;const Nm=bi({render:km,staticRenderFns:[]},undefined,Om,"data-v-0f84f358",false,undefined,!1,void 0,void 0,void 0);const Am={props:{data:{type:Array,default:()=>[]},map:{type:Object,default:{}},searchValue:{type:String,default:""}},data:()=>({activeNames:""}),mounted(){this.reg=new RegExp(this.searchValue,"gm")},methods:{change(){this.data[this.activeNames]&&this.handlerMapLocation(this.data[this.activeNames])},getTitleArr(t){var e=t.toString();return this.searchValue&&e?(e=e.replace(new RegExp(this.searchValue,"gm"),"||"+this.searchValue+"||")).split("||"):[e]},handlerMapLocation(t){this.$emit("handlerMapLocation",t)},mousemove(t,e){this.map.$MapEventBus.$emit("map-left-list-mousemove",this.setPoiIndex(t,e))},mouseleave(t,e){this.map.$MapEventBus.$emit("map-left-list-mouseleave",this.setPoiIndex(t,e))},setPoiIndex(t,e){const i=t;return i.poiindex=(e+1).toString(),i}}};var Rm=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-list-gl"},[i("el-collapse",{attrs:{accordion:""},on:{change:t.change},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},t._l(t.data,(function(e,s){return i("div",{key:s,staticClass:"map-list-gl-container",class:{mapNoShape:!e.shape},on:{mouseover:function(i){return t.mousemove(e,s)},mouseleave:function(i){return t.mouseleave(e,s)}}},[i("el-collapse-item",{attrs:{title:"",name:s}},[i("template",{slot:"title"},[i("div",{staticClass:"map-list-gl-header"},[i("div",{staticClass:"map-list-gl-header-title"},[i("span",{staticClass:"map-list-index"},[t._v(t._s(s+1+"."))]),t._v(" "),e.shape?i("span",[i("i",{staticClass:"el-icon-location-outline"})]):t._e(),t._v(" "),i("div",{staticClass:"header-value-container"},[t._l(t.getTitleArr(e.name||""),(function(e,s){return[i("span",{key:s,staticClass:"header-value",class:{headerValueH:t.searchValue==e}},[t._v(t._s(e))])]}))],2)])])]),t._v(" "),i("div",{staticClass:"map-list-gl-form",on:{click:function(i){return t.handlerMapLocation(e)}}},t._l(e.qQueryList,(function(e,s){return i("div",{key:s,staticClass:"map-list-gl-item"},[i("span",{staticClass:"map-list-label"},[t._v(t._s(e.label))]),t._v(" "),i("div",{staticClass:"map-list-divider"},[t._v(":")]),t._v(" "),i("div",{staticClass:"map-list-value"},[t._l(t.getTitleArr((null==e.value?"":e.value)+(null==e.unit?"":e.unit)),(function(e,s){return[i("span",{key:s,class:{headerValueH:t.searchValue==e}},[t._v(t._s(e))])]}))],2)])})),0)],2)],1)})),0)],1)};Rm._withStripped=!0;const Fm={components:{mapList:bi({render:Rm,staticRenderFns:[]},undefined,Am,"data-v-7955bc6a",false,undefined,!1,void 0,void 0,void 0)},props:{data:{type:Object,default:{}},map:{type:Object,default:{}},pdomid:{type:String,default:""},searchValue:{type:String,default:""}},data:()=>({domid:"map-search-result-query",dataList:[],maxHeight:"720px",count:0,pageSizesAll:[10,20,30,50],currentSize:10,currentPage:1,pagerCount:5}),mounted(){this.list=this.data.records||[],this.count=this.list.length,this.getDataList(),this.$nextTick((()=>{this.setMaxHeight()}))},methods:{handleSizeChange(t){this.currentSize=t,this.getDataList()},handleCurrentChange(t){this.currentPage=t,this.getDataList()},setMaxHeight(){const t=this.map._container.id,e=document.getElementById(t);if(e){var i=document.getElementById(this.pdomid),s=i?i.offsetTop:0;this.maxHeight=e.clientHeight-180-s+"px",window.onresize=()=>{const t=this.map._container.id,e=document.getElementById(t);var i=document.getElementById(this.pdomid),s=i?i.offsetTop:0;this.maxHeight=e.clientHeight-180-s+"px"}}},addLocationsLayerMap(t){this.map.$MapEventBus.$emit("map-left-list-locations-layer",t)},getDataList(){let t=[];if(0==this.count||void 0===this.list)return this.addLocationsLayerMap(JSON.parse(JSON.stringify(t))),void(this.dataList=t);const e=(this.currentPage-1)*this.currentSize;let i=this.currentPage*this.currentSize;(this.count<=this.currentSize||i>=this.count)&&(i=this.count),t=this.list.slice(e,i),this.addLocationsLayerMap(JSON.parse(JSON.stringify(t))),this.dataList=t},close(){this.map.$MapEventBus.$emit("map-left-list-close"),this.$emit("close")},mapShowAll(){},mapListLocation(t){this.map.$MapEventBus.$emit("map-left-list-click",t)}}};var Bm=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.count>0?i("div",{staticClass:"mx-map-search-result",attrs:{id:t.domid}},[i("el-card",{staticClass:"card-container"},[i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"mx-map-search-header",attrs:{slot:"header",id:t.domid},slot:"header"},[t._v("\n 查询到\n "),i("span",{on:{click:t.mapShowAll}},[t._v(t._s(t.count))]),t._v("\n 条结果\n "),i("div",{staticClass:"close",on:{click:t.close}},[i("i",{staticClass:"el-icon-close"})])]),t._v(" "),i("div",{staticClass:"mx-map-search-list",style:{maxHeight:t.maxHeight}},[t.dataList.length>0?i("map-list",{attrs:{map:t.map,searchValue:t.searchValue,data:t.dataList},on:{handlerMapLocation:t.mapListLocation}}):i("div",[i("el-empty",{attrs:{description:"暂无数据"}})],1)],1),t._v(" "),i("div",{staticClass:"mx-map-search-fonter"},[i("el-pagination",{attrs:{"current-page":t.currentPage,"page-size":t.currentSize,"page-sizes":t.pageSizesAll,"pager-count":t.pagerCount,layout:"prev, pager, next",total:t.count,small:"",background:"","hide-on-single-page":!1},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}})],1)])],1):t._e()};Bm._withStripped=!0;const Gm={components:{LocationsList:bi({render:Bm,staticRenderFns:[]},undefined,Fm,"data-v-70023e79",false,undefined,!1,void 0,void 0,void 0)},props:{customAxios:{default:()=>gr}},data:()=>({domid:"map-locationquery-container",position:"",default:"",input_value:"",loading:!1,visible:!1,data:{}}),mounted(){this.input_value=this.default},methods:{onSearch(){if(this.input_value){var t=this.getSearchUrl();t?this.customAxios({method:"post",url:t,headers:{"Content-Type":"application/json"},data:{conditions:{project_name:this.input_value||"",current:1,size:1e3}}}).then((t=>{200==t.code?t.data.length&&(this.data=t.data[0],this.visible=!1,this.$nextTick((()=>{this.visible=!0}))):window.MapMessage.ShowMessage({message:t.msg,type:"warning"})})):window.MapMessage.ShowMessage({message:"地名地址查询接口不存在!",type:"warning"})}else window.MapMessage.ShowMessage({message:"请输入地名地址,不可为空!",type:"warning"})},onInputClear(){this.input_value=""},onInputFocus(){},onInputBlur(){}},computed:{styleCss(){let t={"z-index":4};return this.position&&Object.assign(t,this.position),t}}};var zm=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-locationquery-container animate__animated animate__fadeIn",style:t.styleCss,attrs:{id:t.domid}},[i("el-input",{staticClass:"mx-map-input-container",attrs:{slot:"reference",title:t.input_value,size:"small",placeholder:"请输入地名地址"},on:{focus:t.onInputFocus,blur:t.onInputBlur},slot:"reference",model:{value:t.input_value,callback:function(e){t.input_value=e},expression:"input_value"}},[i("span",{staticClass:"mx-input-close",attrs:{slot:"suffix"},on:{click:t.onInputClear},slot:"suffix"},[i("i",{staticClass:"el-icon-close"})]),t._v(" "),i("el-button",{staticStyle:{color:"#ffffff"},attrs:{slot:"append",icon:"el-icon-search",loading:t.loading},on:{click:function(e){return t.onSearch()}},slot:"append"})],1),t._v(" "),t.visible?i("LocationsList",{attrs:{data:t.data,pdomid:t.domid,map:t.map,searchValue:t.input_value},on:{close:t.close}}):t._e()],1)};zm._withStripped=!0;const jm=bi({render:zm,staticRenderFns:[]},undefined,Gm,"data-v-3154259e",false,undefined,!1,void 0,void 0,void 0);const Um={props:["cdata","cmap","cposition","panelId","cOffsetHeight","cMainHeight","axiosOptions"],components:{mapList:ou},inject:["mapP"],provide(){return{map:this.getMap}},data:()=>({count:0,list:[],dataList:[],pagerCount:5,maxHeight:"720px",currentPage:1,currentSize:10,pageSizesAll:[10,20,30,50],maxCount:1e3,all:!1,activeDataList:null,currentListIndex:0,clientHeightOffset:0,maxInitHeight:0,changeTop:!1,domid:"map-search-result-c",offsetHeight:200,offectId:"map-datainfo-panel",pageSize:10,getAxiosSearchData:""}),mounted(){this.cOffsetHeight&&(this.offsetHeight=this.cOffsetHeight),this.panelId&&(this.offectId=this.panelId),this.mapP&&(this.map=this.mapP()),this.cdata&&(this.data=this.cdata),this.cmap&&(this.map=this.cmap),this.data&&("object"==typeof this.axiosOptions&&(this.pageSize=this.axiosOptions.size||this.pageSize,this.currentSize=this.pageSize,this.getAxiosSearchData=this.axiosOptions.getAxiosSearchData),Array.isArray(this.data)?this.activeDataList=this.data[this.currentListIndex]:this.activeDataList=this.data,this.activeDataList.total?this.count=(this.activeDataList.total,this.activeDataList.total):this.count=this.activeDataList.records.length,this.list=this.activeDataList.records||[],this.getDataList(),this.$nextTick((()=>{this.setMaxHeight()})))},methods:{changeIcon(t){this.changeTop=!t},changeTopHandler(){this.changeTop=!this.changeTop,this.$emit("changeTopPanel",this.changeTop)},getMap(){return this.map},mapShowTabChange(t){this.currentListIndex=t.index,this.currentPage=1,this.currentSize=this.pageSize,this.activeDataList=this.data[this.currentListIndex],null==this.activeDataList.records&&(this.activeDataList.records=[]),this.activeDataList.total?this.count=this.activeDataList.total||0:this.count=this.activeDataList.records.length,this.list=this.activeDataList.records,this.getDataList()},mapShowAll(){this.all=!this.all,this.all?this.currentSize=this.count:this.currentSize=this.pageSize,this.currentPage=1,this.changeData()},mapListLocation(t){this.map.$MapEventBus.$emit("map-left-list-click",t)},close(){this.map.$MapEventBus.$emit("map-left-list-close"),this.$emit("close")},setMaxHeightChange(t){const e=parseFloat(this.maxInitHeight);var i=0;this.cMainHeight&&(i=this.cMainHeight),this.maxHeight=t?`${e}px`:e+this.clientHeightOffset-i-10+"px"},setMaxHeight(){const t=this.map._container.id,e=document.getElementById(t);if(e){var i=document.getElementById(this.offectId),s=e.getElementsByClassName("mx-map-search")[0];this.clientHeightOffset=i?i.clientHeight+10:0;var a=s?s.offsetTop:0;this.maxHeight=e.clientHeight-this.offsetHeight-a-this.clientHeightOffset-(this.tabBtn.length>1?36:0)+"px",this.maxInitHeight=1*parseFloat(this.maxHeight),window.onresize=()=>{var t=document.getElementById(this.offectId);this.clientHeightOffset=t?t.clientHeight+10:0;const i=this.map._container.id,s=document.getElementById(i);var a=e.getElementsByClassName("mx-map-search")[0],n=a?a.offsetTop:0;this.maxHeight=s.clientHeight-this.offsetHeight-n-this.clientHeightOffset-(this.tabBtn.length>1?36:0)+"px",this.maxInitHeight=1*parseFloat(this.maxHeight)}}},handleSizeChange(t){this.currentSize=t,this.changeData()},handleCurrentChange(t){this.currentPage=t,this.changeData()},changeData(){if(this.getAxiosSearchData){const t=this.axiosOptions.conditions;t.current=this.currentPage,t.size=this.currentSize,this.getAxiosSearchData(this.axiosOptions,t,(t=>{this.dataList=t.data[0].records,this.addLocationsLayerMap(JSON.parse(JSON.stringify(this.dataList)))}))}else this.getDataList()},addLocationsLayerMap(t){this.map.$MapEventBus.$emit("map-left-list-locations-layer",t)},getDataList(){let t=[];if(0==this.count||void 0===this.list)return this.addLocationsLayerMap(JSON.parse(JSON.stringify(t))),void(this.dataList=t);const e=(this.currentPage-1)*this.currentSize;let i=this.currentPage*this.currentSize;(this.count<=this.currentSize||i>=this.count)&&(i=this.count),t=this.list.slice(e,i),this.addLocationsLayerMap(JSON.parse(JSON.stringify(t))),this.dataList=t}},computed:{tabBtn(){const t=[];return Array.isArray(this.cdata)?(this.cdata.forEach(((e,i)=>{t.push({name:this.cdata[i].name||`列表${i+1}`,index:i})})),t):t}}};var Vm=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.count>=0||t.tabBtn.length>1?i("div",{staticClass:"mx-map-search-result",attrs:{id:t.domid}},[i("el-card",{staticClass:"card-container"},[i("div",{staticClass:"mx-map-search-header",attrs:{slot:"header"},slot:"header"},[t._v("\n 查询到\n "),i("span",{on:{click:t.mapShowAll}},[t._v(t._s(t.count))]),t._v("\n 条结果\n "),i("i",{staticClass:"arrow",class:[t.changeTop?"el-icon-bottom":"el-icon-top"],on:{click:t.changeTopHandler}})]),t._v(" "),t.tabBtn.length>1?i("div",{staticClass:"mx-map-search-tabbtn"},t._l(t.tabBtn,(function(e,s){return i("div",{key:s,staticClass:"tabbtn-item",class:{active:t.currentListIndex==e.index},on:{click:function(i){return t.mapShowTabChange(e)}}},[i("span",[t._v(t._s(e.name))])])})),0):t._e(),t._v(" "),i("div",{staticClass:"mx-map-search-list",style:{maxHeight:t.maxHeight}},[t.dataList.length>0?i("map-list",{attrs:{data:t.dataList},on:{handlerMapLocation:t.mapListLocation}}):i("div",[i("el-empty",{attrs:{description:"暂无数据"}})],1)],1),t._v(" "),i("div",{staticClass:"mx-map-search-fonter"},[i("el-pagination",{attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizesAll,"page-size":t.currentSize,"pager-count":t.pagerCount,layout:"prev, pager, next, jumper",total:t.count,small:"",background:"","hide-on-single-page":!1},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e}}}),t._v(" "),i("span",{staticClass:"medo-pagesize",attrs:{title:this.currentSize}},[t._v(" "+t._s("/"+this.currentSize))])],1)])],1):t._e()};Vm._withStripped=!0;const qm=bi({render:Vm,staticRenderFns:[]},undefined,Um,"data-v-4ae80636",false,undefined,!1,void 0,void 0,void 0);var Hm={props:{fieldValue:{type:String,default:"shape"}},inject:["mapP"],data:()=>({activeDraw:""}),mounted(){this.map=this.mapP()},methods:{mapDraw(t){this.activeDraw=t,this.map.GLSDK.mapStartDraw({type:t,clear:!0},(e=>{var i;this.closeDraw(),"map_draw_point_geo"==t&&e&&this.map.GLSDK.mapDrawControl&&(i=this.map.GLSDK.mapDrawControl.getCenterByWkt(e)),this.$emit("success",this.fieldValue,e,i)}))},closeDraw(){this.activeDraw="",this.map.GLSDK.mapClearDraw()}}};const $m=Hm;var Wm=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"mx-draw-container"},[i("el-tooltip",{staticClass:"item",attrs:{content:"点选",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_point_geo"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_point_geo")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686290675207",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"25777",width:"24",height:"24"}},[i("path",{attrs:{d:"M863.9 362c-19.2-45.5-46.8-86.3-81.8-121.3-35.1-35.1-75.9-62.6-121.3-81.8-47.1-19.9-97.1-30-148.6-30s-101.5 10.1-148.6 30c-45.5 19.2-86.3 46.8-121.3 81.8-35.1 35.1-62.6 75.9-81.8 121.3-19.9 47.1-30 97.1-30 148.6s10.1 101.5 30 148.6c19.2 45.5 46.8 86.3 81.8 121.3 35.1 35.1 75.9 62.6 121.3 81.8 47.1 19.9 97.1 30 148.6 30s101.5-10.1 148.6-30c45.5-19.2 86.3-46.8 121.3-81.8 35.1-35.1 62.6-75.9 81.8-121.3 19.9-47.1 30-97.1 30-148.6s-10.1-101.5-30-148.6zM512.1 852.4c-188.5 0-341.8-153.3-341.8-341.8s153.3-341.8 341.8-341.8 341.8 153.3 341.8 341.8-153.3 341.8-341.8 341.8z","p-id":"25778"}}),t._v(" "),i("path",{attrs:{d:"M512.1 510.6m-153.8 0a153.8 153.8 0 1 0 307.6 0 153.8 153.8 0 1 0-307.6 0Z","p-id":"25779"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"面",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_polygon"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_polygon")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686209935389",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"29372",width:"24",height:"24"}},[i("path",{attrs:{d:"M792 826H232c-13.28 0-24-10.72-24-24V490.48c0-6.16 2.4-12.16 6.64-16.64l242.24-252.48c4.72-4.88 11.2-7.6 18.08-7.36 6.8 0.24 13.2 3.28 17.6 8.48l317.76 376.72c3.68 4.32 5.68 9.84 5.68 15.44v187.36c0 13.28-10.72 24-24 24z m-536-48h512V623.44l-294.96-349.6L256 500.16v277.84z","p-id":"29373"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"圆",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_circle"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_circle")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686212080974",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"36459",width:"24",height:"24"}},[i("path",{attrs:{d:"M512.000512 512m-81.864496 0a81.864496 81.864496 0 1 0 163.728992 0 81.864496 81.864496 0 1 0-163.728992 0Z","p-id":"36460"}}),t._v(" "),i("path",{attrs:{d:"M925.251464 337.411683c-22.590508-53.410444-54.926984-101.373829-96.108919-142.555763s-89.144296-73.517387-142.555763-96.107895c-55.311747-23.394826-114.050546-35.256992-174.587294-35.256992s-119.27657 11.862165-174.587293 35.256992c-53.411467 22.590508-101.373829 54.92596-142.556787 96.107895-41.181935 41.181935-73.517387 89.145319-96.107895 142.555763-23.394826 55.310723-35.256992 114.051569-35.256992 174.588317s11.862165 119.27657 35.256992 174.587294c22.591531 53.410444 54.926984 101.373829 96.107895 142.556786 41.182958 41.181935 89.145319 73.518411 142.556787 96.108918 55.310723 23.394826 114.050546 35.256992 174.587293 35.256992s119.27657-11.862165 174.587294-35.256992c53.410444-22.590508 101.372805-54.926984 142.555763-96.108918s73.518411-89.145319 96.108919-142.556786c23.394826-55.310723 35.256992-114.050546 35.256991-174.587294 0-60.537771-11.862165-119.277594-35.256991-174.588317zM511.999488 909.343657c-219.095997 0-397.343657-178.24766-397.343657-397.343657S292.903491 114.656343 511.999488 114.656343 909.343145 292.904003 909.343145 512 731.095485 909.343657 511.999488 909.343657z","p-id":"36461"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:"矩形",placement:"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:"map_draw_rectangle"==t.activeDraw},on:{click:function(e){return t.mapDraw("map_draw_rectangle")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686212503737",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"40288",width:"24",height:"24"}},[i("path",{attrs:{d:"M876.4664713541666 302.9680989583333H776.4029947916665V202.90462239583334c0-11.865234374999998-9.8876953125-21.7529296875-21.7529296875-21.7529296875s-21.7529296875 9.8876953125-21.7529296875 21.7529296875v100.0634765625H632.8336588541666c-11.865234374999998 0-21.7529296875 9.8876953125-21.7529296875 21.7529296875s9.8876953125 21.7529296875 21.7529296875 21.7529296875h100.0634765625v100.0634765625c0 11.865234374999998 9.8876953125 21.7529296875 21.7529296875 21.7529296875s21.7529296875-9.8876953125 21.7529296875-21.7529296875V346.4739583333333H876.4664713541666c11.865234374999998 0 21.7529296875-9.8876953125 21.7529296875-21.7529296875 0-12.2607421875-9.8876953125-21.7529296875-21.7529296875-21.7529296875zM146.75455729166666 386.0247395833333c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625h0.7910156249999999v-21.7529296875h36.38671875c10.678710937499998 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-9.0966796875-19.775390625-19.775390625-19.775390625l-56.953125-0.39550781249999994c-11.07421875 0-19.775390625 8.701171874999998-19.775390625 19.775390625v42.71484374999999c0 9.8876953125 8.701171874999998 18.984374999999996 19.775390625 18.984374999999996z m135.26367187500003-41.92382812499999h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-8.701171874999998-19.775390625-19.775390625-19.775390625h-98.876953125c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625 0 11.07421875 9.0966796875 19.775390625 19.775390625 19.775390625z m177.1875 0h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-8.701171874999998-19.775390625-19.775390625-19.775390625h-98.876953125c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625 0.7910156249999999 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625zM774.8209635416665 560.8391927083335c0-11.07421875-8.701171874999998-19.775390625-19.775390625-19.775390625s-19.775390625 8.701171874999998-19.775390625 19.775390625v98.876953125c0 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625s19.775390625-8.701171874999998 19.775390625-19.775390625v-98.876953125z m-19.775390625 157.41210937500003c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625v64.072265625h-79.1015625v1.1865234374999998c-11.07421875 0-19.775390625 8.701171874999998-19.775390625 19.775390625s8.701171874999998 19.775390625 19.775390625 19.775390625h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625V738.8177083333334c0-11.865234374999998-9.0966796875-20.56640625-19.775390625-20.56640625zM581.0221354166666 802.0989583333333L166.52994791666666 801.3079427083333V423.2024739583333h-0.7910156249999999c0-11.07421875-8.701171874999998-19.775390625-19.775390625-19.775390625s-19.775390625 8.701171874999998-19.775390625 19.775390625V821.8743489583334c0 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625H579.8356119791666c11.07421875 0 19.775390625-9.0966796875 19.775390625-19.775390625 0-11.07421875-9.0966796875-19.775390625-18.5888671875-19.775390625z","p-id":"40289"}})])])]),t._v(" "),i("div",{staticClass:"mx-draw-btn"},[i("el-tooltip",{staticClass:"item",attrs:{content:"关闭",placement:"top"}},[i("el-button",{staticClass:"el-icon-close",attrs:{size:"mini",circle:""},on:{click:t.closeDraw}})],1)],1)],1)])};Wm._withStripped=!0;const Km=bi({render:Wm,staticRenderFns:[]},undefined,$m,"data-v-7020b35a",false,undefined,!1,void 0,void 0,void 0);var Ym={components:{MapDraw:Km},provide(){return{mapP:this.getMap}},props:{codeList:{type:Object,default:{}},form:{type:Object,default:{}},map:{type:Object,default:{}},item:{type:Object,default:{}},xindex:{type:Number,default:0}},data:()=>({DatePickerRangeObj:{},pickerOptions:{shortcuts:[{text:"今天",onClick(t){t.$emit("pick",new Date)}},{text:"昨天",onClick(t){const e=new Date;e.setTime(e.getTime()-864e5),t.$emit("pick",e)}},{text:"一周前",onClick(t){const e=new Date;e.setTime(e.getTime()-6048e5),t.$emit("pick",e)}}]}}),methods:{changeFocus(t){this.$emit("changeFocus",t)},getMap(){return this.map},successDraw(t,e,i){this.$emit("successDraw",t,e,i)}}};const Jm=Ym;var Xm=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.item.dataType?i("el-row",{staticClass:"form-item-body"},[i("el-form-item",{attrs:{label:t.item.label,prop:t.item.value}},["ComboBox"==t.item.dataType?i("div",{key:t.xindex,staticClass:"datainfo-item"},[i("el-select",{attrs:{placeholder:"请选择"+t.item.label,size:"small",clearable:"",filterable:"","popper-append-to-body":!1,"popper-class":"mx-map-search-select"},model:{value:t.form[t.item.value],callback:function(e){t.$set(t.form,t.item.value,e)},expression:"form[item.value]"}},t._l(t.codeList[t.item.groupId],(function(t){return i("el-option",{key:t.value,attrs:{label:t.label,value:t.value,disabled:void 0!==t.enabled&&"0"==t.enabled}})})),1)],1):"DatePicker"==t.item.dataType?i("div",{key:t.xindex,staticClass:"datainfo-item"},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"请选择"+t.item.label,"value-format":"yyyy-MM-dd"},model:{value:t.form[t.item.value],callback:function(e){t.$set(t.form,t.item.value,e)},expression:"form[item.value]"}})],1):"DateTimePicker"==t.item.dataType?i("div",{key:t.xindex,staticClass:"datainfo-item"},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:"请选择"+t.item.label,align:"right","picker-options":t.pickerOptions},model:{value:t.form[t.item.value],callback:function(e){t.$set(t.form,t.item.value,e)},expression:"form[item.value]"}})],1):"DatePickerRange"==t.item.dataType?i("div",{key:t.xindex,staticClass:"datainfo-item"},[i("el-col",{attrs:{span:20,xs:24}},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"请选择"+t.item.label,"value-format":"yyyy-MM-dd"},model:{value:t.form[t.item.value],callback:function(e){t.$set(t.form,t.item.value,e)},expression:"form[item.value]"}})],1),t._v(" "),i("el-col",{staticClass:"datainfo-range",attrs:{span:4,xs:24}},[t._v("至")]),t._v(" "),i("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"请选择"+t.item.label,"value-format":"yyyy-MM-dd"},model:{value:t.form[t.item.value+"_DatePickerRange"],callback:function(e){t.$set(t.form,t.item.value+"_DatePickerRange",e)},expression:"form[item.value + '_DatePickerRange']"}})],1):"NumberRange"==t.item.dataType?i("div",{key:t.xindex,staticClass:"datainfo-item"},[i("el-col",{attrs:{span:20,xs:24}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{size:"mini",clearable:"",placeholder:"请输入"+t.item.label,"controls-position":"left"},model:{value:t.form[t.item.value],callback:function(e){t.$set(t.form,t.item.value,e)},expression:"form[item.value]"}})],1),t._v(" "),i("el-col",{staticClass:"datainfo-range",attrs:{span:4,xs:24}},[t._v("至")]),t._v(" "),i("el-col",{attrs:{span:20,xs:24}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{size:"mini",clearable:"",placeholder:"请输入"+t.item.label,"controls-position":"left"},model:{value:t.form[t.item.value+"_NumberRange"],callback:function(e){t.$set(t.form,t.item.value+"_NumberRange",e)},expression:"form[item.value + '_NumberRange']"}})],1)],1):"GeometryBox"==t.item.dataType?i("div",{key:t.xindex,staticClass:"datainfo-item"},[i("el-input",{attrs:{placeholder:"请绘制"+t.item.label,size:"small",clearable:""},model:{value:t.form[t.item.value],callback:function(e){t.$set(t.form,t.item.value,e)},expression:"form[item.value]"}}),t._v(" "),i("map-draw",{attrs:{fieldValue:t.item.value},on:{success:t.successDraw}})],1):i("div",{staticClass:"datainfo-item"},[i("el-input",{attrs:{placeholder:"请输入"+t.item.label,size:"small",clearable:""},on:{focus:function(e){return t.changeFocus(t.item)}},model:{value:t.form[t.item.value],callback:function(e){t.$set(t.form,t.item.value,e)},expression:"form[item.value]"}})],1),t._v(" "),t._t("default")],2)],1):t._e()};Xm._withStripped=!0;var Qm={components:{DataInfoResult:qm,FormItem:bi({render:Xm,staticRenderFns:[]},undefined,Jm,"data-v-f26cde6c",false,undefined,!1,void 0,void 0,void 0)},provide(){return{mapP:this.getMap}},data:()=>({visibleFormPanel:!1,closeBtn:!1,offsetHeight:150,mainHeight:60,visibleForm:!1,visibleTopResult:!1,domid:"map-query-panel",data:"",selectCode:"",customAxios:mr,activeNames:"100",title:"信息搜索",queryWidgeid:[],codeList:{},form:{},loading:!1,formVisible:!1,count:0,DatePickerRangeObj:{},pickerOptions:{shortcuts:[{text:"今天",onClick(t){t.$emit("pick",new Date)}},{text:"昨天",onClick(t){const e=new Date;e.setTime(e.getTime()-864e5),t.$emit("pick",e)}},{text:"一周前",onClick(t){const e=new Date;e.setTime(e.getTime()-6048e5),t.$emit("pick",e)}}]},servicekey:"",DataResult:!1,containerStyle:{},initFormData:{},expand:!1,renderAxiosPage:!1,renderPageSize:10,shapeColumnName:"shape",urlConfig:{}}),mounted(){this.title=this.data.apiName+"-综合查询",this.queryWidgeid=this.data.queryList,this.setStyle(),this.initForm(),this.queryWidgeid[0]&&(this.firstKey=this.queryWidgeid[0].value),this.expand&&this.changeForm()},methods:{changeForm(){this.visibleForm=!this.visibleForm,this.$refs.dataInfoResult&&this.visibleTopResult||(this.visibleFormPanel=this.visibleForm)},changeFocus(t){t.value==this.firstKey&&(this.visibleForm=!0)},changeTopPanel(){this.visibleTopResult=!this.visibleTopResult,this.visibleFormPanel=!this.visibleTopResult,this.$refs.dataInfoResult&&this.$refs.dataInfoResult.setMaxHeightChange(this.visibleFormPanel)},getMap(){return this.map},getBuffer(){var t=20;return this.map&&this.map.M.iqueryManager&&(t=this.map.M.iqueryManager.getBuffer())<1e-4&&(t=1e-4),t},initForm(){this.formVisible=!1,this.count=this.queryWidgeid.length,new Promise((t=>{var e={};this.queryWidgeid.forEach(((i,s)=>{switch(i.dataType){case"ComboBox":this.remoteMethod(i);break;case"GeometryBox":this.shapeColumnName=i.value||this.shapeColumnName}e[i.value]=JSON.parse(JSON.stringify(i.defaultValue?i.defaultValue:"")),"NumberRange"==i.dataType&&(i.defaultValue||"0"==i.defaultValue?e[i.value]=Number(i.defaultValue):delete e[i.value]),s==this.count-1&&t(e)}))})).then((t=>{this.form=JSON.parse(JSON.stringify(t)),this.formVisible=!1,this.$nextTick((()=>{this.formVisible=!0,this.initFormData=JSON.parse(JSON.stringify(this.form))}))}))},successDraw(t,e,i){this.form[t]=e,i&&Array.isArray(i)&&(this.form.stx=i[0])},onRefresh(){this.form=JSON.parse(JSON.stringify(this.initFormData)),this.onClear()},onSubmit(){this.$refs.form.validate((t=>{if(t){let t={...this.form},i=Object.assign({current:1,size:1e3},t);var e=i[this.shapeColumnName];e&&e.toLowerCase().indexOf("point")>-1&&(i.buffer=this.getBuffer()),this.axiosOptions={renderAxiosPage:this.renderAxiosPage,current:1,size:this.renderPageSize,customURL:this.urlConfig.customURL_QQuery,customURL_QQuery:this.urlConfig.customURL_QQuery,select_code:this.selectCode},i.current=this.axiosOptions.current,i.size=this.axiosOptions.renderAxiosPage?this.axiosOptions.size:1e3,this.axiosOptions.renderAxiosPage&&(this.axiosOptions.getAxiosSearchData=this.getAxiosSearchData),this.axiosOptions.conditions=i,this.getAxiosSearchData(this.axiosOptions,i,(t=>{this.DataResult=!1,this.$nextTick((()=>{this.DataResult=t.data}))}))}}))},getAxiosSearchData(t,e,i){this.customAxios({method:"post",url:`${t.customURL||this.urlConfig.customURL_QQuery}/${t.select_code}`,headers:{"Content-Type":"application/json"},data:{conditions:e}}).then((t=>{200==t.code?i&&i(t):window.MapMessage.ShowMessage({message:t.msg,type:"warning"})}))},onClear(){this.DataResult=!1,this.onClearMap&&this.onClearMap()},close(){},remoteMethod(t){let e=t.groupId;if(!this.codeList[e])if(e){const t=this.urlConfig.customURL_dict;dr.get({url:t,params:{groupCode:e,dictCode:e},nomessage:!0}).then((t=>{t&&t.data&&(t.data.map((t=>{void 0===t.value&&(t.value=t.itemCode),void 0===t.label&&(t.label=t.itemName),void 0===t.enabled&&(t.enabled=t.status)})),this.codeList[e]=t.data,this.formVisible=!1,this.$nextTick((()=>{this.formVisible=!0})))}))}else this.codeList[e]=[]},setStyle(){this.$nextTick((()=>{this.containerStyle=Object.assign({"z-index":4},this.position)}))}},computed:{queryStyle(){return{height:35*this.count}}},beforeDestroy(){this.map&&this.map.$MapEventBus.$emit("map-left-list-close")}};const Zm=Qm;var tg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-datainfo-container",style:t.containerStyle,attrs:{id:t.domid}},[t.formVisible?i("div",{staticClass:"map-datainfo-panel",style:t.queryStyle,attrs:{id:"map-datainfo-panel"}},[i("i",{staticClass:"arrow",class:[t.visibleForm?"el-icon-arrow-up":"el-icon-arrow-down"],on:{click:t.changeForm}}),t._v(" "),i("el-form",{ref:"form",attrs:{model:t.form,"label-width":"85px"}},[t._l(t.queryWidgeid,(function(e,s){return[0==s?i("form-item",{key:s,attrs:{xindex:s,codeList:t.codeList,form:t.form,item:e,map:t.map},on:{changeFocus:t.changeFocus,successDraw:t.successDraw}}):t._e()]})),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.visibleFormPanel,expression:"visibleFormPanel"}]},[t._l(t.queryWidgeid,(function(e,s){return[s>0?i("form-item",{key:s,attrs:{xindex:s,codeList:t.codeList,form:t.form,item:e,map:t.map},on:{successDraw:t.successDraw}}):t._e()]})),t._v(" "),i("div",{staticClass:"datainfo-btn"},[t.closeBtn?i("el-button",{attrs:{size:"small"},on:{click:t.close}},[t._v("关闭")]):t._e(),t._v(" "),i("el-button",{attrs:{size:"small"},on:{click:t.onRefresh}},[t._v("重置")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSubmit}},[t._v("查询")])],1)],2)],2)],1):t._e(),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.visibleForm,expression:"visibleForm"}]},[t.DataResult?i("div",{staticClass:"map-datainfo-result"},[i("DataInfoResult",{ref:"dataInfoResult",attrs:{map:t.map,cdata:t.DataResult,cOffsetHeight:t.offsetHeight,cMainHeight:t.mainHeight,axiosOptions:t.axiosOptions},on:{changeTopPanel:t.changeTopPanel}})],1):t._e()])])};tg._withStripped=!0;const eg=bi({render:tg,staticRenderFns:[]},undefined,Zm,"data-v-036f0576",false,undefined,!1,void 0,void 0,void 0);const ig={data:()=>({domId:"",data:[],playState:!1,silderValue:0,stepValue:1,silderVisible:!1,marks:{},widthValue:"320px",maxWidthValue:"320px",timer:null,overflowValue:"auto",playInterval:2e3,immediateNext:!1}),mounted(){const t=this.data.length;this.silderCount=t-1,this.$nextTick((()=>{this.setMaxWidth()})),this.widthValue=80*t+"px",this.setMarks(),this.silderVisible=!0},methods:{setMaxWidth(){var t=document.getElementById(this.domId);if(t){var e=.8*t.clientWidth-100+"px";parseFloat(this.widthValue)<parseFloat(e)?(this.maxWidthValue="auto",this.overflowValue="unset"):this.maxWidthValue=e}},setMarks(){this.data.forEach(((t,e)=>{this.marks[e]=t.mapLayerName||t.label}))},handlerPlay(){try{if(this.playState)this.playState=!1,this.timer&&clearInterval(this.timer);else{this.playState=!0,this.timer&&clearInterval(this.timer),this.silderValue>=this.silderCount&&(this.silderValue=0);const t=this.getPlayInterval?this.getPlayInterval():this.playInterval;this.intervalFun=()=>{this.data[this.silderValue]&&(this.silderValue+=this.stepValue),this.silderValue>=this.silderCount&&(this.playState=!1,clearInterval(this.timer))},this.immediateNext&&this.intervalFun(),this.timer=setInterval((()=>{this.intervalFun()}),t)}}catch(t){this.playState=!1,this.timer&&clearInterval(this.timer)}},inputSilder(t){this.changeMapImage&&this.changeMapImage(t)},close(){}},beforeDestroy(){this.timer&&clearInterval(this.timer),this.close&&this.close()}};var sg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-image-compare-container animate__animated animate__fadeIn",attrs:{id:t.domId}},[i("div",{staticClass:"mx-image-content"},[i("div",{staticClass:"image-close",on:{click:t.close}},[i("i",{staticClass:"el-icon-close"})]),t._v(" "),t.silderVisible?i("div",{staticClass:"apanel1"},[i("i",{class:[t.playState?"el-icon-video-pause":"el-icon-video-play"],attrs:{title:t.playState?"暂停":"播放"},on:{click:t.handlerPlay}}),t._v(" "),i("div",{staticClass:"image-side-container",style:{maxWidth:t.maxWidthValue,overflow:t.overflowValue}},[i("el-slider",{staticClass:"image-side",style:{width:t.widthValue},attrs:{min:0,max:t.silderCount,step:t.stepValue,"show-tooltip":!1,"show-stops":"",marks:t.marks,size:"small"},on:{input:t.inputSilder},model:{value:t.silderValue,callback:function(e){t.silderValue=e},expression:"silderValue"}})],1)]):t._e()])])};sg._withStripped=!0;const ag=bi({render:sg,staticRenderFns:[]},undefined,ig,"data-v-2f4d3925",false,undefined,!1,void 0,void 0,void 0),ng={map_draw_point_pickup_geo:{name:"拾取",svg:'<svg t="1726649164341" class="icon"\n viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" \n p-id="13310" width="24" height="24">\n <path d="M888.32 595.968l-119.296-44.032c17.408-40.96 26.624-86.016 26.624-133.12 0-190.976-155.648-346.624-346.624-346.624S102.4 227.328 102.4 418.816s155.648 346.624 346.624 346.624c30.208 0 59.392-4.096 87.04-11.264l52.224 141.824c1.536 5.632 9.216 6.656 11.776 1.024l80.384-208.384c0.512-1.536 1.536-2.56 3.072-3.072l206.336-77.824c5.12-2.048 4.608-10.24-1.536-11.776zM143.36 418.816c0-168.448 137.216-305.664 305.664-305.664 168.448 0 305.664 137.216 305.664 305.664 0 42.496-8.704 82.432-24.064 119.296L645.12 506.368c30.72-68.608 24.064-150.528-22.528-214.528-2.56-3.584-7.168-4.096-10.752-1.536-3.584 2.56-4.096 7.168-1.536 10.752 43.52 59.392 49.664 136.192 20.48 199.68l-14.848-5.632-189.44-69.632c-4.608-1.024-9.216 3.072-7.68 7.68L484.352 614.4c-56.832 10.24-117.248-4.608-164.352-44.544-3.072-2.56-8.192-2.56-10.752 1.024-2.56 3.072-2.56 8.192 1.024 10.752 40.448 34.304 89.6 51.712 139.264 51.712 13.824 0 27.136-1.536 40.448-4.096l31.744 86.016c-23.552 5.632-47.616 8.704-72.704 8.704-168.448 0.512-305.664-136.704-305.664-305.152z" p-id="13311"></path><path d="M311.808 274.944c70.656-67.584 182.272-73.216 259.584-13.312 3.584 2.56 8.192 2.048 10.752-1.536s2.048-8.192-1.536-10.752c-82.944-64.512-203.264-58.368-279.552 14.336-76.288 73.216-88.064 193.024-27.136 279.04 1.536 2.048 4.096 3.072 6.144 3.072 1.536 0 3.072-0.512 4.608-1.536 3.584-2.56 4.096-7.168 2.048-10.752-56.832-79.36-46.08-190.976 25.088-258.56z" \n p-id="13312"></path></svg>'},map_draw_point_canvas:{name:"poi",svg:'<svg\n t="1686208906464"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="1483"\n width="20"\n height="20"\n >\n <path\n d="M512 0C301.056 0 129.536 171.008 129.536 382.464 129.536 635.392 512 1024 512 1024s382.464-363.008 382.464-641.536C894.464 171.008 722.944 0 512 0z m0 557.568c-107.52 0-194.56-87.04-194.56-194.56s87.04-194.56 194.56-194.56 194.56 87.04 194.56 194.56-87.04 194.56-194.56 194.56z"\n p-id="1484"\n ></path>\n <path\n d="M512 363.52m-194.56 0a194.56 194.56 0 1 0 389.12 0 194.56 194.56 0 1 0-389.12 0Z"\n fill="#FFFFFF"\n p-id="1485"\n ></path>\n </svg>'},map_draw_point_geo:{name:"点",svg:'<svg\n t="1686290675207"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="25777"\n width="24"\n height="24"\n >\n <path\n d="M863.9 362c-19.2-45.5-46.8-86.3-81.8-121.3-35.1-35.1-75.9-62.6-121.3-81.8-47.1-19.9-97.1-30-148.6-30s-101.5 10.1-148.6 30c-45.5 19.2-86.3 46.8-121.3 81.8-35.1 35.1-62.6 75.9-81.8 121.3-19.9 47.1-30 97.1-30 148.6s10.1 101.5 30 148.6c19.2 45.5 46.8 86.3 81.8 121.3 35.1 35.1 75.9 62.6 121.3 81.8 47.1 19.9 97.1 30 148.6 30s101.5-10.1 148.6-30c45.5-19.2 86.3-46.8 121.3-81.8 35.1-35.1 62.6-75.9 81.8-121.3 19.9-47.1 30-97.1 30-148.6s-10.1-101.5-30-148.6zM512.1 852.4c-188.5 0-341.8-153.3-341.8-341.8s153.3-341.8 341.8-341.8 341.8 153.3 341.8 341.8-153.3 341.8-341.8 341.8z"\n p-id="25778"\n ></path>\n <path\n d="M512.1 510.6m-153.8 0a153.8 153.8 0 1 0 307.6 0 153.8 153.8 0 1 0-307.6 0Z"\n p-id="25779"\n ></path>\n </svg>'},map_draw_polyline:{name:"线",svg:'<svg\n t="1686209349467"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="3640"\n width="24"\n height="24"\n >\n <path\n d="M243.616 650.08l113.696-214.288 42.4 22.496-113.696 214.272zM625.088 569.92l113.696-214.272 42.4 22.496-113.68 214.288zM455.248 455.472l42.656-21.984 67.36 130.704-42.672 21.984z"\n p-id="3641"\n ></path>\n <path\n d="M221.12 743.52m-71.04 0a71.04 71.04 0 1 0 142.08 0 71.04 71.04 0 1 0-142.08 0Z"\n p-id="3642"\n ></path>\n <path\n d="M588.32 590.24c-39.2 0-71.04 31.84-71.04 71.04s31.84 71.2 71.04 71.2a71.12 71.12 0 0 0 0-142.24zM496.64 363.2c0-39.2-31.84-71.2-71.04-71.2a71.12 71.12 0 0 0 0 142.24c39.2 0 71.04-31.84 71.04-71.04z"\n p-id="3643"\n ></path>\n <path\n d="M802.88 280.48m-71.04 0a71.04 71.04 0 1 0 142.08 0 71.04 71.04 0 1 0-142.08 0Z"\n p-id="3644"\n ></path>\n </svg>'},map_draw_polygon:{name:"面",svg:'<svg\n t="1686209935389"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="29372"\n width="24"\n height="24"\n >\n <path\n d="M792 826H232c-13.28 0-24-10.72-24-24V490.48c0-6.16 2.4-12.16 6.64-16.64l242.24-252.48c4.72-4.88 11.2-7.6 18.08-7.36 6.8 0.24 13.2 3.28 17.6 8.48l317.76 376.72c3.68 4.32 5.68 9.84 5.68 15.44v187.36c0 13.28-10.72 24-24 24z m-536-48h512V623.44l-294.96-349.6L256 500.16v277.84z"\n p-id="29373"\n ></path>\n </svg>'},map_draw_circle:{name:"圆",svg:'<svg\n t="1686212080974"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="36459"\n width="24"\n height="24"\n >\n <path\n d="M512.000512 512m-81.864496 0a81.864496 81.864496 0 1 0 163.728992 0 81.864496 81.864496 0 1 0-163.728992 0Z"\n p-id="36460"\n ></path>\n <path\n d="M925.251464 337.411683c-22.590508-53.410444-54.926984-101.373829-96.108919-142.555763s-89.144296-73.517387-142.555763-96.107895c-55.311747-23.394826-114.050546-35.256992-174.587294-35.256992s-119.27657 11.862165-174.587293 35.256992c-53.411467 22.590508-101.373829 54.92596-142.556787 96.107895-41.181935 41.181935-73.517387 89.145319-96.107895 142.555763-23.394826 55.310723-35.256992 114.051569-35.256992 174.588317s11.862165 119.27657 35.256992 174.587294c22.591531 53.410444 54.926984 101.373829 96.107895 142.556786 41.182958 41.181935 89.145319 73.518411 142.556787 96.108918 55.310723 23.394826 114.050546 35.256992 174.587293 35.256992s119.27657-11.862165 174.587294-35.256992c53.410444-22.590508 101.372805-54.926984 142.555763-96.108918s73.518411-89.145319 96.108919-142.556786c23.394826-55.310723 35.256992-114.050546 35.256991-174.587294 0-60.537771-11.862165-119.277594-35.256991-174.588317zM511.999488 909.343657c-219.095997 0-397.343657-178.24766-397.343657-397.343657S292.903491 114.656343 511.999488 114.656343 909.343145 292.904003 909.343145 512 731.095485 909.343657 511.999488 909.343657z"\n p-id="36461"\n ></path>\n </svg>'},map_draw_rectangle:{name:"矩形",svg:'<svg\n t="1686212503737"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="40288"\n width="24"\n height="24"\n >\n <path\n d="M876.4664713541666 302.9680989583333H776.4029947916665V202.90462239583334c0-11.865234374999998-9.8876953125-21.7529296875-21.7529296875-21.7529296875s-21.7529296875 9.8876953125-21.7529296875 21.7529296875v100.0634765625H632.8336588541666c-11.865234374999998 0-21.7529296875 9.8876953125-21.7529296875 21.7529296875s9.8876953125 21.7529296875 21.7529296875 21.7529296875h100.0634765625v100.0634765625c0 11.865234374999998 9.8876953125 21.7529296875 21.7529296875 21.7529296875s21.7529296875-9.8876953125 21.7529296875-21.7529296875V346.4739583333333H876.4664713541666c11.865234374999998 0 21.7529296875-9.8876953125 21.7529296875-21.7529296875 0-12.2607421875-9.8876953125-21.7529296875-21.7529296875-21.7529296875zM146.75455729166666 386.0247395833333c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625h0.7910156249999999v-21.7529296875h36.38671875c10.678710937499998 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-9.0966796875-19.775390625-19.775390625-19.775390625l-56.953125-0.39550781249999994c-11.07421875 0-19.775390625 8.701171874999998-19.775390625 19.775390625v42.71484374999999c0 9.8876953125 8.701171874999998 18.984374999999996 19.775390625 18.984374999999996z m135.26367187500003-41.92382812499999h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-8.701171874999998-19.775390625-19.775390625-19.775390625h-98.876953125c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625 0 11.07421875 9.0966796875 19.775390625 19.775390625 19.775390625z m177.1875 0h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-8.701171874999998-19.775390625-19.775390625-19.775390625h-98.876953125c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625 0.7910156249999999 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625zM774.8209635416665 560.8391927083335c0-11.07421875-8.701171874999998-19.775390625-19.775390625-19.775390625s-19.775390625 8.701171874999998-19.775390625 19.775390625v98.876953125c0 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625s19.775390625-8.701171874999998 19.775390625-19.775390625v-98.876953125z m-19.775390625 157.41210937500003c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625v64.072265625h-79.1015625v1.1865234374999998c-11.07421875 0-19.775390625 8.701171874999998-19.775390625 19.775390625s8.701171874999998 19.775390625 19.775390625 19.775390625h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625V738.8177083333334c0-11.865234374999998-9.0966796875-20.56640625-19.775390625-20.56640625zM581.0221354166666 802.0989583333333L166.52994791666666 801.3079427083333V423.2024739583333h-0.7910156249999999c0-11.07421875-8.701171874999998-19.775390625-19.775390625-19.775390625s-19.775390625 8.701171874999998-19.775390625 19.775390625V821.8743489583334c0 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625H579.8356119791666c11.07421875 0 19.775390625-9.0966796875 19.775390625-19.775390625 0-11.07421875-9.0966796875-19.775390625-18.5888671875-19.775390625z"\n p-id="40289"\n ></path>\n </svg>'},map_draw_text:{name:"文本",svg:'<svg\n t="1686292575158"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="29443"\n width="24"\n height="24"\n >\n <path\n d="M206.791111 76.572444c38.058667 0 68.892444 30.890667 68.892445 68.949334v2.844444h428.828444V217.315556H275.683556v4.835555c0 38.058667-30.833778 68.892444-68.892445 68.892445h-15.36v398.222222h15.36c38.058667 0 68.892444 30.890667 68.892445 68.949333v4.721778h428.828444v68.949333H275.683556v2.901334c0 38.115556-30.833778 68.949333-68.892445 68.949333H130.161778c-38.058667 0-68.892444-30.890667-68.892445-68.949333v-76.572445c0-38.115556 30.833778-68.949333 68.892445-68.949333h-7.623111v-398.222222h7.623111c-38.058667 0-68.892444-30.833778-68.892445-68.892445V145.521778c0-38.115556 30.833778-68.949333 68.892445-68.949334h76.629333z m566.670222 214.471112c-38.058667 0-68.892444-30.890667-68.892444-68.949334V145.521778c0-38.115556 30.833778-68.949333 68.892444-68.949334h76.572445c38.115556 0 68.949333 30.890667 68.949333 68.949334v76.572444c0 38.058667-30.890667 68.892444-68.949333 68.892445h7.68v398.222222h-7.68c38.115556 0 68.949333 30.890667 68.949333 68.949333v76.572445c0 38.115556-30.890667 68.949333-68.949333 68.949333h-76.572445c-38.058667 0-68.892444-30.890667-68.892444-68.949333v-76.572445c0-38.115556 30.833778-68.949333 68.892444-68.949333h15.303111v-398.222222h-15.303111z m-566.670222 467.057777H130.161778v76.629334h76.629333v-76.572445z m643.242667 0h-76.572445v76.629334h76.572445v-76.572445z m-241.208889-424.96a34.474667 34.474667 0 0 1 0 68.892445h-84.764445v237.397333a34.474667 34.474667 0 0 1-68.835555 0L455.111111 402.033778H371.427556a34.474667 34.474667 0 0 1 0-68.892445h237.397333zM206.791111 145.521778H130.161778v76.572444h76.629333V145.521778z m643.242667 0h-76.572445v76.572444h76.572445V145.521778z"\n p-id="29444"\n ></path>\n </svg>'},map_draw_files:{name:"文件导入",svg:'<svg\n t="1702365604407"\n class="icon"\n viewBox="0 0 1024 1024"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n p-id="1816"\n width="24"\n height="24"\n >\n <path\n d="M426.666667 170.666667l85.333333 85.333333h341.333333a85.333333 85.333333 0 0 1 85.333334 85.333333v426.666667a85.333333 85.333333 0 0 1-85.333334 85.333333H170.666667a85.333333 85.333333 0 0 1-85.333334-85.333333V256a85.333333 85.333333 0 0 1 85.333334-85.333333h256z m426.666666 170.666666H170.666667v426.666667h682.666666V341.333333zM384 384v85.333333H298.666667v170.666667h85.333333v85.333333H213.333333V384h170.666667z m128 42.666667v88.32h128v80.213333h-128V682.666667l-128-128 128-128z"\n p-id="1817"\n ></path>\n </svg>'},clear:{name:"清除",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">\n <path\n d="M8.5,11v-1h13v1H8.5z M12.5,8c0-0.6,0.4-1,1-1h3\n\tc0.6,0,1,0.4,1,1v1h-5V8z M12.5,21h1v-9h1v9h1v-9h1v9h1v-9h2v10c0,0.6-0.4,1-1,1h-7c-0.6,0-1-0.4-1-1V12h2V21z"\n />\n </svg>'}};var og={pointRadius:6,color:"rgba(255, 0, 0, 0.8)",fillColor:"rgba(255, 0, 0, 0.25)",width:2,textHaloWidth:5,textColor:"rgba(0, 0, 0, 1)",textHaloColor:"rgba(255, 255, 255, 1)",textFontSize:"14px",lineStyle:"soild",symbolname:"",symbolSize:1};var rg=new class{constructor(){this.map=null,this.renderStyle=og,this.drawTypeControls=["map_draw_point_geo","map_draw_rectangle","map_draw_circle","map_draw_polygon","map_draw_files","clear"],this.activeDraw="",this.form={textContent:"文本标注"},this.poiList=[],this.drawCallback=null,this.drawCallbackData={},this.drawEnd=null,this.selected=!0,this.fitBounds=!1,this.drawTypeMode="single",this.selectDrawCallback=null}getDrawResult(){return this.drawCallbackData}getDrawMergeResult(){var t=Object.values(this.drawCallbackData||{});return Pp.st_mergewkt(t)}loadMap(t){this.map=t,this.clearDraw()}mapDraw(t){this.activeDraw!=t&&this.map.GLSDK.mapCloseDraw(),this.activeDraw=t;var e=this.getRenderStyle();if("map_draw_point_pickup_geo"!=this.activeDraw){const i=this.drawTypeMode;this.map.GLSDK.mapStartDraw({type:t,mode:i,sticky:{target:""},renderStyle:e,selected:this.selected,clear:!1},((t,e,s)=>{const{id:a,shape:n}=s;this.drawCallbackData[a]=n,"single"==i&&(this.activeDraw="",this.map.ExAPI.setCursor(""),this.drawEndCall()),this.drawCallback&&this.drawCallback(this.drawCallbackData)}))}else this.map.GLSDK.drawCommonPickUpVisible=!0,this.map.GLSDK.ChangeIQuery(!0,!0),this.map.GLSDK.setOnlyPickUp(!0,null,!1,!1),this.map.GLSDK.getIQueryDataCallback=(t,e)=>{this.setPickUpDrawData(t,e)};this.map.GLSDK.mapDrawControl.on("selected",(t=>{this.selectDrawCallback&&this.selectDrawCallback(t)})),this.map.GLSDK.mapDrawControl.on("remove-selected",(t=>{this.removeSelectedData(t)}))}removeSelectedData(t){this.drawCallbackData[t]&&delete this.drawCallbackData[t],this.drawCallback&&this.drawCallback(this.drawCallbackData)}getRenderStyle(){var t=Object.assign({},og,this.renderStyle||{}),e={pointColor:t.color,lineColor:t.color,fillColor:t.fillColor,fillOutLineColor:t.color,lineWidth:t.width,fillOutLineWidth:t.width,pointRadius:t.pointRadius,lineStyle:t.lineStyle,textColor:t.textColor,textFontSize:t.textFontSize,textHaloWidth:t.textHaloWidth,textHaloColor:t.textHaloColor,text:this.form.textContent,symbolSize:parseFloat(t.symbolSize)};const i=t.symbolname;return i&&"默认图标"!=i&&(e.symbolname=i,e.symbolself=!0,e.symbolSize=parseFloat(t.symbolSize),this.addMarkerImage(i)),e}addMarkerImage(t){this.poiList.forEach((e=>{e.name==t&&this.map.GLSDK.addMarkerImage([e])}))}handleChangeUpload(t){window.MapMessage.ShowLoading({text:"正在读取文件...."});const e=t.name.split(".").pop().toLowerCase();switch(e){case"zip":case"dwg":case"shp":this.showImportMapCommonByJava(t,e)}}showImportMapCommonByJava(t){const e=this.map.GLSDK.getOnemapConfig().customURL_ReadGeoJSONByFile;dr.postShape({url:e,files:t}).then((async e=>{var i={features:[],type:"FeatureCollection"};e.data.forEach((t=>{"FeatureCollection"==t.type?i.features=i.features.concat(t.features):i.features=i.features.concat(t.Collection.features)})),Array.isArray(e)||200==e.code?this.showMapLocations(t,e.data[0].Collection,"geojson"):(window.MapMessage.ShowMessage({type:"warning",message:`文件读取失败:${e.msg}`||"未知"}),this.map.$MapEventBus.$emit("map-show-readfiles-callback",""))}))}showMapLocations(t,e,i="qdata"){window.MapMessage.CloseLoading();const s="geojson"==i?e.features.length:e.length,a=t.name;if(0==s)return void window.MapMessage.ShowMessage({type:"warning",duration:5e3,message:`文件:${a}未检测到空间要素!请重新上传!`});const n=this.getDrawType(e);this.activeDraw!=n&&this.map.GLSDK.mapCloseDraw(),this.activeDraw=n;if(!n)return this.activeDraw="",this.map.ExAPI.setCursor(""),this.drawEndCall(),void(this.drawCallback&&this.drawCallback(this.drawCallbackData));this.map.GLSDK.mapStartDraw({type:n,data:e,mode:"single",sticky:{target:""},renderStyle:this.getRenderStyle(),selected:this.selected,clear:!1,fitBounds:this.fitBounds},((t,e,i)=>{this.setFileToMapData(JSON.parse(JSON.stringify(t))),this.activeDraw="",this.map.ExAPI.setCursor(""),this.drawEndCall(),this.drawCallback&&this.drawCallback(this.drawCallbackData)})),this.map.GLSDK.mapDrawControl.on("selected",(t=>{this.selectDrawCallback&&this.selectDrawCallback(t)})),this.map.GLSDK.mapDrawControl.on("remove-selected",(t=>{this.removeSelectedData(t)}))}setFileToMapData(t){t.features.forEach((t=>{var e=t.id||Math.random();if(t.geometry){var i=Pp.st_geojson2wkt(t.geometry);this.drawCallbackData[e]=i}}))}setPickUpDrawData(t,e){"string"!=typeof e||"object"!=typeof t?(t.forEach((t=>{var e=t.name+"_layersPickup";t.records.forEach((t=>{t.shape&&(this.drawCallbackData[e+t.id]=t.shape)}))})),this.drawCallback&&this.drawCallback(this.drawCallbackData)):this.clearPickUpDrawData(e,t.id)}clearPickUpDrawData(t,e){this.map.GLSDK.clearOnlyPickUpData(t,e),delete this.drawCallbackData[t+e],this.drawCallback&&this.drawCallback(this.drawCallbackData)}getDrawType(t){var e;const i=t.features.filter((t=>t.geometry));if(i.length>0){const t=i[0].geometry.type.toLowerCase();t.indexOf("point")>-1?e="map_draw_point_canvas":t.indexOf("linestring")>-1?e="map_draw_polyline":t.indexOf("polygon")>-1&&(e="map_draw_polygon")}return e}removeSelectedDraw(){this.map.GLSDK.mapDrawControl.removeSelectedFeature()}clearDraw(){this.map&&(this.map.GLSDK.mapClearDraw(),this.map.GLSDK.onlyPickUpVisible&&(this.map.GLSDK.clearOverlay(),this.map.GLSDK.ChangeIQuery(!1,!0),this.map.GLSDK.drawCommonPickUpVisible=!1,this.map.GLSDK.setOnlyPickUp(!1,null,!1),this.map.GLSDK.getIQueryDataCallback=null),this.map.ExAPI.setCursor("")),this.activeDraw="",this.drawEndCall(),this.drawCallbackData={},this.drawCallback&&this.drawCallback(this.drawCallbackData)}drawEndCall(){this.drawEnd&&this.drawEnd()}closeDraw(){this.map.GLSDK.mapCloseDraw(),this.activeDraw="",this.map.ExAPI.setCursor(""),this.drawEndCall()}},lg={name:"MedoxMapDraw",props:{drawTypeDomList:{type:Object,default:()=>ng},drawStyle:{type:Object,default:function(){return{}}},tooltip:{type:Object,default:function(){return{placement:"top",effect:"light"}}},operateVisible:{type:Boolean,default:!0},deleteSelectLabel:{type:String,default:"删除选中"}},mounted(){rg.renderStyle=Object.assign(rg.renderStyle,this.drawStyle||{}),this.drawTypeControls=rg.drawTypeControls,rg.selected=this.operateVisible,rg.drawEnd=()=>{this.activeDraw=""},rg.selectDrawCallback=t=>{this.showSelectClearBtn=t}},data:()=>({acceptFileType:".dwg,.shp,.zip",activeDraw:"",drawTypeControls:[],showSelectClearBtn:!1}),methods:{mapDraw(t){if(this.showSelectClearBtn=!1,"clear"===t)this.activeDraw="",rg.clearDraw();else this.activeDraw=t,rg.mapDraw(t)},handleChangeUpload(t,e){rg.handleChangeUpload(t,e)},removeSelectedDraw(){rg.removeSelectedDraw(),this.showSelectClearBtn=!1}}};const hg=lg;var cg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-draw-body"},[i("div",{staticClass:"mx-draw-container"},[t._l(t.drawTypeControls,(function(e,s){return["map_draw_files"!=e?i("el-tooltip",{key:s,staticClass:"item",attrs:{effect:t.tooltip.effect||"light",content:t.drawTypeDomList[e].name,placement:t.tooltip.placement||"top"}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:t.activeDraw==e},domProps:{innerHTML:t._s(t.drawTypeDomList[e].svg)},on:{click:function(i){return t.mapDraw(e)}}})]):i("el-tooltip",{key:s,staticClass:"item",attrs:{content:t.drawTypeDomList[e].name,placement:t.tooltip.placement||"top",effect:t.tooltip.effect||"light"}},[i("el-upload",{ref:"elUpload",refInFor:!0,staticClass:"mx-upload-layer mx-print-draw-icon",attrs:{action:"#","on-change":t.handleChangeUpload,multiple:!0,accept:t.acceptFileType,"auto-upload":!1}},[i("div",{staticClass:"mx-print-draw-icon",class:{activedraw:t.activeDraw==e},domProps:{innerHTML:t._s(t.drawTypeDomList[e].svg)}})])],1)]}))],2),t._v(" "),t.operateVisible&&t.showSelectClearBtn?i("div",{staticClass:"mx-draw-btn"},[i("el-button",{staticClass:"mx-text-btn",attrs:{size:"mini"},on:{click:t.removeSelectedDraw}},[t._v(t._s(t.deleteSelectLabel||"删除选中")+"\n ")]),t._v(" "),t._e(),t._v(" "),t._e()],1):t._e()])};cg._withStripped=!0;const pg=bi({render:cg,staticRenderFns:[]},undefined,hg,"data-v-14a4f085",false,undefined,!1,void 0,void 0,void 0);const ug={components:{MedoxMapDraw:pg},data:()=>({domId:"map-data-export-panel",data:[],title:"",formatList:[],styleConfig:{},position:"",form:{layerId:"",exportBounds:"",exportType:""},rules:{layerId:[{required:!0,message:"请选择图层",trigger:"change"}]}}),mounted(){this.form.exportType=this.formatList[0];var t=this.data.filter((t=>"1"==t.status));t.length>0&&(this.form.layerId=t[0].id)},methods:{onSubmit(){this.$refs.form.validate((t=>{if(!t)return!1;this.onExport&&this.onExport(this.form)}))}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var dg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-data-export",style:t.styleCss,attrs:{id:t.domId}},[i("mx-map-card",{staticClass:"mx-onemap-content",attrs:{title:t.title},on:{close:t.close}},[i("template",{slot:"content"},[i("el-form",{ref:"form",attrs:{rules:t.rules,model:t.form,"label-width":"85px"}},[i("el-form-item",{attrs:{required:"",label:"资源名称",prop:"layerId"}},[i("el-select",{attrs:{placeholder:"请选择图层",size:"small",clearable:"",filterable:"","popper-append-to-body":!0,"popper-class":"mx-map-search-select"},model:{value:t.form.layerId,callback:function(e){t.$set(t.form,"layerId",e)},expression:"form.layerId"}},t._l(t.data,(function(t){return i("el-option",{key:t.id,attrs:{label:t.mapLayerName,value:t.id,disabled:void 0!==t.status&&"0"==t.status}})})),1)],1),t._v(" "),i("el-form-item",{attrs:{label:"导出范围"}},[i("MedoxMapDraw",{attrs:{operateVisible:!0}})],1),t._v(" "),i("el-form-item",{attrs:{label:"导出格式",prop:"exportType"}},[i("el-select",{attrs:{placeholder:"请选择导出格式",size:"small","popper-append-to-body":!0,"popper-class":"mx-map-search-select"},model:{value:t.form.exportType,callback:function(e){t.$set(t.form,"exportType",e)},expression:"form.exportType"}},t._l(t.formatList,(function(t){return i("el-option",{key:t,attrs:{label:t,value:t}})})),1)],1),t._v(" "),i("div",{staticClass:"mx-submit"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSubmit}},[t._v("导出")])],1)],1)],1)],2)],1)};dg._withStripped=!0;const mg=bi({render:dg,staticRenderFns:[]},undefined,ug,"data-v-bf004ec4",false,undefined,!1,void 0,void 0,void 0);const gg={data:()=>({domId:"map-pick-area-panel",title:"",styleConfig:{},position:"",form:{label:"拾取个数",label2:"综合面积",count:"0",area:"0 m²"}}),methods:{onSubmit(){},onClear(){},transformUnit(){}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var yg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-pick-area",style:t.styleCss,attrs:{id:t.domId}},[i("mx-map-card",{staticClass:"mx-onemap-content",attrs:{title:t.title},on:{close:t.close}},[i("template",{slot:"content"},[i("el-row",{attrs:{gutter:24}},[i("el-col",{attrs:{span:8}},[i("div",{staticClass:"map-pick-count"},[i("el-statistic",{key:"1",attrs:{title:t.form.label}},[i("template",{slot:"formatter"},[i("span",[t._v(t._s(t.form.count))])])],2)],1)]),t._v(" "),i("el-col",{attrs:{span:16}},[i("div",{staticClass:"map-pick-value-container"},[i("el-statistic",{key:"2",attrs:{title:t.form.label2}},[i("template",{slot:"title"},[i("div",{staticClass:"map-pick-title"},[i("span",[t._v(" "+t._s(t.form.label2))]),t._v(" "),i("i",{staticClass:"el-icon-refresh-right map-pick-refresh",on:{click:t.transformUnit}})])]),t._v(" "),i("div",{staticClass:"map-pick-value",attrs:{slot:"formatter"},slot:"formatter"},[i("span",[t._v(" "+t._s(t.form.area))])])],2)],1)])],1),t._v(" "),i("el-row",[i("div",{staticClass:"mx-submit"},[i("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.onClear}},[t._v("清除")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSubmit}},[t._v("开启拾取")])],1)])],1)],2)],1)};yg._withStripped=!0;const fg=bi({render:yg,staticRenderFns:[]},undefined,gg,undefined,false,undefined,!1,void 0,void 0,void 0);const _g={data:()=>({domId:"",data:[],playState:!1,silderValue:0,stepValue:.1,stepDefaultValue:.1,stepPlayValue:1,silderVisible:!1,marks:{},widthValue:"320px",maxWidthValue:"320px",timer:null,overflowValue:"auto",playInterval:2e3,firstLoad:!0}),mounted(){const t=this.data.length;this.silderCount=t-1,this.$nextTick((()=>{this.setMaxWidth()})),this.widthValue=80*t+"px",this.setMarks(),this.silderVisible=!0},methods:{setMaxWidth(){var t=document.getElementById(this.domId);if(t){var e=.8*t.clientWidth-100+"px";parseFloat(this.widthValue)<parseFloat(e)?(this.maxWidthValue="auto",this.overflowValue="unset"):this.maxWidthValue=e}},setMarks(){this.data.forEach(((t,e)=>{this.marks[e]=t.mapLayerName||t.label}))},handlerPlay(){try{if(this.playState)this.playState=!1,this.stepValue=this.stepDefaultValue,this.timer&&clearInterval(this.timer);else{this.playState=!0,this.stepValue=this.stepPlayValue,this.timer&&clearInterval(this.timer),this.silderValue>=this.silderCount&&(this.silderValue=0);const t=this.getPlayInterval?this.getPlayInterval():this.playInterval;this.intervalFun=()=>{this.silderValue+=this.stepValue,this.silderValue>=this.silderCount&&(this.playState=!1,this.stepValue=this.stepDefaultValue,clearInterval(this.timer))},this.timer=setInterval((()=>{this.intervalFun()}),t)}}catch(t){this.playState=!1,this.timer&&clearInterval(this.timer),this.stepValue=this.stepDefaultValue}},inputSilder(t){this.firstLoad?this.firstLoad=!1:this.changeOpacity&&this.changeOpacity(t)},close(){}},beforeDestroy(){this.timer&&clearInterval(this.timer),this.close&&this.close()}};var vg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-image-compare-container animate__animated animate__fadeIn",attrs:{id:t.domId}},[i("div",{staticClass:"mx-image-content"},[i("div",{staticClass:"image-close",on:{click:t.close}},[i("i",{staticClass:"el-icon-close"})]),t._v(" "),t.silderVisible?i("div",{staticClass:"apanel1"},[i("i",{class:[t.playState?"el-icon-video-pause":"el-icon-video-play"],attrs:{title:t.playState?"暂停":"播放"},on:{click:t.handlerPlay}}),t._v(" "),i("div",{staticClass:"image-side-container",style:{maxWidth:t.maxWidthValue,overflow:t.overflowValue}},[i("el-slider",{staticClass:"image-side",style:{width:t.widthValue},attrs:{min:0,max:t.silderCount,step:t.stepValue,"show-tooltip":!1,marks:t.marks,size:"small"},on:{input:t.inputSilder},model:{value:t.silderValue,callback:function(e){t.silderValue=e},expression:"silderValue"}})],1)]):t._e()])])};vg._withStripped=!0;const xg=bi({render:vg,staticRenderFns:[]},undefined,_g,"data-v-7647027e",false,undefined,!1,void 0,void 0,void 0);const Cg={props:{visible:{type:Boolean,default:()=>!1}},data:()=>({controlLabel:{coordinates:"坐标串",wkt:"WKT",geojson:"GeoJSON"},domId:"map-location-panel",title:"定位窗口",activeNames:"1",styleConfig:{},position:"",locationType:"",rules:{x:[{required:!0,message:"请输入坐标数字",trigger:"blur"}],y:[{required:!0,message:"请输入坐标数字",trigger:"blur"}],wkt:[{required:!0,message:"请输入",trigger:"change"}],geojson:[{required:!0,message:"请输入",trigger:"change"}]},label:{x:"经度坐标",y:"纬度坐标"},wktform:{wkt:""},geojsonform:{geojson:""},coorform:{x:"",y:""}}),mounted(){this.locationType=this.controls[0]},methods:{submit(){switch(this.locationType){case"coordinates":this.$refs.coorform.validate((t=>{t&&this.mapLocationData(`POINT(${this.coorform.x} ${this.coorform.y})`,"wkt")}));break;case"wkt":this.$refs.wktform.validate((t=>{t&&this.mapLocationData(this.wktform.wkt,"wkt")}));break;case"geojson":this.$refs.geojsonform.validate((t=>{t&&this.mapLocationData(this.geojsonform.geojson,"geojson")}))}},close(){}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var Lg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-control animate__animated animate__fadeIn",style:t.position,attrs:{id:t.domId}},[i("div",{staticClass:"map-container-content"},[i("div",{staticClass:"map-panel"},[i("el-collapse",{attrs:{accordion:""},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[i("el-collapse-item",{attrs:{name:"1"}},[i("template",{slot:"title"},[i("span",{staticClass:"mx-collapse-title"},[t._v(t._s(t.title))])]),t._v(" "),t.controls.length>1?i("div",{staticClass:"map-change-radio"},[i("el-radio-group",{attrs:{size:"mini"},model:{value:t.locationType,callback:function(e){t.locationType=e},expression:"locationType"}},[t._l(t.controls,(function(e,s){return[i("el-radio-button",{key:s,attrs:{label:e}},[t._v(t._s(t.controlLabel[e]))])]}))],2)],1):t._e(),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"coordinates"==t.locationType,expression:"locationType == 'coordinates'"}]},[i("el-form",{ref:"coorform",attrs:{model:t.coorform,rules:t.rules,"label-width":"80px"}},[i("el-form-item",{staticClass:"is-required",attrs:{label:t.label.x,prop:"x"}},[i("el-input",{attrs:{oninput:"value=value.replace(/[^0-9.]/g,'')",placeholder:"请输入坐标",clearable:""},model:{value:t.coorform.x,callback:function(e){t.$set(t.coorform,"x",e)},expression:"coorform.x"}})],1),t._v(" "),i("el-form-item",{staticClass:"is-required",attrs:{label:t.label.y,prop:"y"}},[i("el-input",{attrs:{oninput:"value=value.replace(/[^0-9.]/g,'')",placeholder:"请输入坐标",clearable:""},model:{value:t.coorform.y,callback:function(e){t.$set(t.coorform,"y",e)},expression:"coorform.y"}})],1)],1)],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"wkt"==t.locationType,expression:"locationType == 'wkt'"}]},[i("el-form",{ref:"wktform",attrs:{model:t.wktform,rules:t.rules,"label-width":"65px"}},[i("el-form-item",{staticClass:"is-required",attrs:{label:"WKT",prop:"wkt"}},[i("el-input",{attrs:{type:"textarea",placeholder:"请输入WKT",autosize:{minRows:2,maxRows:10},clearable:""},model:{value:t.wktform.wkt,callback:function(e){t.$set(t.wktform,"wkt",e)},expression:"wktform.wkt"}})],1)],1)],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"geojson"==t.locationType,expression:"locationType == 'geojson'"}]},[i("el-form",{ref:"geojsonform",attrs:{model:t.geojsonform,rules:t.rules,"label-width":"65px"}},[i("el-form-item",{staticClass:"is-required",attrs:{label:"内容",prop:"geojson"}},[i("el-input",{attrs:{type:"textarea",placeholder:"请输入",autosize:{minRows:2,maxRows:10},clearable:!0},model:{value:t.geojsonform.geojson,callback:function(e){t.$set(t.geojsonform,"geojson",e)},expression:"geojsonform.geojson"}})],1)],1)],1),t._v(" "),i("div",{staticClass:"mx-map-btn-container"},[i("el-button",{staticClass:"btn",attrs:{type:""},on:{click:t.close}},[t._v(t._s("关闭"))]),t._v(" "),i("el-button",{staticClass:"btn",attrs:{type:"primary"},on:{click:t.submit}},[t._v(t._s("确定"))])],1)],2)],1)],1)])])};Lg._withStripped=!0;const Mg=bi({render:Lg,staticRenderFns:[]},undefined,Cg,"data-v-33f4b0fc",false,undefined,!1,void 0,void 0,void 0);var bg;class wg{constructor(){this._templateDefaultInit={MEDOMAP_POPUP_DEFAULT:Xp,MEDOMAP_MOREINFO_DEFAULT:su,MEDOMAP_LIST_DEFAULT:hu,MEDOMAP_IMPORTFILES_DEFAULT:gu,MEDOMAP_WEBPRINT_DEFAULT:Em,MEDOMAP_COORDINATE_DEFAULT:_u,MEDOMAP_WEATHER_DEFAULT:Cu,MEDOMAP_TRACESLIDER_DEFAULT:wu,MEDOMAP_LENGED_DEFAULT:Nm,MEDOMAP_LOCATION_QUERY_DEFAULT:jm,MEDOMAP_QUERY_PANEL_DEFAULT:eg,MEDOMAP_DRAWTOOLS_DEFAULT:bg,MEDOMAP_LOCATIONTOOL_DEFAULT:Mg,MEDOMAP_IMAGECOMPARE_DEFAULT:ag,MEDOMAP_IMAGECOMPARE_OPACITY_DEFAULT:xg,MEDOMAP_DATA_EXPORT_DEFAULT:mg,MEDOMAP_PICK_AREA_DEFAULT:fg},this._templateDefault={MEDOMAP_POPUP_DEFAULT:Xp,MEDOMAP_MOREINFO_DEFAULT:su,MEDOMAP_LIST_DEFAULT:hu,MEDOMAP_IMPORTFILES_DEFAULT:gu,MEDOMAP_WEBPRINT_DEFAULT:Em,MEDOMAP_COORDINATE_DEFAULT:_u,MEDOMAP_WEATHER_DEFAULT:Cu,MEDOMAP_TRACESLIDER_DEFAULT:wu,MEDOMAP_LENGED_DEFAULT:Nm,MEDOMAP_LOCATION_QUERY_DEFAULT:jm,MEDOMAP_QUERY_PANEL_DEFAULT:eg,MEDOMAP_DRAWTOOLS_DEFAULT:bg,MEDOMAP_LOCATIONTOOL_DEFAULT:Mg,MEDOMAP_IMAGECOMPARE_DEFAULT:ag,MEDOMAP_IMAGECOMPARE_OPACITY_DEFAULT:xg,MEDOMAP_DATA_EXPORT_DEFAULT:mg,MEDOMAP_PICK_AREA_DEFAULT:fg},this._templateStyleConfigDefault={MEDOMAP_LIST_DEFAULT:{position:this.getListDefaultPosition()},MEDOMAP_WEATHER_DEFAULT:{position:this.getPositionStyle([null,null,"30px","15px"])},MEDOMAP_TRACESLIDER_DEFAULT:{position:this.getPositionStyle([null,null,"40px","50px"])},MEDOMAP_IMPORTFILES_DEFAULT:{position:this.getPositionStyle(["60px",null,null,"80px"])},MEDOMAP_WEBPRINT_DEFAULT:{position:this.getPositionStyle(["60px",null,null,"80px"])},MEDOMAP_LENGED_DEFAULT:{position:this.getPositionStyle([null,null,"30px","15px"])},MEDOMAP_LOCATION_QUERY_DEFAULT:{position:this.getListDefaultPosition()},MEDOMAP_QUERY_PANEL_DEFAULT:{position:this.getPositionStyle(["20px",null,null,"80px"])},MEDOMAP_DRAWTOOLS_DEFAULT:{position:this.getListDefaultPosition()},MEDOMAP_LOCATIONTOOL_DEFAULT:{position:this.getListDefaultPosition()},MEDOMAP_IMAGECOMPARE_DEFAULT:{position:this.getPositionStyle([null,null,"60px",null])},MEDOMAP_IMAGECOMPARE_OPACITY_DEFAULT:{position:this.getPositionStyle([null,null,"60px",null])},MEDOMAP_DATA_EXPORT_DEFAULT:{position:this.getListDefaultPosition()},MEDOMAP_PICK_AREA_DEFAULT:{position:this.getListDefaultPosition()}}}setMapListDefaultPosition(){this._templateStyleConfigDefault.MEDOMAP_LIST_DEFAULT.position=this.getListDefaultPosition()}setMapImportFileDefaultPosition(){this._templateStyleConfigDefault.MEDOMAP_IMPORTFILES_DEFAULT.position=this.getImportFilesDefaultPosition()}getListDefaultPosition(){const t=window.jqueryMap(".mx-map-search").position()||this.getDomPosition("mx-map-search");return t?(t.top=`${parseFloat(t.top+40)}px`,t.left=`${parseFloat(t.left)}px`,t.position="absolute",t):this.getPositionStyle(["60px",null,null,"80px"])}getDomPosition(t){var e,i=window.jqueryMap(`.${t}`);if(i&&1==i.length)e=i.position();else if((i=document.getElementsByClassName(t))[0]){var s=i[0],a=s.getBoundingClientRect(),n=s.parentElement.getBoundingClientRect();e={top:a.top-n.top,left:a.left-n.left}}return e}getImportFilesDefaultPosition(){const t=window.jqueryMap(".mx-map-tools").position()||this.getDomPosition("mx-map-tools"),e=window.jqueryMap(".mx-map-search").position()||this.getDomPosition("mx-map-search");if(t){if(t.top=`${parseFloat(t.top)}px`,e){const i=parseFloat(t.top),s=parseFloat(e.top);i<s&&(t.top=`${parseFloat(s+40)}px`)}return t.left=`${parseFloat(t.left+40)}px`,t.position="absolute",t}return this.getPositionStyle(["60px",null,null,"80px"])}getStyleConfigTemplate(t){return this._templateStyleConfigDefault[t]?JSON.parse(JSON.stringify(this._templateStyleConfigDefault[t])):{}}setStyleConfigTemplate(t,e){this._templateStyleConfigDefault[t]&&(this._templateStyleConfigDefault[t]=e)}setTemplate(t,e){this._templateDefault[t]=e||this._templateDefaultInit[t]}getTemplate(t){return this._templateDefault[t]}getInstance(t,e){var i=e;i.styleConfig||(i=Object.assign(i,{styleConfig:this.getStyleConfigTemplate(t)}));return new(w.default.extend(this._templateDefault[t]))({data:i})}getPositionStyle(t){return{position:"absolute",top:null==t[0]?"auto":t[0],right:null==t[1]?"auto":t[1],bottom:null==t[2]?"auto":t[2],left:null==t[3]?"auto":t[3]}}}class Sg{constructor(t){this.options=t||{},this.domid,this.position=this.options.position||[null,null,"40px","60px"],this.intance=null,this.lengedArr=[],this.getInstanceFactory=new wg,this.active=!1,this.legendObjTemp={},this.printMap=!0,this.dragResizeEnable=!1,this.dragResizeConfig={w:220,h:250,z:2,left:0,top:0,parentW:0,parentH:0}}addTo(t,e){this.map=t,this.destory();const i=this.map.getOnemapConfig(),s=this.map._container,a=s.id;this.domid=a+(this.options.id||"medomap-lenged");const n=i.optionControls[a],o=!!n&&n.MapLegend;if(!o)return;o.printMap&&void 0!==o.printMap&&(this.printMap=o.printMap),this.position=t.ExAPI.getPositionStyle(o.position||this.position);const r=void 0!==o.dragResizeEnable?o.dragResizeEnable:this.dragResizeEnable,l=void 0!==o.collapsedEnable&&o.collapsedEnable,h=void 0===o.imagePageEnable||o.imagePageEnable,c=o.type||"card";if("card"==c){Object.assign(this.dragResizeConfig,o.dragResizeConfig||{});const t=o.maxWidth||this.dragResizeConfig.w;this.dragResizeConfig.w=parseFloat(t)+60,this.dragResizeConfig.parentW=s.offsetWidth,this.dragResizeConfig.parentH=s.offsetHeight,this.dragResizeConfig.left=parseFloat(this.position.left),this.dragResizeConfig.top=this.dragResizeConfig.parentH-this.dragResizeConfig.h-parseFloat(this.position.bottom)}else this.dragResizeConfig.w=10,this.dragResizeConfig.h=10;return this.intance=this.getInstanceFactory.getInstance("MEDOMAP_LENGED_DEFAULT",{domid:this.domid,position:this.position,dragResizeEnable:r,imagePageEnable:h,maxWidth:this.dragResizeEnable&&"card"==c?"auto":o.maxWidth||"auto",marginLeft:o.marginLeft||0,showType:c,titleEnable:void 0===o.titleEnable||o.titleEnable,titleMainEnable:void 0!==o.titleMainEnable&&o.titleMainEnable,collapsedEnable:!(!h||"image"!=c)||l,collapsed:void 0===o.collapsed||o.collapsed,dragResizeConfig:this.dragResizeConfig}),this.map.ExAPI.appendMapControlContainer(this.intance),this.active=!0,e&&this.show(e.node,e.checked),this}show(t,e){this.addLenged(t,e),this.intance.addLenged(t,e)}addLenged(t,e){var i={id:t.id||t.ID,legend:t.legend,legendInfoList:t.legendInfoList,type:t.legendInfoList?"arcgis":"image"},s=i.id;e?this.legendObjTemp[s]=i.legend:this.legendObjTemp[s]&&delete this.legendObjTemp[s]}getLengedImage(t){this.intance&&0==this.intance.legendArr.length?t():am(this.domid,(e=>{t(e)}),[],"image/png")}destory(){this.map&&this.map.ExAPI&&this.map.ExAPI.removeMapControlContainer(this.domid)}}var Ig={default:[{level:0,resolution:156367.78906250003,scale:590995186.1175001},{level:1,resolution:78183.89453125001,scale:295497593.05875003},{level:2,resolution:39091.94726562501,scale:147748796.52937502},{level:3,resolution:19545.973632812504,scale:73874398.26468751},{level:4,resolution:9772.986816406252,scale:36937199.132343754},{level:5,resolution:4886.493408203126,scale:18468599.566171877},{level:6,resolution:2443.246704101563,scale:9234299.783085939},{level:7,resolution:1221.6233520507815,scale:4617149.891542969},{level:8,resolution:610.8116760253907,scale:2308574.9457714846},{level:9,resolution:305.40583801269537,scale:1154287.4728857423},{level:10,resolution:152.70291900634768,scale:577143.7364428712},{level:11,resolution:76.35145950317384,scale:288571.8682214356},{level:12,resolution:38.17572975158692,scale:144285.9341107178},{level:13,resolution:19.08786487579346,scale:72142.9670553589},{level:14,resolution:9.54393243789673,scale:36071.48352767945},{level:15,resolution:4.771966218948365,scale:18035.741763839724},{level:16,resolution:2.3859831094741826,scale:9017.870881919862},{level:17,resolution:1.1929915547370913,scale:4508.935440959931},{level:18,resolution:.5964957773685456,scale:2254.4677204799655},{level:19,resolution:.2982478886842728,scale:1127.2338602399827},{level:20,resolution:.1491239443421364,scale:563.6169301199914}],4490:[{level:0,resolution:1.406250026231578,scale:590995197.141668},{level:1,resolution:.703125013115789,scale:295497598.570834},{level:2,resolution:.3515625065578945,scale:147748799.285417},{level:3,resolution:.17578125327894775,scale:73874399.6427087},{level:4,resolution:.08789062663947399,scale:36937199.8213544},{level:5,resolution:.043945313319736994,scale:18468599.9106772},{level:6,resolution:.021972656659868472,scale:9234299.95533859},{level:7,resolution:.010986328329934226,scale:4617149.97766929},{level:8,resolution:.005493164164967124,scale:2308574.98883465},{level:9,resolution:.0027465820824835504,scale:1154287.49441732},{level:10,resolution:.0013732910412417797,scale:577143.747208662},{level:11,resolution:.0006866455206208899,scale:288571.873604331},{level:12,resolution:.0003433227603104438,scale:144285.936802165},{level:13,resolution:.0001716613801552224,scale:72142.9684010827},{level:14,resolution:8583069007761132e-20,scale:36071.4842005414},{level:15,resolution:4291534503880566e-20,scale:18035.7421002707},{level:16,resolution:21457672519402802e-21,scale:9017.87105013534},{level:17,resolution:10728836259701401e-21,scale:4508.93552506767},{level:18,resolution:5364418129850712e-21,scale:2254.46776253384},{level:19,resolution:2682209064925356e-21,scale:1127.23388126692},{level:20,resolution:1341104532462678e-21,scale:563.61694063346}],4326:[{level:0,resolution:.7039144156731805,scale:295829355.45},{level:1,resolution:.35195720784848755,scale:147914677.73},{level:2,resolution:.17597860391234646,scale:73957338.86},{level:3,resolution:.08798930195617323,scale:36978669.43},{level:4,resolution:.04399465098998392,scale:18489334.72},{level:5,resolution:.02199732549499196,scale:9244667.36},{level:6,resolution:.01099866274749598,scale:4622333.68},{level:7,resolution:.00549933137374799,scale:2311166.84},{level:8,resolution:.002749665686873995,scale:1155583.42},{level:9,resolution:.0013748328434369974,scale:577791.71},{level:10,resolution:.0006874164098211937,scale:288895.85},{level:11,resolution:.0003437082168079019,scale:144447.93},{level:12,resolution:.00017185409650664595,scale:72223.96},{level:13,resolution:8592704825332297e-20,scale:36111.98},{level:14,resolution:4296352412666149e-20,scale:18055.99},{level:15,resolution:2148177396063577e-20,scale:9028},{level:16,resolution:10740886980317885e-21,scale:4514},{level:17,resolution:5370443490158943e-21,scale:2257},{level:18,resolution:26852217450794713e-22,scale:1128.5},{level:19,resolution:13426108725397357e-22,scale:564.25}]};class Eg extends Rp{constructor(t,e){super(t,e)}init(){const{url:t,layer:e}=this.options;this.layer=e,this.layer.url=t}addToMap(t){this.options.minzoom&&void 0!==this.layer.minZoom&&(this.layer.minZoom=this.options.minzoom),this.options.maxzoom&&void 0!==this.layer.maxZoom&&(this.layer.maxZoom=this.options.maxzoom);const{map:e}=this;let i;this.layer.type="3DGS",this.layer.paint&&(this.layer.callback=(t,e)=>{t.setScale(this.layer.paint["model-scale"]||1),t.setRotation(this.getRotation(this.layer.paint));var i=this.getTranslate(this.layer.paint);t.setTranslate(i)}),t&&(i=e.getLayer(t)),i?e.addLayer(this.layer,t):e.addLayer(this.layer)}getOpacity(){return 1}setOpacity(){}}class Tg extends Rp{constructor(t,e){super(t,e)}init(){const{url:t,layer:e}=this.options;this.layer=e,this.layer.url=t}addToMap(t){this.options.minzoom&&void 0!==this.layer.minZoom&&(this.layer.minZoom=this.options.minzoom),this.options.maxzoom&&void 0!==this.layer.maxZoom&&(this.layer.maxZoom=this.options.maxzoom);const{map:e}=this;let i;t&&(i=e.getLayer(t)),i?e.addLayer(this.layer,t):e.addLayer(this.layer)}getOpacity(){return 1}setOpacity(){}}class Dg{constructor(t){this.map=t,this.initData(),this.layersStyles={}}initData(){this.layers={},this.layersEx={},this.layersLegend={},this.layersChangeData=[],this.polygonLayers={},this.lineLayers={},this.pointLayers={},this.layersExTypeArr=["popup_poi"],this.layersTempReals={},this.icxLayerResourcesTemp={},this.symbolHighLayerTemp=[],this.baseLayer={}}getLayerInstance(t){return this.layers[t]}getlayersExTypeArr(){return this.layersExTypeArr}getLayerInstanceByTreeId(t){if(!t)return null;var e=this.layers,i=[];for(let s in e)e.hasOwnProperty(s)&&e[s].virtualId===t&&i.push(e[s]);return i}getLayerInstanceFilter(t,e){var i=this.layers,s=[];for(let a in i)if(i.hasOwnProperty(a)){const n=i[a].layerType,o=!e||i[a].virtualId===e;(Array.isArray(t)?t.includes(n):!t||n===t)&&o&&s.push(i[a])}return s}getRealLayerInstanceFilter(t,e){var i=this.layers,s=[];for(let n in i)if(i.hasOwnProperty(n)){var a=i[n];const o=a.layerType,r=!e||a.virtualId===e;(Array.isArray(t)?t.includes(o):!t||o===t)&&r&&s.push(a.sceneMapLayerAll||a.layerRender)}return s}initBaseMapStyleSheet(t){t.baseMapStyleSheet&&t.baseMapStyleSheetChange&&this.setStyleRemainByStylesheet(t,t.baseMapStyleSheet)}async setStyleRemainByStylesheet(t,e){t.style.stylesheet=e;const i=e.layers,s=Object.keys(e.sources),a=s.length;new Promise((i=>{s.forEach(((s,n)=>{t.getSource(s)||t.addSource(s,e.sources[s]),n==a-1&&i()}))})).then((()=>{i.forEach((e=>{t.getLayer(e.id)&&t.removeLayer(e.id),t.addLayer(e,"t_base")})),t.mapIsLoading=!1}))}async addBaseLayer(t,e){let i=t;i=Object.assign(i,{beforeId:"t_base"}),this.map.GLSDK&&"number"==typeof this.map.GLSDK.baseMapOpacity&&(i.opacity=this.map.GLSDK.baseMapOpacity),this.baseLayer[i.id]=i.id,await this.addLayer(i,!0,e)}async getProxyServer(t){const e=await fr({url:t});return 200==e.code&&e.data&&e.data||{}}async addLayer(t,e=!1,i){const{id:s,geometryType:a,serverType:n}=t;if(this.layers[s])return void(i&&i());if(t.geoMapMarkerList&&this.addMapSymbolImage(t.geoMapMarkerList),"ProxyServer"==n&&t.url){var o=await this.getProxyServer(t.url);t.url=o.url,t.serverType=o.serverType||null,t.source&&(t.source.tiles[0]=t.url)}const r=await this.getLayer(t);let l="t_point";switch(a){case"点":l="t_point",this.pointLayers[s]=r;break;case"线":l="t_line",this.lineLayers[s]=r;break;case"面":l="t_polygon",this.polygonLayers[s]=r;break;default:this.pointLayers[s]=r}e&&(l="t_base"),await r.addToMap(t.selfBeforeId||l),"StyleLayer"==r.layerType?this.layersStyles[s]=r:this.layers[s]=r,i&&i()}changeBaseMapOpacity(t){"number"==typeof t&&Object.keys(this.baseLayer).forEach((e=>{this.layers[e]&&this.layers[e].setOpacity(t),this.layersStyles[e]&&this.layersStyles[e].setOpacity(t)}))}getLayerHighLightEnable(t){const e=this.icxLayerResourcesTemp[t];if(e){var i=[];for(let t=0;t<e.length;t++){const s=e[t];this.layers[s]&&this.layers[s].symbolLayerEnable&&i.push(s)}return i}return""}setLayerHighLight(t,e){this.symbolHighLayerTemp=[],t.forEach((t=>{this.layers[t]&&(this.symbolHighLayerTemp.push(t),this.layers[t].realLayerIdsHighLight(e))}))}removeLayerHighLight(t){const e=[...this.symbolHighLayerTemp];this.symbolHighLayerTemp=[],e.forEach((e=>{this.layers[e].unHighLight(t)}))}addLayerEx(t){this.layersEx[t.id]=t,this.map.GLSDK?setTimeout((()=>{this.map.GLSDK.addLayerEx(this.layersEx[t.id])}),200):this.layersEx[t.id].defaultChecked=!0}setLayerFilter(t,e){var i=Object.keys(this.layers);if(0!=i.length){var s=i.filter((e=>{const i=this.layers[e],s=i.options;return i.realLayerIds.includes(t)||s.id==t||s.label==t||s.virtualId==t}));if(s.length>0){const i=s[0];this.layers[i].setLayerFilter(t,e)}}}addDefaultCheckedLayerEx(){var t=Object.keys(this.layersEx);if(t.length>0){var e=t[0];if(!this.layersEx[e].defaultChecked)return;t.forEach((t=>{this.layersEx[t].defaultChecked&&this.map.GLSDK.addLayerEx(this.layersEx[t])}))}}mapLayerChangeCheck(t,e){!1!==this.map.mapLegendVisible&&this.mapLegendShow(t,e),this.map.GLSDK?this.map.GLSDK.mapLayerChangeCheck(t,e,this.map):this.layersChangeData.push(t)}async mapLegendShow(t,e){var{id:i}=t;if(!t.children)if(!this.map.MapLayerLegend||e){if(this.layersLegend[i])t.legendInfoList=this.layersLegend[i];else{const e=t.layerIds,s=await this.getLegendInfoList(e);s.length>0&&(t.legendInfoList=s,this.layersLegend[i]=s)}if(t.legendInfoList||t.legend)if(this.map.MapLayerLegend)this.map.MapLayerLegend.show(t,e);else{const i=this.map.getOnemapConfig().optionControls[this.map._container.id];if(!(!!i&&i.MapLegend))return;this.map.MapLayerLegend=(new Sg).addTo(this.map,{node:t,checked:e})}}else this.map.MapLayerLegend.show(t,e)}getLegendInfoList(t){var e=[];return t.forEach((t=>{this.layers[t]&&this.layers[t].legendService&&(e=e.concat(this.layers[t].legendInfo))})),e}mapLayerChangeDefaultChecked(){this.layersChangeData.forEach((t=>{this.map.GLSDK.mapLayerChangeCheck(t,!0,this.map)}))}getLayerById(t){return this.layers[t]||void 0}getQueryLayerIds(){const{layers:t}=this;let e=[],i={},s=[],a=[];for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const o=t[n];o.options.supportIQuery&&o.options.iQueryIdList&&o.options.iQueryIdList.length&&("3dtile"==o.options.layerType&&o.propertyName?s.push(o.id):"model"==o.options.layerType&&o.propertyName?a.push(o.id):(e=e.concat(o.options.iQueryIdList),i=Object.assign(i,this.getObjSourcesIdsList(o.options.iQueryIdList,[o.id],i))))}return this.icxLayerResourcesTemp=Object.assign(this.icxLayerResourcesTemp,i),{layerIds:e,layerIds3Dtiles:s,layerIdsModel:a,layerSourcesIdsKeyPid:i}}getObjSourcesIdsList(t,e,i){return t.reduce(((t,s)=>(i[s]&&(e=e.concat(i[s])),t[s]=e,t)),{})}getQueryLayerRealIds(){const{layers:t}=this;let e=[];for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const s=t[i];if(s.options.supportIQuery){const{options:t}=s;if(t.layer.layers&&Array.isArray(t.layer.layers)){const i=this.getLayerIdsToLayers(t.layer.layers,t);e=e.concat(i)}else e=e.concat(s.id),this.layersTempReals[s.id]=t}}return e}getQueryLayerRealIdsByMapLayerId(t){const{layers:e}=this;let i=[];if(Object.prototype.hasOwnProperty.call(e,t)){const s=e[t],{options:a}=s;if(a.layer.layers&&Array.isArray(a.layer.layers)){const t=this.getLayerIdsToLayers(a.layer.layers,a);i=i.concat(t)}else i=i.concat(s.id)}return i}getLayerRealIdsByTree(t,e){let i=[];if(t.layer.layers&&Array.isArray(t.layer.layers)){const s=this.getLayerIdsToLayers(t.layer.layers,t,e);i=i.concat(s)}else i=i.concat(t.layer.id),e&&e.push(t.layer.id);return i}getLayerName(t){return this.layersTempReals[t]?this.layersTempReals[t].label:""}getLayeriQueryIdList(t){return this.layersTempReals[t]?this.layersTempReals[t].iQueryIdList:[]}getLayerIdsToLayers(t,e,i){let s=[];for(const a of t){let t=a.id;if(a.expandPro){const e=JSON.parse(a.expandPro);e.id&&(t=e.id)}s=s.concat(t),this.layersTempReals[t]=e,i&&i.push(t)}return s}removeLayerById(t){const e=this.layers[t]||void 0;e&&e.clear(!e.cache),e&&e.options.supportIQuery&&e.iQueryIdList&&e.iQueryIdList.length>0&&this.map.$MapEventBus.$emit("remove-layer-iquery-locations",e.iQueryIdList);const i=this.layersStyles[t]||void 0;i&&i.clear(),delete this.layersStyles[t],delete this.layers[t],delete this.pointLayers[t],delete this.lineLayers[t],delete this.polygonLayers[t],delete this.baseLayer[t]}removeLayerExById(t){this.layersEx[t]&&(this.map.GLSDK.removeLayerEx(this.layersEx[t]),delete this.layersEx[t])}async getLayer(t){const{layerType:e}=t;let i=null;switch(e.toLowerCase()){case"raster":i="arcgis"==t.serverType.toLowerCase()?await this.getCustomRasterLayer(t):await this.getRasterLayer(t);break;case"vector":i=await this.getVectorLayer(t);break;case"geojson":i=await this.getGeoJsonLayer(t);break;case"3dtile":case"3dtiles":i=await this.getTile3DLayer(t);break;case"model":i=await this.getModelLayer(t);break;case"arcgis-tile":i=await this.getCustomRasterLayer(t);break;case"wmts":i=await this.getWmtsLayer(t);break;case"arcgis-tile-iis":case"arcgis-tile-iis10":i=await this.getCustomRasterIISLayer(t);break;case"arcgis-dynamic":i=await this.getDynamicLayer(t);break;case"scene":i=await this.getSceneLayer(t);break;case"static":i=await this.getStaticLayer(t);break;case"style":i=await this.getStyleLayer(t);break;case"style-business":i=await this.getStyleBusinessLayer(t);break;case"3dgs":case"3dgs-lod":i=await this.getMap3DGSLayer(t);break;case"common":i=await this.getCommonLayer(t)}return i}async getRasterLayer(t){let e=t;e=await this.formatAttributes(e);return new Fp(this.map,e)}async getVectorLayer(t){let e=t;e=await this.formatAttributes(e);const i=new Bp(this.map,e);return await i.init(),i}async getGeoJsonLayer(t){let e=t;e=await this.formatAttributes(e);return new Gp(this.map,e)}async getTile3DLayer(t){let e=t;e=await this.formatAttributes(e);return new Hp(this.map,e)}async getSceneLayer(t){let e=t;e=await this.formatAttributes(e);return new $p(this.map,e)}async getStyleLayer(t){let e=t;e=await this.formatAttributes(e);return new zp(this.map,e)}async getStyleBusinessLayer(t){let e=t;e=await this.formatAttributes(e);return new jp(this.map,e)}async getCommonLayer(t){let e=t;e=await this.formatAttributes(e);const i=new Tg(this.map,e);return await i.init(),i}async getMap3DGSLayer(t){let e=t;e=await this.formatAttributes(e);const i=new Eg(this.map,e);return await i.init(),i}async getModelLayer(t){let e=t;e=await this.formatAttributes(e);return new Wp(this.map,e)}async getCustomRasterIISLayer(t){let e=t;const{map:i}=this;e=await this.formatAttributes(e);let s=e.url;s+="/Conf.xml",s=`${s}${e._token?`?${e._token}`:""}`;const a=await fr({url:s}),n=await this.getXmlToJson(a),o=this.getTileInfoByXmlJson(n);if(o.spatialReference){const t=o.spatialReference.wkid;this.isIntNum(t)&&(e.projection=t.toString())}const r=i.M.view.get().resolution||o.lods.map((t=>t.resolution));if(o.lods.length){const t=Ig[e.projection||""]||Ig.default,i=o.lods[0].resolution,s=[];t.map((t=>(s.push(Math.abs(t.resolution-i)),t)));const a=0-s.findIndex((t=>t===Math.min(...s)));e.source.zoomOffset=a;const n=Math.abs(a)+1;for(let t=1;t<n;t++)r.unshift(i*Math.pow(2,t));"4326"==e.projection&&(e.source.zoomOffset=e.source.zoomOffset-1)}e.tileInfo={origin:[o.origin.x,o.origin.y],resolutions:r,tileSize:o.rows||256},e.source.zoomOffset<-15&&(delete e.source.zoomOffset,delete e.tileInfo.resolutions);const l=new Up(this.map,e);return await l.init(),l}async getWmtsLayer(t){let e=t;const{map:i}=this;e=await this.formatAttributes(e);let s=e.url;const a=e._token;a&&(s.indexOf("{token}")>-1?s=s.replace("{token}",a):s+=`${s.indexOf("?")>-1?"&":"?"}${a}`),s+=(s.indexOf("?")>-1?"&":"?")+"service=WMTS&request=GetCapabilities";const n=await fr({url:s}),o=await this.getXmlToJson(n),r=this.getTileInfoByWmtsXmlJson(o),l=r.lods.length;if(r.spatialReference){const t=r.spatialReference.wkid;this.isIntNum(t)&&(e.projection=t.toString())}const h=i.M.view.get().resolution||r.lods.map((t=>t.resolution));if(r.lods.length){if(["4490","3857"].includes(e.projection)&&l>=21)e.source.zoomOffset=0;else{const t=Ig[e.projection||""]||Ig.default,i=r.lods[0].resolution,s=[];t.map((t=>(s.push(Math.abs(t.resolution-i)),t)));const a=0-s.findIndex((t=>t===Math.min(...s)));e.source.zoomOffset=a;const n=Math.abs(a)+1;for(let t=1;t<n;t++)h.unshift(i*Math.pow(2,t))}"4326"==e.projection&&(e.source.zoomOffset=e.source.zoomOffset-1)}e.tileInfo={origin:[r.origin.x,r.origin.y],resolutions:h,tileSize:r.rows||256,style:r.style},e.source.zoomOffset<-15&&(delete e.source.zoomOffset,delete e.tileInfo.resolutions);const c=new Up(this.map,e);return await c.init(),c}getTileInfoByXmlJson(t){const e=t.CacheInfo.TileCacheInfo[0],i=e.LODInfos[0].LODInfo,s=e.SpatialReference[0].WKID[0],a=e.TileOrigin[0],n=parseInt(e.TileRows[0]);var o={rows:n,cols:n,format:"PNG",lods:[],origin:{x:parseFloat(a.X[0]),y:parseFloat(a.Y[0])},spatialReference:{wkid:s}};return i.forEach((t=>{o.lods.push({level:parseFloat(t.LevelID[0]),resolution:parseFloat(t.Resolution[0]),scale:parseFloat(t.Scale[0])})})),o}getTileInfoByWmtsXmlJson(t){const e=t.Capabilities.Contents[0].TileMatrixSet,i=e[0].TileMatrix,s=e[0]["ows:Identifier"][0];let a=i[0].TopLeftCorner[0];a=a.split(" ");var n={x:parseFloat(a[1]),y:parseFloat(a[0])};const o=parseInt(i[0].TileWidth);var r={rows:o,cols:o,format:"PNG",lods:[],origin:n,style:s};return i.forEach((t=>{const e=parseFloat(t.ScaleDenominator[0]),i=9.144/(1/e*2*90.714*Math.PI*6378137);r.lods.push({level:parseFloat(t["ows:Identifier"][0]),resolution:i,scale:e})})),r}async getXmlToJson(t){return new Promise((e=>{f.parseString(t,((t,i)=>{t?console.error("Error parsing XML:",t):e(i)}))}))}async getCustomRasterLayer(t){let e=t;const{map:i}=this;e=await this.formatAttributes(e);let s=`${e.url}${e._token?`?${e._token}`:""}`;s.indexOf("f=json")<0&&(s.indexOf("?")>-1?s+="&f=json":s+="?f=json");const{tileInfo:a,fullExtent:n,spatialReference:o}=await fr({url:s});if(o){const t=o.wkid;this.isIntNum(t)&&(e.projection=t.toString())}const r=i.M.view.get().resolution||a.lods.map((t=>t.resolution));if(a.lods.length){const t=Ig[e.projection||""]||Ig.default,i=a.lods[0].resolution,s=[];t.map((t=>(s.push(Math.abs(t.resolution-i)),t)));const n=0-s.findIndex((t=>t===Math.min(...s)));e.source.zoomOffset=n;const o=Math.abs(n)+1;for(let t=1;t<o;t++)r.unshift(i*Math.pow(2,t));"4326"==e.projection&&(e.source.zoomOffset=e.source.zoomOffset-1)}e.tileInfo={origin:[a.origin.x,a.origin.y],resolutions:r,tileSize:a.rows||256},e.source.zoomOffset<-15&&(delete e.source.zoomOffset,delete e.tileInfo.resolutions),n&&(e.source.extent=[n.xmin,n.ymin,n.xmax,n.ymax]);const l=new Up(this.map,e);return await l.init(),l}async getDynamicLayer(t){let e=t;e=await this.formatAttributes(e),e.tileInfo={};const i=new Vp(this.map,e);return await i.init(),i}getStaticLayer(t){return new qp(this.map,t)}async formatAttributes(t){const e=t,i=e.token?await this.map.M.tokenManager.get(e.token):null;return e._token=i,e}async addMapSymbolImage(t){null!=t&&0!=t.length&&t.forEach((t=>{const e=t.markerUrl;var i=function(t){return t.substring(t.lastIndexOf(".")+1)||""}(e);"svg"===i.toLowerCase()?Fd.addImageSvgToMap(this.map,t):this.map.loadImage(e,((e,i)=>{if(e)throw e;this.map.hasImage(t.markerName)?this.map.updateImage(t.markerName,i):this.map.addImage(t.markerName,i,{sdf:t.sdf||!1})}))}))}isIntNum(t){return new RegExp(/^\d{1,}$/).test(t)}get3DAnalysisInstanceLayer(){var t=[];return Object.keys(this.layers).forEach((e=>{let i=this.layers[e],s=i.layerType;if(["model","3dtiles","scene"].includes(s)&&i.getInstanceLayer){let e=i.getInstanceLayer();e&&t.push(e)}})),t}setLayerOpacity(t,e){this.layers[t]&&this.layers[t].setOpacity(e)}setLayerVisible(t,e){this.layers[t]&&this.layers[t].setVisible(e)}}class Pg{constructor(t,e){this.map=t,this.oneMapConfig=this.getOnemapConfig(),this.options=e,this.click=null,this.map.$MapEventBus.$on("map-show-left-list",(t=>{})),this.iqueryBuffer={},this.queryRenderedFeatures=!1,this.closeAllFitBounds=!1,this.clearOverlay=!0,this.renderStyle={},this.initBuffer(),this.active=!1,this.onlyPickUp={visible:!1,clear:!0},this.parmsQuery}getOnemapConfig(){return this.map.getOnemapConfig()}initBuffer(){this.iqueryBuffer=this.oneMapConfig.iqueryBuffer||{},this.queryRenderedFeatures=this.iqueryBuffer.queryRenderedFeatures,this.closeAllFitBounds=this.iqueryBuffer.closeAllFitBounds,this.clearOverlay=0!=this.iqueryBuffer.clearOverlay}getBuffer(t){if(void 0!==this.iqueryBuffer.buffer)return this.iqueryBuffer.buffer;const e=this.map.unproject([0,40]),i=this.map.unproject([0,0]);let s=vs({type:"Feature",geometry:{type:"LineString",coordinates:[[e.lat,e.lng],[i.lat,i.lng]]}})||15;if(t){t[0]>180&&s<1&&(s=this.getMeters(s),s>200&&(s=200),s<20&&(s=20))}return s}getMeters(t){return 111e3*t}create(){this.clearOverlay&&this.map.M.clear("map-iquery-clear"),this.clear(),this.map.M.setCursor("help"),this.click=async t=>{if(this.map.stopPropagation&&this.map.stopPropagation(t))return;this.map.M.data.clear("g_source");let{layerIds:e,layerIds3Dtiles:i,layerIdsModel:s}=this.map.M.layerManager.getQueryLayerIds();const a=this.map.GLSDK.mapLayerManagerAPI.getQueryLayerIds()||[];e=Array.from(new Set(e.concat(a)));let n=this.map.GLSDK.mapLocationsLayerControl.getLayersidAll();const o=this.map.GLSDK.getDataToMapLayersIdAll();n=Array.from(new Set(n.concat(o)));if(this.map.queryRenderedFeatures(t.point,{layers:n}).length>0)return;var r,l=null;if(i.length>0&&(l=await this.query3DTilesLayer(i,t.point)),s.length>0&&(l=await this.queryModelLayer(s,t.point)),this.map.GLSDK.mapIQueryJustActionCallback||this.queryRenderedFeatures){const e=this.map.M.layerManager.getQueryLayerRealIds(),i=this.map.queryRenderedFeatures(t.point,{layers:e});if(i.forEach(((t,e)=>{const s=t.layer.id,a=this.map.M.layerManager.getLayerName(s),n=this.map.M.layerManager.getLayerIqueryApis(s);i[e].layerName=a,i[e].iQueryIdList=n})),this.map.GLSDK.mapIQueryJustActionCallback)return void this.map.GLSDK.mapIQueryJustActionCallback(i,l);if(i){var h=r=i[0];if(h){var c=this.map.GLSDK.getOnClickFun(h);if(c)return void c(r,i,l)}}}if(0===e.length&&0===i.length&&0===s.length)return;this.map.M.setCursor("wait");let p=null;if(this.map.projection){const[e,i]=t.coordinate;p=[e,i]}else{const{lng:e,lat:i}=t.lngLat;p=[e,i],this.map.sz2000sdk&&(p=this.map.MapmostSDKConvert.toDefinedProj(p)),this.map.enableTransform&&(p=this.map.M.projTransform(null,this.map.enableTransform.srid,p))}this.map.M.setCursor("help");const{popupTemplate:u}=this.options;if(u&&u.getData){const t=this.getBuffer(p);var d={apiIds:e,coordinate:p,conditions:{size:void 0!==this.iqueryBuffer.size?this.iqueryBuffer.size:1e3,current:1,buffer:t,x:p[0],y:p[1],deviation:this.iqueryBuffer.deviation}},m=!0;if(l)d.apiIds=l.iQueryIdList,d.conditions.project_name=l.propertyName,m=!1;else if(this.queryRenderedFeatures&&r){if(this.map.GLSDK.unhighlight3DTiles(),d.apiIds=r.iQueryIdList,d.conditions.project_name=r.properties.id||r.properties.objectid,r.geometry)"Point"==r.geometry.type&&(m=!1)}else this.map.GLSDK.unhighlight3DTiles();if(0===d.apiIds.length)return;Object.assign(d.conditions,this.map.GLSDK.queryParamsExtra||{});const i=await u.getData(d);if(this.parmsQuery=d,200===i.code&&i.data.length){var g=i.data.filter((t=>0!=t.total));if(g.length)this.onlyPickUp.visible?this.onlyPickUp.clear?this.map.GLSDK.clearOverlay((()=>{this.addMapOnlyPickUp(g)}),"map-iquery-clear"):this.addMapOnlyPickUp(g):(this.clearOverlay&&this.map.GLSDK.clearOverlay(null,"map-iquery-clear"),this.map.$MapEventBus.$emit("map-show-left-list",{data:g,showShape:m,closeAllFitBounds:this.closeAllFitBounds}));else try{this.map.$MapEventBus.$emit("map-popup-close"),this.map.$MapEventBus.$emit("map-left-list-close"),this.onlyPickUp.visible?this.onlyPickUp.clear&&this.map.GLSDK.clearOverlay(null,"map-iquery-clear"):this.clearOverlay&&this.map.GLSDK.clearOverlay(null,"map-iquery-clear")}catch(t){console.log(t)}this.map.GLSDK.getIQueryDataCallback&&this.map.GLSDK.getIQueryDataCallback(g,this.onlyPickUp)}else window.MapMessage.ShowMessage({message:i.msg,type:"warning"})}},this.map.on("click",this.click),this.active=!0}query3DTilesLayer(t,e){var i;for(let n=0;n<t.length;n++){const o=t[n];var s=this.map.M.layerManager.getLayerInstance(o),a=s.query3DTiles(e);if(a){i={label:s.label,propertyName:a,iQueryIdList:s.iQueryIdList};break}}return i}queryModelLayer(t,e){var i;for(let n=0;n<t.length;n++){const o=t[n];var s=this.map.M.layerManager.getLayerInstance(o),a=s.selectModel(e);if(a){i={label:s.label,propertyName:a,iQueryIdList:s.iQueryIdList};break}}return i}addMapOnlyPickUp(t){t.forEach((t=>{var e=t.name+"_layersPickup",i=t.apiId||"";this.map.GLSDK.mapLocationsData({layerkey:e,data:t.records,apiId:i,options:{layerLabel:!1,layerType:"symbol_poi",closeMouseMoveTip:!0,avoidance:!1,renderStyle:"object"==typeof this.onlyPickUp&&this.onlyPickUp.renderStyle||{}},onlyPickUp:!0,fitBounds:!1,clear:this.onlyPickUp.clear,click:(t,e,i)=>{this.map.GLSDK.getIQueryDataCallback&&this.map.GLSDK.getIQueryDataCallback(i,e,this.onlyPickUp)}})}))}clear(){this.map.M.setCursor(""),this.map.off("click",this.click),this.active=!1,this.onlyPickUp={visible:!1,clear:!0}}async spatialIquery(t,e){if(this.map.M.isDoingDraw||this.map.GLSDK.mapDrawControl.isDoingDraw)return;this.map.M.data.clear("g_source");let{layerIds:i}=this.map.M.layerManager.getQueryLayerIds();const s=this.map.GLSDK.mapLayerManagerAPI.getQueryLayerIds()||[];if(i=Array.from(new Set(i.concat(s))),0===i.length)return;const{popupTemplate:a}=this.options;if(a&&a.getData){var n={apiIds:i,coordinate:[],type:"poly",conditions:{size:1e3,current:1,buffer:5,geometry:t,x:0,y:0}};Object.assign(n.conditions,this.map.GLSDK.queryParamsExtra||{});const s=await a.getData(n);if(this.parmsQuery=n,200===s.code&&s.data.length){var o=s.data.filter((t=>0!=t.total));if(o.length)this.onlyPickUp.visible?this.addMapOnlyPickUp(o):this.map.$MapEventBus.$emit("map-show-left-list",{data:o}),e&&e(o);else try{this.map.$MapEventBus.$emit("map-popup-close"),this.map.$MapEventBus.$emit("map-left-list-close")}catch(t){console.log(t)}this.map.GLSDK.getIQueryDataCallback&&this.map.GLSDK.getIQueryDataCallback(o,this.onlyPickUp)}else window.MapMessage.ShowMessage({message:s.msg,type:"warning"})}}async reGetIqueryDataByCode(t,e){if(!this.parmsQuery)return;var i=JSON.parse(JSON.stringify(this.parmsQuery));i.apiIds=t,Object.assign(i.conditions,e||{});const{popupTemplate:s}=this.options,a=await s.getData(i);return 200===a.code&&a.data.length?a.data[0]:null}}class Og{constructor(t){this.map=t,this.init()}init(){this.markerList=[],this.data=[],this.active=0}show(t){const{list:e,data:i}=t;this.data=i,this.active=0,this.list=e,this.options=t,this.renderMarker(e,t)}renderMarker(t,e){let i=e;this.hide(),this.markerList=[],i=i||{},i.className=i.className||"",i.innerHTML=i.innerHTML||"number",t.map(((t,e)=>{const s=document.createElement("div");s.className=`${i.className} icon-bubble ${e==this.active?"active":""}`,s.title=e+1,"number"===i.innerHTML?s.innerHTML=`<span>${e+1}</span>`:s.innerHTML=i.innerHTML;const a=this.getCoordinate(t),n=new I.default.Marker({element:s,draggable:!1,anchor:"center",className:"map-marker"}).setLngLat(a).addTo(this.map);return n.getElement().addEventListener("click",(()=>{event.stopPropagation(),this.clickItem(e)})),this.markerList.push({id:e,center:a,marker:n}),t})),this.map.flyTo({center:this.markerList[this.active].center}),this.map.M.popupManager.show({center:this.markerList[this.active].center,content:[this.data[this.active]]})}hide(){this.markerList.map((t=>(t.marker.remove(),t))),this.map.M.popupManager.hide()}clickItem(t){this.active=t,this.renderMarker(this.list,this.options)}getCoordinate(t){const{Utils:e}=I.default;return e.centerOfMass(t.geometry.coordinates).geometry.coordinates}}class kg{constructor(t,e){const i=t;E.default.init(i),i.M={},this.init(i,e),i.M.pubsub=new Oi}init(t,e){const i=t;i.M={GLOBSOURCE:"g_source",GLOBEPOINTLAYER:"g_pointLayer",GLOBELINELAYER:"g_lineLayer",GLOBEPOLYGONLAYER:"g_polygonLayer",tokenManager:new Np,layerManager:new Dg(i,e),iqueryManager:new Pg(i,e),markerManager:new Og(i,e),projTransform:np};const s={data:{center:[0,0],zoom:11,bearing:0,pitch:0,curve:1},set:function(t={}){s.data=Object.assign(s.data,t)},get:function(){return s.data}};i.M.view=s;const a={setVisible:function(t,e){i.getLayer(t)&&i.setLayoutProperty(t,"visibility",e?"visible":"none")}};i.M.layer=a;const n={clear:function(t){const e=i.getSource(t);e&&e.setData({type:"FeatureCollection",features:[]})},setFeatures:function(t,e){const s=i.getSource(t);s&&(e.map((t=>{const e=t;return e.properties={selected:0,...e.properties||{}},e})),s.setData({type:"FeatureCollection",features:e}))},updateFeaturesByUUID:function(t,e){const s=i.getSource(t);if(s){const{features:t}=s._data;t.map((t=>{const i=t;return i.properties.uuid===e?i.properties.selected=1:i.properties.selected=0,i})),s.setData({type:"FeatureCollection",features:t})}},insertFeatures:function(t,e=[]){const s=i.getSource(t);if(s){const t=s._data.features||[];s.setData({type:"FeatureCollection",features:t.concat(e)})}}};i.M.data=n,i.M.initAddBaseLayer=this.initAddBaseLayer,i.M.initAddBaseLayerAll=this.initAddBaseLayerAll,this.createBasePlaceLayer(i),this.createGlobePlaceLayer(i),this.createGlobeHighlightLayer(i),i.M.setCursor=function(t){i.getCanvasContainer().style.cursor=t||"default",i.getCanvas().style.cursor=t||"default"},i.M.setCursorIQuery=function(){i.M.iqueryManager.active?i.M.setCursor("help"):i.M.setCursor("")},i.M.clear=function(){i.M.pubsub.publish("clear"),i.M.setCursorIQuery(),i.M.data.clear("t_source"),i.unhighlight3DTiles&&i.unhighlight3DTiles(),i.unhighlightModelLayer&&i.unhighlightModelLayer()},i.M.getCoordinateType=function(){return!(i.getCenter()[0]>180||i.enableTransform)};const o={measure:null,clear:function(){null!==this.measure&&this.measure.clear(),this.measure=null}};i.M.action=o,i.M.isGeographical=i.M.getCoordinateType()}initAddBaseLayerAll(t){this.createBasePlaceLayer(t),this.createGlobePlaceLayer(t),this.createGlobeHighlightLayer(t)}initAddBaseLayer(t){this.createBasePlaceLayer(t),this.createGlobePlaceLayer(t)}createBasePlaceLayer(t){t.getLayer("t_underground")||t.addLayer({id:"t_underground",type:"background",paint:{"background-color":"transparent"}}),t.getLayer("t_base")||t.addLayer({id:"t_base",type:"background",paint:{"background-color":"transparent"}})}createGlobePlaceLayer(t){t.getLayer("t_polygon")||t.addLayer({id:"t_polygon",type:"background",paint:{"background-color":"transparent"}}),t.getLayer("t_line")||t.addLayer({id:"t_line",type:"background",paint:{"background-color":"transparent"}}),t.getLayer("t_point")||t.addLayer({id:"t_point",type:"background",paint:{"background-color":"transparent"}})}createGlobeHighlightLayer(t){t.addSource(t.M.GLOBSOURCE,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),t.addLayer({id:t.M.GLOBEPOLYGONLAYER,type:"fill",source:t.M.GLOBSOURCE,filter:["in","$type","Polygon"],paint:{"fill-opacity":.5,"fill-color":["get","fill"],"fill-outline-color":"transparent"}}),t.addLayer({id:t.M.GLOBELINELAYER,type:"line",source:t.M.GLOBSOURCE,filter:["in","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":2,"line-opacity":.9,"line-color":["match",["get","selected"],1,"rgba(255,180,0,1)",0,"#3366ff","#3366ff"]}}),t.addLayer({id:t.M.GLOBEPOINTLAYER,type:"circle",source:t.M.GLOBSOURCE,filter:["in","$type","Point"],paint:{"circle-radius":6,"circle-opacity":.9,"circle-color":["match",["get","selected"],1,"rgba(255,180,0,1)",0,"#3366ff","#3366ff"]}})}}class Ng{constructor(t){this.tokenFlat={},this.token={},this.register(t)}register(t){let e=[];e=t instanceof Array?t:[t];for(const t of e)this.tokenFlat[t.id]=t}async getToken(t){let e="";if(!t)return e;const i=this.tokenFlat[t];if(!i)return e;if(this.token[t])return this.token[t];const{tokenType:s}=i;switch(s){case"ARCGIS":e=await this._getArcgisToken(t);break;case"Bearer":case"SIPGIS":e=await this._getSIPGISToken(t);break;case"STATIC_RESOURCE":e=await this._getStaticToken(t);break;case"CUSTOM":e=await this._getCustomToken(t)}return e}async _getArcgisToken(t){const e=await this._getTokenResult(t);return this.token[t]=e,{type:"arcgis",label:"token",value:e}}async _getSIPGISToken(t){const e=await this._getTokenResult(t);let i="";return 200===e.code&&(i=e.token),this.token[t]=i,{type:"sipgis",label:"sipsdToken",value:i}}async _getStaticToken(t){const e=this.token[t]||null;if(e)return e;const i=this.tokenFlat[t];return this.token[t]=i.requestUrl,{type:"",label:"token",value:i.requestUrl}}async _getTokenResult(t){const e=this.token[t]||"";if(e)return e;const i=this.tokenFlat[t],s={url:i.url,notoken:!0,nocode:!0,method:i.requestMethod||"get",addheaders:i.requestHeader||{},addtimeout:i.requestTimeout||2e4};"post"==i.requestMethod.toLowerCase()&&(s.data={...i.requestBody}),"get"==i.requestMethod.toLowerCase()&&(s.params={...i.requestBody});return await dr.request(s)}getTokenUrl(t,e){let i=t;return i.indexOf("{token}")>-1&&(i=i.replace("{token}",e.value)),i=`${i}${i.indexOf("?")>-1?"&":"?"}${e.label}=${e.value}`,i}}var Ag={name:"MapViewport",props:{id:{type:String,default:"container"},options:{type:Object,default:()=>({})},tokens:{type:Array,default:()=>[]},styleURL:{type:[Object,String],default:null},accessToken:{type:String,default:""},popupTemplate:{type:Object,default:null}},inject:{adapter:{from:"adapter",default:()=>null}},data:()=>({loaded:!1,localOptions:{},localTokens:[],localPopupTemplate:{},map:null,oneMapConfig:{}}),provide(){return{mapP:this.getMap}},mounted(){this.oneMapConfig=lr.getConfig(this.id),0==this.oneMapConfig.observeMap&&delete this.map,this.initOptions((()=>{this.initCreateMap()}))},methods:{initOptions(t){this.adapter?(Object.assign(this.localOptions,this.options,this.adapter().MV.props.options),this.localTokens=this.tokens.concat(this.adapter().MV.props.tokens),Object.assign(this.localPopupTemplate,this.popupTemplate,this.adapter().MV.props.popupTemplate)):(this.localOptions=this.options,this.localTokens=this.tokens,this.localPopupTemplate=this.popupTemplate),t&&t()},async initCreateMap(){let t=this.styleURL;if(this.TokenManager=new Ng(this.localTokens),this.options.tokenId&&t){const e=await this.TokenManager.getToken(this.options.tokenId);t=this.TokenManager.getTokenUrl(t,e)}var e=this.accessToken||this.oneMapConfig.accessToken;if(e){var i=await function(t){try{let e=new N.default;return e.setPrivateKey(Jo),e.decrypt(t)}catch(t){return!1}}(e);i&&(e=i)}let s={userId:e,enableOIT:!1,container:this.id,preserveDrawingBuffer:!0,doubleClickZoom:!1,antialias:!0,trackResize:!0,style:t||{version:8,sprite:this.oneMapConfig.sprite,glyphs:this.oneMapConfig.glyphs,sources:{},layers:[{id:"ground-bk",type:"background",paint:{"background-color":"transparent"}}]},sky:this.oneMapConfig.sky||"light",attributionControl:!1};const a=this.localOptions.srid;"sz2000sdk"==a&&(this.localOptions.center=Wc(this.localOptions.center)),s=Object.assign(s,this.localOptions,this.oneMapConfig.mapmostOption||{}),delete s.accessToken,s.center[0]>180&&this.oneMapConfig.enableTransform&&(s.center=np(this.oneMapConfig.enableTransform.srid,null,s.center));const n=new I.default.Map(s);if(this.map=n,0==this.oneMapConfig.observeMap?this.map.observeMap=!1:this.map.observeMap=!0,"sz2000sdk"==a&&(n.sz2000sdk=!0,n.MapmostSDKConvert=Xc),this.map.initMapOptions=JSON.parse(JSON.stringify(s)),this.map.getOnemapConfig=()=>lr.getConfig(this.id),n.projection)"SZ2000"!=n.projection.toUpperCase()&&"LOCAL"!=n.projection.toUpperCase()||(n.isCoordinate=!0);else{const t=this.localOptions.srid;if(["4527"].includes(t)){const t={srid:"4527"};this.oneMapConfig.enableTransform=t,I.default.enableTransform=t,n.enableTransform=t}}"object"==typeof this.oneMapConfig.enableTransform&&this.oneMapConfig.enableTransform.srid&&(I.default.enableTransform=this.oneMapConfig.enableTransform,n.enableTransform=this.oneMapConfig.enableTransform),console.warn("地图初始化加载......"),n.once("style.load",(()=>{this.map.baseMapStyleSheet=JSON.parse(JSON.stringify(n.style.stylesheet)),this.map.viewMode=this.oneMapConfig.viewMode,"2D"!=this.oneMapConfig.viewMode&&"2d"!=this.oneMapConfig.viewMode||(this.map.setBearing(0),this.map.setPitch(0),this.map.dragRotate.disable(),this.map.touchZoomRotate.disableRotation()),this.$emit("on-loaded-before",n),this.map.$MapEventBus=new w.default,this.map.ExAPI=new nd({map:n}),this.mapTemp=new kg(n,{popupTemplate:this.localPopupTemplate}),n.M.view.set(this.localOptions),n.localOptions=this.localOptions,n.M.tokenManager.register(this.localTokens),n.tokenManager=this.TokenManager,this.loaded=!0,this.$emit("on-loaded",n),n.setStyleInit=()=>{this.mapTemp.initAddBaseLayerAll(n)}}))},changeRole(){this.initOptions((()=>{this.map.M.view.set(this.localOptions),this.map.M.tokenManager.register(this.localTokens),this.map.initMapOptions=Object.assign(this.map.initMapOptions,this.localOptions);var t=this.map.M.view.get(),e=JSON.parse(JSON.stringify(t)),i=e.center;this.map.sz2000sdk&&(i=Wc(i),this.localOptions.center=Wc(this.localOptions.center)),i[0]>180&&this.oneMapConfig.enableTransform&&(i=np(this.oneMapConfig.enableTransform.srid,null,i)),e.center=i,this.localOptions.center=i,this.map.M.view.set(this.localOptions),this.map.flyTo(JSON.parse(JSON.stringify(e)))}))},getMap(){return this.map},getWebGLContext(){let t=this.map.getCanvas();if(t){var e=1==this.map._useWebGL2?"webgl2":"webgl";return t.getContext(e)}return null}},beforeDestroy(){this.map._animateWater_&&window.cancelAnimationFrame(this.map._animateWater_)},destroy(){if(this.map){let e=this.map.getCanvas();if(e){var t=1==this.map._useWebGL2?"webgl2":"webgl";let i=e.getContext(t);i&&i.getExtension("WEBGL_lose_context")&&i.getExtension("WEBGL_lose_context").loseContext()}try{this.map&&this.map.remove()}catch(t){console.error(t)}}}};const Rg=Ag;var Fg=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"mx-map-viewer",attrs:{id:t.id}},[t.loaded?[t._t("default")]:t._e()],2)};Fg._withStripped=!0;const Bg=bi({render:Fg,staticRenderFns:[]},undefined,Rg,undefined,false,undefined,!1,void 0,void 0,void 0);class Gg{constructor(t){this.flat={},this.data=null,this.render(t)}render(t){const e=t=>{for(const i of t)this.flat[i.id]=i,i.layerIds=(i.mapResourceList||[]).map((t=>t?t.id:(console.error("图层配置错误"),""))),i.children&&e(i.children)};for(let i of t)e(t);this.data=t}getCheckedIds(){const t=[];for(const e in this.flat)if(Object.prototype.hasOwnProperty.call(this.flat,e)){const i=this.flat[e]||void 0;i&&i.isChecked&&!i.children&&t.push(i.id)}return t}getCheckedNodes(){const t=[];for(const e in this.flat)if(Object.prototype.hasOwnProperty.call(this.flat,e)){const i=this.flat[e]||void 0;i&&i.isChecked&&!i.children&&t.push(i)}return t}getExpandIds(){const t=[];for(const e in this.flat)if(Object.prototype.hasOwnProperty.call(this.flat,e)){const i=this.flat[e]||void 0;i&&i.expand&&t.push(i.id)}return t}getSources(){const t=[];for(const e in this.flat)if(Object.prototype.hasOwnProperty.call(this.flat,e)){const i=this.flat[e]||void 0;""!=i.serviceUrl&&["vector","raster"].includes(i.memo)&&t.push(i)}return t}}var zg={props:{layerIds:Array,closeFillOutLineOpacity:{type:Boolean,default:!1}},inject:["mapP"],data:()=>({opacity:0,layers:[],layersidsArr:[],baseLayerType:["background","sky"],baseLayerTypeLayerId:["ground-bk","mapmost_default_sky","scene_default_layer","t_underground","t_base","t_line","t_point","t_polygon","g_lineLayer","g_pointLayer","g_polygonLayer","t_mask"],lastIndex:0,transformControlLayer:null}),created(){const t=s.inject("mapP",{});this.map=t(),this.init(),this.map.GLSDK&&(this.lastIndex=this.map.GLSDK.getLastlayerIdIndex())},methods:{onLayerTransformMost(){this.transformControlLayer&&this.transformControlLayer.mapmostTransformControls()},onClose(){this.$emit("close")},init(){for(const t of this.layerIds){const e=this.map.M.layerManager.getLayerById(t);this.layers.push(e);const i=e.layer.layers;Array.isArray(i)&&0!=i.length?i.forEach((t=>{this.layersidsArr.push(t.id)})):this.layersidsArr.push(e.layer.id||e.id),this.layersidsArr.length>0&&(this.opacity=e.getOpacity(this.layersidsArr[0],this.closeFillOutLineOpacity))}},onLayerUp(){const t=this.layersidsArr.length;if(t>0){const e=this.layersidsArr[t-1];this.getSiblings(e,(t=>{const{nextId:i,next2Id:s}=t;i==e||null==i&&null==s?this.$message({message:"图层已置顶!",type:"warning"}):this.layersidsArr.forEach((t=>{this.map.getLayer(t)&&(s?this.map.moveLayer(t,s):this.map.moveLayer(t))}))}))}},onLayerUpMost(){this.layersidsArr.forEach((t=>{this.map.getLayer(t)&&this.map.moveLayer(t)})),this.$message({message:"图层已置顶!",type:"warning"})},onLayerDown(){if(this.layersidsArr.length>0){const t=this.layersidsArr[0];this.getSiblings(t,(e=>{const{preId:i}=e;i!=t?this.layersidsArr.forEach((t=>{this.map.getLayer(t)&&this.map.moveLayer(t,i)})):this.$message({message:"图层已置底!",type:"warning"})}))}},onLayerDownMost(){if(this.layersidsArr.length>0){const t=this.layersidsArr[0],e=this.getOrderLayersId();if(e.length){const i=e[0];if(i!=t)this.layersidsArr.forEach((t=>{if(this.map.getLayer(t)){const e=this.map.M.layerManager.getLayerById(t);e&&1===e.underground?e.onLayerDownMost():this.map.moveLayer(t,i)}}));else{const e=this.map.M.layerManager.getLayerById(t);e&&1===e.underground&&e.onLayerDownMost(),this.$message({message:"图层已置底!",type:"warning"})}}}},onChange(){for(const t of this.layers)t.setOpacity(parseFloat(this.opacity),null,this.closeFillOutLineOpacity),this.layersidsArr.length>0&&t.setOpacity(parseFloat(this.opacity),this.layersidsArr[0],this.closeFillOutLineOpacity)},getOrderLayersId(){let t=JSON.parse(JSON.stringify(this.map.style._order)),e=t.findIndex((t=>"t_base"===t));t=t.slice(e);const i=t.filter(((t,e)=>!this.baseLayerTypeLayerId.includes(t)));return i},getSiblings(t,e){let i=null,s=null,a=null;const n=this.getOrderLayersId(),o=n.length;for(let r=0;r<o;r++){if(n[r]===t){const o=n[r-1];i=o||t,s=n[r+1]?n[r+1]:t,a=n[r+2]?n[r+2]:"",e({preId:i,nextId:s,next2Id:a});break}}}}};const jg=zg;var Ug=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-layer-tools"},[i("span",{staticClass:"mx-map-layer-tools__arrow"}),t._v(" "),i("ul",[i("li",{on:{click:t.onLayerUp}},[i("el-icon",[i("SortUp")],1),t._v("上移一层\n ")],1),t._v(" "),i("li",{on:{click:t.onLayerUpMost}},[t._v("置顶")]),t._v(" "),i("li",{on:{click:t.onLayerDown}},[i("el-icon",[i("SortDown")],1),t._v("下移一层\n ")],1),t._v(" "),i("li",{on:{click:t.onLayerDownMost}},[t._v("置底")]),t._v(" "),null!=t.opacity?i("li",[i("div",[t._v("透明度"+t._s(t.opacity))]),t._v(" "),null!=t.opacity?i("div",[i("input",{directives:[{name:"model",rawName:"v-model",value:t.opacity,expression:"opacity"}],staticStyle:{width:"85%"},attrs:{type:"range",min:"0",max:"1",step:"0.1"},domProps:{value:t.opacity},on:{input:function(e){return t.onChange()},change:function(e){return t.onChange()},__r:function(e){t.opacity=e.target.value}}})]):t._e()]):t._e(),t._v(" "),t._e(),t._v(" "),i("li",{on:{click:t.onClose}},[t._v("关闭")])])])};Ug._withStripped=!0;const Vg=bi({render:Ug,staticRenderFns:[]},undefined,jg,undefined,false,undefined,!1,void 0,void 0,void 0);var qg={props:{data:{type:Array,default:()=>[]},checkboxParent:{type:Boolean,default:!0},closeDefaultExpand:{type:Boolean,default:!1},showSearchEnable:{type:Boolean,default:!0},showToolsEnable:{type:Boolean,default:!0},closeDefaultLayer:{type:Boolean,default:!1},closeFillOutLineOpacity:{type:Boolean,default:!1},copyToCustom:{type:Boolean,default:!1},layerDomid:{type:String,default:""},mapSyncConfig:{type:Object,default:function(){return{show:!0}}},showImportData:{type:[Boolean,Object],default:!1}},components:{LayerTools:Vg},inject:["mapP"],filters:{showCount:t=>t.childNodes.length?`(${t.childNodes.length})`:""},data:()=>({editVisible:!0,expandAll:!1,layerData:[],checkedKeys:[],expandedKeys:[],popoverVisible:!1,popoverLayerIds:[],popoverTop:0,popoverRight:"30px",filterText:"",setStyleAllCheckedIds:[],maxHeightStyle:{maxHeight:"600px"},oneMapConfig:{},fitBounds:!1}),mounted(){"object"==typeof this.showImportData&&(this.fitBounds=this.showImportData.fitBounds),this.map=this.mapP(),this.oneMapConfig=this.map.getOnemapConfig(),this.data.length>0&&(this.treeStore=new Gg(this.data),this.init()),this.funToken=this.map.M.pubsub.subscribe("clearAllLayer",(()=>{this.clearAllLayer()})),this.map.M.destorySubscribe=()=>{this.map.M.pubsub.remove("clearAllLayer",this.funToken)},this.map.M.getDefaultLayerKeys=()=>this.checkedKeys,this.$nextTick((()=>{this.initHeight()})),this.map.M.getTreeObj=()=>this.getTreeObj(),this.map.M.getAllCheckedIds=()=>this.getAllCheckedIds(),this.map.M.setAllCheckedIds=t=>this.setAllCheckedIds(t),this.map.M.MapOnNodeChecked=(t,e)=>{const i=this.$refs.tree;this.onNodeChecked(i.getNode(t).data,!0)}},beforeDestroy(){this.map.M.destorySubscribe()},methods:{initHeight(){var t=document.getElementById(this.layerDomid).getBoundingClientRect(),e=this.map.getCanvas().getBoundingClientRect();const i=t.top-e.top;e&&(this.maxHeightStyle.maxHeight=.6*(e.height-i)+"px")},clearAllLayer(){this.setIsCheckLayer(),this.map.setStyleInitAddCheckLayer=()=>{this.setStyleAllCheckedIds.forEach((t=>{this.setMapLayerChecked(t,!1),setTimeout((()=>{this.setMapLayerChecked(t,!0)}),100)}))}},setIsCheckLayer(){this.setStyleAllCheckedIds=this.getAllCheckedIds()},setMapLayerChecked(t,e=!0){const i=this.$refs.tree;Array.isArray(t)?t.forEach((t=>{i.setChecked(t,e,!0)})):i.setChecked(t,e,!0)},filterNode:(t,e)=>!t||-1!==e.label.indexOf(t),copyToCustomEvent(t){this.$emit("copyToCustomEvent",t)},deleteLayer(t){this.$confirm(`确定删除${t.label}?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{var e=t.data.id;dr.request({url:this.oneMapConfig.customURL_UploadDelete,method:"post",params:{id:e}}).then((i=>{200==i.code?(this.setMapLayerChecked(e,!1),this.$nextTick((()=>{const i=t.parent,s=i.data.children||i.data,a=s.findIndex((t=>t.id===e));if(s.splice(a,1),this.$message({message:"成功删除图层",type:"success",showClose:!0}),0==s.length){const t=this.$refs.tree.getNode(i.data.id).parent,e=t.data.children||t.data,s=e.findIndex((t=>t.id===i.data.id));e.splice(s,1)}}))):this.$message({message:"删除图层失败!"+i.msg,type:"warning",showClose:!0})}))}))},setExpand(t){const e=this.$refs.tree;for(var i=0;i<e.store._getAllNodes().length;i++)e.store._getAllNodes()[i].expanded=t},setExpandById(t,e){this.$refs.tree.getNode(t).expanded=e},getCurrentLayerIsChecked(t){return(this.$refs.tree.getCheckedKeys()||[]).includes(t)},async getMapLayerIds(t){const e=this.$refs.tree.getNode(t.id);if(!e)return void t.callback(null);const{allCN:i,SourceData:s}=await this.getAllChildLayerIds(e.data,t);t.callback&&t.callback(i,s)},getAllChildLayerIds(t,e){var i=[],s={},a=async(t,i)=>{var n=t.children;if(n)for(var o=0;o<n.length;o++){var r=n[o];a(r,i)}else for(let a=0;a<t.mapResourceList.length;a++){const n=t.mapResourceList[a];var l=n.id;if(!this.map.M.layerManager.getLayerById(l)&&1==e.render)continue;const o=await this.map.M.layerManager.getLayerRealIdsByTree(n,i);s[t.id]=o}};return a(t,i),{SourceData:s,allCN:i||[]}},init(){if(this.layerData=this.treeStore.data,1!=this.closeDefaultExpand?this.expandedKeys=this.treeStore.getExpandIds():this.expandedKeys=[],!0===this.closeDefaultLayer)return;this.checkedKeys=this.treeStore.getCheckedIds();const t=this.treeStore.getCheckedNodes();for(const e of t)this.onNodeChecked(e,!0)},async layerCheckedT(t,e){if("style"!=e.layerType)return t&&1!=this.map.mapIsLoading?await this.map.M.layerManager.addLayer(e):await this.map.M.layerManager.removeLayerById(e.id)},legendChecked(t,e){""!==e.legend&&(t?this.map.M.pubsub.publish("add-legend",{id:e.id,url:e.legend}):this.map.M.pubsub.publish("remove-legend",e.id))},nodeClick(t,e){if(!e.disabled&&!t.children){this.$refs.tree.setChecked(t.id||t.ID,!e.checked,!0)}},async onNodeChecked(t,e){const{mapResourceList:i,pidlabel:s}=t;if(i.length>0)for(const t of i)"自定义图层"===s&&this.fitBounds&&(t.fitBounds=this.fitBounds),await this.layerCheckedT(e,t);if(this.$emit("node-checked",t,e),this.map.M.layerManager.mapLayerChangeCheck(t,e),e){const e=this.$route?.path||"";this.map.GLSDK.writeLog("MAP_LAYER_CLICK",t.label,e)}},onImportEidtTools(t,e){Array.isArray(e.mapResourceList)&&this.$emit("onImportEidtTools",e)},onLayerTools(t,e){if(!Array.isArray(e.mapResourceList)||!e.mapResourceList[0]||"popup_poi"!=e.mapResourceList[0].layer.type){this.popoverVisible=!0,this.popoverLayerIds=e.layerIds;var i,s=20;if(this.layerDomid){i=document.getElementById(this.layerDomid).getBoundingClientRect();var a=t.target.getBoundingClientRect();s=i.right-a.right-16}this.popoverTop=t.clientY-i.top+15,this.popoverRight=s+"px"}},onMouseLeave(){this.timer=setTimeout((()=>{this.popoverVisible=!1}),100)},onMouseOver(){this.timer&&clearTimeout(this.timer),this.popoverVisible=!0},setChecked(t,e){this.$refs.tree.setChecked(t.id,e)},clearAll(){this.$refs.tree.setCheckedKeys([])},setAllCheckedIds(t){this.$refs.tree.setCheckedKeys(t)},getAllCheckedIds(){return this.$refs.tree?this.$refs.tree.getCheckedKeys():[]},getTreeObj(){return this.$refs.tree}},watch:{filterText(t){this.$refs.tree.filter(t)},data(t){this.treeStore=new Gg(t)}}};const Hg=qg;var $g=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-layer"},[t.showSearchEnable?i("el-input",{staticClass:"mx-map-filter-search",attrs:{placeholder:"输入【图层名称】进行过滤",clearable:""},model:{value:t.filterText,callback:function(e){t.filterText=e},expression:"filterText"}}):t._e(),t._v(" "),i("el-tree",{ref:"tree",staticClass:"mx-treecontainer",class:[0==t.checkboxParent?"mx-tree-disabled-checkbox":""],style:t.maxHeightStyle,attrs:{data:t.layerData,"show-checkbox":"","node-key":"id","default-expand-all":t.expandAll,"default-checked-keys":t.checkedKeys,"default-expanded-keys":t.expandedKeys,"render-after-expand":!1,"auto-expand-parent":!1,"show-icon":!0,"filter-node-method":t.filterNode},on:{"check-change":t.onNodeChecked,"node-click":t.nodeClick},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.node,a=e.data;return[i("div",{staticClass:"mx-title-box",class:[s.disabled?"medotree-disabled":""]},[i("div",[a.imgSrc?i("img",{staticStyle:{"margin-right":"6px"},attrs:{src:"./assets/legend/"+a.imgSrc,height:"12"}}):t._e()]),t._v(" "),i("div",{staticClass:"mx-treelabel",staticStyle:{flex:"1","text-align":"left"},attrs:{title:s.label}},[i("span",{class:s.data.children?"mx-tree-group-icon":"mx-tree-child-icon"},[t._v(t._s(s.label)+t._s(t._f("showCount")(s))+"\n "),i("svg",{directives:[{name:"show",rawName:"v-show",value:1==s.data.supportIQuery,expression:"node.data.supportIQuery == 1"}],staticClass:"tree-issupport-iquery",attrs:{t:"1701323451083",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"23012",width:12,height:12}},[i("path",{attrs:{d:"M464 800H199.776L96 928h468.288L464 800z m0-32C649.568 768 800 617.568 800 432S649.568 96 464 96 128 246.432 128 432 278.432 768 464 768z",fill:"#FFFFFF","p-id":"23013"}}),t._v(" "),i("path",{attrs:{d:"M464 800H199.776L96 928h468.288L464 800z m34.56 96H163.136l51.904-64h233.376l50.144 64z",fill:"#808FA1","p-id":"23014"}}),t._v(" "),i("path",{attrs:{d:"M464 736a304 304 0 1 1 0-608 304 304 0 0 1 0 608z m0 32C649.568 768 800 617.568 800 432S649.568 96 464 96 128 246.432 128 432 278.432 768 464 768z m235.776-94.08a48 48 0 0 0 0 67.904l158.4 158.4a48 48 0 0 0 67.872-67.904l-158.4-158.4a48 48 0 0 0-67.84 0z",fill:"#5D6D7E","p-id":"23015"}}),t._v(" "),i("path",{attrs:{d:"M470.72 705.28a176 176 0 1 0-270.816-1.728h-0.128L335.84 896l134.848-190.72z m-134.72-25.28a88 88 0 1 1 0-176 88 88 0 0 1 0 176z",fill:"#326EF0","p-id":"23016"}}),t._v(" "),i("path",{attrs:{d:"M358.432 198.72c-2.88 12.608-4.832 25.6-5.76 38.88a224 224 0 0 1 323.968 265.12c12.704-3.552 25.056-8.064 36.928-13.44A256 256 0 0 0 358.4 198.72z",fill:"#808FA1","p-id":"23017"}})])])]),t._v(" "),t.mapSyncConfig.show&&t.showToolsEnable&&s.checked&&(!a.children||0==a.children.length)&&"自定义图层"!=s.data.pidlabel?i("div",{staticClass:"mx-layer-tools"},[t._t("extra-before-tool",null,{node:{node:s,data:a}}),t._v(" "),t.copyToCustom&&1==s.data.supportIQuery?i("span",{staticClass:"mx-copy-custom",on:{click:function(e){return e.stopPropagation(),t.copyToCustomEvent(s)}}},[i("i",{staticClass:"el-icon-copy-document"})]):t._e(),t._v(" "),i("span",{on:{click:function(e){return e.stopPropagation(),t.onLayerTools(e,s.data)}}},[i("i",{staticClass:"el-icon-s-operation"})]),t._v(" "),t._t("extra-tool",null,{node:{node:s,data:a}})],2):t._e(),t._v(" "),"自定义图层"==s.data.pidlabel?i("div",{staticClass:"mx-layer-tools"},[s.checked?i("span",{on:{click:function(e){return e.stopPropagation(),t.onImportEidtTools(e,s.data)}}},[i("i",{staticClass:"el-icon-s-operation"})]):t._e(),t._v(" "),i("span",{staticClass:"icon-delete",on:{click:function(e){return e.stopPropagation(),t.deleteLayer(s)}}},[i("i",{staticClass:"el-icon-delete"})])]):t._e()])]}}],null,!0)}),t._v(" "),t.popoverVisible?i("layer-tools",{style:{top:t.popoverTop+"px",right:t.popoverRight},attrs:{layerIds:t.popoverLayerIds,closeFillOutLineOpacity:t.closeFillOutLineOpacity},on:{close:t.onMouseLeave},nativeOn:{mouseleave:function(e){return t.onMouseLeave.apply(null,arguments)},mouseover:function(e){return t.onMouseOver.apply(null,arguments)}}}):t._e()],1)};$g._withStripped=!0;const Wg=bi({render:$g,staticRenderFns:[]},undefined,Hg,"data-v-25627f27",false,undefined,!1,void 0,void 0,void 0);const Kg={name:"MapCoordinate",data:()=>({coordinate:"",currentZoom:""}),inject:["mapP"],mounted(){const t=this.mapP()||this.$parent.getMap();t.on("mousemove",(e=>{let i="";if(t.projection){const[t,s]=e.coordinate;i=`x: ${t.toFixed(2)} y: ${s.toFixed(2)}`}else{const{lng:s,lat:a}=e.lngLat;if(t.enableTransform){const[e,n]=t.M.projTransform(enableTransform.srid,null,[s,a]);i=`x: ${e.toFixed(2)} y: ${n.toFixed(2)}`}else i=`lng: ${s.toFixed(6)} lat: ${a.toFixed(6)}`}this.coordinate=i})),this.currentZoom=` z:${parseFloat(t.getZoom().toFixed(2))}`,t.on("zoomend",(()=>{this.currentZoom=` z:${parseFloat(t.getZoom().toFixed(2))}`}))},methods:{handlerShowExtent(){const t=this.mapP();if(t){let e=t.getCenter();e.lng&&(e=[e.lng,e.lat]),e.x&&(e=[e.x,e.y]),e.push(t.getZoom()),alert(`获取地图范围(中心点+层级):[${e}]`)}}}};var Yg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-coordinate rb",on:{click:function(e){return e.stopPropagation(),t.handlerShowExtent.apply(null,arguments)}}},[i("div",[t._v(t._s(t.coordinate))]),t._v(" "),i("div",{staticClass:"map-zoom"},[i("span",[t._v(t._s(t.currentZoom))])])])};Yg._withStripped=!0;const Jg=bi({render:Yg,staticRenderFns:[]},undefined,Kg,"data-v-6e556c70",false,undefined,!1,void 0,void 0,void 0);var Xg={components:{DataInfoResult:qm,MapDraw:Km},props:{data:{type:Object,default:{}},customAxios:{default:()=>new Promise},selectCode:{type:String,default:""},visible:{type:Boolean,default:!1},foucsFilter:{type:Boolean,default:!1},MapSearch:{type:[Boolean,Object],default:()=>!0}},inject:["mapP"],provide(){return{map:this.getMap}},data:()=>({activeNames:"100",title:"信息搜索",queryWidgeid:[],codeList:{},form:{},loading:!1,formVisible:!1,count:0,DatePickerRangeObj:{},pickerOptions:{shortcuts:[{text:"今天",onClick(t){t.$emit("pick",new Date)}},{text:"昨天",onClick(t){const e=new Date;e.setTime(e.getTime()-864e5),t.$emit("pick",e)}},{text:"一周前",onClick(t){const e=new Date;e.setTime(e.getTime()-6048e5),t.$emit("pick",e)}}]},servicekey:"",DataResult:!1,containerStyle:{},initFormData:{},renderAxiosPage:!1,renderPageSize:10,shapeColumnName:"shape",oneMapConfig:{}}),mounted(){var t=this.mapP();this.oneMapConfig=t.getOnemapConfig(),this.MapSearch&&(this.renderAxiosPage="object"==typeof this.MapSearch&&this.MapSearch.renderAxiosPage,this.renderAxiosPage&&(this.renderPageSize=10),this.renderPageSize="object"==typeof this.MapSearch&&"number"==typeof this.MapSearch.size?this.MapSearch.size:10),this.title=this.data.apiName+"-综合查询",this.queryWidgeid=this.data.queryList,this.setStyle(),this.initForm()},methods:{changeTopPanel(t){this.activeNames=t?"":"100",this.changeCollapse(this.activeNames)},changeCollapse(t){this.$refs.dataInfoResult&&this.$refs.dataInfoResult.setMaxHeightChange(!!t)},getMap(){return this.mapP()},initForm(){this.formVisible=!1,this.count=this.queryWidgeid.length,new Promise((t=>{var e={};this.queryWidgeid.forEach(((i,s)=>{switch(i.dataType){case"ComboBox":this.remoteMethod(i);break;case"GeometryBox":this.shapeColumnName=i.value||this.shapeColumnName}e[i.value]=JSON.parse(JSON.stringify(i.defaultValue?i.defaultValue:"")),"NumberRange"==i.dataType&&(i.defaultValue||"0"==i.defaultValue?e[i.value]=Number(i.defaultValue):delete e[i.value]),s==this.count-1&&t(e)}))})).then((t=>{this.form=JSON.parse(JSON.stringify(t)),this.formVisible=!1,this.$nextTick((()=>{this.formVisible=!0,this.initFormData=JSON.parse(JSON.stringify(this.form)),this.$nextTick((()=>{this.foucsFilter&&this.onSubmit()}))}))}))},getBuffer(){var t=20,e=this.mapP();return e&&e.M.iqueryManager&&(t=e.M.iqueryManager.getBuffer())<1e-4&&(t=1e-4),t},successDraw(t,e,i){this.form[t]=e,i&&Array.isArray(i)&&(this.form.stx=i[0])},onRefresh(){this.form=JSON.parse(JSON.stringify(this.initFormData)),this.onClear()},onSubmit(){this.$refs.form.validate((t=>{if(t){let t={...this.form},i=Object.assign({current:1,size:1e3},t);var e=i[this.shapeColumnName];e&&e.toLowerCase().indexOf("point")>-1&&(i.buffer=this.getBuffer()),this.axiosOptions={renderAxiosPage:this.renderAxiosPage,current:1,size:this.renderPageSize,customURL:this.oneMapConfig.customURL_QQuery,customURL_QQuery:this.oneMapConfig.customURL_QQuery,select_code:this.selectCode},i.current=this.axiosOptions.current,i.size=this.axiosOptions.renderAxiosPage?this.axiosOptions.size:1e3,this.axiosOptions.renderAxiosPage&&(this.axiosOptions.getAxiosSearchData=this.getAxiosSearchData),this.axiosOptions.conditions=i,this.getAxiosSearchData(this.axiosOptions,i,(t=>{this.DataResult=!1,this.$nextTick((()=>{this.DataResult=t.data}))}))}}))},getAxiosSearchData(t,e,i){this.customAxios({method:"post",url:`${t.customURL||this.oneMapConfig.customURL_QQuery}/${t.select_code}`,headers:{"Content-Type":"application/json"},data:{conditions:e}}).then((t=>{200==t.code?i&&i(t):window.MapMessage.ShowMessage({message:t.msg,type:"warning"})}))},onClear(){this.$emit("closeQuery"),this.DataResult=!1},close(){this.$emit("update:visible",!1)},remoteMethod(t){let e=t.groupId;if(!this.codeList[e])if(e){const t=this.oneMapConfig.customURL_dict;dr.get({url:t,params:{groupCode:e,dictCode:e},nomessage:!0}).then((t=>{t&&t.data&&(t.data.map((t=>{void 0===t.value&&(t.value=t.itemCode),void 0===t.label&&(t.label=t.itemName),void 0===t.enabled&&(t.enabled=t.status)})),this.codeList[e]=t.data,this.formVisible=!1,this.$nextTick((()=>{this.formVisible=!0})))}))}else this.codeList[e]=[]},setStyle(){var t=20;this.$nextTick((()=>{document.getElementsByClassName("mx-map-search")[0]&&(t=60),this.containerStyle={top:t+"px"}}))}},computed:{queryStyle(){return{height:35*this.count}}},beforeDestroy(){this.$emit("closeQuery")}};const Qg=Xg;var Zg=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-datainfo-container",style:t.containerStyle},[i("el-collapse",{attrs:{accordion:""},on:{change:t.changeCollapse},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[i("el-collapse-item",{attrs:{name:"100"}},[i("div",{staticClass:"mx-map-search-header",attrs:{slot:"title"},slot:"title"},[t._v("\n "+t._s(t.title)+"\n "),i("div",{staticClass:"close",on:{click:t.close}},[i("i",{staticClass:"el-icon-close"})])]),t._v(" "),t.formVisible?i("div",{staticClass:"map-datainfo-panel",style:t.queryStyle,attrs:{id:"map-datainfo-panel"}},[i("el-form",{ref:"form",attrs:{model:t.form,"label-width":"85px"}},[t._l(t.queryWidgeid,(function(e,s){return[i("el-row",{key:s},[i("el-form-item",{attrs:{label:e.label,prop:e.value}},["ComboBox"==e.dataType?i("div",{key:s,staticClass:"datainfo-item"},[i("el-select",{attrs:{placeholder:"请选择"+e.label,size:"small",clearable:"",filterable:"","popper-append-to-body":!0,"popper-class":"mx-map-search-select"},model:{value:t.form[e.value],callback:function(i){t.$set(t.form,e.value,i)},expression:"form[item.value]"}},t._l(t.codeList[e.groupId],(function(t){return i("el-option",{key:t.value,attrs:{label:t.label,value:t.value,disabled:void 0!==t.enabled&&"0"==t.enabled}})})),1)],1):"DatePicker"==e.dataType?i("div",{key:s,staticClass:"datainfo-item"},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"请选择"+e.label,"value-format":"yyyy-MM-dd"},model:{value:t.form[e.value],callback:function(i){t.$set(t.form,e.value,i)},expression:"form[item.value]"}})],1):"DateTimePicker"==e.dataType?i("div",{key:s,staticClass:"datainfo-item"},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime",placeholder:"请选择"+e.label,align:"right","picker-options":t.pickerOptions},model:{value:t.form[e.value],callback:function(i){t.$set(t.form,e.value,i)},expression:"form[item.value]"}})],1):"DatePickerRange"==e.dataType?i("div",{key:s,staticClass:"datainfo-item"},[i("el-col",{attrs:{span:20,xs:24}},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"请选择"+e.label,"value-format":"yyyy-MM-dd"},model:{value:t.form[e.value],callback:function(i){t.$set(t.form,e.value,i)},expression:"form[item.value]"}})],1),t._v(" "),i("el-col",{staticClass:"datainfo-range",attrs:{span:4,xs:24}},[t._v("至")]),t._v(" "),i("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"请选择"+e.label,"value-format":"yyyy-MM-dd"},model:{value:t.form[e.value+"_DatePickerRange"],callback:function(i){t.$set(t.form,e.value+"_DatePickerRange",i)},expression:"form[item.value + '_DatePickerRange']"}})],1):"NumberRange"==e.dataType?i("div",{key:s,staticClass:"datainfo-item"},[i("el-col",{attrs:{span:20,xs:24}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{size:"mini",clearable:"",placeholder:"请输入"+e.label,"controls-position":"left"},model:{value:t.form[e.value],callback:function(i){t.$set(t.form,e.value,i)},expression:"form[item.value]"}})],1),t._v(" "),i("el-col",{staticClass:"datainfo-range",attrs:{span:4,xs:24}},[t._v("至")]),t._v(" "),i("el-col",{attrs:{span:20,xs:24}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{size:"mini",clearable:"",placeholder:"请输入"+e.label,"controls-position":"left"},model:{value:t.form[e.value+"_NumberRange"],callback:function(i){t.$set(t.form,e.value+"_NumberRange",i)},expression:"form[item.value + '_NumberRange']"}})],1)],1):"GeometryBox"==e.dataType?i("div",{key:s,staticClass:"datainfo-item"},[i("el-input",{attrs:{placeholder:"请绘制"+e.label,size:"small",clearable:""},model:{value:t.form[e.value],callback:function(i){t.$set(t.form,e.value,i)},expression:"form[item.value]"}}),t._v(" "),i("map-draw",{attrs:{fieldValue:e.value},on:{success:t.successDraw}})],1):i("div",{staticClass:"datainfo-item"},[i("el-input",{attrs:{placeholder:"请输入"+e.label,size:"small",clearable:""},model:{value:t.form[e.value],callback:function(i){t.$set(t.form,e.value,i)},expression:"form[item.value]"}})],1)])],1)]})),t._v(" "),i("el-form-item",{staticClass:"datainfo-btn"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSubmit}},[t._v("查询")]),t._v(" "),i("el-button",{attrs:{size:"small"},on:{click:t.onRefresh}},[t._v("重置")])],1)],2)],1):t._e()])],1),t._v(" "),t.DataResult?i("div",{staticClass:"map-datainfo-result"},[i("DataInfoResult",{ref:"dataInfoResult",attrs:{cdata:t.DataResult,axiosOptions:t.axiosOptions},on:{changeTopPanel:t.changeTopPanel}})],1):t._e()],1)};Zg._withStripped=!0;const ty={name:"MapSearch",props:{data:{type:Array,default:()=>[]},customAxios:{default:()=>gr},customURL:{type:String,default:""},MapSearch:{type:[Boolean,Object],default:()=>!0}},inject:["mapP"],components:{MapQuery:bi({render:Zg,staticRenderFns:[]},undefined,Qg,"data-v-1bef37e3",false,undefined,!1,void 0,void 0,void 0)},data:()=>({dataDropList:[],queryData:{},mapSearchQueryVisible:!1,loading:!1,popoverVisible:!1,input_value:"",select_item:"",select_value:"",select_code:"",select_queryCode:"",result:[],pageNo:1,foucsFilter:!1,tempDataAll:[],renderAxiosPage:!1,renderPageSize:10,maxSize:1e3}),created(){this.dataDropList=this.data},mounted(){const t={};for(const e of this.dataDropList)t[e.apiCode]=e;this.initData(),this._options=t,this.map=this.mapP(),this.MapSearch&&(this.foucsFilter="object"==typeof this.MapSearch&&this.MapSearch.foucsFilter,this.renderAxiosPage="object"==typeof this.MapSearch&&this.MapSearch.renderAxiosPage,this.renderAxiosPage&&(this.renderPageSize=10),this.renderPageSize="object"==typeof this.MapSearch&&"number"==typeof this.MapSearch.size?this.MapSearch.size:10,this.maxSize="object"==typeof this.MapSearch&&"number"==typeof this.MapSearch.maxSize?this.MapSearch.maxSize:1e3),this.tempDataAll=JSON.parse(JSON.stringify(this.dataDropList)),this.map.M&&this.map.M.pubsub.subscribe("map-sucess",(()=>{this.bindEvent()}))},methods:{bindEvent(){this.map.GLSDK.getMapSearchData=t=>this.getMapSearchData(t),this.map.GLSDK.setMapSearchData=t=>{this.setMapSearchData(t)},this.map.GLSDK.onSearchAll=t=>{this.onSearchAll(t)}},setMapSearchData(t){this.dataDropList=t,this.initData()},getMapSearchData(t){return t?this.tempDataAll:this.dataDropList},initData(){const t=this.dataDropList[0];this.select_item=t,this.select_value=t.apiName,this.select_code=t.apiCode,this.input_value=t.defaultValue,this.url=t.apiUrl},showOpenQuery(t){this.queryData=t,this.select_queryCode=t.apiCode,this.mapSearchQueryVisible=!1;this.queryData.queryList.length&&this.$nextTick((()=>{this.map.$MapEventBus.$emit("map-left-list-close"),this.mapSearchQueryVisible=!0,this.onSelectChange(t.apiCode,!0),this.$refs.searchDropbox.blur()}))},onSelectChange(t,e=!1){const i=this._options[t]||null;i&&(this.input_value=i.defaultValue,this.select_code=i.apiCode,this.select_queryCode=i.apiCode,this.select_value=i.apiName),this.mapSearchQueryVisible=e,this.select_item=i},closeQuery(){this.map.$MapEventBus.$emit("map-left-list-close")},onSearchAll(t){this.select_code=t.select_code,this.input_value=t.input_value,this.pageNo=1,this.onSearch("reset",t.total)},onSearch(t,e){this.mapSearchQueryVisible=!1,"reset"===t&&(this.pageNo=1);const i={renderAxiosPage:this.renderAxiosPage,maxSize:e||this.maxSize,current:this.pageNo,size:this.renderPageSize,customURL:this.customURL,select_code:this.select_code,input_value:this.input_value};i.renderAxiosPage&&(i.getAxiosSearchData=this.getAxiosSearchData);const s={input_value:i.input_value,current:i.current,size:i.renderAxiosPage?i.size:e||this.maxSize};this.getAxiosSearchData(i,s,(t=>{this.map.$MapEventBus.$emit("map-show-left-list",{data:t.data,source:"search-list",searchValue:i.input_value,axiosOptions:i})}))},getAxiosSearchData(t,e,i){var s={conditions:{project_name:e.input_value||"",current:e.current,size:e.size}};Object.assign(s.conditions,this.map.GLSDK.queryParamsExtra||{}),this.customAxios({method:"post",url:`${t.customURL}/${t.select_code}`,headers:{"Content-Type":"application/json"},data:s,loading:!0}).then((t=>{200==t.code?i&&i(t):window.MapMessage.ShowMessage({message:t.msg,type:"warning"})}))},hasSubscribe(){this.map.M.pubsub.subscribe("change-query-current",(({data:t})=>{this.pageNo=t.pageNo,this.onSearch()}))},onInputClear(){this.input_value=""},onInputFocus(){this.result.length>0&&(this.popoverVisible=!0);const t=this.select_item.queryList;this.foucsFilter&&t&&t.length&&this.showOpenQuery(this.select_item)},onInputBlur(){}}};var ey=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-search"},[i("el-input",{staticClass:"mx-map-input-container",attrs:{slot:"reference",title:t.input_value,size:"small"},on:{focus:t.onInputFocus,blur:t.onInputBlur},slot:"reference",model:{value:t.input_value,callback:function(e){t.input_value=e},expression:"input_value"}},[i("el-select",{ref:"searchDropbox",staticStyle:{width:"140px"},attrs:{slot:"prepend","value-key":t.select_code,label:t.select_value,placeholder:"请选择","popper-class":"mx-map-search-select","popper-append-to-body":!1},on:{change:t.onSelectChange},slot:"prepend",model:{value:t.select_value,callback:function(e){t.select_value=e},expression:"select_value"}},t._l(t.dataDropList,(function(e){return i("el-option",{key:e.apiCode,attrs:{label:e.apiName,value:e.apiCode}},[i("span",{staticClass:"mx-search-label"},[t._v(t._s(e.apiName))]),t._v(" "),(Array.isArray(e.queryList)?e.queryList.length:e.queryList)?i("span",{staticClass:"mx-search-icon",on:{click:function(i){return i.stopPropagation(),t.showOpenQuery(e)}}},[i("el-tooltip",{attrs:{content:"综合查询",placement:"top"}},[i("i",{staticClass:"el-icon-set-up"})])],1):t._e()])})),1),t._v(" "),i("span",{staticClass:"mx-input-close",attrs:{slot:"suffix"},on:{click:t.onInputClear},slot:"suffix"},[i("i",{staticClass:"el-icon-close"})]),t._v(" "),i("el-button",{staticStyle:{color:"#ffffff"},attrs:{slot:"append",icon:"el-icon-search",loading:t.loading},on:{click:function(e){return t.onSearch("reset")}},slot:"append"})],1),t._v(" "),t.mapSearchQueryVisible?i("div",{staticClass:"mx-map-search-query"},[i("map-query",{ref:"mapquery",attrs:{visible:t.mapSearchQueryVisible,data:t.queryData,MapSearch:t.MapSearch,selectCode:t.select_queryCode,customAxios:t.customAxios,foucsFilter:t.foucsFilter},on:{"update:visible":function(e){t.mapSearchQueryVisible=e},closeQuery:t.closeQuery}})],1):t._e()],1)};ey._withStripped=!0;const iy=bi({render:ey,staticRenderFns:[]},undefined,ty,"data-v-de8d3dde",false,undefined,!1,void 0,void 0,void 0);const sy={data:()=>({active:!1,tool:{mapToolCode:"ToolBox",mapToolName:"工具箱"}}),inject:["mapP"],mounted(){this.map=this.mapP()},methods:{onClick(){this.map.GLSDK.toolsOnClick(this.tool,this.active),this.active=!this.active,this.$emit("change")}}};var ay=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",class:[this.active?"roate0deg":"roate90deg"],attrs:{t:"1702532978998",viewBox:"0 0 1051 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1809",width:"24",height:"24"}},[i("path",{attrs:{d:"M727.204278 714.609626m-135.255615 0a135.255615 135.255615 0 1 0 270.51123 0 135.255615 135.255615 0 1 0-270.51123 0Z","p-id":"1810"}}),t._v(" "),i("path",{attrs:{d:"M779.225668 492.834225h-163.730481c-50.37861 0-91.995722-41.069519-91.995722-91.995722V237.655615c0-50.37861 41.069519-91.995722 91.995722-91.995722h163.730481c50.37861 0 91.995722 41.069519 91.995722 91.995722v163.730481c-0.547594 50.37861-41.617112 91.448128-91.995722 91.448129z m-163.730481-300.081284c-24.641711 0-44.902674 20.260963-44.902674 44.902674v163.730481c0 24.641711 20.260963 44.902674 44.902674 44.902674h163.730481c24.641711 0 44.902674-20.260963 44.902674-44.902674V237.655615c0-24.641711-20.260963-44.902674-44.902674-44.902674h-163.730481zM398.100535 867.935829H234.370053c-50.37861 0-91.995722-41.069519-91.995721-91.995722v-163.730481c0-50.37861 41.069519-91.995722 91.995721-91.995722h163.730482c50.37861 0 91.995722 41.069519 91.995722 91.995722v163.730481c0 50.926203-41.069519 91.995722-91.995722 91.995722z m-163.730482-300.628877c-24.641711 0-44.902674 20.260963-44.902673 44.902674v163.730481c0 24.641711 20.260963 44.902674 44.902673 44.902674h163.730482c24.641711 0 44.902674-20.260963 44.902674-44.902674v-163.730481c0-24.641711-20.260963-44.902674-44.902674-44.902674H234.370053zM779.225668 867.935829h-163.730481c-50.37861 0-91.995722-41.069519-91.995722-91.995722v-163.730481c0-50.37861 41.069519-91.995722 91.995722-91.995722h163.730481c50.37861 0 91.995722 41.069519 91.995722 91.995722v163.730481c-0.547594 50.926203-41.617112 91.995722-91.995722 91.995722z m-163.730481-300.628877c-24.641711 0-44.902674 20.260963-44.902674 44.902674v163.730481c0 24.641711 20.260963 44.902674 44.902674 44.902674h163.730481c24.641711 0 44.902674-20.260963 44.902674-44.902674v-163.730481c0-24.641711-20.260963-44.902674-44.902674-44.902674h-163.730481zM278.17754 342.793583H205.347594c-13.142246 0-23.546524-10.404278-23.546524-23.546524s10.404278-23.546524 23.546524-23.546524h72.829946c13.142246 0 23.546524 10.404278 23.546524 23.546524-0.547594 13.142246-10.951872 23.546524-23.546524 23.546524zM427.670588 342.793583H354.840642c-13.142246 0-23.546524-10.404278-23.546524-23.546524s10.404278-23.546524 23.546524-23.546524h72.829946c13.142246 0 23.546524 10.404278 23.546524 23.546524s-10.951872 23.546524-23.546524 23.546524z","p-id":"1811"}})])])};ay._withStripped=!0;var ny={name:"MapTools",components:{ToolBox:bi({render:ay,staticRenderFns:[]},undefined,sy,"data-v-80ea7522",false,undefined,!1,void 0,void 0,void 0)},props:{data:{type:Array,default:()=>[]},cdata:{type:Array,default:()=>[]},MapTools:{type:[Boolean,Object],default:()=>!0}},inject:{adapter:{from:"adapter",default:()=>null}},data:()=>({showTools:!0,toolBoxControls:{expand:!0},refresh:{MapSpatial:!1,MapOpacity:!1,MeasureLength:!1,MeasureArea:!1},childPanel:{MapSpatial:!1,MapOpacity:!1,MeasureLength:!1,MeasureArea:!1},localData:[],mapToolsArr:["FullScreen","ResetView","MeasureLength","MeasureLocation","MeasureArea","IQuery","MapSyncMove","MapSyncMoveSplit","ImportFilesToMap","MapPrint","MapCompass","MapZoomIn","MapZoomOut","Clear","MapWebPrint","MapSpatial","MapChangeView","MapImageCompare","MapDataExport","MapLocationTool","MapOpacity","MapPickArea","LocationQuery","Measure3DArea","Measure3DLength","LinearExtrudeAnalysis","SightLineAnalysis","CubeSectionAnalysis","MapRoaming"],layoutVertical:!0,tooltipPlacement:"right"}),created(){if(this.adapter?Object.assign(this,this.adapter().MT.props):this.localData=this.data||[],"object"==typeof this.MapTools&&(this.toolBoxControls=void 0!==this.MapTools.toolsBox?this.MapTools.toolsBox:this.toolBoxControls),"object"==typeof this.toolBoxControls&&(this.showTools=void 0===this.toolBoxControls.expand||this.toolBoxControls.expand),"object"==typeof this.MapTools&&(this.layoutVertical="horizontal"!=this.MapTools.layout,this.layoutVertical?this.tooltipPlacement="right":this.tooltipPlacement="top"),"object"==typeof this.MapTools){var t=void 0!==this.MapTools.tooltipPlacement?this.MapTools.tooltipPlacement:this.tooltipPlacement;"top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end".split("/").includes(t)&&(this.tooltipPlacement=t)}},methods:{changeToolbox(t){this.showTools=void 0!==t?t:!this.showTools,this.$emit("changeToolbox",this.showTools)},activeCurrentTools(t){this.childPanel[t.$vnode.key||t.name]=t.childPanel},openTip(t){this.childPanel[t]=!1,this.refresh[t]=!0,this.$nextTick((()=>{this.refresh[t]=!1}))}}};const oy=ny;var ry=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.localData&&t.localData.length?i("div",{staticClass:"mx-map-tools"},[i("div",{staticClass:"mx-map-tools-body",class:{horizontal:!t.layoutVertical}},[t.toolBoxControls?i("div",{key:"工具箱",staticClass:"mx-map-toolsbox mx-map-tools-group"},[i("el-tooltip",{key:"工具箱",attrs:{content:"工具箱",placement:"right",effect:"light"}},[i("ToolBox",{on:{change:t.changeToolbox}})],1)],1):t._e(),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.showTools,expression:"showTools"}],staticClass:"mx-map-tools-content",class:[t.showTools?"animateFade":"",t.layoutVertical?"":"horizontal"]},[t._l(t.localData,(function(e){return[t._t(e.mapToolCode,(function(){return[i("div",{key:e.mapToolCode,staticClass:"mx-map-tools-group",class:{horizontal:!t.layoutVertical}},[t._l(e.children,(function(e){return[t._t(e.mapToolCode,(function(){return[t.refresh[e.mapToolCode]?t._e():i("el-tooltip",{key:e.mapToolName,attrs:{content:e.mapToolName,placement:t.tooltipPlacement,effect:"light",disabled:t.childPanel[e.mapToolCode],MapTools:t.MapTools}},[t.mapToolsArr.includes(e.mapToolCode)?i("T"+e.mapToolCode,{key:e.mapToolCode,ref:e.mapToolCode,refInFor:!0,tag:"component",attrs:{id:e.mapToolCode,tool:e,MapTools:t.MapTools,layoutVertical:t.layoutVertical},on:{activeCurrentTools:t.activeCurrentTools,openTip:t.openTip}}):i("TMapSelfTools",{key:e.mapToolCode,ref:e.mapToolCode,refInFor:!0,tag:"component",staticClass:"mx-self-tools",attrs:{tool:e,MapTools:t.MapTools,id:e.mapToolCode,layoutVertical:t.layoutVertical},on:{activeCurrentTools:t.activeCurrentTools,openTip:t.openTip}})],1)]}),{data:e})]}))],2)]}),{data:e})]}))],2)])]):t._e()};ry._withStripped=!0;const ly=bi({render:ry,staticRenderFns:[]},undefined,oy,"data-v-62bf8726",false,undefined,!1,void 0,void 0,void 0);const hy={name:"FullScreen",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({isScreenFull:!1}),inject:{mapP:{from:"mapP",default:()=>null}},mounted(){this.map=this.mapP(),A.default.isEnabled&&A.default.onchange((()=>{this.isScreenFull=A.default.isFullscreen}))},methods:{onToggle(){const t=this.mapP();A.default.toggle(t._container||document.getElementById("app")),this.map.GLSDK.toolsOnClick(this.tool,!0)}}};var cy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.isScreenFull},on:{click:function(e){return e.preventDefault(),t.onToggle.apply(null,arguments)}}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"}},[i("path",{attrs:{d:"M19,23v-1h3v-3h1v4H19z M22,8h-3V7h4v4h-1V8z M8,11H7V7h4v1H8\n\tV11z M9,9h12v12H9V9z M10,20h10V10H10V20z M11,11h8v8h-8V11z M8,22h3v1H7v-4h1V22z"}})])])};cy._withStripped=!0;const py=bi({render:cy,staticRenderFns:[]},undefined,hy,undefined,false,undefined,!1,void 0,void 0,void 0);const uy={mapToolCode:"ResetView",props:{tool:{type:Object,default:function(){return{}}}},inject:["mapP"],mounted(){this.map=this.mapP()},methods:{onClick(){this.map.GLSDK.toolsOnClick(this.tool,!0);var t=this.map.M.view.get(),e=this.map.enableTransform,i=t.center;e&&i[0]>180&&(t.center=this.map.M.projTransform(this.map.enableTransform.srid,null,i));let s={center:t.center,bearing:t.bearing,pitch:t.pitch,zoom:t.zoom};this.map.flyTo(s)}}};var dy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"}},[i("path",{attrs:{d:"M15,5c5.6,0,10,4.4,10,10c0,5.6-4.4,10-10,10S5,20.6,5,15\n\tC5,9.4,9.4,5,15,5z M9.5,14.6c0.1-1.3,0.4-2.9,1-4.4C9.6,9.7,8.8,9.3,8.2,8.9c-1.4,1.5-2.2,3.5-2.3,5.7H9.5z M5.9,15.4\n\tc0.1,2.2,0.9,4.2,2.3,5.7c0.6-0.4,1.4-0.9,2.3-1.2c-0.6-1.6-1-3.2-1-4.4H5.9z M12.5,6.3c-1.4,0.4-2.6,1.1-3.6,2\n\tc0.5,0.4,1.2,0.8,2,1.1C11.2,8.2,11.8,7.1,12.5,6.3z M8.8,21.7c1,0.9,2.3,1.6,3.6,2c-0.7-0.9-1.2-2-1.6-3.1\n\tC10.1,20.9,9.4,21.3,8.8,21.7z M14.6,11.2c-1-0.1-2.1-0.4-3.3-0.8c-0.5,1.4-0.9,2.8-0.9,4.1h4.2V11.2z M10.4,15.4\n\tc0.1,1.3,0.4,2.7,0.9,4.1c1.1-0.5,2.3-0.8,3.3-0.8v-3.3H10.4z M14.6,5.9c-0.3,0-0.6,0-0.9,0.1c-0.8,1.1-1.5,2.3-2.1,3.7\n\tc1,0.4,2,0.6,3,0.6V5.9z M14.6,19.7c-0.9,0.1-2,0.3-3,0.6c0.5,1.3,1.2,2.6,2.1,3.7c0.3,0.1,0.6,0.1,0.9,0.1V19.7z M15.4,10.3\n\tc1-0.1,2-0.3,3-0.6c-0.6-1.4-1.3-2.6-2.1-3.7c-0.3-0.1-0.6-0.1-0.9-0.1V10.3z M15.4,14.6h4.2c-0.1-1.4-0.4-2.8-0.9-4.1\n\tc-1.1,0.5-2.3,0.8-3.3,0.8V14.6z M15.4,15.4v3.3c1,0.1,2.1,0.4,3.3,0.8c0.5-1.4,0.9-2.8,0.9-4.1H15.4z M15.4,24.1\n\tc0.3,0,0.6,0,0.9-0.1c0.8-1.1,1.5-2.4,2.1-3.7c-1-0.4-2-0.6-3-0.6V24.1z M21.2,8.3c-1-0.9-2.3-1.6-3.6-2c0.6,0.9,1.2,2,1.7,3.1\n\tC20,9,20.6,8.6,21.2,8.3z M17.5,23.7c1.4-0.3,2.6-1,3.6-2c-0.6-0.4-1.2-0.8-2-1.1C18.8,21.7,18.2,22.8,17.5,23.7z M24.1,14.6\n\tc-0.1-2.2-0.9-4.2-2.3-5.7c-0.6,0.4-1.4,0.9-2.3,1.2c0.6,1.6,0.9,3.2,1,4.4H24.1z M20.5,15.4c0,1.2-0.4,2.9-1,4.4\n\tc0.9,0.4,1.7,0.8,2.3,1.2c1.4-1.5,2.2-3.5,2.3-5.7H20.5z"}})])])};dy._withStripped=!0;const my=bi({render:dy,staticRenderFns:[]},undefined,uy,undefined,false,undefined,!1,void 0,void 0,void 0);const gy={name:"MapIQuery",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("ChangeIQuery",(t=>{t&&this.active||(!t&&this.active&&this.onClick(),t&&!this.active&&this.onClick())})),this.map.M.pubsub.subscribe("ChangeIQueryActive",(t=>{this.active=t}))},methods:{onClick(t){if(this.active)return!0===t&&this.map.GLSDK.toolsOnClick(this.tool,!1),this.map.M.iqueryManager.clear(),void(this.active=!1);!0===t&&this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.M.iqueryManager.create(),this.active=!0}}};var yy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},attrs:{id:"MapIQuery"},on:{click:function(e){return e.preventDefault(),t.onClick(!0)}}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"}},[i("path",{attrs:{d:"M15,23c-4.4,0-8-3.6-8-8\n\ts3.6-8,8-8c4.4,0,8,3.6,8,8S19.4,23,15,23z M15,8c-3.9,0-7,3.1-7,7s3.1,7,7,7s7-3.1,7-7S18.9,8,15,8z M14,13h2v6h-2V13z M14,10h2v2\n\th-2V10z"}})])])};yy._withStripped=!0;const fy=bi({render:yy,staticRenderFns:[]},undefined,gy,undefined,false,undefined,!1,void 0,void 0,void 0);class _y{constructor(t){this.map=t,this.mouseClick=null,this.mouseDblClick=null,this.mouseMove=null}findIndexSourceDataById(t,e){return this.map.getSource(t)._data.features.findIndex((t=>t.properties.id===e))+1}querySourceFeatures(t,e){return this.map.querySourceFeatures(t,{filter:["==",["get","id"],e]})}findFirstNonZeroAfterDecimal(t){const e=t.match(/\.(0*)([1-9])/);if(e){return e[1].length+1}return-1}clear(){}getCoordinate(t){let e=null;if(this.map.projection){const[i,s]=t.coordinate;e=[i,s]}else{const{lng:i,lat:s}=t.lngLat;e=[i,s]}return e}changeUnit(t){this.markers.forEach((e=>{const i=e.distance;if("number"==typeof i){var s=this.formateTipValue(i,t,this.precision);s=`${s} ${t}`,e.lenMsg&&(s+=e.lenMsg),e.getElement().innerText=s}}))}formateTipValue(t,e,i=3){var s,a=i;switch(e){case"米":case"平方米":case"m":case"m²":default:s=t;break;case"亩":s=.0015*t;break;case"公顷":case"ha":s=1e-4*t;break;case"平方千米":case"km²":s=1e-6*t;break;case"千米":case"km":case"公里":s=.001*t;break;case"里":s=.002*t;break;case"尺":s=3*t}Number.isInteger(s)&&(a=0);const n=this.findFirstNonZeroAfterDecimal(s.toString());return a<=n&&(a=n+1),s=s.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:a})}closeEdit(){this.dragEditEvent&&(this.dragEditEvent.destory(),this.dragEditEvent=null)}setMarkerPoint(t,e){this.map.projection?t.setCoordinate(e):t.setLngLat(e)}destory(){this.mouseClick&&this.map.off("click",this.mouseClick),this.mouseDblClick&&this.map.off("dblclick",this.mouseDblClick),this.mouseMove&&this.map.off("mousemove",this.mouseMove),this.mouseClick=null,this.mouseDblClick=null,this.mouseMove=null}}class vy extends _y{constructor(t,e){super(t),this.options=e||{},this.transformType=void 0===this.options.transform?1:this.options.transform,this.unit=2===this.transformType?"m":"米",this.max="object"==typeof this.options?this.options.max:null,this.precision=this.options.precision||3,this.dragEditEnable=this.options.dragEditEnable||!1,this.persistent="object"==typeof this.options&&this.options.persistent,this.markers=[],this.dynamicPopup=null,this.endCallback=null,this.dragCallback=null,t.U.addGeoJSON("measure-geojson"),t.U.addGeoJSON("measure-geojson-move",{type:"FeatureCollection",features:[]}),t.U.addLineLayer("measure-layer-line","measure-geojson",{lineWidth:2,lineColor:"rgba(255,0,0,0.7)",lineCap:"round",lineJoin:"round",filter:["in","$type","LineString"]}),t.U.addCircleLayer("measure-layer-point","measure-geojson",{circleColor:"#ff0000",circleRadius:4,filter:["in","$type","Point"]}),t.U.addLineLayer("measure-layer-line-move","measure-geojson-move",{lineWidth:2,lineColor:"rgba(255,0,0,0.7)",lineCap:"round",lineJoin:"round",filter:["in","$type","LineString"]}),this.measureValueMsg="",this.transformAble=!1,this.groupCode=1,this.dragEditEvent=null,this.dragDataTemp={}}back(){}reSetLineStringFeature(t){return{type:"Feature",id:t||this.groupCode,geometry:{type:"LineString",coordinates:[]},properties:{id:t||this.groupCode}}}start(){let t=null,e=[],i=0,s=0;const a=this,n={type:"FeatureCollection",features:[]};let o={type:"FeatureCollection",features:[]},r=this.reSetLineStringFeature(),l=!1,h=null,c=null;const p=t=>{const a=e.length;if(a>0){const n=e[a-1];if(c||(c=n,this.showMarker(c,"起点",this.groupCode,0)),d().length>=2){r.geometry.coordinates=d().map((function(t){return t.geometry.coordinates})),i=s||0,s=this.getLineDistance(r);const e=o.features.length-1;o.features[e].properties.curDistance=s,o.features[e].properties.prevDistance=i,t&&this.showMarker(n,s,this.groupCode,e)}else r=this.reSetLineStringFeature(r.id)}const l={type:"FeatureCollection",features:n.features.concat(o.features).concat([r])};this.map.U.setData("measure-geojson",l),this.max&&a>=this.max&&this.mouseDblClick()};this.mouseClick=i=>{i.preventDefault();const s=a.getCoordinate(i);l=!0,t&&t.geometry.coordinates[0]===s[0]&&t.geometry.coordinates[1]===s[1]||(t={type:"Feature",geometry:{type:"Point",coordinates:s},properties:{id:String((new Date).getTime()),curDistance:0,prevDistance:0,groupCode:this.groupCode}},o.features.push(t),e.push(s),p(!0))},this.mouseDblClick=()=>{if(!1===l)return;o.features.length<=1?window.MapMessage.ShowMessage({type:"warning",message:"几何构线失败,请至少添加二个点!"}):(t=void 0,e=[],this.dragEditEnable&&(this.dragDataTemp[r.id]=JSON.parse(JSON.stringify(r)),this.dragCallback&&this.dragCallback(this.groupCode)),n.features=n.features.concat(o.features).concat([r]),this.groupCode++,o={type:"FeatureCollection",features:[]},r=this.reSetLineStringFeature(),i=0,s=0,this.transformAble=!1,this.persistent||(this.map.off("click",this.mouseClick),this.map.M.setCursor("")),c=null,h=null,this.map.U.setData("measure-geojson-move"),this.dynamicPopup&&(this.dynamicPopup.remove(),this.dynamicPopup=null),this.endCallback&&this.endCallback(this.measureValueMsg,n))},this.update=(t,e)=>{const i=n.features.findIndex((e=>e.properties.id===t));n.features[i]=e,this.dragDataTemp[t]=e},this.updatePoint=(t,e)=>{n.features=n.features.filter((e=>e.properties.groupCode!=t)),n.features=n.features.concat(e)},this.reStart=()=>{this.dragEditEnable&&this.dragEditEvent||(this.mouseClick&&this.map.off("click",this.mouseClick),this.map.M.setCursor("Crosshair"),this.map.on("click",this.mouseClick))},this.closeMeasure=()=>{this.map.off("click",this.mouseClick),this.map.M.setCursor("")};const u=()=>{if(t&&h){const e={type:"Feature",geometry:{type:"LineString",coordinates:[t.geometry.coordinates,h]}},i=this.getLineDistance(e);if(i-0==0)return;this.map.U.setData("measure-geojson-move",{type:"FeatureCollection",features:[e]});const a=parseFloat(s)+parseFloat(i);m(h,a)}else this.map.U.setData("measure-geojson-move",{type:"FeatureCollection",features:[]}),this.dynamicPopup&&(this.dynamicPopup.remove(),this.dynamicPopup=null)};this.mouseMove=e=>{e.preventDefault(),l&&t&&(h=a.getCoordinate(e),u())},this.back=()=>{let i=o.features.length;0!=i?(o.features.pop(),e.pop(),i=o.features.length,i>0?(t=o.features[i-1],s=t.properties.curDistance):(s=0,t=null,c=null),h=null,this.markers[this.markers.length-1].remove(),this.markers.pop(),p(),u()):window.MapMessage.ShowMessage({message:"无法撤销,节点不存在!",type:"warning"})},this.map.on("click",this.mouseClick),this.map.on("dblclick",this.mouseDblClick),this.map.on("mousemove",this.mouseMove);const d=()=>o.features.filter((function(t){return"Point"===t.geometry.type})),m=(t,e)=>{let i=e;i="number"==typeof i?this.transformValue(i,"move"):i;var s=`<div class="map-measure-distance">${i}</div>`;this.dynamicPopup?(this.dynamicPopup.setHTML(s),this.map.isCoordinate?this.dynamicPopup.setCoordinate(t):this.dynamicPopup.setLngLat(t).addTo(this.map)):(this.dynamicPopup=new I.default.Popup({closeOnClick:!1,closeButton:!1,className:"measure-popup",anchor:"bottom-left"}),this.dynamicPopup.setHTML(s),this.map.isCoordinate?this.dynamicPopup.setCoordinate(t).addTo(this.map):this.dynamicPopup.setLngLat(t).addTo(this.map)),this.dynamicPopup.distance=e}}updateMarkerDistance(t,e){this.transformAble=!0,this.markers.forEach((i=>{const s=i.distance;if("number"==typeof s){var a=this.formateTipValue(s,t,e);i.getElement().innerText=`${a} ${t}`}}))}transformValue(t,e){let i=t,s=this.precision;switch(this.transformType){case 1:Number(i)<1e3?(this.unit="米",i=this.formateTipValue(t,this.unit,s)):(this.unit="千米",i=this.formateTipValue(t,this.unit,s),!this.transformAble&&"click"==e&&this.updateMarkerDistance(this.unit,s));break;case 2:Number(i)<1e3?(this.unit="m",i=this.formateTipValue(t,this.unit,s)):(this.unit="km",i=this.formateTipValue(t,this.unit,s),!this.transformAble&&"click"==e&&this.updateMarkerDistance(this.unit,s))}return`${i} ${this.unit}`}getLineDistance(t){return this.map.sz2000sdk?this.map.MapmostSDKConvert.calcSdkDistanceToGeoJSON(t.geometry):vs(t)}showMarker(t,e,i,s,a){let n=e;n="number"==typeof n?this.transformValue(n,"click"):n;const o=document.createElement("div");o.className="map-measure-distance",o.innerHTML=n;const r=new I.default.Marker({element:o,anchor:"bottom-left"});return this.map.projection?r.setCoordinate(t):r.setLngLat(t),r.addTo(this.map),r.distance=e,r.groupCode=i,r.groupIndex=s,a?this.markers.splice(a,0,r):this.markers.push(r),this.measureValueMsg=n,r}openEditById(t){this.closeMeasure(),this.closeEdit();let e=this.dragDataTemp[t],i=JSON.parse(JSON.stringify(e));i.id=this.findIndexSourceDataById("measure-geojson",i.id),i.layer={id:"measure-layer-line"},i.source="measure-geojson",i.findId=t,this.edit(i)}edit(t){const e=new $d(t);e.start(this.map);const i=t.source,s=t.findId;e.measureUpdate=(t,e,a,n)=>{this.update(s,JSON.parse(JSON.stringify(n)));const o=t.features.filter((t=>0==t.properties.fictitious));this.updatePoint(s,JSON.parse(JSON.stringify(o))),this.updateAllSourceData(i,s,o),this.updateAllDistanceLabel(s,o,e,a)},this.dragEditEvent=e}updateAllSourceData(t,e,i){let s=this.map.getSource(t)._data;s.features=s.features.filter((t=>t.properties.groupCode!=e)),s.features=s.features.concat(i),this.map.getSource(t).setData(s)}async updateAllDistanceLabel(t,e,i,s){const a=e.length;let n=this.markers.filter((e=>e.groupCode==t));const o=n.length;if(s){let s=(i+1)/2;if(i=s,o<a){let i=e[s].geometry.coordinates,a=this.markers.findIndex((e=>e.groupCode==t&&e.groupIndex==s));this.markers.filter((e=>e.groupCode==t&&e.groupIndex>=s)).map((t=>(t.groupIndex=t.groupIndex+1,t)));let n=this.getgetLineDistanceByIndex(e,s);await this.showMarker(i,n,t,s,a)}}else i/=2;n=this.markers.filter((e=>e.groupCode==t)),0==i&&(this.setMarkerPoint(n[0],e[0].geometry.coordinates),i++);let r=i;for(let t=r;t<n.length;t++){let i=this.getgetLineDistanceByIndex(e,t),s=n[t];s.distance=i;let a="number"==typeof i?this.transformValue(i,"click"):i;s.getElement().innerText=a,t==r&&this.setMarkerPoint(s,e[t].geometry.coordinates)}}getgetLineDistanceByIndex(t,e){let i=t.slice(0,e+1);i=i.map((t=>t.geometry.coordinates));const s={type:"Feature",geometry:{type:"LineString",coordinates:i}};return this.getLineDistance(s)}clear(){this.closeEdit(),this.destory(),this.dynamicPopup&&(this.dynamicPopup.remove(),this.dynamicPopup=null);for(const t of this.markers)t&&t.remove();this.markers=[],this.map.U.removeLayer(["measure-layer-point","measure-layer-line","measure-layer-line-move"]),this.map.U.removeSource(["measure-geojson","measure-geojson-move"])}}const xy={name:"MeasureLength",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,childPanel:!0,measure:{},name:"MeasureLength",unitValue:"千米",unitList:[{label:"米",value:"米"},{label:"千米",value:"千米"},{label:"里",value:"里"},{label:"公里",value:"公里"},{label:"尺",value:"尺"}],dragList:[],dragEditEnable:!1,acticeDragCode:0,showChild:!1}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1,this.destory()})),"object"==typeof this.MapTools&&(this.measure=void 0!==this.MapTools.measure?JSON.parse(JSON.stringify(this.MapTools.measure)):this.measure,this.dragEditEnable=this.measure.dragEditEnable||!1,this.showChild=this.measure.showChild||!1)},methods:{destory(){this.showChild&&(this.$emit("openTip",this.name),this.active=!1)},close(){this.active&&(this.map.GLSDK.toolsOnClick(this.tool,!1),this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1,this.map.M.setCursorIQuery(),this.destory())},onClick(){if(this.active)return void this.close();this.map.GLSDK.mapActiveTools({key:this.name,close:()=>{this.close()}}),this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new vy(this.map,this.measure);t.start(),this.dragEditEnable&&(t.dragCallback=t=>{this.dragList.push(t)}),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1},this.showChild&&(this.active?this.$emit("activeCurrentTools",this):this.destory())},onStart(){this.map.M.action&&this.map.M.action.measure&&this.map.M.action.measure.reStart()},openDragEdit(t){if(this.map.M.action&&this.map.M.action.measure&&this.map.M.action.measure.openEditById){if(this.acticeDragCode==t)return this.map.M.action.measure.closeEdit(),void(this.acticeDragCode="");this.map.M.action.measure.openEditById(t),this.acticeDragCode=t}},onDrawBack(){let t=this.map.M.action.measure;t&&t.back()},handleCommand(t){this.unitValue=t;let e=this.map.M.action.measure;e&&e.changeUnit(t)}}};var Cy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("path",{attrs:{d:"M12.5,22v-5h2v3H15v-3\n\th1.5v2H17v-2h2.5v3H20v-3h1.5v2H22v-2h1v5H12.5z M21,10H9v1H8v-1V9V8h1v1h12V8h1v1v1v1h-1V10z M8.5,20H9v-3h1.5v2H11v-2h1v5H7v-5\n\th1.5V20z"}})]),t._v(" "),t.showChild&&t.active?i("transition",{attrs:{name:"el-zoom-in-top"}},[i("div",{staticClass:"mx-map-tools-child tools-child-measure",class:{"tools-child-measure-drag":t.dragEditEnable}},[i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"撤销",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.stopPropagation(),t.onDrawBack()}}},[i("svg",{staticClass:"icon",attrs:{t:"1746522215770",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1458",width:"20",height:"20"}},[i("path",{attrs:{d:"M363 252h8.582c298.234 0 540 241.766 540 540v80.007c0 22.09-17.909 40-40 40s-40-17.91-40-40V792c0-254.051-205.95-460-460-460H363v132.533c0 8.836-7.163 16-16 16a16 16 0 0 1-9.747-3.312L118.517 309.188c-7.008-5.383-8.324-15.428-2.941-22.435a16 16 0 0 1 2.94-2.941l218.737-168.033c7.007-5.383 17.052-4.066 22.435 2.941a16 16 0 0 1 3.312 9.747V252z","p-id":"1459"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"单位",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item measure-unit"},[i("el-dropdown",{on:{command:t.handleCommand}},[i("span",{staticClass:"el-dropdown-link"},[t._v("\n "+t._s(t.unitValue)),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.unitList,(function(e){return i("el-dropdown-item",{key:e.value,attrs:{command:e.value}},[t._v(t._s(e.label))])})),1)],1)],1)]),t._v(" "),t.dragEditEnable?i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"开始",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.stopPropagation(),t.onStart()}}},[i("svg",{staticClass:"icon",attrs:{t:"1747375548038",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1464",width:"20",height:"20"}},[i("path",{attrs:{d:"M896.64 864h-768a32 32 0 1 0 0 64h768a32 32 0 0 0 0-64zM232.32 799.168l180.992-45.248c0.96-0.256 1.824-0.768 2.752-1.088a31.776 31.776 0 0 0 11.968-7.232l0.16-0.096L881.504 292.16a32 32 0 0 0 0-45.28l-135.776-135.744a32 32 0 0 0-45.248 0L247.168 564.48l-0.096 0.128a31.84 31.84 0 0 0-7.232 12c-0.32 0.96-0.864 1.76-1.088 2.752l-45.248 181.024c-5.44 21.76 16.992 44.224 38.784 38.784zM723.072 179.04l90.528 90.496-67.904 67.904-90.496-90.528 67.872-67.84z m-113.12 113.152l90.496 90.496-294.944 294.944-90.496-90.528 294.944-294.912zM287.136 649.696l55.808 55.84-74.432 18.624 18.624-74.432z","p-id":"1465"}})])])]):t._e(),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"关闭",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1746578316711",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2615",width:"18",height:"18"}},[i("path",{attrs:{d:"M726.954667 794.88l-214.912-214.954667-215.04 214.912-67.84-67.84L444.117333 512 229.162667 297.045333 296.96 229.12 512 444.117333l214.954667-214.954666 67.882666 67.84L579.882667 512l214.954666 214.954667-67.84 67.882666z","p-id":"2616"}})])])]),t._v(" "),t.dragEditEnable&&t.dragList.length?i("div",{staticClass:"mx-map-measure-drag-content"},t._l(t.dragList,(function(e,s){return i("div",{key:s,staticClass:"mx-map-measure-drag-item",class:{active:t.acticeDragCode==e},on:{click:function(i){return i.stopPropagation(),t.openDragEdit(e)}}},[t._v("\n "+t._s("图斑"+e)+"\n "),i("i",{staticClass:"el-icon-edit"})])})),0):t._e()],1)]):t._e()],1)};Cy._withStripped=!0;const Ly=bi({render:Cy,staticRenderFns:[]},undefined,xy,undefined,false,undefined,!1,void 0,void 0,void 0);class My extends _y{constructor(t){super(t),this.popups=[],this.endCallback=null,t.U.addGeoJSON("measure-geojson"),t.U.addCircleLayer("measure-layer-point","measure-geojson",{circleColor:"#e55e5e",circleRadius:4})}start(){const{map:t}=this,e={type:"FeatureCollection",features:[]};this.mouseClick=i=>{let s=[];const a=[];if(t.projection){const[t,e]=i.coordinate;s=[t,e],a.push(`<div class="map-measurelocation">X:${t.toFixed(2)}</div>`),a.push(`<div class="map-measurelocation">Y:${e.toFixed(2)}</div>`)}else{let{lat:e,lng:n}=i.lngLat;if(s=[n,e],t.sz2000sdk&&(s=t.MapmostSDKConvert.toDefinedProj([n,e]),n=s[0]||n,e=s[1]||e),t.enableTransform){const[e,i]=t.M.projTransform(null,t.enableTransform.srid,s);a.push(`<div class="map-measurelocation">X:${e.toFixed(2)}</div>`),a.push(`<div class="map-measurelocation">Y:${i.toFixed(2)}</div>`)}else a.push(`<div class="map-measurelocation">lng:${n.toFixed(6)}</div>`),a.push(`<div class="map-measurelocation">lat:${e.toFixed(6)}</div>`)}const n=new I.default.Popup({className:"measure-popup",closeOnClick:!1,closeOnMove:!1,closeButton:!1}).addTo(t).setHTML(a.join("")).setLngLat(i.lngLat);this.popups.push(n),e.features.push({type:"Feature",geometry:{type:"Point",coordinates:s}}),t.U.setData("measure-geojson",e),this.endCallback&&this.endCallback(e)},t.on("click",this.mouseClick)}clear(){this.destory();for(const t of this.popups)t.remove();this.popups=[],this.map.U.removeLayer(["measure-layer-point"]),this.map.U.removeSource(["measure-geojson"])}}const by={name:"MeasureLocation",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,name:"MeasureLocation"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1}))},methods:{close(){this.active&&(this.map.GLSDK.toolsOnClick(this.tool,!1),this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1,this.map.M.setCursorIQuery())},onClick(){if(this.active)return void this.close();this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.close()}}),this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new My(this.map);t.start(),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1}}}};var wy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"}},[i("path",{attrs:{d:"M22.9,16c-0.5,3.6-3.3,6.5-6.9,6.9V25h-2v-2.1c-3.6-0.5-6.5-3.3-6.9-6.9H5v-2h2.1c0.5-3.6,3.3-6.5,6.9-6.9V5h2\n\tv2.1c3.6,0.4,6.5,3.3,6.9,6.9H25v2H22.9z M22,14c-0.4-3.1-2.9-5.6-6-6v2h-2V8c-3.1,0.4-5.5,2.9-6,6h2v2H8c0.4,3.1,2.9,5.5,6,6v-2h2\n\tv2c3.1-0.4,5.6-2.9,6-6h-2v-2H22z M15,18c-1.7,0-3-1.3-3-3s1.3-3,3-3s3,1.3,3,3S16.7,18,15,18z"}})])])};wy._withStripped=!0;const Sy=bi({render:wy,staticRenderFns:[]},undefined,by,undefined,false,undefined,!1,void 0,void 0,void 0);class Iy extends _y{constructor(t,e){super(t),this.options=e||{},this.transformType=void 0===this.options.transform?1:this.options.transform,this.unit=this.options.unit||"平方米",this.precision=this.options.precision||3,this.dragEditEnable=this.options.dragEditEnable||!1,this.persistent="object"==typeof this.options&&this.options.persistent,this.markers=[],this.dynamicPopup=null,this.endCallback=null,this.dragCallback=null,this.curArea=0,t.U.addGeoJSON("measure-geojson"),t.U.addGeoJSON("measure-geojson-line"),t.U.addGeoJSON("measure-geojson-polygon",{type:"FeatureCollection",features:[]}),t.U.addLineLayer("measure-layer-line","measure-geojson-line",{lineWidth:2,lineColor:"#ff0000",lineCap:"round",lineJoin:"round",filter:["in","$type","LineString"]}),t.U.addCircleLayer("measure-layer-point","measure-geojson",{circleColor:"#ff0000",circleRadius:5,filter:["in","$type","Point"]}),t.U.addFillLayer("measure-layer-polygon","measure-geojson-polygon",{fillColor:"#ff0000",fillOpacity:.2}),this.measureValueMsg="",this.transformAble=!1,this.groupCode=1,this.dragEditEvent=null,this.dragDataTemp={}}back(){}reSetPolygonStringFeature(t){return{type:"Feature",id:t||this.groupCode,geometry:{type:"Polygon",coordinates:[]},properties:{id:t||this.groupCode}}}reSetLineStringFeature(t,e){return{type:"Feature",geometry:{type:"LineString",coordinates:e||[]},properties:{groupCode:t||this.groupCode}}}start(){const t=this;let e=null;const i={type:"FeatureCollection",features:[]},s={type:"FeatureCollection",features:[]},a={type:"FeatureCollection",features:[]};let n={type:"FeatureCollection",features:[]},o=this.reSetLineStringFeature(),r=this.reSetPolygonStringFeature(),l=!1,h=null,c=null;const p=()=>{n.features.length>=2&&(o.geometry.coordinates=d().map((function(t){return t.geometry.coordinates})),o.geometry.coordinates.push(h));const t={type:"FeatureCollection",features:i.features.concat(n.features)};this.map.U.setData("measure-geojson",t)};this.mouseClick=i=>{i.preventDefault();const s=t.getCoordinate(i);l=!0,e&&e.geometry.coordinates[0]===s[0]&&e.geometry.coordinates[1]===s[1]||(e={type:"Feature",geometry:{type:"Point",coordinates:s},properties:{id:String((new Date).getTime()),curDistance:0,prevDistance:0,groupCode:this.groupCode}},null===h&&(h=s),n.features.push(e),p())},this.mouseDblClick=()=>{n.features.length<=2?window.MapMessage.ShowMessage({type:"warning",message:"几何构面失败,请至少添加三个点!"}):(l=!1,e=void 0,h=null,c=null,this.dragEditEnable&&(this.dragDataTemp[r.id]=JSON.parse(JSON.stringify(r)),this.dragCallback&&this.dragCallback(this.groupCode)),i.features=i.features.concat(n.features),s.features.push(o),a.features.push(r),this.groupCode++,n={type:"FeatureCollection",features:[]},o=this.reSetLineStringFeature(),r=this.reSetPolygonStringFeature(),this.markers.push(this.dynamicPopup),this.dynamicPopup=null,this.persistent||(this.map.off("click",this.mouseClick),this.map.M.setCursor("")),this.map.off("mousemove",this.mouseClick),this.endCallback&&this.endCallback(this.measureValueMsg))},this.update=(t,e)=>{const i=a.features.findIndex((e=>e.properties.id===t));a.features[i]=e,this.dragDataTemp[t]=e},this.updatePoint=(t,e)=>{i.features=i.features.filter((e=>e.properties.groupCode!=t)),i.features=i.features.concat(e),this.map.getSource("measure-geojson").setData(i)},this.updateLine=(t,e)=>{s.features=s.features.filter((e=>e.properties.groupCode!=t)),s.features=s.features.concat(e),this.map.getSource("measure-geojson-line").setData(s)},this.reStart=()=>{this.dragEditEnable&&this.dragEditEvent||(this.mouseClick&&this.map.off("click",this.mouseClick),this.map.M.setCursor("Crosshair"),this.map.on("click",this.mouseClick))},this.closeMeasure=()=>{this.map.off("click",this.mouseClick),this.map.M.setCursor("")};const u=()=>{let t=c,e=n.features.length;if(e>0){o.geometry.coordinates=d().map((function(t){return t.geometry.coordinates})),t&&o.geometry.coordinates.push(t),o.geometry.coordinates.push(h);const e=s.features.concat([o]);this.map.U.setData("measure-geojson-line",{type:"FeatureCollection",features:e})}else this.map.U.setData("measure-geojson-line",{type:"FeatureCollection",features:s.features});if(e>1){r.geometry.coordinates=[o.geometry.coordinates];const t=a.features.concat([r]);this.map.U.setData("measure-geojson-polygon",{type:"FeatureCollection",features:t})}else this.map.U.setData("measure-geojson-polygon",{type:"FeatureCollection",features:a.features});if(o.geometry.coordinates.length>3){const t=this.getPolygonArea(r),e=this.getPolygonLength(o),i=Cs(r);this.curArea=t,m([i[0],i[1]],t,e,this.groupCode)}else this.dynamicPopup&&(this.dynamicPopup.remove(),this.dynamicPopup=null)};this.mouseMove=e=>{e.preventDefault(),l&&(c=t.getCoordinate(e),u())},this.back=()=>{let t=n.features.length;0!=t?(n.features.pop(),t=n.features.length,t>0?c=n.features[t-1]:(l=!1,h=null),c=null,p(),u()):window.MapMessage.ShowMessage({message:"无法撤销,节点不存在!",type:"warning"})},this.map.on("click",this.mouseClick),this.map.on("dblclick",this.mouseDblClick),this.map.on("mousemove",this.mouseMove);const d=()=>n.features.filter((function(t){return"Point"===t.geometry.type})),m=(t,e,i,s)=>{let a=e;a=this.transformValue(a);let n=this.transformValueLength(i);if(n=`(L ${n})`,a=`${a} ${n}`,this.dynamicPopup)this.dynamicPopup.getElement().innerHTML=a,this.map.projection?this.dynamicPopup.setCoordinate(t):this.dynamicPopup.setLngLat(t);else{const e=document.createElement("div");e.className="map-measure-distance",e.innerHTML=a,this.dynamicPopup=new I.default.Marker({element:e,anchor:"center"}),this.map.projection?this.dynamicPopup.setCoordinate(t):this.dynamicPopup.setLngLat(t),this.dynamicPopup.addTo(this.map)}this.dynamicPopup.distance=e,this.dynamicPopup.lenMsg=n,this.dynamicPopup.groupCode=s}}getPolygonLength(t){return this.map.sz2000sdk?this.map.MapmostSDKConvert.calcSdkDistanceToGeoJSON(t.geometry):vs(t)}getPolygonArea(t){return this.map.sz2000sdk?this.map.MapmostSDKConvert.calcSdkAreaToGeoJson(t.geometry):xs(t)}transformValue(t){let e=t,i=this.precision;switch(this.transformType){case 1:Number(e)<1e6?(this.unit="平方米",e=this.formateTipValue(t,this.unit,i)):(this.unit="平方千米",e=this.formateTipValue(t,this.unit,i));break;case 2:Number(e)<666.667?(this.unit="m²",e=this.formateTipValue(t,this.unit,i)):Number(e)<1e4?(this.unit="亩",e=this.formateTipValue(t,this.unit,i)):(this.unit="公顷",e=this.formateTipValue(t,this.unit,i))}return this.measureValueMsg=`${e} ${this.unit}`,this.measureValueMsg}transformValueLength(t){let e=t,i="米",s=this.precision;return Number(e)<1e3?(i="米",e=this.formateTipValue(t,i,s)):(i="千米",e=this.formateTipValue(t,i,s)),`${e} ${i}`}openEditById(t){this.closeMeasure(),this.closeEdit();let e=this.dragDataTemp[t],i=JSON.parse(JSON.stringify(e));i.id=this.findIndexSourceDataById("measure-geojson-polygon",i.id),i.layer={id:"measure-layer-polygon"},i.source="measure-geojson-polygon",i.findId=t,this.edit(i)}edit(t){const e=new $d(t);e.start(this.map),t.source;const i=t.findId;e.measureUpdate=(t,e,s,a)=>{this.update(i,JSON.parse(JSON.stringify(a)));const n=t.features.filter((t=>0==t.properties.fictitious));this.updatePoint(i,JSON.parse(JSON.stringify(n)));let o=this.getLineFeature(a);this.updateLine(i,o),this.updateAllLabel(i,a,o)},this.dragEditEvent=e}async updateAllLabel(t,e,i){let s=this.markers.filter((e=>e.groupCode==t));if(s.length>0){const t=this.getPolygonArea(e),a=this.getPolygonLength(i);let n=Cs(e);this.curArea=t,n=[n[0],n[1]];const o=s[0];this.setMarkerPointAndMsg(o,n,t,a)}}setMarkerPointAndMsg(t,e,i,s){let a=i;a=this.transformValue(a);let n=this.transformValueLength(s);n=`(L ${n})`,a=`${a} ${n}`,t.getElement().innerHTML=a,t.distance=i,t.lenMsg=n,this.map.projection?t.setCoordinate(e):t.setLngLat(e)}getLineFeature(t){const e=t.geometry.coordinates[0],i=t.properties.id;return this.reSetLineStringFeature(i,e)}clear(){this.closeEdit(),this.destory(),this.dynamicPopup&&(this.dynamicPopup.remove(),this.dynamicPopup=null);for(const t of this.markers)t&&t.remove();this.markers=[],this.map.U.removeLayer(["measure-layer-point","measure-layer-line","measure-layer-polygon"]),this.map.U.removeSource(["measure-geojson","measure-geojson-line","measure-geojson-polygon"])}}const Ey={name:"MeasureArea",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,childPanel:!0,measure:{},name:"MeasureArea",unitValue:"平方米",unitList:[{label:"平方米",value:"平方米"},{label:"平方千米",value:"平方千米"},{label:"亩",value:"亩"},{label:"公亩",value:"公亩"},{label:"公顷",value:"公顷"}],dragList:[],dragEditEnable:!1,acticeDragCode:0,showChild:!1}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1,this.destory()})),"object"==typeof this.MapTools&&(this.measure=void 0!==this.MapTools.measure?JSON.parse(JSON.stringify(this.MapTools.measure)):this.measure,this.dragEditEnable=this.measure.dragEditEnable||!1,this.showChild=this.measure.showChild||!1)},methods:{destory(){this.showChild&&(this.$emit("openTip",this.name),this.active=!1)},close(){this.active&&(this.map.GLSDK.toolsOnClick(this.tool,!1),this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1,this.map.M.setCursorIQuery(),this.destory())},onClick(){if(this.active)return void this.close();this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.close()}}),this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new Iy(this.map,this.measure);t.start(),this.dragEditEnable&&(t.dragCallback=t=>{this.dragList.push(t)}),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1},this.showChild&&(this.active?this.$emit("activeCurrentTools",this):this.destory())},onStart(){this.map.M.action&&this.map.M.action.measure&&this.map.M.action.measure.reStart()},openDragEdit(t){if(this.map.M.action&&this.map.M.action.measure&&this.map.M.action.measure.openEditById){if(this.acticeDragCode==t)return this.map.M.action.measure.closeEdit(),void(this.acticeDragCode="");this.map.M.action.measure.openEditById(t),this.acticeDragCode=t}},onDrawBack(){let t=this.map.M.action.measure;t&&t.back()},handleCommand(t){this.unitValue=t;let e=this.map.M.action.measure;e&&e.changeUnit(t)}}};var Ty=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("g",[i("g",{staticStyle:{opacity:"0.8"}},[i("polygon",{attrs:{points:"8,17.1 8,6.2 18,6.2 22,10.2 22,17.1"}})]),t._v(" "),i("g",[i("polygon",{staticStyle:{opacity:"0.8"},attrs:{points:"22,18.8 22,20.8 21.5,20.8 21.5,18.8 20,18.8 20,21.8 19.5,21.8 19.5,18.8\n\t\t\t17,18.8 17,20.8 16.5,20.8 16.5,18.8 15,18.8 15,21.8 14.5,21.8 14.5,18.8 12.5,18.8 12.5,23.8 23,23.8 23,18.8 \t\t"}}),t._v(" "),i("polygon",{staticStyle:{opacity:"0.8"},attrs:{points:"11,20.8 10.5,20.8 10.5,18.8 9,18.8 9,21.8 8.5,21.8 8.5,18.8 7,18.8 7,23.8\n\t\t\t12,23.8 12,18.8 11,18.8 \t\t"}}),t._v(" "),i("path",{staticStyle:{opacity:"0.8"},attrs:{d:"M22,10.2l-4-4L8,6.2l0,10.8l14,0.1V10.2z M21,16.1L9,16.1l0-8.9l8.6-0.1l3.4,3.4V16.1z\n\t\t\t"}})])])]),t._v(" "),t.showChild&&t.active?i("transition",{attrs:{name:"el-zoom-in-top"}},[i("div",{staticClass:"mx-map-tools-child tools-child-measure-area",class:{"tools-child-measure-area-drag":t.dragEditEnable}},[i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"撤销",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.stopPropagation(),t.onDrawBack()}}},[i("svg",{staticClass:"icon",attrs:{t:"1746522215770",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1458",width:"20",height:"20"}},[i("path",{attrs:{d:"M363 252h8.582c298.234 0 540 241.766 540 540v80.007c0 22.09-17.909 40-40 40s-40-17.91-40-40V792c0-254.051-205.95-460-460-460H363v132.533c0 8.836-7.163 16-16 16a16 16 0 0 1-9.747-3.312L118.517 309.188c-7.008-5.383-8.324-15.428-2.941-22.435a16 16 0 0 1 2.94-2.941l218.737-168.033c7.007-5.383 17.052-4.066 22.435 2.941a16 16 0 0 1 3.312 9.747V252z","p-id":"1459"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"单位",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item measure-unit"},[i("el-dropdown",{on:{command:t.handleCommand}},[i("span",{staticClass:"el-dropdown-link"},[t._v("\n "+t._s(t.unitValue)),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.unitList,(function(e){return i("el-dropdown-item",{key:e.value,attrs:{command:e.value}},[t._v(t._s(e.label))])})),1)],1)],1)]),t._v(" "),t.dragEditEnable?i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"开始",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.stopPropagation(),t.onStart()}}},[i("svg",{staticClass:"icon",attrs:{t:"1747375548038",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1464",width:"20",height:"20"}},[i("path",{attrs:{d:"M896.64 864h-768a32 32 0 1 0 0 64h768a32 32 0 0 0 0-64zM232.32 799.168l180.992-45.248c0.96-0.256 1.824-0.768 2.752-1.088a31.776 31.776 0 0 0 11.968-7.232l0.16-0.096L881.504 292.16a32 32 0 0 0 0-45.28l-135.776-135.744a32 32 0 0 0-45.248 0L247.168 564.48l-0.096 0.128a31.84 31.84 0 0 0-7.232 12c-0.32 0.96-0.864 1.76-1.088 2.752l-45.248 181.024c-5.44 21.76 16.992 44.224 38.784 38.784zM723.072 179.04l90.528 90.496-67.904 67.904-90.496-90.528 67.872-67.84z m-113.12 113.152l90.496 90.496-294.944 294.944-90.496-90.528 294.944-294.912zM287.136 649.696l55.808 55.84-74.432 18.624 18.624-74.432z","p-id":"1465"}})])])]):t._e(),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"关闭",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1746578316711",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2615",width:"18",height:"18"}},[i("path",{attrs:{d:"M726.954667 794.88l-214.912-214.954667-215.04 214.912-67.84-67.84L444.117333 512 229.162667 297.045333 296.96 229.12 512 444.117333l214.954667-214.954666 67.882666 67.84L579.882667 512l214.954666 214.954667-67.84 67.882666z","p-id":"2616"}})])])]),t._v(" "),t.dragEditEnable&&t.dragList.length?i("div",{staticClass:"mx-map-measure-drag-content"},t._l(t.dragList,(function(e,s){return i("div",{key:s,staticClass:"mx-map-measure-drag-item",class:{active:t.acticeDragCode==e},on:{click:function(i){return i.stopPropagation(),t.openDragEdit(e)}}},[t._v("\n "+t._s("图斑"+e)+"\n "),i("i",{staticClass:"el-icon-edit"})])})),0):t._e()],1)]):t._e()],1)};Ty._withStripped=!0;const Dy=bi({render:Ty,staticRenderFns:[]},undefined,Ey,"data-v-2ad3c4b4",false,undefined,!1,void 0,void 0,void 0);const Py={name:"MapPrinter",props:{iconName:{type:String,default:"icon"},tool:{type:Object,default:function(){return{}}}},inject:["mapP"],mounted(){this.map=this.mapP()},methods:{onClick(){this.map.GLSDK.toolsOnClick(this.tool,!0);const t=this.map.getCanvas().toDataURL();this.map.MapLayerLegend&&this.map.MapLayerLegend.printMap?this.map.MapLayerLegend.getLengedImage((e=>{e?im(t,e,(t=>{this.printMap(t)})):this.printMap(t)})):this.printMap(t)},printMap(t){const e=this.map.getWaterMarkImg();if("object"==typeof e.MapWaterMark&&!0===e.MapWaterMark.printMap){var i=e.img;if(i)return void im(t,i,(t=>{em(t,"map","png")}))}em(t,"map","png")}}};var Oy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"}},[i("path",{attrs:{d:"M20,18v5h-7l-3-3v-2H7v-7c0-0.6,0.4-1,1-1h2V7h10v3h2\n\tc0.6,0,1,0.4,1,1v7H20z M19,8h-8v2h8V8z M21,14H9v3h1v-2h1v2v1v1h3v3h5v-4v-1v-2h1v2h1V14z M12,17h6v1h-6V17z M12,15h6v1h-6V15z"}})])])};Oy._withStripped=!0;const ky=bi({render:Oy,staticRenderFns:[]},undefined,Py,undefined,false,undefined,!1,void 0,void 0,void 0);const Ny={name:"MapClear",props:{tool:{type:Object,default:function(){return{}}}},inject:["mapP"],mounted(){this.map=this.mapP()},methods:{onClick(){this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.M.clear()}}};var Ay=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"}},[i("path",{attrs:{d:"M8.5,11v-1h13v1H8.5z M12.5,8c0-0.6,0.4-1,1-1h3\n\tc0.6,0,1,0.4,1,1v1h-5V8z M12.5,21h1v-9h1v9h1v-9h1v9h1v-9h2v10c0,0.6-0.4,1-1,1h-7c-0.6,0-1-0.4-1-1V12h2V21z"}})])])};Ay._withStripped=!0;const Ry=bi({render:Ay,staticRenderFns:[]},undefined,Ny,undefined,false,undefined,!1,void 0,void 0,void 0);const Fy={name:"MapOpacity",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,childPanel:!0,name:"MapOpacity",opacityVal:1,activeSilder:!1,timer01:null}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.destory()})),this.map.GLSDK&&"number"==typeof this.map.GLSDK.baseMapOpacity&&(this.opacityVal=this.map.GLSDK.baseMapOpacity)},methods:{onClick(){this.active=!this.active,this.map.GLSDK.toolsOnClick(this.tool,this.active),this.active?(this.$emit("activeCurrentTools",this),this.timer01&&clearTimeout(this.timer01),this.timer01=setTimeout((()=>{this.activeSilder=!0}),1e3)):this.destory()},onChange(){this.activeSilder&&(this.map.GLSDK.baseMapOpacity=this.opacityVal,this.map.M.layerManager.changeBaseMapOpacity(this.map.GLSDK.baseMapOpacity))},destory(){this.$emit("openTip",this.name),this.active=!1,this.timer01&&clearTimeout(this.timer01),this.activeSilder=!1}}};var By=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},attrs:{id:"MapOpacity"}},[i("svg",{staticClass:"icon",attrs:{t:"1733361417719",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"40878",width:"26",height:"26"},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("path",{attrs:{d:"M487.2 423.3l22.7-22.7c18.9 10.3 36.9 22.9 53.6 37.8l-21.7 21.7c-16.6-14.7-34.9-27-54.6-36.8zM281.9 415.7c-31 12.6-58.9 31.1-82.8 55s-42.4 51.7-55 82.8c-6.5 15.9-11.2 32.3-14.2 49L95.4 637c2.6-68.3 29.9-135.9 82.1-188 52.1-52.1 119.7-79.5 188-82.1L331 401.4c-16.8 3.1-33.2 7.9-49.1 14.3zM188.6 813.3L166.9 835c-14.9-16.6-27.5-34.7-37.8-53.6l22.7-22.7c9.8 19.8 22.1 38 36.8 54.6zM563.5 481.9l21.7-21.7c14.9 16.6 27.5 34.7 37.8 53.6l-22.7 22.7c-9.8-19.8-22.1-38-36.8-54.6zM378.3 397.4l29-29c24.9 2.8 49.5 8.9 73.1 18.3l-23.9 23.9c-25.1-8.5-51.4-12.9-78.2-13.2zM613 567.1l23.9-23.9c9.4 23.6 15.5 48.2 18.3 73.1l-29 29c-0.2-26.8-4.7-53-13.2-78.2zM264.9 871.8l-22.7 22.7c-18.9-10.3-36.9-22.9-53.6-37.8l21.7-21.7c16.6 14.7 34.9 27.1 54.6 36.8zM373.7 897.8l-29 29c-24.9-2.8-49.5-8.9-73.1-18.3l23.9-23.9c25.2 8.5 51.4 12.9 78.2 13.2zM470.2 879.5c31-12.6 58.9-31.1 82.8-55s42.4-51.7 55-82.8c6.5-15.9 11.2-32.3 14.2-49l34.5-34.5c-2.6 68.3-29.9 135.9-82.1 188-52.1 52.1-119.7 79.5-188 82.1l34.5-34.5c16.8-3.1 33.2-7.9 49.1-14.3zM139.1 728.1L115.2 752c-9.4-23.6-15.5-48.2-18.3-73.1l29-29c0.2 26.8 4.6 53 13.2 78.2z","p-id":"40879"}}),t._v(" "),i("path",{attrs:{d:"M553 470.7c3.6 3.6 7.1 7.4 10.5 11.2L210.3 835c-3.8-3.4-7.5-6.9-11.2-10.5-3.6-3.6-7.1-7.4-10.5-11.2l353.2-353.2c3.8 3.4 7.5 6.9 11.2 10.6z","p-id":"40880"}}),t._v(" "),i("path",{attrs:{d:"M199.1 824.5c3.6 3.6 7.4 7.1 11.2 10.5l-21.7 21.7c-3.8-3.4-7.5-6.9-11.1-10.5-3.6-3.6-7.1-7.4-10.5-11.1l21.7-21.7c3.3 3.7 6.8 7.5 10.4 11.1zM553 470.7c-3.6-3.6-7.4-7.1-11.2-10.5l21.7-21.7c3.8 3.4 7.5 6.9 11.1 10.5s7.1 7.4 10.5 11.1l-21.7 21.7c-3.3-3.8-6.8-7.5-10.4-11.1zM607.9 553.4c1.8 4.5 3.5 9.1 5.1 13.7L295.5 884.6c-4.6-1.6-9.2-3.2-13.7-5.1-5.8-2.3-11.4-4.9-17-7.6l335.4-335.4c2.8 5.5 5.4 11.2 7.7 16.9z","p-id":"40881"}}),t._v(" "),i("path",{attrs:{d:"M281.9 879.5c4.5 1.8 9.1 3.5 13.7 5.1l-23.9 23.9c-10-4-19.9-8.6-29.5-13.9l22.7-22.7c5.5 2.7 11.2 5.2 17 7.6zM607.9 553.4c-2.3-5.8-4.9-11.4-7.6-17l22.7-22.7c5.2 9.6 9.8 19.5 13.9 29.5L613 567.1c-1.6-4.6-3.2-9.2-5.1-13.7zM626.2 647.6c0 15.3-1.4 30.3-4.1 45.1l-201 201c-14.8 2.7-29.9 4.1-45.1 4.1h-2.3l252.5-252.5v2.3z","p-id":"40882"}}),t._v(" "),i("path",{attrs:{d:"M376 897.8c15.3 0 30.3-1.4 45.1-4.1l-34.5 34.5c-14 0.5-28 0-41.8-1.5l29-29c0.7 0.1 1.5 0.1 2.2 0.1zM626.2 647.6v-2.3l29-29c1.5 13.9 2.1 27.9 1.5 41.8l-34.5 34.5c2.7-14.7 4-29.7 4-45zM470.2 415.7c5.8 2.3 11.4 4.9 17 7.6L151.8 758.8c-2.7-5.5-5.3-11.2-7.6-17-1.8-4.5-3.5-9.1-5.1-13.7l317.4-317.4c4.6 1.5 9.2 3.2 13.7 5z","p-id":"40883"}}),t._v(" "),i("path",{attrs:{d:"M470.2 415.7c-4.5-1.8-9.1-3.5-13.7-5.1l23.9-23.9c10 4 19.9 8.6 29.5 13.9l-22.7 22.7c-5.6-2.7-11.2-5.2-17-7.6zM144.1 741.8c2.3 5.8 4.9 11.4 7.6 17L129 781.5c-5.2-9.6-9.8-19.5-13.9-29.5l23.9-23.9c1.6 4.6 3.3 9.1 5.1 13.7zM376 397.4h2.3L125.9 649.9v-2.3c0-15.3 1.4-30.3 4.1-45.1l201-201c14.7-2.7 29.8-4.1 45-4.1z","p-id":"40884"}}),t._v(" "),i("path",{attrs:{d:"M95.4 637l34.5-34.5c-2.7 14.8-4.1 29.9-4.1 45.1v2.3l-29 29c-1.4-14-2-27.9-1.4-41.9zM376 397.4c-15.3 0-30.3 1.4-45.1 4.1l34.5-34.5c14-0.5 28 0 41.8 1.5l-29 29c-0.6-0.1-1.4-0.1-2.2-0.1z","p-id":"40885"}}),t._v(" "),i("path",{attrs:{d:"M643.3 647.6c0-154.2-125-279.1-279.1-279.1-14.3 0-28.4 1.1-42.1 3.2 17.8-146.5 142.6-260 293.8-260 163.5 0 296 132.5 296 296 0 156.1-120.9 284-274.2 295.2 3.7-17.9 5.6-36.4 5.6-55.3z","p-id":"40886"}})]),t._v(" "),i("transition",{attrs:{name:"el-zoom-in-top"}},[t.active?i("div",{staticClass:"mx-map-tools-child mx-silder-container"},[i("div",{staticClass:"mx-map-tools-item"},[i("el-slider",{staticClass:"mx-map-tools-sidler-opacity",attrs:{min:0,max:1,step:.1,"show-tooltip":!1},on:{input:t.onChange},model:{value:t.opacityVal,callback:function(e){t.opacityVal=e},expression:"opacityVal"}}),t._v(" "),i("span",{staticClass:"mx-silder-label"},[t._v(t._s(t.opacityVal))])],1)]):t._e()])],1)};By._withStripped=!0;const Gy=bi({render:By,staticRenderFns:[]},undefined,Fy,undefined,false,undefined,!1,void 0,void 0,void 0);const zy={name:"LocationQuery",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.map.GLSDK.removeLocationQuery(),this.active=!1}))},methods:{onClick(){this.map.GLSDK.addLocationQuery(),this.active=!0,this.map.GLSDK.toolsOnClick(this.tool,!0)}}};var jy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1697270755302",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1467",width:"24",height:"24"}},[i("path",{attrs:{d:"M509.58422 32A268.01526094 268.01526094 0 0 1 776.99553594 300.63868812c0 84.86403094-74.14887563 227.58990188-145.21957969 334.31284969 26.84633531 2.68852969 52.95235031 6.21479063 77.92840406 10.50085313v42.12030187a1028.47958437 1028.47958437 0 0 0-105.20334469-13.16990062 762.66580125 762.66580125 0 0 1-54.97848843 69.00560156c89.61766406 6.42909281 156.83091187 33.11957156 156.83091093 65.14814531 0 36.76272469-88.74096937 66.55085625-198.17192906 66.55085625s-198.05503687-29.7881325-198.05503687-66.55085625c0-32.35976906 68.61595875-59.26455094 159.49995937-65.26503844a776.53705687 776.53705687 0 0 1-54.64729312-68.57699437c-183.46294312 14.57261156-320.05195219 69.97970625-320.05195219 135.98506312 0 77.26601156 186.77490094 139.72562719 417.11177906 139.72562719s416.91695719-62.57650781 416.91695719-139.72562719c0-42.97751438-57.95925-81.43518187-149.15496375-107.15155406v-43.0944075c126.45831656 32.57407219 209.47154812 87.66945375 209.47154812 150.12906938 0 100.19644406-213.71864625 181.41732281-477.31147031 181.41732281s-477.31147031-81.22087875-477.31147031-181.41732281c0-83.77303312 149.79787313-154.41513094 353.19100594-175.20253313-71.28500719-106.72294875-145.74559594-249.877425-145.74559594-334.74145594A268.01526094 268.01526094 0 0 1 509.58422 32zM535.41748625 757.84463c-11.29961812 10.81256625-20.24190281 16.832535-25.77481969 16.832535s-14.49468281-6.0978975-25.89171187-16.929945c-84.065265 3.42885-148.6289475 24.85916063-148.6289475 50.65346156 0 28.28801062 77.4608325 51.33533531 173.0205375 51.33533625s173.13742969-22.9304325 173.13742969-51.33533625c0-25.50207-63.18045281-46.75704187-145.86248813-50.65346156zM506.72035156 194.01315031a127.04277937 127.04277937 0 1 0 132.47828531 126.98433281 129.80923781 129.80923781 0 0 0-132.47828531-126.98433281z","p-id":"1468"}})])])};jy._withStripped=!0;const Uy=bi({render:jy,staticRenderFns:[]},undefined,zy,undefined,false,undefined,!1,void 0,void 0,void 0);class Vy extends _y{constructor(t,e){super(t),this.options=e||{},this.type="area",this.meas=null}start(){let t;this.map.GLSDK.mapmostMeasure3D?(t=this.map.GLSDK.mapmostMeasure3D,t.clear()):t=new B.default(this.map),t.setType(this.type),t.start(),this.meas=t,this.map.GLSDK.mapmostMeasure3D=t}clear(){this.destory(),this.meas&&(this.meas.stop(),this.meas.clear()),this.map.U.removeLayer(["measure-layer-point","measure-layer-line","measure-layer-line-move"]),this.map.U.removeSource(["measure-geojson","measure-geojson-move"])}}const qy={name:"Measure3DArea",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,measure:{},name:"Measure3DArea"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1})),"object"==typeof this.MapTools&&(this.measure=void 0!==this.MapTools.measure?JSON.parse(JSON.stringify(this.MapTools.measure)):this.measure)},methods:{close(){if(this.active)return this.map.GLSDK.toolsOnClick(this.tool,!1),this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1,void this.map.M.setCursorIQuery()},onClick(){if(this.active)return void this.close();this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.close()}}),this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new Vy(this.map,this.measure);t.start(),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1}}}};var Hy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"}},[i("g",[i("g",{staticStyle:{opacity:"0.8"}},[i("polygon",{attrs:{points:"8,17.1 8,6.2 18,6.2 22,10.2 22,17.1"}})]),t._v(" "),i("g",[i("polygon",{staticStyle:{opacity:"0.8"},attrs:{points:"22,18.8 22,20.8 21.5,20.8 21.5,18.8 20,18.8 20,21.8 19.5,21.8 19.5,18.8\n\t\t\t17,18.8 17,20.8 16.5,20.8 16.5,18.8 15,18.8 15,21.8 14.5,21.8 14.5,18.8 12.5,18.8 12.5,23.8 23,23.8 23,18.8 \t\t"}}),t._v(" "),i("polygon",{staticStyle:{opacity:"0.8"},attrs:{points:"11,20.8 10.5,20.8 10.5,18.8 9,18.8 9,21.8 8.5,21.8 8.5,18.8 7,18.8 7,23.8\n\t\t\t12,23.8 12,18.8 11,18.8 \t\t"}}),t._v(" "),i("path",{staticStyle:{opacity:"0.8"},attrs:{d:"M22,10.2l-4-4L8,6.2l0,10.8l14,0.1V10.2z M21,16.1L9,16.1l0-8.9l8.6-0.1l3.4,3.4V16.1z\n\t\t\t"}})])])]),t._v(" "),i("span",{staticClass:"mx-map-tools-item-label"},[t._v("3D")])])};Hy._withStripped=!0;const $y=bi({render:Hy,staticRenderFns:[]},undefined,qy,"data-v-1d5eb9d3",false,undefined,!1,void 0,void 0,void 0);class Wy extends _y{constructor(t,e){super(t),this.options=e||{},this.type="distance",this.meas=null}start(){let t;this.map.GLSDK.mapmostMeasure3D?(t=this.map.GLSDK.mapmostMeasure3D,t.clear()):t=new B.default(this.map),t.setType(this.type),t.start(),this.meas=t,this.map.GLSDK.mapmostMeasure3D=t}clear(){this.destory(),this.meas&&(this.meas.stop(),this.meas.clear()),this.map.U.removeLayer(["measure-layer-point","measure-layer-line","measure-layer-line-move"]),this.map.U.removeSource(["measure-geojson","measure-geojson-move"])}}const Ky={name:"Measure3DLength",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,measure:{},name:"Measure3DLength"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1})),"object"==typeof this.MapTools&&(this.measure=void 0!==this.MapTools.measure?JSON.parse(JSON.stringify(this.MapTools.measure)):this.measure)},methods:{close(){if(this.active)return this.map.GLSDK.toolsOnClick(this.tool,!1),this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1,this.map.M.isDoingDraw=!1,void this.map.M.setCursorIQuery()},onClick(){if(this.active)return void this.close();this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.close()}}),this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new Wy(this.map,this.measure);t.start(),console.log(t,"measuremeasure"),console.log(this.map,"this.map"),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1}}}};var Yy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"}},[i("path",{attrs:{d:"M12.5,22v-5h2v3H15v-3\n\th1.5v2H17v-2h2.5v3H20v-3h1.5v2H22v-2h1v5H12.5z M21,10H9v1H8v-1V9V8h1v1h12V8h1v1v1v1h-1V10z M8.5,20H9v-3h1.5v2H11v-2h1v5H7v-5\n\th1.5V20z"}})]),t._v(" "),i("span",{staticClass:"mx-map-tools-item-label black-label"},[t._v("3D")])])};Yy._withStripped=!0;const Jy=bi({render:Yy,staticRenderFns:[]},undefined,Ky,undefined,false,undefined,!1,void 0,void 0,void 0);class Xy{constructor(t){this.options=t||{},this.id=this.options.id||Math.random(),this.map=null,this.analysis=null,this.func=null,this.modelTipLayer}subscribeMapClear(){this.map&&(this.func&&this.map.M.pubsub.remove("clear",this.func),this.func=this.map.M.pubsub.subscribe("clear",(()=>{this.destory&&this.destory()})))}addModelLayer(){let t="model_id"+Math.random(),e={id:t,type:"model",funcRender:(t,e)=>{this.modelTipLayer&&this.modelTipLayer.renderMarker(t,e)},callback:(t,e)=>{this.modelTipLayer=e}};this.pointIds.push(t),this.map.addLayer(e)}init(t){this.analysis&&this.analysis.clear(),this.map.SpatialAnalysis||(this.map.SpatialAnalysis={},this.map.SpatialAnalysis[t]=new I.default[t](this.map)),this.analysis=this.map.SpatialAnalysis[t]?this.map.SpatialAnalysis[t]:new I.default[t](this.map),this.map.SpatialAnalysis[t]=this.analysis}clear(t){t?this.analysis&&this.analysis.clear(t):this.analysis&&this.analysis.clear(),this.removeCubeLine&&this.removeCubeLine()}removeLayer(t){t.forEach((t=>{this.map.getLayer(t)&&this.map.removeLayer(t)}))}show3DTipsPopup(t,e,i){let s=e,a=document.createElement("div");a.className="map-spatial-tip",a.innerText=s,t[2]=t[2]+20;let n=[{element:a,position:t}];this.dynamicPopup&&this.dynamicPopup.remove(),this.dynamicPopup=this.modelTipLayer.addMarker({id:"marker",avoidance:!1,data:n})}showTipsPopup(t,e,i){let s=e,a=[5,-5];if(this.dynamicPopup)this.dynamicPopup.setHTML(`<div class="medo-popup-measure">${s}</div>`),this.map.projection?this.dynamicPopup.setCoordinate(t):this.dynamicPopup.setLngLat(t);else{var n=i&&i.anchor||"bottom-left",o=Object.assign({closeOnClick:!1,closeButton:!1,anchor:n,offset:a,className:"map-popup-measure map-spatial-tip"},i||{});this.map.projection?(this.dynamicPopup=new I.default.Popup(o).setHTML(`<div class="medo-popup-measure">${s}</div>`),this.dynamicPopup.setCoordinate(t)):(this.dynamicPopup=new I.default.Popup(o).setHTML(`<div class="medo-popup-measure">${s}</div>`),this.dynamicPopup.setLngLat(t)),this.dynamicPopup.addTo(this.map)}}async transformData(){this.enableTransform||this.map.enableTransform&&this.map.enableTransform.srid,this.map.sz2000sdk&&(geo=await this.map.MapmostSDKConvert.convertGeoSDKToSZ2000(geo),wkt=GeoUtil.st_geojson2wkt(geo))}destoryEvent(){this.map.M.isDoingDraw=!1,this.mouseDrag&&this.map.off("drag",this.mouseDrag),this.mouseRotate&&this.map.off("rotate",this.mouseRotate),this.mouseMove&&this.map.off("mousemove",this.mouseMove),this.mouseDown&&this.map.off("click",this.mouseDown),this.mouseDbclick&&this.map.off("dblclick",this.mouseDbclick),this.dynamicPopup&&this.dynamicPopup.remove(),this.map.GLSDK.removeMouseMoveTips(),this.map.ExAPI.setCursor("")}}const Qy={data:()=>({domId:"map-sight-line-analysis",data:[],title:"通视分析",styleConfig:{},position:"",precision:3,dataList:[],analysisOptions:{viewLineColor:"#00ff00",obstructLineColor:"#ff0000"}}),mounted(){},methods:{onSubmit(){},clear(){},close(){},filterVisible:(t,e)=>e.visible===t,formatPrecision(t,e,i,s){return"number"!=typeof i?i:i.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:this.precision})}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var Zy=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-analysis",attrs:{id:t.domId}},[i("mx-map-card",{staticClass:"mx-onemap-content",style:t.styleCss,attrs:{title:t.title},on:{close:t.close}},[i("template",{slot:"content"},[i("div",{staticClass:"mx-analysis-content"},[i("el-table",{staticStyle:{width:"360px"},attrs:{data:t.dataList,"max-height":"200px",size:"mini"}},[i("el-table-column",{attrs:{type:"index",label:"序号",width:"50"}}),t._v(" "),i("el-table-column",{attrs:{filters:[{text:"不可见",value:"不可见"},{text:"可见",value:"可见"}],"filter-method":t.filterVisible,"filter-placement":"bottom-end",prop:"visible",label:"可见性",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-tag",{attrs:{effect:"dark",color:"不可见"===e.row.visible?t.analysisOptions.obstructLineColor:t.analysisOptions.viewLineColor}},[t._v(t._s(e.row.visible))])]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"distance",label:"距离/米",width:"100",sortable:""}}),t._v(" "),i("el-table-column",{attrs:{prop:"horizontalDistance",label:"水平距离",width:"100",sortable:""}}),t._v(" "),i("el-table-column",{attrs:{prop:"verticalDistance",label:"垂直距离",width:"100",sortable:""}}),t._v(" "),i("el-table-column",{attrs:{prop:"obstructDistance",label:"障碍距离",width:"100",sortable:""}})],1),t._v(" "),i("div",{staticClass:"mx-submit"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSubmit}},[t._v("开始绘制")]),t._v(" "),i("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.clear}},[t._v("清除")])],1)],1)])],2)],1)};Zy._withStripped=!0;const tf=bi({render:Zy,staticRenderFns:[]},undefined,Qy,"data-v-5b0868af",false,undefined,!1,void 0,void 0,void 0);class ef extends Xy{constructor(t){super(t),this.positionPoint=null,this.pointSize=void 0!==this.options.pointSize?this.options.pointSize:2,this.viewPointColor=this.options.viewPointColor||"#0000ff",this.targetPointColor=this.options.targetPointColor||"#ffb536",this.analysisOptions=Object.assign({viewLineColor:"#00ff00",obstructLineColor:"#ff0000",drawLine:!0,lineWidth:10},this.options.analysis),this.pointIds=[],this.pointObject=[],this.dataList=[],this.precision=this.options.precision||3,this.minViewHeight=this.options.minViewHeight||1.8,this.currentAnalyseId,this.position=this.options.position||[null,"20px","20px",null],this.instance,this.active=!1,this.uiEnable=void 0===this.options.uiEnable||this.options.uiEnable,this.domId=this.options.domId||"map-sight-line-analysis-panel",this.title=this.options.title||"通视分析",this.targetPoint=null,this.closeCallback=null,this.destoryCallback=null}addTo(t){if(this.map=t,this.init("SightLineAnalysis"),this.subscribeMapClear(),this.uiEnable){let t=this.map.ExAPI.getPositionStyle(this.position),e={domId:this.domId,title:this.title,position:t,dataList:this.dataList,analysisOptions:this.analysisOptions,precision:this.precision};const i=new(w.default.extend(tf))({data:e});i.close=()=>{this.closeCallback&&this.closeCallback(),this.destory()},i.clear=()=>{this.clear()},i.onSubmit=()=>{this.start()},this.map.ExAPI.appendMapControlContainer(i),this.instance=i}}start(){if(this.active)return;var t,e;this.clear(),this.active=!0,this.map.ExAPI.setCursor("crosshair",this.map),this.map.M.isDoingDraw=!1;let i=null;this.mouseMove=t=>{this.positionPoint?(this.map.GLSDK.removeMouseMoveTips(),this.map.GLSDK.showMouseMoveTips(t.point,"点击拾取目标点!双击结束!"),this.analysis&&this.analysis.clear(e),this.targetPoint=this.map.getPosition(t),e="move_analyse"+Math.random(),this.updateAnalysis(e,this.targetPoint)):this.map.GLSDK.showMouseMoveTips(t.point,"点击拾取观察点!")},this.mouseDown=e=>{let s=this.targetPoint;if(this.positionPoint)i=setTimeout((()=>{this.add3DPoint(s,this.targetPointColor),t=this.id+"_analyse"+Math.random();let e=this.updateAnalysis(t,s);this.calcAnalysisResult(e,this.positionPoint,s)}),50);else{var a=this.map.getPosition(e);this.positionPoint=a;const t="3dpoint_"+Math.random();this.pointIds.push(t);let i={id:t,type:"model",callback:(t,e)=>{this.modelLayer=e}};this.map.addLayer(i),this.positionPoint[2]<1&&(this.positionPoint[2]=this.minViewHeight),this.add3DPoint(a,this.viewPointColor)}},this.mouseDbclick=()=>{i&&clearTimeout(i),this.analysis&&this.analysis.clear(e),this.destoryEvent(),this.active=!1},this.map.on("dblclick",this.mouseDbclick),this.map.on("click",this.mouseDown),this.map.on("mousemove",this.mouseMove),this.map.M.isDoingDraw=!0}updateAnalysis(t,e){return this.analysis.analyse({viewPoint:this.positionPoint,targetPoint:e,viewLineColor:this.analysisOptions.viewLineColor,obstructLineColor:this.analysisOptions.obstructLineColor,drawLine:this.analysisOptions.drawLine,lineWidth:this.analysisOptions.lineWidth,layer:this.analysisOptions.layer,id:t})}calcAnalysisResult(t,e,i){const s={visible:t.visible?"可见":"不可见",distance:0,horizontalDistance:0,verticalDistance:0,obstructHorizontalDistance:"/",obstructVerticalDistance:"/",obstructDistance:"/"},a=Math.abs(e[2]-i[2]);s.verticalDistance=a;const n=xp(e,i);s.horizontalDistance=n;const o=Math.sqrt(Math.pow(n,2)+Math.pow(a,2));s.distance=o;const r=t.obstructPoint;if(r){const t=xp(e,r);s.obstructHorizontalDistance=t;const i=Math.abs(e[2]-r[2]);s.obstructVerticalDistance=i;const a=Math.sqrt(Math.pow(t,2)+Math.pow(i,2));s.obstructDistance=a}this.dataList.push(s)}formatPrecision(t){return t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:this.precision})}add3DPoint(t,e){let i=this.modelLayer.addPoints({type:"sphere",size:this.pointSize,color:e||"#0000ff",opacity:1,data:[{coordinate:t}]});this.pointObject.push(i)}clear(){this.positionPoint=null,this.destoryEvent(),this.analysis&&this.analysis.clear(),this.modelLayer&&this.modelLayer.removeModel(this.pointObject[this.pointObject.length-1]),this.dataList.splice(0,this.dataList.length),this.removeLayer(JSON.parse(JSON.stringify(this.pointIds))),this.pointIds=[],this.active=!1}destory(){this.clear(),this.map&&(this.map.ExAPI.removeMapControlContainer(this.domId),this.func&&this.map.M.pubsub.remove("clear",this.func)),this.destoryCallback&&this.destoryCallback()}}const sf={data:()=>({domId:"map-cube-section-analysis",data:[],title:"剖切分析",styleConfig:{},position:"",activeNames:"",minSize:1,sizeX:100,maxSizeX:500,sizeY:100,maxSizeY:500,sizeZ:100,maxSizeZ:500,analysisOptionsInit:{},analysisOptions:{size:[100,100,100],rotateZ:0},centerX:0,centerY:0,centerZ:0,step:1e-4}),mounted(){this.analysisOptionsInit=JSON.parse(JSON.stringify(this.analysisOptions)),this.initData(),this.maxSizeX=5*this.sizeX,this.maxSizeY=5*this.sizeY,this.maxSizeZ=5*this.sizeZ},methods:{initData(){this.analysisOptions.center&&(this.centerX=this.analysisOptions.center[0],this.centerY=this.analysisOptions.center[1],this.centerZ=this.analysisOptions.center[2]),this.sizeX=this.analysisOptions.size[0],this.sizeY=this.analysisOptions.size[1],this.sizeZ=this.analysisOptions.size[2]},initCenter(){this.analysisOptions.center?(this.analysisOptionsInit.center=this.analysisOptions.center,this.centerX=this.analysisOptions.center[0],this.centerY=this.analysisOptions.center[1],this.centerZ=this.analysisOptions.center[2],this.centerX>180&&(this.step=2)):(delete this.analysisOptions.center,this.centerX=null,this.centerY=null,this.centerZ=null)},onSubmit(){},clear(){},close(){},reset(){this.analysisOptions=JSON.parse(JSON.stringify(this.analysisOptionsInit)),this.initData(),this.changeInput()},changeRotateZ(){},change(){const t=[this.sizeX,this.sizeY,this.sizeZ];this.changeSize&&this.changeSize(t)},changeInput(){const t=[this.centerX,this.centerY,this.centerZ];this.changeCenter&&this.changeCenter(t)}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var af=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-analysis",attrs:{id:t.domId}},[i("mx-map-card",{staticClass:"mx-onemap-content",style:t.styleCss,attrs:{title:t.title},on:{close:t.close}},[i("template",{slot:"content"},[i("div",{staticClass:"mx-analysis-content"},[i("el-collapse",{attrs:{accordion:""},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[i("el-collapse-item",{attrs:{title:"尺寸调整",name:"1"}},[i("div",{staticClass:"mx-analysis-slider-block"},[i("span",[t._v("长度")]),t._v(" "),i("el-slider",{attrs:{min:t.minSize,max:t.maxSizeX,step:1,"show-tooltip":!1},on:{input:t.change},model:{value:t.sizeX,callback:function(e){t.sizeX=e},expression:"sizeX"}}),t._v(" "),i("span",[t._v(t._s(t.sizeX))])],1),t._v(" "),i("div",{staticClass:"mx-analysis-slider-block"},[i("span",[t._v("宽度")]),t._v(" "),i("el-slider",{attrs:{min:t.minSize,max:t.maxSizeY,step:1,"show-tooltip":!1},on:{input:t.change},model:{value:t.sizeY,callback:function(e){t.sizeY=e},expression:"sizeY"}}),t._v(" "),i("span",[t._v(t._s(t.sizeY))])],1),t._v(" "),i("div",{staticClass:"mx-analysis-slider-block"},[i("span",[t._v("高度")]),t._v(" "),i("el-slider",{attrs:{min:t.minSize,max:t.maxSizeZ,step:1,"show-tooltip":!1},on:{input:t.change},model:{value:t.sizeZ,callback:function(e){t.sizeZ=e},expression:"sizeZ"}}),t._v(" "),i("span",[t._v(t._s(t.sizeZ))])],1)]),t._v(" "),i("el-collapse-item",{attrs:{title:"坐标平移",name:"2",disabled:!t.analysisOptions.center}},[i("div",{staticClass:"mx-analysis-slider-block"},[i("span",[t._v("经度/x")]),t._v(" "),i("el-input-number",{attrs:{size:"mini",step:t.step},on:{change:t.changeInput},model:{value:t.centerX,callback:function(e){t.centerX=e},expression:"centerX"}})],1),t._v(" "),i("div",{staticClass:"mx-analysis-slider-block"},[i("span",[t._v("纬度/y")]),t._v(" "),i("el-input-number",{attrs:{size:"mini",step:t.step},on:{change:t.changeInput},model:{value:t.centerY,callback:function(e){t.centerY=e},expression:"centerY"}})],1),t._v(" "),i("div",{staticClass:"mx-analysis-slider-block"},[i("span",[t._v("高度/z")]),t._v(" "),i("el-input-number",{attrs:{size:"mini",step:2},on:{change:t.changeInput},model:{value:t.centerZ,callback:function(e){t.centerZ=e},expression:"centerZ"}})],1)])],1),t._v(" "),i("div",{staticClass:"mx-analysis-slider-block"},[i("span",[t._v("旋转")]),t._v(" "),i("el-slider",{attrs:{min:0,max:360,step:1,"show-tooltip":!1},on:{input:t.changeRotateZ},model:{value:t.analysisOptions.rotateZ,callback:function(e){t.$set(t.analysisOptions,"rotateZ",e)},expression:"analysisOptions.rotateZ"}}),t._v(" "),i("span",[t._v(t._s(t.analysisOptions.rotateZ))])],1),t._v(" "),i("div",{staticClass:"mx-submit"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSubmit}},[t._v("开始绘制")]),t._v(" "),i("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.clear}},[t._v("清除")]),t._v(" "),i("el-button",{attrs:{size:"small"},on:{click:t.reset}},[t._v("重置")])],1)],1)])],2)],1)};af._withStripped=!0;const nf=bi({render:af,staticRenderFns:[]},undefined,sf,"data-v-1f927670",false,undefined,!1,void 0,void 0,void 0);class of extends Xy{constructor(t){super(t),this.size=this.options.size||[100,100,100],this.rotateZ=this.options.rotateZ||0,this.targetLayers=this.options.targetLayers,this.enableFillExtrusion=this.options.enableFillExtrusion||!0,this.enableGround=this.options.enableGround||!0,this.analysisOptions={size:this.size,targetLayers:this.targetLayers,rotateZ:this.rotateZ,enableFillExtrusion:this.enableFillExtrusion,enableGround:this.enableGround},this.borderLine=[],this.pointIds=[],this.color=this.options.color||"#ffff00",this.outLine=this.options.outLine||!0,this.position=this.options.position||[null,"20px","20px",null],this.instance,this.active=!1,this.uiEnable=void 0===this.options.uiEnable||this.options.uiEnable,this.domId=this.options.domId||"map-cube-section-analysis-panel",this.title=this.options.title||"剖切分析",this.closeCallback=null,this.destoryCallback=null}addTo(t){if(this.map=t,window.turf=T,this.init("CubeSectionAnalysis"),this.subscribeMapClear(),this.uiEnable){let t=this.map.ExAPI.getPositionStyle(this.position),e={domId:this.domId,title:this.title,position:t,analysisOptions:this.analysisOptions};const i=new(w.default.extend(nf))({data:e});i.close=()=>{this.closeCallback&&this.closeCallback(),this.destory()},i.clear=()=>{this.clear(),i.initCenter(null)},i.onSubmit=()=>{this.start()},i.changeSize=t=>{this.setSize(t)},i.changeRotateZ=t=>{this.setRotateZ(t)},i.changeCenter=t=>{this.changeCenter(t)},this.map.ExAPI.appendMapControlContainer(i),this.instance=i}}start(){let t=this.map.M.layerManager.get3DAnalysisInstanceLayer();if(Array.isArray(t)&&0==t.length)return t=null,void window.MapMessage.ShowMessage({message:"无法绘制,不存在支持图层!",type:"warning"});this.active||(this.clear(),this.active=!0,this.map.ExAPI.setCursor("crosshair",this.map),this.analysisOptions.targetLayers=t,this.map.M.isDoingDraw=!1,this.outLine&&this.addModelLayer(),this.mouseDrag=t=>{this.map.GLSDK.removeMouseMoveTips()},this.mouseRotate=t=>{this.map.GLSDK.removeMouseMoveTips()},this.mouseMove=t=>{this.map.GLSDK.showMouseMoveTips(t.point,"点击,添加剖切体!")},this.mouseDown=t=>{this.destoryEvent();const e=this.map.getPosition(t);this.analysisOptions.center=e,this.instance&&this.instance.initCenter(),this.updateAnalysis()},this.map.on("click",this.mouseDown),this.map.on("mousemove",this.mouseMove),this.map.on("drag",this.mouseDrag),this.map.on("rotate",this.mouseRotate),this.map.M.isDoingDraw=!0)}changeCenter(t){this.analysisOptions.center=t,this.updateAnalysis()}setRotateZ(t){this.rotateZ=t,this.analysisOptions.rotateZ=t,this.updateAnalysis()}setSize(t){this.size=t,this.analysisOptions.size=t,this.updateAnalysis()}updateAnalysis(){if(!this.analysisOptions.center)return;let t=this.analysis.analyse(this.analysisOptions);if(this.outLine){let e=[[t[0],t[1]],[t[0],t[4]],[t[0],t[3]],[t[1],t[2]],[t[1],t[5]],[t[2],t[3]],[t[2],t[6]],[t[3],t[7]],[t[4],t[5]],[t[4],t[7]],[t[5],t[6]],[t[6],t[7]]];this.removeCubeLine(),this.addCubeLine(e)}}addCubeLine(t){t.forEach((t=>{const e=this.modelTipLayer.addLines({type:"pipe",color:this.color,width:2,data:[{coordinate:t}]});this.borderLine.push(e)}))}removeCubeLine(){this.borderLine.forEach((t=>{this.modelTipLayer.removeModel(t)}))}clear(){this.destoryEvent(),this.analysis&&this.analysis.clear(),this.analysisOptions.center=null,this.removeCubeLine(),this.removeLayer(JSON.parse(JSON.stringify(this.pointIds))),this.pointIds=[],this.active=!1}destory(){this.clear(),this.map&&(this.map.ExAPI.removeMapControlContainer(this.domId),this.func&&this.map.M.pubsub.remove("clear",this.func)),this.destoryCallback&&this.destoryCallback()}}const rf={data:()=>({domId:"map-linear-extrude-analysis",data:[],title:"",styleConfig:{},position:"",height:100,minHeight:1,maxHeight:500,marks:{}}),mounted(){this.marks={},this.marks[this.minHeight]=this.minHeight.toString(),this.marks[this.maxHeight]=this.maxHeight.toString()},methods:{changeHeight(){},onSubmit(){},clear(){},close(){}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var lf=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-linear-extrude-analysis",attrs:{id:t.domId}},[i("mx-map-card",{staticClass:"mx-onemap-content",style:t.styleCss,attrs:{title:t.title},on:{close:t.close}},[i("template",{slot:"content"},[i("div",{staticClass:"silder-map"},[t._v("\n 高度:"+t._s(t.height)+"\n "),i("span",[t._v("米")]),t._v(" "),i("el-slider",{attrs:{min:t.minHeight,max:t.maxHeight,step:1,"show-tooltip":!1,marks:t.marks},on:{input:t.changeHeight},model:{value:t.height,callback:function(e){t.height=e},expression:"height"}}),t._v(" "),i("div",{staticClass:"mx-submit"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSubmit}},[t._v("开始绘制")]),t._v(" "),i("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.clear}},[t._v("清除")])],1)],1)])],2)],1)};lf._withStripped=!0;const hf=bi({render:lf,staticRenderFns:[]},undefined,rf,"data-v-6a8fa4bc",false,undefined,!1,void 0,void 0,void 0);class cf extends Xy{constructor(t){super(t),this.renderStyle=Object.assign({fillColor:"rgb(255, 255, 0)",fillSideColor:"rgb(255, 0, 0)",opacity:.35},this.options.renderStyle||{}),this.type=this.options.type||"map_draw_rectangle",this.height=this.options.height||100,this.height<1&&(this.height=1),this.geometry,this.sourceId="source"+Math.random(),this.layerId="layer"+Math.random(),this.uiEnable=void 0===this.options.uiEnable||this.options.uiEnable,this.position=this.options.position||[null,"20px","20px",null],this.instance,this.domId=this.options.domId||"map-linear-extrude-analysis-panel",this.title=this.options.title||"限高分析",this.minHeight=this.options.minHeight||1,this.maxHeight=this.options.maxHeight||500,this.active=!1,this.closeCallback=null,this.destoryCallback=null}addTo(t){if(this.map=t,this.subscribeMapClear(),this.uiEnable){let t=this.map.ExAPI.getPositionStyle(this.position),e={domId:this.domId,title:this.title,position:t,maxHeight:this.maxHeight,minHeight:this.minHeight,height:this.height};const i=new(w.default.extend(hf))({data:e});i.changeHeight=t=>{this.changeHeight(t)},i.close=()=>{this.closeCallback&&this.closeCallback(),this.destory()},i.clear=()=>{this.clear()},i.onSubmit=()=>{this.start()},this.map.ExAPI.appendMapControlContainer(i),this.instance=i}}start(){this.active||(this.clear(),this.active=!0,this.map.GLSDK.mapStartDraw({type:this.type,clear:!0,renderStyle:this.renderStyle},((t,e,i)=>{this.closeDraw(),i&&(this.geometry=i.geoDraw,this.analyse())})),this.mouseMove=t=>{const e=this.map.getPosition(t);this.showTipsPopup(e,"绘制限高区域!")},this.map.on("mousemove",this.mouseMove))}changeHeight(t){if(this.map.getSource(this.sourceId)){this.height=t;const e=this.getData(this.height);this.map.getSource(this.sourceId).setData(e)}}analyse(){const t=this.getData(this.height);this.map.addSource(this.sourceId,{type:"geojson",data:t}),this.map.addLayer({id:this.layerId,type:"fill-extrusion",source:this.sourceId,paint:{"fill-extrusion-color":this.renderStyle.fillColor,"fill-extrusion-height":["get","height"],"fill-extrusion-base":["get","baseHeight"],"fill-extrusion-opacity":this.renderStyle.opacity||1,"fill-extrusion-color-top":this.renderStyle.fillColor,"fill-extrusion-color-side":this.renderStyle.fillSideColor}})}getData(t){return{type:"FeatureCollection",features:[{type:"Feature",geometry:this.geometry,properties:{height:t,baseHeight:t-.2}}]}}closeDraw(){this.map.GLSDK.mapClearDraw(),this.destoryEvent(),this.active=!1}clear(){this.closeDraw(),this.map.getLayer(this.layerId)&&(this.map.removeLayer(this.layerId),this.map.removeSource(this.sourceId))}destory(){this.closeDraw(),this.clear(),this.map&&(this.map.ExAPI.removeMapControlContainer(this.domId),this.func&&this.map.M.pubsub.remove("clear",this.func)),this.destoryCallback&&this.destoryCallback()}}const pf={name:"LinearExtrudeAnalysis",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,config:{},name:"LinearExtrudeAnalysis"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.remove()})),"object"==typeof this.MapTools&&(this.config=this.MapTools.linearExtrudeAnalysis||{})},methods:{onClick(){if(this.active)return this.remove(),void this.map.GLSDK.toolsOnClick(this.tool,!1);this.map.GLSDK.toolsOnClick(this.tool,!0),this.plugin=new cf(this.config),this.plugin.addTo(this.map),this.plugin.closeCallback=()=>{this.closeCallback()},this.active=!0,this.active&&this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.remove()}})},remove(){this.plugin&&(this.plugin.destory(),this.plugin=null),this.active=!1},closeCallback(){this.active=!1}}};var uf=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},attrs:{id:"LinearExtrudeAnalysis"},on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1746599852056",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3480",width:"22",height:"22"}},[i("path",{attrs:{d:"M136.106667 128h837.12c4.48 0 8.106667 3.84 8.106666 8.533333v64c0 4.693333-3.626667 8.533333-8.106666 8.533334H136.106667A8.362667 8.362667 0 0 1 128 200.533333V136.533333c0-4.693333 3.626667-8.533333 8.106667-8.533333zM213.333333 303.402667V805.973333C213.333333 832.128 234.581333 853.333333 260.736 853.333333h246.528c26.197333 0 47.402667-21.205333 47.402667-47.402666V303.36C554.666667 277.205333 533.461333 256 507.306667 256H260.693333c-26.154667 0-47.36 21.205333-47.36 47.402667z m659.413334 95.872c3.754667 4.992 0.298667 12.458667-5.76 12.458666h-63.573334v285.866667h67.498667c6.186667 0 9.514667 7.466667 5.802667 12.458667l-102.101334 136.021333a6.997333 6.997333 0 0 1-11.434666 0l-102.101334-136.021333c-3.712-4.992-0.298667-12.458667 5.802667-12.458667h63.573333v-285.866667h-67.541333c-6.186667 0-9.514667-7.466667-5.76-12.501333l102.058667-136.106667a6.997333 6.997333 0 0 1 11.434666 0l102.101334 136.106667zM136.106667 900.266667h837.12c4.48 0 8.106667 3.84 8.106666 8.533333v64c0 4.693333-3.626667 8.533333-8.106666 8.533333H136.106667a8.362667 8.362667 0 0 1-8.106667-8.533333v-64c0-4.693333 3.626667-8.533333 8.106667-8.533333z","p-id":"3481"}})])])};uf._withStripped=!0;const df=bi({render:uf,staticRenderFns:[]},undefined,pf,undefined,false,undefined,!1,void 0,void 0,void 0);var mf={props:{data:{type:Array,default:()=>[]},layerDomid:{type:String,default:""},draggable:{type:Boolean,default:!1},storageFavour:{type:Boolean,default:!1},showToolsEnable:{type:Boolean,default:!0},closeFillOutLineOpacity:{type:Boolean,default:!1},mapSyncConfig:{type:Object,default:function(){return{show:!0}}}},inject:["mapP"],components:{LayerTool:Vg},data:()=>({baseLayerType:["background","sky"],popoverVisible:!1,popoverLayerIds:[],popoverTop:0,popoverRight:30,checkKeys:[],checkCurentKeys:[],checkBox:!0,lastIndex:0,baseLayerTypeLayerId:["ground-bk","mapmost_default_sky","scene_default_layer","t_underground","t_base","t_line","t_point","t_polygon","g_lineLayer","g_pointLayer","g_polygonLayer","t_mask"]}),mounted(){},methods:{getStorageFavourAllIds(){if(1==this.storageFavour){return JSON.parse(JSON.stringify(this.data)).map((t=>t.id))}return null},handleDragStart(){this.checkKeys=this.$refs.tree.getCheckedKeys()},allowDrag(t){var e=!1;if(this.draggable){const i=this.$refs.tree.getCheckedKeys();this.data.length>=2&&t.checked&&i.length>=2&&(e=!0)}return e},handleAllowDrop:(t,e,i)=>"inner"!=i,handleDrop(t,e,i,s){const a=t.data.id;this.$nextTick((()=>{const e=this.$refs.tree.getCheckedKeys();e.forEach(((i,s)=>{a==i&&this.reorderTreeNodeLayer(s,e,t.data)}))}))},reorderTreeNodeLayer(t,e,i){const s=e.length,a=i.layerIds,n=this.getLayerIdsArr(a);if(0==t)this.onLayerUpMost(n);else if(t==s-1)this.onLayerDownMost(n);else{const i=e[t+1],s=this.$refs.tree.getNode(i).data.layerIds,a=this.getLayerIdsArr(s);this.onLayerBefore(n,a)}},onLayerBefore(t,e){const i=t.length;var s=this.mapP();if(i>0){const i=e[0];t.forEach((t=>{s.getLayer(t)&&s.moveLayer(t,i)}))}},onLayerUpMost(t){var e=this.mapP();t.forEach((t=>{e.getLayer(t)&&e.moveLayer(t)})),this.$message({message:"图层已置顶!",type:"warning"})},onLayerDownMost(t){var e=this.mapP();e.GLSDK&&(this.lastIndex=e.GLSDK.getLastlayerIdIndex());if(t.length>0){const i=t[0],s=this.getOrderLayersId();if(s.length){const a=s[0].id;a!=i?t.forEach((t=>{e.getLayer(t)&&e.moveLayer(t,a)})):this.$message({message:"图层已置底!",type:"warning"})}}},getOrderLayersId(){var t=this.mapP();let e=JSON.parse(JSON.stringify(t.style._order)),i=e.findIndex((t=>"t_base"===t));e=e.slice(i);const s=e.filter(((t,e)=>!this.baseLayerTypeLayerId.includes(t)));return s},getLayerIdsArr(t){var e=this.mapP(),i=[];for(const s of t){const t=e.M.layerManager.getLayerById(s),a=t.layer.layers;a?a.forEach((t=>{i.push(t.id)})):i.push(t.id)}return i},onNodeChecked(t,e){if(this.checkKeys.length>1)return this.$refs.tree.setCheckedKeys(this.checkKeys),this.checkKeys=[],void(this.checkCurentKeys=this.$refs.tree.getCheckedKeys());this.$emit("node-checked",t,e)},onLayerTools(t,e){var i;this.popoverVisible=!0,this.popoverLayerIds=e.layerIds,this.layerDomid&&(i=document.getElementById(this.layerDomid).getBoundingClientRect()),this.popoverTop=t.clientY-i.top+15,this.popoverRight=20},setCheckedKeys(t){this.$refs.tree.setCheckedKeys(t)},setChecked(t,e){var i=t;"object"==typeof t&&(i=t.id),this.$nextTick((()=>{this.$refs.tree.setChecked(i,e)}))},onMouseLeave(){this.timer=setTimeout((()=>{this.popoverVisible=!1}),100)},onMouseOver(){this.timer&&clearTimeout(this.timer),this.popoverVisible=!0},getNode(t){return this.$refs.tree.getNode(t)}}};const gf=mf;var yf=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-layer"},[i("el-tree",{ref:"tree",attrs:{data:t.data,"show-checkbox":"","node-key":"id","check-on-click-node":!t.draggable,"show-icon":!0,draggable:t.draggable,"allow-drag":t.allowDrag,"allow-drop":t.handleAllowDrop},on:{"check-change":t.onNodeChecked,"node-drop":t.handleDrop,"node-drag-start":t.handleDragStart},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.node,a=e.data;return[i("div",{staticClass:"mx-title-box"},[i("div",{staticStyle:{flex:"1","text-align":"left"}},[i("span",{class:s.data.children?"mx-tree-group-icon":"mx-tree-child-icon"},[t._v(t._s(s.label))])]),t._v(" "),!t.showToolsEnable||!s.checked||a.children&&0!=a.children.length||"自定义图层"==s.data.pidlabel?t._e():i("div",{staticClass:"mx-layer-tools"},[t._t("extra-before-tool",null,{node:{node:s,data:a}}),t._v(" "),i("span",{on:{click:function(e){return e.stopPropagation(),t.onLayerTools(e,s.data)}}},[i("i",{staticClass:"el-icon-s-operation"})]),t._v(" "),t._t("extra-tool",null,{node:{node:s,data:a}})],2)])]}}],null,!0)}),t._v(" "),t.popoverVisible?i("layer-tool",{style:{top:t.popoverTop+"px",right:t.popoverRight+"px"},attrs:{layerIds:t.popoverLayerIds,closeFillOutLineOpacity:t.closeFillOutLineOpacity},on:{close:t.onMouseLeave},nativeOn:{mouseleave:function(e){return t.onMouseLeave.apply(null,arguments)},mouseover:function(e){return t.onMouseOver.apply(null,arguments)}}}):t._e()],1)};yf._withStripped=!0;const ff=bi({render:yf,staticRenderFns:[]},undefined,gf,undefined,false,undefined,!1,void 0,void 0,void 0);var _f={pointColor:"rgba(255, 0, 0, 0.8)",pointRadius:4,lineStyle:"soild",lineWidth:2,lineColor:"rgba(255, 0, 0, 0.8)",fillColor:"rgba(255, 0, 0, 0.25)",fillOutLineColor:"rgba(255, 0, 0, 0.8)",fillOutLineWidth:2,openLabel:!1,textField:"",textColor:"#000000",textHaloColor:"#FFFFFF",textHaloWidth:2,textFontSize:"px",glyphsFonts:["Noto Sans Hans Regular"],labelOverlapEnable:!1};class vf{constructor(t,e){this.oneMapConfig=e,this.plotselfsymbol=Object.assign({..._f},{glyphsFonts:this.oneMapConfig.glyphsFonts},t||{})}getStyle(){return{layers:[{paint:{"fill-color":this.plotselfsymbol.fillColor||_f.fillColor},type:"fill",filter:["==","$type","Polygon"]},{paint:{"line-width":this.plotselfsymbol.fillOutLineWidth,"line-color":this.plotselfsymbol.fillOutLineColor,"line-dasharray":"dash"==this.plotselfsymbol.lineStyle?[this.plotselfsymbol.fillOutLineWidth,this.plotselfsymbol.fillOutLineWidth]:[this.plotselfsymbol.fillOutLineWidth,0]},type:"line",filter:["==","$type","Polygon"]},{paint:{"line-width":this.plotselfsymbol.lineWidth,"line-color":this.plotselfsymbol.lineColor,"line-dasharray":"dash"==this.plotselfsymbol.lineStyle?[this.plotselfsymbol.lineWidth,this.plotselfsymbol.lineWidth]:[this.plotselfsymbol.lineWidth,0]},type:"line",filter:["==","$type","LineString"]},{paint:{"circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-color":this.plotselfsymbol.pointColor,"circle-radius":this.plotselfsymbol.pointRadius},type:"circle",filter:["all",["==","$type","Point"],["!has","openLabel"],["!has","Text"]]},{filter:["all",["==","$type","Point"],["!has","openLabel"],["has","Text"]],type:"symbol",layout:{"text-anchor":"bottom-left","symbol-placement":"point","text-pitch-alignment":"viewport","text-field":"{Text}",visibility:"visible","text-font":this.plotselfsymbol.glyphsFonts,"text-size":parseInt(this.plotselfsymbol.textFontSize.replace(/[^0-9]/gi,""),10),"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":this.plotselfsymbol.textColor,"text-halo-color":this.plotselfsymbol.textHaloColor,"text-halo-width":this.plotselfsymbol.textHaloWidth}},{filter:["all",["==","$type","Point"],["has","openLabel"]],type:"symbol",openLabel:this.plotselfsymbol.openLabel,layout:{"text-anchor":"bottom","symbol-placement":"point","text-pitch-alignment":"viewport",visibility:this.plotselfsymbol.openLabel?"visible":"none","text-font":this.plotselfsymbol.glyphsFonts,"text-field":this.plotselfsymbol.textField||"","text-size":parseInt(this.plotselfsymbol.textFontSize.replace(/[^0-9]/gi,""),10),"text-offset":[0,-.5],"text-allow-overlap":!this.plotselfsymbol.labelOverlapEnable,"text-ignore-placement":!this.plotselfsymbol.labelOverlapEnable},paint:{"text-color":this.plotselfsymbol.textColor,"text-halo-color":this.plotselfsymbol.textHaloColor,"text-halo-width":this.plotselfsymbol.textHaloWidth}}]}}}const xf={mounted(){this.title=this.data.label+"编辑",this.form.title=this.data.label,this.parseExpandPro()},data:()=>({domid:"map-editLayer-Control",title:"自定义图层编辑",activeNames:["1","2"],lineStyleList:[{label:"实线",value:"soild"},{label:"虚线",value:"dash"}],form:{title:""},fieldList:[],renderStyle:{color:"rgba(255, 0, 0, 0.8)",fillColor:"rgba(255, 0, 0, 0.25)",width:2,lineStyle:"dash",textColor:"#000000",openLabel:!1,labelOverlapEnable:!1,textField:"",textFontSize:"14px",textHaloColor:"#ffffff",textHaloWidth:2},textFontSizeList:["12px","14px","16px","24px","28px","32px","48px"],mapResourceCode:""}),methods:{commandDrop(t){this.renderStyle.textFontSize=t},parseExpandPro(){const t=this.data.mapResourceList[0];this.mapResourceCode=t.mapResourceCode;var e=t.layer.layers,i=e.findIndex((t=>"line"==JSON.parse(t.expandPro).type)),s=JSON.parse(e[i].expandPro);if(this.renderStyle.color=s.paint["line-color"],"点"==this.getGeometryType()){var a=e.findIndex((t=>"circle"==JSON.parse(t.expandPro).type)),n=JSON.parse(e[a].expandPro);this.renderStyle.width=n.paint["circle-radius"]}else this.renderStyle.width=s.paint["line-width"];const o=s.paint["line-dasharray"];this.renderStyle.lineStyle=o?0==o[1]?"soild":"dash":"soild";var r=e.findIndex((t=>"fill"==JSON.parse(t.expandPro).type)),l=JSON.parse(e[r].expandPro);this.renderStyle.fillColor=l.paint["fill-color"];var h=e.findIndex((t=>"symbol"==JSON.parse(t.expandPro).type));if(h>-1){var c=JSON.parse(e[h].expandPro),p=c.layout["text-field"];this.renderStyle.textField=Array.isArray(p)?p[1]:"",this.renderStyle.openLabel=this.getOpenLabel(c.openLabel),this.renderStyle.labelOverlapEnable=this.getOverlapEnableValue(c.layout["text-allow-overlap"]);const t=c.layout["text-size"];t&&(this.renderStyle.textFontSize=t+"px"),this.renderStyle.textColor=c.paint["text-color"],this.renderStyle.textHaloColor=c.paint["text-halo-color"],this.renderStyle.textHaloWidth=c.paint["text-halo-width"]}},submit(){},close(){},changeLabel(){},changeLabelOverlap(){},changeTextField(){},getOpenLabel(){},getOverlapEnableValue(){},getGeometryType(){}}};var Cf=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-webprint-control",attrs:{id:t.domid}},[i("div",{staticClass:"map-container-content",attrs:{id:"mx-map-container-drag"}},[i("div",{staticClass:"mx-map-webprint-panel"},[i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"mx-webprint-title",attrs:{id:"mx-map-container-drag"}},[t._v(t._s(t.title))]),t._v(" "),i("div",{staticClass:"mx-webprint-close"},[i("i",{staticClass:"el-icon-close",on:{click:t.close}})]),t._v(" "),i("el-form",{ref:"form",staticClass:"mx-print-form",attrs:{model:t.form,"label-width":"80px"}},[i("el-collapse",{attrs:{accordion:""},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[i("el-collapse-item",{attrs:{name:"1"}},[i("template",{slot:"title"},[i("span",{staticClass:"mx-collapse-title"},[t._v("基础信息")])]),t._v(" "),i("el-form-item",{attrs:{label:"图层名称"}},[i("el-input",{model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1)],2),t._v(" "),i("el-collapse-item",{attrs:{name:"2"}},[i("template",{slot:"title"},[i("span",{staticClass:"mx-collapse-title"},[t._v("渲染属性")])]),t._v(" "),i("el-form-item",{attrs:{label:"主颜色"}},[i("span",{attrs:{slot:"label"},slot:"label"},[i("el-tooltip",{attrs:{placement:"top",content:"圆点、线型颜色;"}},[i("i",{staticClass:"el-icon-question"})]),t._v("\n 主颜色\n ")],1),t._v(" "),i("el-row",[i("el-col",{attrs:{span:20}},[i("el-input",{model:{value:t.renderStyle.color,callback:function(e){t.$set(t.renderStyle,"color",e)},expression:"renderStyle.color"}})],1),t._v(" "),i("el-col",{attrs:{span:2}},[i("el-color-picker",{staticClass:"mx-print-color",attrs:{"show-alpha":""},on:{"active-change":function(e){t.renderStyle.color=e}},model:{value:t.renderStyle.color,callback:function(e){t.$set(t.renderStyle,"color",e)},expression:"renderStyle.color"}})],1)],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"填充色"}},[i("el-row",[i("el-col",{attrs:{span:20}},[i("el-input",{model:{value:t.renderStyle.fillColor,callback:function(e){t.$set(t.renderStyle,"fillColor",e)},expression:"renderStyle.fillColor"}})],1),t._v(" "),i("el-col",{attrs:{span:2}},[i("el-color-picker",{staticClass:"mx-print-color",attrs:{"show-alpha":""},on:{"active-change":function(e){t.renderStyle.fillColor=e}},model:{value:t.renderStyle.fillColor,callback:function(e){t.$set(t.renderStyle,"fillColor",e)},expression:"renderStyle.fillColor"}})],1)],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"线型"}},[i("el-select",{staticClass:"mx-print-select",attrs:{placeholder:"请选择线型"},model:{value:t.renderStyle.lineStyle,callback:function(e){t.$set(t.renderStyle,"lineStyle",e)},expression:"renderStyle.lineStyle"}},t._l(t.lineStyleList,(function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),i("el-form-item",{attrs:{label:"宽度"}},[i("el-slider",{staticClass:"mx-print-slider",attrs:{min:2,max:10,"show-tooltip":!0},model:{value:t.renderStyle.width,callback:function(e){t.$set(t.renderStyle,"width",e)},expression:"renderStyle.width"}})],1)],2),t._v(" "),i("el-collapse-item",{attrs:{name:"3"}},[i("template",{slot:"title"},[i("span",{staticClass:"mx-collapse-title"},[t._v("标注选项")])]),t._v(" "),i("el-row",[i("el-col",{attrs:{span:12}},[i("el-form-item",{staticStyle:{"text-align":"left"},attrs:{label:"开启标注"}},[i("el-switch",{on:{change:t.changeLabel},model:{value:t.renderStyle.openLabel,callback:function(e){t.$set(t.renderStyle,"openLabel",e)},expression:"renderStyle.openLabel"}})],1)],1),t._v(" "),i("el-col",{attrs:{span:12}},[i("el-form-item",{staticStyle:{"text-align":"left"},attrs:{label:"自动避让","label-width":"100px"}},[i("span",{attrs:{slot:"label"},slot:"label"},[i("el-tooltip",{attrs:{placement:"top",content:"优先开启标注;"}},[i("i",{staticClass:"el-icon-question"})]),t._v("\n 自动避让\n ")],1),t._v(" "),i("el-switch",{attrs:{disabled:!t.renderStyle.openLabel},on:{change:t.changeLabelOverlap},model:{value:t.renderStyle.labelOverlapEnable,callback:function(e){t.$set(t.renderStyle,"labelOverlapEnable",e)},expression:"renderStyle.labelOverlapEnable"}})],1)],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"标注字段"}},[i("el-select",{staticClass:"mx-print-select",attrs:{placeholder:"请选择标注字段"},model:{value:t.renderStyle.textField,callback:function(e){t.$set(t.renderStyle,"textField",e)},expression:"renderStyle.textField"}},t._l(t.fieldList,(function(t,e){return i("el-option",{key:e,attrs:{label:t,value:t}})})),1)],1),t._v(" "),i("el-form-item",{attrs:{label:"字体颜色"}},[i("el-row",[i("el-col",{attrs:{span:20}},[i("el-input",{model:{value:t.renderStyle.textColor,callback:function(e){t.$set(t.renderStyle,"textColor",e)},expression:"renderStyle.textColor"}})],1),t._v(" "),i("el-col",{attrs:{span:2}},[i("el-color-picker",{staticClass:"mx-print-color",on:{"active-change":function(e){t.renderStyle.textColor=e}},model:{value:t.renderStyle.textColor,callback:function(e){t.$set(t.renderStyle,"textColor",e)},expression:"renderStyle.textColor"}})],1)],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"字体大小"}},[i("el-col",{attrs:{span:20}},[i("el-input",{model:{value:t.renderStyle.textFontSize,callback:function(e){t.$set(t.renderStyle,"textFontSize",e)},expression:"renderStyle.textFontSize"}})],1),t._v(" "),i("el-col",{attrs:{span:2}},[i("el-dropdown",{on:{command:t.commandDrop}},[i("span",{staticClass:"el-dropdown-link"},[i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.textFontSizeList,(function(e,s){return i("el-dropdown-item",{key:s,attrs:{command:e}},[t._v(t._s(e))])})),1)],1)],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"描边宽度"}},[i("el-slider",{staticClass:"mx-print-slider",attrs:{min:0,max:20},model:{value:t.renderStyle.textHaloWidth,callback:function(e){t.$set(t.renderStyle,"textHaloWidth",e)},expression:"renderStyle.textHaloWidth"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"描边颜色"}},[i("el-row",[i("el-col",{attrs:{span:20}},[i("el-input",{model:{value:t.renderStyle.textHaloColor,callback:function(e){t.$set(t.renderStyle,"textHaloColor",e)},expression:"renderStyle.textHaloColor"}})],1),t._v(" "),i("el-col",{attrs:{span:2}},[i("el-color-picker",{staticClass:"mx-print-color",attrs:{"show-alpha":""},on:{"active-change":function(e){t.renderStyle.textHaloColor=e}},model:{value:t.renderStyle.textHaloColor,callback:function(e){t.$set(t.renderStyle,"textHaloColor",e)},expression:"renderStyle.textHaloColor"}})],1)],1)],1)],2)],1)],1),t._v(" "),i("el-row",{staticClass:"mx-row-btn"},[i("el-button",{staticClass:"btn",attrs:{type:"warning"},on:{click:t.close}},[t._v(t._s("取消"))]),t._v(" "),i("el-button",{staticClass:"btn",attrs:{type:"primary"},on:{click:t.submit}},[t._v(t._s("应用"))])],1)],1)])])};Cf._withStripped=!0;const Lf=bi({render:Cf,staticRenderFns:[]},undefined,xf,"data-v-9168a6c8",false,undefined,!1,void 0,void 0,void 0);class Mf{constructor(t){this.map=null,this.options=t,this.domid="map-editLayer-Control",this.dataId=t.mapResourceList[0].id,this.updateCallback=null,this.layer,this.fieldList=[],this.isAddLabelPoint=!1,this.labelLayerId,this.geometryType}addTo(t){this.map=t;var e=this.map.M.layerManager.getLayerById(this.dataId);e&&(this.layer=e,this.geometryType=e.geometryType),this.destory();const i=w.default.extend(Lf);var s={data:this.options};this.intance=new i({data:s}),this.intance.close=()=>{this.destory()},this.intance.submit=()=>{this.submit()},this.intance.changeLabel=()=>{this.changeLabel()},this.intance.changeLabelOverlap=()=>{this.changeLabelOverlap()},this.intance.getOpenLabel=()=>this.getOpenLabel(),this.intance.getGeometryType=()=>this.getGeometryType(),this.intance.getOverlapEnableValue=()=>this.getOverlapEnableValue(),this.map.ExAPI.appendMapControlContainer(this.intance),this.initData()}getLabelLayerId(){var t=this.map.M.layerManager.getLayerById(this.dataId);return t?(this.layer=t,this.labelLayerId=this.layer.labelLayerId,this.labelLayerId):this.labelLayerId}initData(){this.layer&&(this.fieldList=this.layer.fieldList,this.isAddLabelPoint=this.layer.isAddLabelPoint,this.intance.fieldList=this.fieldList,this.labelLayerId=this.layer.labelLayerId,this.geometryType=this.layer.geometryType)}getGeometryType(){return this.geometryType}getOpenLabel(t){var e=t;const i=this.labelLayerId;if(i?this.map.getLayer(i):null){var s=this.map.getLayoutProperty(i,"visibility");s&&(e="visible"==s)}return e}getOverlapEnableValue(t){var e=t;const i=this.getLabelLayerId();return(i?this.map.getLayer(i):null)&&(e=this.map.getLayoutProperty(i,"text-allow-overlap")),!e}async changeLabel(){this.isAddLabelPoint||(await this.layer.calcGeoJsonCenterToLabel(),this.isAddLabelPoint=!0);const t=this.getLabelLayerId();if(t?this.map.getLayer(t):null){if(this.intance.renderStyle.openLabel){this.map.setLayoutProperty(t,"visibility","visible");let i=this.intance.renderStyle.textField;if(i){var e=["get",i];this.map.setLayoutProperty(t,"text-field",e)}else this.map.setLayoutProperty(t,"text-field","")}else this.map.setLayoutProperty(t,"visibility","none")}}changeLabelOverlap(){const t=this.getLabelLayerId();if(t?this.map.getLayer(t):null){const e=this.intance.renderStyle.labelOverlapEnable;this.map.setLayoutProperty(t,"text-allow-overlap",!e),this.map.setLayoutProperty(t,"text-ignore-placement",!e)}}submit(){const t=this.map.GLSDK.getOnemapConfig(),e=this.intance.renderStyle;const i=new vf({pointColor:e.color,pointRadius:e.width,lineStyle:e.lineStyle,lineWidth:e.width,lineColor:e.color,fillColor:e.fillColor,fillOutLineColor:e.color,fillOutLineWidth:e.width,textColor:e.textColor,textField:e.textField?["get",e.textField]:"",textFontSize:e.textFontSize,openLabel:e.openLabel,labelOverlapEnable:e.labelOverlapEnable,textHaloColor:e.textHaloColor,textHaloWidth:e.textHaloWidth},t).getStyle(this.dataId);var s=`${t.customURL_UploadEditLayer}`;const a=this.intance.form.title,n=this.intance.mapResourceCode;var o={id:this.dataId,expandPro:JSON.stringify(i),mapResourceName:a,mapLayerType:"geojson",mapResourceCode:n};dr.request({url:s,method:"post",data:o||{}}).then((t=>{200==t.code&&this.updateCallback&&this.updateCallback(t.data)}))}destory(){this.map&&this.map.ExAPI.removeMapControlContainer(this.domid)}}var bf={inject:{adapter:{from:"adapter",default:()=>null},mapP:{from:"mapP",default:()=>null},getOnemapConfig:{from:"onemapConfig",default:()=>null}},props:{data:{type:Array,default:()=>[],required:!0},MapLayerManager:{type:[Boolean,Object],default:()=>!1},mapSyncConfig:{type:Object,default:function(){return{show:!0}}}},created(){this.oneMapConfig=this.getOnemapConfig(),this.layerDomid="layer"+Math.floor(999*Math.random()),this.adapter?Object.assign(this,this.adapter().LM.props):this.localData=this.data,"object"==typeof this.MapLayerManager&&(this.showImportData=void 0!==this.MapLayerManager.showImportData&&this.MapLayerManager.showImportData,this.showSearchEnable=void 0===this.MapLayerManager.showSearchEnable||this.MapLayerManager.showSearchEnable,this.closeDefaultExpand=void 0!==this.MapLayerManager.closeDefaultExpand&&this.MapLayerManager.closeDefaultExpand,this.closeOthersControls=void 0!==this.MapLayerManager.closeOthersControls&&this.MapLayerManager.closeOthersControls,this.selectedLayerControls=void 0===this.MapLayerManager.selectedLayerControls||this.MapLayerManager.selectedLayerControls,this.showToolsEnable=void 0===this.MapLayerManager.showToolsEnable||this.MapLayerManager.showToolsEnable,this.closeDefaultLayer=void 0!==this.MapLayerManager.closeDefaultLayer&&this.MapLayerManager.closeDefaultLayer,this.closeFillOutLineOpacity=void 0!==this.MapLayerManager.closeFillOutLineOpacity&&this.MapLayerManager.closeFillOutLineOpacity,this.layerDragOrder=void 0===this.MapLayerManager.layerDragOrder||this.MapLayerManager.layerDragOrder,this.checkboxParent=0!=this.MapLayerManager.checkboxParent,this.storageFavour=void 0!==this.MapLayerManager.storageFavour&&this.MapLayerManager.storageFavour,this.layout=void 0!==this.MapLayerManager.layout?this.MapLayerManager.layout:this.layout,this.copyToCustom=void 0!==this.MapLayerManager.copyToCustom&&this.MapLayerManager.copyToCustom)},components:{MapLayer:Wg,LayerView:ff},data:()=>({oneMapConfig:{},styleContent:{},expandAll:!1,visible:!1,activeTab:"layer",favourData:[],localData:[],recentData:[],selectedData:[],showImportData:!1,closeOthersControls:!1,selectedLayerControls:!0,showSearchEnable:!1,showToolsEnable:!0,closeDefaultExpand:!1,closeDefaultLayer:!1,closeFillOutLineOpacity:!1,layerDragOrder:!0,checkboxParent:!0,storageFavour:!1,copyToCustom:!1,acceptFileType:".dwg,.shp,.zip",layout:"horizontal"}),mounted(){this.map=this.mapP();const t=this.localData.length;if(t>0){0==this.showImportData&&"自定义图层"==this.localData[t-1].label&&this.localData.splice(t-1,1);const{treeStore:e}=this.$refs.mapLayer;if(e.flat)for(const t in e.flat)if(Object.prototype.hasOwnProperty.call(e.flat,t)){const i=e.flat[t];i.favourite&&this.favourData.push(i)}}setTimeout((()=>{"object"==typeof this.MapLayerManager&&(this.visible=this.MapLayerManager.expand)}),100)},methods:{setVisible(t){this.visible!=t&&(this.visible=t,this.$nextTick((()=>{this.initHeight()})))},copyToCustomEvent(t){var e=t.label;this.$confirm(`确定导入【${e}】至自定义图层?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{const i=new vf({},this.oneMapConfig).getStyle();let s=new FormData;s.append("expandPro",JSON.stringify(i)),s.append("mapResourceName",e),s.append("mapLayerType","geojson"),s.append("serverType","iQueryCopy"),s.append("layerId",t.data.id);var a=`${this.oneMapConfig.customURL_CopyToCustom}`;dr.request({url:a,method:"post",addheaders:{"Content-Type":"multipart/formdata"},data:s||{},loading:!0}).then((t=>{200==t.code?(this.addFileLayerData(t.data),this.$message({message:"导入成功!",type:"success",showClose:!0})):this.$message({message:"导入失败!"+t.msg,type:"warning",showClose:!0})}))}))},removeFavourLayers(){0!=this.favourData.length&&(1==this.storageFavour?this.$confirm("确定移除全部收藏图层?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{var t=this.oneMapConfig.customURL_RemoveFavourUrl;try{dr.request({url:t,method:"post",data:{},loading:!1,nocode:!0,nomessage:!0}).then((t=>{200==t.code&&this.removeFavourData()}))}catch(t){throw t}})):this.removeFavourData())},removeFavourData(){new Promise((t=>{var e=this.favourData.length;0==e&&t(),this.favourData.forEach(((i,s)=>{var a=this.$refs.favourView.getNode(i.id);this.$set(a.data,"favourite",!1),s==e-1&&t()}))})).then((()=>{this.favourData=[]}))},saveFavourLayers(t,e){if(1==this.storageFavour){var i=this.oneMapConfig.customURL_collectFavourUrl;try{dr.request({url:i,method:"post",data:{layerId:t,type:!0===e?1:0},loading:!1,nocode:!0,nomessage:!0}).then((t=>{}))}catch(t){throw t}}},changeLayerBtn(){this.visible=!this.visible,this.$nextTick((()=>{this.initHeight()}))},initHeight(){this.$refs.mapLayer.initHeight()},onImportEidtTools(t){const e=new Mf(t);var i=this.mapP();e.addTo(i),e.updateCallback=t=>{this.updateLayer(t)}},handleChangeUpload(t,e){var i=t.name.substring(0,t.name.lastIndexOf("."));const s=new vf({},this.oneMapConfig).getStyle();let a=new FormData;a.append("file",t.raw),a.append("expandPro",JSON.stringify(s)),a.append("mapResourceName",i),a.append("mapLayerType","geojson"),a.append("serverType","File"),this.$confirm("确定导入自定义图层数据?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{var e=`${this.oneMapConfig.customURL_Upload}`;dr.request({url:e,method:"post",addheaders:{"Content-Type":"multipart/formdata"},data:a||{},loading:!0}).then((e=>{200==e.code?(this.addFileLayerData(e.data),this.$message({message:"导入图层数据成功!"+e.msg,type:"success",showClose:!0}),t=null,this.$refs.elUpload.clearFiles()):(t=null,this.$message({message:"导入图层数据失败!"+e.msg,type:"warning",showClose:!0}))}))}))},addFileLayerData(t){const e=this.localData.length,i=this.localData[e-1]||{},s=t,a=this.getConvertImportLayer(t);var n="";if("自定义图层"==i.label)n=i.id,i.children.push(a);else{var o={id:Math.random(),label:"自定义图层",children:[],expand:!0,mapResourceList:""};o.children.push(a),this.localData.push(o),n=o.id}this.$nextTick((()=>{this.setMapLayerChecked(s.id,!0),this.$refs.mapLayer.setExpandById(n,!0)}))},getConvertImportLayer(t){const e=t,i=e.mapResourceList[0];var s=i.serverUrl;return{id:e.id,label:e.mapLayerName,pidlabel:"自定义图层",mapResourceList:[{iQueryIdList:[],id:i.id,label:i.mapLayerName,layerType:i.mapLayerType,mapResourceCode:i.mapResourceCode,fileId:i.fileId,geometryType:"",token:"",serverType:i.serverType||"File",url:s,supportIQuery:!1,geoMapMarkerList:[],minzoom:null,maxzoom:null,sourceCache:1,layersIndex:"",layerDefs:"",virtualId:e.id,opacity:null,source:{id:i.id,type:"geojson",data:s},layer:{id:i.id,type:"geojson",source:i.id,layers:i.expandProList},_token:null}],opacity:1,expand:!1,legend:"",layerIds:[i.id],delete:1}},updateLayer(t){const e=t.id,i=this.localData.length,s=this.localData[i-1].children||[],a=s.findIndex((t=>t.id===e));this.setMapLayerChecked(t.id,!1);const n=this.getConvertImportLayer(t);this.$nextTick((()=>{s.splice(a,1),s.splice(a,0,n),this.$nextTick((()=>{this.setMapLayerChecked(t.id,!0)}))}))},ShowExpandTree(){this.$refs.mapLayer.setExpand&&(this.expandAll=!this.expandAll,this.$refs.mapLayer.setExpand(this.expandAll))},setMapLayerChecked(t,e){this.$refs.mapLayer.setMapLayerChecked(t,e)},getMapLayerIds(t){this.$refs.mapLayer.getMapLayerIds(t)},onClick(t){const e=this.recentData.findIndex((e=>e.id==t.id));-1!==e?(this.recentData.splice(e,1),this.recentData.unshift(Object.assign(t,{isChecked:!0}))):(this.recentData.unshift(Object.assign(t,{isChecked:!0})),this.$nextTick((()=>{}))),this.changeSelectedLayerData(t)},changeSelectedLayerData(t){const e=this.selectedData.findIndex((e=>e.id==t.id));-1!==e?this.selectedData.splice(e,1):(this.selectedData.unshift(Object.assign(t,{isChecked:!0})),this.$nextTick((()=>{this.$refs.selectedView.setChecked(t.id,!0)})))},onCollect(t){const e=1==t.data.favourite;if(this.$set(t.data,"favourite",!e),e){const e=this.favourData.findIndex((e=>e.id==t.data.id));this.favourData.splice(e,1)}else this.favourData.push(Object.assign(t.data,{isChecked:!0})),this.$nextTick((()=>{this.$refs.favourView.setChecked(t.data.id,!0)}));this.saveFavourLayers(t.data.id,!e)},onSelectedNodeChcked(t,e){this.$refs.mapLayer.setChecked(t,e),this.$refs.favourView.setChecked(t,e),this.$refs.recentView.setChecked(t,e)},onRecentNodeChcked(t,e){this.$refs.mapLayer.setChecked(t,e),this.$refs.favourView.setChecked(t,e)},onViewNodeChcked(t,e){this.$refs.mapLayer.setChecked(t,e),this.$refs.recentView.setChecked(t,e)},onLayerNodeChecked(t,e){const i=t;i.children||(this.onClick(i),i.isChecked=e),this.$refs.favourView.setChecked(i,e),this.$refs.recentView.setChecked(i,e)},clearAll(){this.$refs.mapLayer.clearAll()},getAllCheckedIds(){return this.$refs.mapLayer.getAllCheckedIds()}},computed:{},watch:{visible(t){this.map&&this.map.GLSDK.changeLayerManagerEvent&&this.map.GLSDK.changeLayerManagerEvent(t)}}};const wf=bf;var Sf=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-layer-manager mx-manager-container"},[i("div",{staticClass:"mx-map-btn",class:{activebtn:t.visible},on:{click:t.changeLayerBtn}},[i("i",{staticClass:"icon-layer"}),t._v("图层"),t.visible?i("i",{staticClass:"el-icon-arrow-down"}):i("i",{staticClass:"el-icon-arrow-up"})]),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"mx-layer-panel",class:["vertical"===t.layout?"isVertical":"isHorizontal"],attrs:{id:t.layerDomid}},["vertical"===t.layout?i("div",{staticClass:"mx-panel-header"},[i("i",{staticClass:"icon-layer"})]):t._e(),t._v(" "),i("div",{staticClass:"mx-layer-container-panel"},[i("div",{staticClass:"mx-layer-panel-header"},[i("div",{class:{active:"layer"==t.activeTab},on:{click:function(e){t.activeTab="layer"}}},[i("span",[t._v("图层")])]),t._v(" "),!t.closeOthersControls&&t.selectedLayerControls?i("div",{class:{active:"selectedLayer"==t.activeTab},on:{click:function(e){t.activeTab="selectedLayer"}}},[i("span",[t._v("已选")])]):t._e(),t._v(" "),!t.closeOthersControls&&t.mapSyncConfig.show?i("div",{class:{active:"favour"==t.activeTab},on:{click:function(e){t.activeTab="favour"}}},[i("span",[t._v("收藏")])]):t._e(),t._v(" "),!t.closeOthersControls&&t.mapSyncConfig.show?i("div",{class:{active:"recent"==t.activeTab},on:{click:function(e){t.activeTab="recent"}}},[i("span",[t._v("最近")])]):t._e()]),t._v(" "),i("div",{staticClass:"mx-layer-panel-content",style:t.styleContent},[i("div",{directives:[{name:"show",rawName:"v-show",value:"layer"==t.activeTab,expression:"activeTab == 'layer'"}],attrs:{label:"图层",name:"layer"}},[i("map-layer",{ref:"mapLayer",attrs:{data:t.localData,closeDefaultExpand:t.closeDefaultExpand,showSearchEnable:t.showSearchEnable,showToolsEnable:t.showToolsEnable,mapSyncConfig:t.mapSyncConfig,closeDefaultLayer:t.closeDefaultLayer,closeFillOutLineOpacity:t.closeFillOutLineOpacity,copyToCustom:t.copyToCustom,checkboxParent:t.checkboxParent,showImportData:t.showImportData,layerDomid:t.layerDomid},on:{"node-checked":t.onLayerNodeChecked,onImportEidtTools:t.onImportEidtTools,copyToCustomEvent:t.copyToCustomEvent},scopedSlots:t._u([{key:"extra-before-tool",fn:function(e){var i=e.node;return t.mapSyncConfig.show?[t._t("layer-tool",null,{data:i}),t._v(" "),t._t("layer-common-tool",null,{data:i})]:void 0}},{key:"extra-tool",fn:function(e){var s=e.node;return t.mapSyncConfig.show?[i("a",{staticStyle:{"margin-left":"2px"},on:{click:function(e){return e.stopPropagation(),t.onCollect(s)}}},[i("i",{class:{"icon-star-empty":!s.data.favourite,"icon-star-full":s.data.favourite}})]),t._v(" "),t._t("extra-tool")]:void 0}}],null,!0)})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"favour"==t.activeTab,expression:"activeTab == 'favour'"}],attrs:{label:"收藏",name:"favour"}},[i("layer-view",{ref:"favourView",attrs:{layerDomid:t.layerDomid,storageFavour:t.storageFavour,data:t.favourData,showToolsEnable:t.showToolsEnable,closeFillOutLineOpacity:t.closeFillOutLineOpacity,mapSyncConfig:t.mapSyncConfig},on:{"node-checked":t.onViewNodeChcked},scopedSlots:t._u([{key:"extra-before-tool",fn:function(e){var i=e.node;return[t._t("layer-common-tool",null,{data:i})]}},{key:"extra-tool",fn:function(e){var s=e.node;return[i("a",{staticStyle:{"margin-left":"2px"},on:{click:function(e){return e.stopPropagation(),t.onCollect(s)}}},[i("i",{class:{"icon-star-empty":!s.data.favourite,"icon-star-full":s.data.favourite}})]),t._v(" "),t._t("extra-tool")]}}],null,!0)})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"recent"==t.activeTab,expression:"activeTab == 'recent'"}],attrs:{label:"最近",name:"recent"}},[i("layer-view",{ref:"recentView",attrs:{layerDomid:t.layerDomid,draggable:!t.selectedLayerControls&&t.layerDragOrder,data:t.recentData,showToolsEnable:t.showToolsEnable,closeFillOutLineOpacity:t.closeFillOutLineOpacity,mapSyncConfig:t.mapSyncConfig},on:{"node-checked":t.onRecentNodeChcked},scopedSlots:t._u([{key:"extra-tool",fn:function(e){var s=e.node;return[i("a",{staticStyle:{"margin-left":"2px"},on:{click:function(e){return e.stopPropagation(),t.onCollect(s)}}},[i("i",{class:{"icon-star-empty":!s.data.favourite,"icon-star-full":s.data.favourite}})]),t._v(" "),t._t("extra-tool")]}}],null,!0)})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"selectedLayer"==t.activeTab,expression:"activeTab == 'selectedLayer'"}],attrs:{label:"已选",name:"selectedLayer"}},[i("layer-view",{ref:"selectedView",attrs:{layerDomid:t.layerDomid,draggable:t.layerDragOrder,data:t.selectedData,showToolsEnable:t.showToolsEnable,closeFillOutLineOpacity:t.closeFillOutLineOpacity,mapSyncConfig:t.mapSyncConfig},on:{"node-checked":t.onSelectedNodeChcked},scopedSlots:t._u([{key:"extra-before-tool",fn:function(e){var i=e.node;return t.mapSyncConfig.show?[t._t("layer-common-tool",null,{data:i})]:void 0}},{key:"extra-tool",fn:function(e){var s=e.node;return t.mapSyncConfig.show?[i("a",{staticStyle:{"margin-left":"2px"},on:{click:function(e){return e.stopPropagation(),t.onCollect(s)}}},[i("i",{class:{"icon-star-empty":!s.data.favourite,"icon-star-full":s.data.favourite}})]),t._v(" "),t._t("extra-tool")]:void 0}}],null,!0)})],1)])]),t._v(" "),i("div",{staticClass:"mx-layer-tool"},[t.showImportData&&t.mapSyncConfig.show?i("el-tooltip",{attrs:{content:"导入数据"}},[i("el-upload",{ref:"elUpload",staticClass:"mx-upload-layer",attrs:{action:"#","on-change":t.handleChangeUpload,multiple:!0,accept:t.acceptFileType,"auto-upload":!1}},[i("a",{staticClass:"mx-btn-tool"},[i("i",{staticClass:"el-icon-folder-add"})])])],1):t._e(),t._v(" "),i("el-tooltip",{attrs:{content:"关闭图层"}},[i("a",{staticClass:"mx-btn-tool",on:{click:t.clearAll}},[i("i",{staticClass:"el-icon-brush"})])])],1),t._v(" "),i("div",{staticClass:"mx-tree-expand"},["layer"==t.activeTab?i("el-tooltip",{attrs:{content:t.expandAll?"收起":"展开",placement:"left"}},[i("span",[i("i",{class:[t.expandAll?"el-icon-s-unfold":"el-icon-s-fold"],on:{click:t.ShowExpandTree}})])]):t._e(),t._v(" "),"favour"==t.activeTab?i("el-tooltip",{attrs:{content:"移除全部收藏",placement:"left"}},[i("span",[i("i",{staticClass:"el-icon-s-release",on:{click:t.removeFavourLayers}})])]):t._e()],1)])])};Sf._withStripped=!0;const If=bi({render:Sf,staticRenderFns:[]},undefined,wf,"data-v-2c9467fe",false,undefined,!1,void 0,void 0,void 0);class Ef{constructor(t,e){this.map=t,this.mouseDown=null,this.options=e||{},this.beforeId=this.options.beforeId,this.mode=this.options.mode||"sigle",this.drawModelLayerId=null,this.drawModelLayer=null,this.activeModelLayer,this.activeMoveModelLayer,this.callbackEvent={},this.coordinateList=[],this.pointList=[]}addLayer(){let t={id:this.drawModelLayerId,type:"model",callback:(t,e)=>{this.drawModelLayer=e}};this.map.addLayer(t,this.beforeId)}complete(){this.completeCallback(),"sigle"==this.mode&&this.stop()}completeCallback(){var t=this.callbackEvent.complete;t&&t(JSON.parse(JSON.stringify(this.pointList)))}on(t,e){["complete"].includes(t)&&(this.callbackEvent[t]=e)}stop(){this.mouseDown&&this.map.off("click",this.mouseDown),this.mouseMove&&this.map.off("mousemove",this.mouseMove),this.doubleClick&&this.map.off("dblclick",this.doubleClick),this.map.M.isDoingDraw=!1,this.map.ExAPI.setCursor(),this.mouseDown=null,this.mouseMove=null,this.doubleClick=null}removeModel(){this.drawModelLayer&&(this.activeModelPointLayer&&this.drawModelLayer.removeModel(this.activeModelPointLayer),this.activeMoveModelLayer&&this.drawModelLayer.removeModel(this.activeMoveModelLayer),this.activeModelLayer&&this.drawModelLayer.removeModel(this.activeModelLayer))}clear(){this.removeModel(),this.pointList=[],this.coordinateList=[]}destory(){this.map.getLayer(this.drawModelLayerId)&&this.map.removeLayer(this.drawModelLayerId),this.clear(),this.stop()}}class Tf extends Ef{constructor(t,e){super(t,e),this.renderStyle=Object.assign({type:"sphere",size:2,color:"rgba(255, 0, 0, 0.8)",opacity:1},this.options.renderStyle||{}),this.drawModelLayerId="draw-3d-point"}start(){this.addLayer(),this.mouseDown=t=>{var e=t.coord;this.drawModelLayer&&e&&(this.pointList=e,this.addPoint(e))},this.doubleClick=t=>{this.complete()},this.map.on("click",this.mouseDown),this.map.on("dblclick",this.doubleClick),this.map.M.isDoingDraw=!0,this.map.ExAPI.setCursor("crosshair",this.map)}addPoint(t){this.activeModelLayer&&this.drawModelLayer.removeModel(this.activeModelLayer);var e=Object.assign({data:[{coordinate:t}]},this.renderStyle);let i=this.drawModelLayer.addPoints(e);this.activeModelLayer=i}}class Df extends Ef{constructor(t,e){super(t,e),this.renderStyle=Object.assign({type:"solid",width:10,color:"rgba(255, 0, 0, 0.8)",opacity:1,repeat:{x:20,y:1}},this.options.renderStyle||{}),this.drawModelLayerId="draw-3d-polyline",this.pointList=[],this.coordinateList=[],this.movePoint=null}start(){var t;this.addLayer();var e=!1;this.mouseDown=i=>{i.preventDefault();var s=i.coord;s&&t&&s.join(",")==t.join(",")||(t=s,this.drawModelLayer&&s&&(e&&(e=!1,this.pointList=[],this.coordinateList=[],this.movePoint=null),this.pointList.push(s),this.coordinateList.push({coordinate:s}),this.addPoint(),this.addLine()),console.log(s,"点击"))},this.doubleClick=t=>{t.preventDefault(),this.pointList=this.pointList.slice(0,-1),this.coordinateList=this.coordinateList.slice(0,-1),this.addPoint(),this.addLine(),this.complete(),e=!0,this.movePoint=null,this.activeMoveModelLayer&&this.drawModelLayer.removeModel(this.activeMoveModelLayer)},this.map.on("click",this.mouseDown),this.map.on("dblclick",this.doubleClick),this.map.M.isDoingDraw=!0,this.map.ExAPI.setCursor("crosshair",this.map)}addPoint(){this.activeModelPointLayer&&this.drawModelLayer.removeModel(this.activeModelPointLayer);var t=Object.assign({type:"sphere",size:1,color:this.renderStyle.color,opacity:this.renderStyle.opacity,data:this.coordinateList});let e=this.drawModelLayer.addPoints(t);this.activeModelPointLayer=e}addLine(){this.activeModelLayer&&this.drawModelLayer.removeModel(this.activeModelLayer);if(this.pointList.length<2)return;var t=Object.assign({data:[{coordinate:this.pointList}]},this.renderStyle);let e=this.drawModelLayer.addLines(t);this.activeModelLayer=e}addMouseMoveLine(){if(!this.movePoint)return;var t=this.pointList.length,e=this.pointList[t-1];this.activeMoveModelLayer&&this.drawModelLayer.removeModel(this.activeMoveModelLayer);var i=Object.assign({data:[{coordinate:[e,this.movePoint]}]},this.renderStyle);i.type="dash";let s=this.drawModelLayer.addLines(i);this.activeMoveModelLayer=s}}class Pf extends Ef{constructor(t,e){super(t,e),this.renderStyle=Object.assign({color:"rgb(255, 0, 0)",opacity:.8,side:"FrontSide"},this.options.renderStyle||{}),this.drawModelLayerId="draw-3d-polygon",this.pointList=[],this.clickPointList=[],this.movePoint=null}start(){var t;this.addLayer();var e=!1;this.mouseDown=i=>{i.preventDefault();var s=i.coord;if((!s||!t||s.join(",")!=t.join(","))&&(t=s,this.drawModelLayer&&s)){e&&(e=!1,this.clickPointList=[],this.coordinateList=[],this.pointList=[],this.movePoint=null),this.clickPointList.push(s),this.coordinateList.push({coordinate:s});var a=this.clickPointList[0];this.pointList=this.clickPointList.concat([a]),this.addPoint(),this.addLine(),this.addPolygon()}},this.doubleClick=t=>{t.preventDefault(),this.clickPointList=this.clickPointList.slice(0,-1),this.coordinateList=this.coordinateList.slice(0,-1);var i=this.clickPointList[0];this.pointList=this.clickPointList.concat([i]),this.addPoint(),this.addLine(),this.addPolygon(),this.complete(),e=!0,this.movePoint=null,this.activeMoveModelLayer&&this.drawModelLayer.removeModel(this.activeMoveModelLayer)},this.map.on("click",this.mouseDown),this.map.on("dblclick",this.doubleClick),this.map.M.isDoingDraw=!0,this.map.ExAPI.setCursor("crosshair",this.map)}addPoint(){this.activeModelPointLayer&&this.drawModelLayer.removeModel(this.activeModelPointLayer);var t=Object.assign({type:"sphere",size:1,color:this.renderStyle.color||16777215,opacity:1,data:this.coordinateList});let e=this.drawModelLayer.addPoints(t);this.activeModelPointLayer=e}addLine(){this.activeMoveModelLayer&&this.drawModelLayer.removeModel(this.activeMoveModelLayer);if(this.pointList.length<2)return;var t=Object.assign({type:"solid",width:this.renderStyle.width||5,color:this.renderStyle.color,opacity:this.renderStyle.opacity,data:[{coordinate:this.pointList}]},this.renderStyle);let e=this.drawModelLayer.addLines(t);this.activeMoveModelLayer=e}addPolygon(){this.activeModelLayer&&this.drawModelLayer.removeModel(this.activeModelLayer);if(this.pointList.length<3)return;var t=Object.assign({data:[{coordinate:this.pointList}]},this.renderStyle);let e=this.drawModelLayer.addPolygons(t);this.activeModelLayer=e}addMouseMoveLine(){if(!this.movePoint)return;var t=this.clickPointList.length,e=this.clickPointList[t-1];this.activeMoveModelLayer&&this.drawModelLayer.removeModel(this.activeMoveModelLayer);var i=Object.assign({data:[{coordinate:[e,this.movePoint]}]},this.renderStyle);i.type="dash";let s=this.drawModelLayer.addLines(i);this.activeMoveModelLayer=s}}const Of={circle:{highLight:{"circle-color":"rgba(255, 255, 0, 1)"},layout:{visibility:"visible"},paint:{"circle-color":"rgba(255, 0, 0, 1)","circle-stroke-color":"#ffffff","circle-stroke-width":1,"circle-opacity":1,"circle-radius":4,"circle-blur":0}},line:{highLight:{"line-color":"rgba(255, 255, 0, 1)"},layout:{"line-cap":"butt","line-join":"round"},paint:{"line-dasharray":[2,0],"line-width":2,"line-color":"rgba(255, 0, 0, 1)","line-opacity":1}},fill:{highLight:{"fill-color":"rgba(255, 255, 0, 0.65)"},layout:{},paint:{"fill-opacity":1,"fill-color":"rgba(255, 0, 0, 0.25)","fill-outline-color":"rgba(255, 0, 0, 1)"}},"fill-extrusion":{highLight:{"fill-extrusion-color":"rgba(255, 255, 0, 1)"},layout:{},paint:{"fill-extrusion-opacity":1,"fill-extrusion-color":"rgba(255, 255, 255, 1)","fill-extrusion-base":0,"fill-extrusion-height":100}},symbol:{highLight:{},highLightLayout:{},layout:{"icon-image":"default_poi","icon-size":1,"icon-rotate":0,"icon-anchor":"bottom","icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-field":"","text-font":["Alibaba Regular"],"text-optional":!0,"text-anchor":"bottom","text-offset":[0,-2],"text-allow-overlap":!0,"text-ignore-placement":!0,"text-size":14},paint:{"icon-opacity":1,"text-color":"#333333"}},text:{highLight:{"text-color":"rgba(255, 255, 0, 1)"},highLightLayout:{},layout:{"text-font":["Alibaba Regular"],"text-field":"{index}","text-optional":!0,"text-anchor":"bottom","text-offset":[0,0],"text-allow-overlap":!1,"text-ignore-placement":!1,"text-size":14},paint:{"text-color":"#333333"}}};function kf(t,e){var i=JSON.parse(JSON.stringify(Of[t])),s={highLight:Object.assign(i.highLight,e.highLight),highLightLayout:Object.assign(i.highLightLayout||{},e.highLightLayout),layout:Object.assign(i.layout,e.layout),paint:Object.assign(i.paint,e.paint)};for(const t in s.highLight)if(Object.hasOwnProperty.call(s.highLight,t)){const e=s.highLight[t];var a=JSON.parse(JSON.stringify(s.paint[t]));s.paint[t]=["case",["boolean",["feature-state","hover"],!1],e,a]}for(const t in s.highLightLayout)if(Object.hasOwnProperty.call(s.highLightLayout,t)){const e=s.highLightLayout[t];a=JSON.parse(JSON.stringify(s.layout[t]));s.layout[t]=["case",["boolean",["feature-state","hover"],!1],e,a]}return s}function Nf(t){var e={type:"FeatureCollection",features:[]};if(Array.isArray(t))t.forEach(((t,i)=>{const s={type:"Feature",geometry:fs(t),geometry_name:"SHAPE",id:i+1,properties:{sourceData:t,index:i+1}};e.features.push(s)}));else{const i={type:"Feature",geometry:fs(t),geometry_name:"SHAPE",id:1,properties:{sourceData:t,index:1}};e.features.push(i)}return e}class Af{constructor(t,e){if(this.options=this.formatOptions(t),this.id=this.options.id||"layer_"+Math.random(),this.name=this.options.name||this.id,this.featuresEnable=void 0!==this.options.featuresEnable&&this.options.featuresEnable,this.beforeId=this.options.beforeId||(this.getDefaultBeforeId?this.getDefaultBeforeId():"t_point"),this.sources=[],this.layers=[],this.dataType=this.options.dataType||"wkt",this.picksMode=this.options.picksMode||"single",this.isGlobalHighLight=0!=this.options.isGlobalHighLight,this.data=this.options.data,this.onClickCallback=null,this.onUnHighLightAllCallback=null,this.layerType=e,"symbol"!=this.layerType){let t={},e={};"text"==this.layerType&&(e["text-field"]=this.options.text||"{index}"),"fill-extrusion"==this.layerType&&this.options.height&&(t["fill-extrusion-height"]=this.options.height);let i=kf(this.layerType,{highLight:this.options.highLight||{},layout:Object.assign(e,this.options.layout||{}),paint:Object.assign(t,this.options.paint||{})});this.layout=i.layout,this.paint=i.paint}this.isPattern=0!=this.options.isPattern,this.texture=this.options.texture,this.onlyUseTexture=this.options.onlyUseTexture||!1,this.textureLayerId,this.textureImageName,this.symbolPlacement={line:"line",fill:"line"},this.fitBounds=this.options.fitBounds,this.minZoom=this.options.minZoom,this.maxZoom=this.options.maxZoom,this.hoveredStateId=null,this.layerPopup=null}formatOptions(t){let e=t;switch(typeof t){case"string":e={data:[t]};break;case"object":if(Array.isArray(t))e={dataType:"string"==typeof t[0]?"wkt":"qdata",data:t};else t.shape?e={dataType:"qdata",data:[t]}:t.features&&(e={dataType:"geojson",data:t})}return e}async addTo(t,e){this.map=t,this.addIcon&&this.addIcon();let i=await this.getFormatData(this.data,this.dataType);if(this.map.getLayer(this.id)&&this.map.removeLayer(this.id),this.map.getSource(this.id)&&this.map.removeSource(this.id),this.map.addSource(this.id,{type:"geojson",data:i}),this.sources.push(this.id),this.texture){let t=this.texture.sdf||!1,e=this.texture.type||"Common",i=this.texture.image||"",s=this.texture.density||1;"ArrowLine"!=e||i||(i=require("./assets/arrow.png")),(this.texture.symbolPlacement||this.symbolPlacement[this.layerType])&&i&&(this.textureImageName=e+"_Icon",this.addTextureImage({name:this.textureImageName,url:i,sdf:t}),this.isPattern&&("line"==this.layerType?this.paint["line-pattern"]=this.textureImageName:"fill"==this.layerType&&(this.paint["fill-pattern"]=this.textureImageName,this.paint["fill-pattern-density"]=s)))}if(this.onlyUseTexture&&this.texture)this.textureLayerId=this.id;else{const t={id:this.id,minzoom:void 0!==this.minZoom?this.minZoom:this.map.getMinZoom()<0?0:this.map.getMinZoom(),maxzoom:void 0!==this.maxZoom?this.maxZoom:this.map.getMaxZoom(),type:"text"==this.layerType?"symbol":this.layerType,source:this.id,paint:this.paint,layout:this.layout};this.map.addLayer(t,e),this.layers.push(t.id),this.textureLayerId=this.id+"_texture"}return this.texture&&!this.isPattern&&this.addTextureLayer({id:this.textureLayerId},e),this.fitBounds&&function(t,e,i){e&&pp(t,e,"object"==typeof i?i.zoom:void 0,i)}(this.map,i,this.fitBounds),this.map.GLSDK.dataToMapLayers[this.id]=this,this}addTextureLayer(t,e){const{id:i}=t;let s=this.texture.layout||{},a=this.texture.paint||{},n=this.texture.color||"#000000",o=0!=this.texture.enableHighLight,r=this.texture.symbolPlacement||this.symbolPlacement[this.layerType],l=this.texture.symbolSpacing||40,h=this.texture.size||.5;const c=o?["case",["boolean",["feature-state","hover"],!1],"rgb(255,255,0)",n]:n;this.map.addLayer({id:i,type:"symbol",minzoom:void 0!==this.minZoom?this.minZoom:this.map.getMinZoom()<0?0:this.map.getMinZoom(),maxzoom:void 0!==this.maxZoom?this.maxZoom:this.map.getMaxZoom(),source:this.id,layout:Object.assign({"symbol-placement":r,"symbol-spacing":l,"icon-image":this.textureImageName,"icon-size":h,"icon-allow-overlap":!0,"icon-ignore-placement":!0},s),paint:Object.assign({"icon-color":c},a||{})},e),this.layers.push(i)}addTextureImage(t){Fd.addMapSymbolImage(this.map,[t])}async getFormatData(t,e){var i;switch(e){case"geojson":i=function(t){var e=t.features;return e.length>0&&(void 0!==e[0].id?t.features.map((t=>(t.properties.index=t.id,t.properties.sourceData=JSON.stringify(t),t))):t.features.map(((t,e)=>(t.id=e+1,t.properties.index=e+1,t.properties.sourceData=JSON.stringify(t),t)))),t}(t);break;case"qdata":i=function(t){var e={type:"FeatureCollection",features:[]};return t.forEach(((t,i)=>{if(""!=t.shape&&null!=t.shape){const s=fs(t.shape);let a={label:t.name,name:t.name,sourceData:JSON.stringify(t),index:i+1};(t.detailList||t.iQueryList||t.qQueryList||[]).forEach((t=>{a[t.key]=t.value}));const n={type:"Feature",geometry:s,geometry_name:"SHAPE",id:i+1,properties:a};e.features.push(n)}else{const t={type:"Feature",geometry:null,geometry_name:"SHAPE",id:i+1,properties:properties};e.features.push(t)}})),console.log(e,"111"),e}(t);break;default:i=Nf(t)}if(this.map){var s=this.map.enableTransform;s&&(i=await sp(s.srid,null,JSON.parse(JSON.stringify(i)))),this.map.sz2000sdk&&(i=this.map.MapmostSDKConvert.convertGeojson(JSON.parse(JSON.stringify(i))))}return i}getSources(){return this.sources}getLayers(){return this.layers}onClick(t){this.onClickCallback=t,this.mouseDown=t=>{if(this.map.stopPropagation&&this.map.stopPropagation())return;const e=this.map.queryRenderedFeatures(t.point,{layers:this.layers});"persistent"==this.picksMode?this.pickPersistentEvent(e):this.pickSingleEvent(e)},this.map.on("click",this.mouseDown)}pickPersistentEvent(t){t.length>0?this.callbackFeatures(t,this.name,this.onClickCallback):this.onClickCallback(null)}pickSingleEvent(t){t.length>0?(this.map.timerCallback&&clearTimeout(this.map.timerCallback),this.map.timerCallback=setTimeout((async()=>{if(this.unHighLight(),this.featuresEnable&&t.length>1)this.callbackFeatures(t,this.name,this.onClickCallback);else{var e=t[0],i=e.id||"";if(i&&this.highLight(i),e.name=this.name,this.map.sz2000sdk){var s=await this.map.MapmostSDKConvert.convertGeoSDKToSZ2000(JSON.parse(JSON.stringify(e.geometry)));e.geometry=s}this.onClickCallback(e)}}),100)):(this.unHighLight(),this.map.GLSDK.removeDataToMapPopup(this.id),this.onClickCallback(null))}callbackFeatures(t,e,i){const s=t.length;var a=JSON.parse(JSON.stringify(t));new Promise((t=>{a.map((async(i,a)=>{if(i.name=e,this.map.sz2000sdk){var n=await this.map.MapmostSDKConvert.convertGeoSDKToSZ2000(JSON.parse(JSON.stringify(i.geometry)));i.geometry=n}return s-1==a&&t(),i}))})).then((()=>{i(a)}))}getHighLightIds(){return this.hoveredStateId}getHighLightEnable(t){return!!Array.isArray(this.hoveredStateId)&&this.hoveredStateId.includes(t)}highLight(t){let e=this.map.GLSDK.dataToMapHighLayer;"persistent"==this.picksMode?this.isGlobalHighLight&&e&&e.id&&e.id!=this.id&&this.map.GLSDK.dataToMapHighLayer.unHighLight():(this.hoveredStateId&&this.unHighLight(),e&&e.id!=this.id&&this.map.GLSDK.dataToMapHighLayer.unHighLight());let i=[];if(i=Array.isArray(t)?t:[t],this.map.getSource(this.id)&&(this.hoveredStateId||(this.hoveredStateId=[]),this.isGlobalHighLight&&(this.map.GLSDK.dataToMapHighLayer=this),i.forEach((t=>{this.map.setFeatureState({source:this.id,id:t},{hover:!0}),this.hoveredStateId.includes(t)||this.hoveredStateId.push(t)})),this.svgIconEnable&&this.map.hasImage(this.iconNameLight))){let t=["match",["get","index"],...this.getStopsMatchExpress(this.hoveredStateId,this.iconNameLight),this.iconName];this.map.setLayoutProperty(this.id,"icon-image",t)}}unHighLight(t){let e=this.hoveredStateId;if(e&&this.map.getSource(this.id))if(t){let i=[];i=Array.isArray(t)?t:[t],i.forEach((t=>{if(e.includes(t)&&(this.map.setFeatureState({source:this.id,id:t},{hover:!1}),this.hoveredStateId=e.filter((e=>e!==t)),0==this.hoveredStateId.length&&(this.hoveredStateId=null),this.svgIconEnable&&this.map.hasImage(this.iconName))){if(!this.hoveredStateId)return void this.map.setLayoutProperty(this.id,"icon-image",this.iconName);let t=["match",["get","index"],...this.getStopsMatchExpress(this.hoveredStateId,this.iconNameLight),this.iconName];this.map.setLayoutProperty(this.id,"icon-image",t)}}))}else this.map.removeFeatureState({source:this.id}),this.svgIconEnable&&this.map.hasImage(this.iconName)&&this.map.setLayoutProperty(this.id,"icon-image",this.iconName),this.hoveredStateId=null,this.onUnHighLightAllCallback&&this.onUnHighLightAllCallback()}getStopsMatchExpress(t,e){var i=[];return t.forEach((t=>{i.push(t),i.push(e)})),i}setVisible(t){this.layers.forEach((e=>{this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))}async setData(t,e,i){var s=i||this.id;if(this.map.getSource(s)){var a=await this.getFormatData(t,e);this.map.getSource(s).setData(a)}}clear(){this.sources.forEach((t=>{this.map.getSource(t)&&this.map.getSource(t).setData({type:"FeatureCollection",features:[]})}))}remove(){this.mouseDown&&this.map.off("click",this.mouseDown),this.map.GLSDK.removeDataToMapPopup(this.id),this.unHighLight(),Fd.remove(this.textureImageName,this.map),new Promise((t=>{const e=this.layers.length;0==e&&t(),this.layers.forEach(((i,s)=>{this.map.getLayer(i)&&this.map.removeLayer(i),s==e-1&&t()}))})).then((()=>{this.sources.forEach((t=>{this.map.getSource(t)&&this.map.removeSource(t)}))})),delete this.map.GLSDK.dataToMapLayers[this.id]}}var Rf={props:["cdata"],data:()=>({filterEmpty:!1,domid:"mappopup-container-Panel",position:"",filesList:{},refreshImgage:!0,activeIndex:0,featuresTabPage:[],showType:""}),mounted(){this.cdata&&(this.data=this.cdata),this.initData(),this.featuresTabPage=this.data.featuresTab||[]},methods:{changeActive(t){this.activeIndex=t,this.data=this.featuresTabPage[t]},initData(){(this.data.iQueryList||[]).forEach((t=>{["FilesPath","MinioFiles"].includes(t.type)&&this.ImageList(JSON.parse(JSON.stringify(t)))}))},judageType:t=>!["FilesPath","MinioFiles"].includes(t.type),actions(){},close(){},ImageList(t){var e=t.value,i=t.key;"FilesPath"==t.type?this.filesList[i]=e?e.split(","):[]:"MinioFiles"==t.type&&this.getPathList(t)},async getPathList(t){if(!t.value)return;var e=t.key;const i={url:this.onemapConfig.customURL_Minio,method:"post",addheaders:{},addtimeout:2e4,data:{groupCode:t.value}},s=await dr.request(i);var a=[];s.data.forEach((t=>{t.url&&a.push(t.url)})),this.filesList[e]=a,this.refreshImgage=!1,this.$nextTick((()=>{this.refreshImgage=!0}))},isImage(t){if(!t)return!1;var e=t.split(",")[0];return!!/\.(gif|jpg|jpeg|png|GIF|JPEG|JPG|PNG)$/.test(e)},setPosition(t){this.position=t}},computed:{attributeList(){return this.data.iQueryList||[]},extraList(){return this.data.extras||[]},styleCss(){let t={"z-index":2};return this.position&&Object.assign(t,this.position),t}}};const Ff=Rf;var Bf=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.data?i("div",{directives:[{name:"drag",rawName:"v-drag"}],staticClass:"mappopup-container mappopup-bottom",style:t.styleCss,attrs:{id:t.domid}},[i("div",{staticClass:"mappopup-header"},[i("div",{staticClass:"title"},[t._v(t._s(t.data.name))]),t._v(" "),i("div",{staticClass:"close",on:{click:t.close}},[i("i",{staticClass:"el-icon-close"})])]),t._v(" "),t.attributeList?i("div",{staticClass:"mappopup-content"},[t._l(t.attributeList,(function(e,s){return[1!=t.filterEmpty||e.value?i("div",{key:s,staticClass:"mappopup-item"},[i("span",{staticClass:"mappopup-label"},[t._v(t._s(null==e.label?"":e.label))]),t._v(" "),i("div",{staticClass:"mappopup-divider"},[t._v(":")]),t._v(" "),t.judageType(e)?i("span",{staticClass:"mappopup-value"},[t._v(t._s(null==e.value?"":e.value+(null==e.unit?"":e.unit)))]):i("div",{staticClass:"mappopup-value mappopup-imagelist"},[t.refreshImgage?i("div",{staticClass:"mappopup-imagelist-content"},[t._l(t.filesList[e.key],(function(s,a){return[i("el-image",{key:a,staticClass:"mappopup-image",attrs:{lazy:"","preview-src-list":t.filesList[e.key],src:s}},[i("div",{staticClass:"image-slot",attrs:{slot:"error"},slot:"error"},[i("i",{staticClass:"el-icon-picture-outline"})])])]}))],2):t._e()])]):t._e()]}))],2):t._e(),t._v(" "),t.extraList.length>0?i("div",{staticClass:"mappopup-btn"},t._l(t.extraList,(function(e,s){return i("div",{key:s,staticClass:"mappopup-btn-item",on:{click:function(i){return i.stopPropagation(),t.actions(e,t.data)}}},[i("span",{staticClass:"mappopup-btn-label"},[t._v(t._s(e.extraName))])])})),0):t._e(),t._v(" "),t.featuresTabPage.length>1?i("div",{staticClass:"mappopup-tab-btn"},t._l(t.featuresTabPage,(function(e,s){return i("span",{key:s,class:{current:s==t.activeIndex},on:{click:function(e){return t.changeActive(s)}}},[t._v(t._s(e.name))])})),0):t._e(),t._v(" "),"dialog"!=t.showType?i("div",{staticClass:"mappopup-tip"}):t._e()]):t._e()};Bf._withStripped=!0;const Gf=bi({render:Bf,staticRenderFns:[]},undefined,Ff,"data-v-094addd4",false,undefined,!1,void 0,void 0,void 0);class zf{constructor(t){this.options=t||{},this.data=this.options.data,this.map=null,this.domId=this.options.domId||"map-panel"+Math.floor(999*Math.random()),this.url=this.options.url,this.intance=null,this.closeCallback=null,this.clearPubsub=null,this.position=this.options.position}subscribeMapClear(){this.clearPubsub=this.map.M.pubsub.subscribe("clear",(()=>{this.destory()}))}destory(){this.closeCallback&&this.closeCallback(),this.destoryBefore&&this.destoryBefore(),this.map&&(this.map.ExAPI.removeMapControlContainer(this.domId),this.clearPubsub&&this.map.M.pubsub.remove("clear",this.clearPubsub))}}var jf=new class{constructor(){this.map=null,this.geometryMapping={polygon:"面",point:"点",line:"线","面":"面","点":"点","线":"线"}}convertLayer(t,e){const i=t.id,s={iQueryIdList:t.iQueryIdList,propertyName:t.propertyName,id:i,label:e.mapLayerName,layerLabel:t.mapResourceName,layerType:this.getLayerType(t.mapLayerType),geometryType:this.geometryMapping[t.geometryType],token:this.getTokenCode(t.tokenId),serverType:t.serverType||"",url:t.serverUrl,supportIQuery:!1,geoMapMarkerList:t.geoMapMarkerList||[],minzoom:t.minLevel,maxzoom:t.maxLevel,sourceCache:t.sourceCache,layersIndex:t.layersIndex||"",layerDefs:t.layerDefs||"",mapResourceCode:t.mapResourceCode,fileId:t.fileId,legendService:t.legendService};e&&(s.supportIQuery=1==e.supportIQuery,s.virtualId=e.id,e.projection?s.projection=e.projection:s.projection=t.projection,s.opacity=e.opacity);let a=!1;switch(s.layerType){case"raster":s.source={id:i,type:this.getLayerType(t.mapLayerType,!0),tiles:[this.getServerUrl(t)],tileSize:256},s.layer={id:i,type:this.getLayerType(t.mapLayerType,!0),source:i,paint:{"raster-opacity":1}},this.map.localOptions&&"4527"===this.map.localOptions.srid&&(s.layer.project=this.option.localOptions.srid);break;case"arcgis-tile":case"wmts":case"arcgis-tile-iis":case"arcgis-tile-iis10":s.source={id:i,type:this.getLayerType(t.mapLayerType,!0),tiles:[this.getServerUrl(t)],tileSize:256},s.layer={id:i,type:this.getLayerType(t.mapLayerType,!0),paint:{"raster-opacity":1}};break;case"vector":s.source={id:i,type:this.getLayerType(t.mapLayerType,!0),tiles:[this.getServerUrl(t)]},s.layer={id:i,type:this.getLayerType(t.mapLayerType,!0),source:i};break;case"3dtile":case"scene":s.layer={id:i,data:this.getServerUrl(t)};break;case"style":case"style-business":s.layer={id:i,type:this.getLayerType(t.mapLayerType,!0),data:this.getServerUrl(t)};break;case"model":s.layer={id:i,type:"model",models:t.serverUrl};break;case"arcgis-dynamic":s.source={id:i,type:"raster",tiles:[this.getServerUrl(t)],tileSize:256},s.layer={id:i,type:"raster",paint:{"raster-opacity":1}};break;case"geojson":case"geojson_isrequest":s.source={id:i,type:this.getLayerType(t.mapLayerType,!0),data:this.getServerUrl(t)},s.layer={id:i,type:this.getLayerType(t.mapLayerType,!0),source:i};break;default:a=!0}if(!a){var n=t.expandProList||"";if(Array.isArray(n)){0===n.length&&(n="")}return Object.assign(s.layer,this.getStyle(t),{layers:n}),s}}getLayerType(t,e){let i=t;switch(t){case"wmts":i="wmts";break;case"wmts_tdt":i="raster";break;case"tile":i=e?"raster":"arcgis-tile";break;case"3dtiles":i="3dtile";break;case"dynamic":i="arcgis-dynamic";break;case"geojson":case"geojson_isrequest":i="geojson";break;case"style":i="style";break;case"style_business":i="style-business";break;case"tile_iis":i="arcgis-tile-iis";break;case"tile_iis10":i="arcgis-tile-iis10";break;case"scene":i="scene"}return i}getServerUrl(t){let{serverUrl:e}=t;if(e)if("wmts_tdt"==t.mapLayerType)t.serverUrl.indexOf("&x={x}&y={y}&l={z}")<0&&(e=`${t.serverUrl}&x={x}&y={y}&l={z}`);else if("tile"==t.mapLayerType){if(t.serverUrl.indexOf("/tile/{z}/{y}/{x}")<0)if(t.serverUrl.indexOf("?")>-1){const i=t.serverUrl.split("?");if(i.length>2){const i=t.serverUrl.lastIndexOf("?");e=this.insertStr(e,i,"/tile/{z}/{y}/{x}")}else e=`${i[0]}/tile/{z}/{y}/{x}?${i[1]}`}else e=`${t.serverUrl}/tile/{z}/{y}/{x}`}else if("vector"==t.mapLayerType){const i=t.serverType||"";t.serverUrl.indexOf(".pbf")<0&&"mapmost"!=i.toLowerCase()&&(e=`${t.serverUrl}/{z}/{x}/{y}.pbf`)}else"3dtiles"==t.mapLayerType||"scene"==t.mapLayerType?e=t.serverUrl:"geojson_isrequest"==t.mapLayerType?(e=t.serverUrl,-1!=t.serverUrl.indexOf("?")?e=e.replace("?","?isrequest=1"):e+="?isrequest=1"):"style"==t.mapLayerType||"style_business"==t.mapLayerType||"dynamic"==t.mapLayerType?e=t.serverUrl:t.mapLayerType;return e}getTokenCode(t){const e=this.map.getOnemapConfig().mapTokens;if(e){const i=e.filter((e=>e.id==t))[0];if(i)return i.tokenCode}return""}getStyle(t){let e={};if(t.expandPro)try{e=JSON.parse(t.expandPro)}catch(t){e={}}else e={};return e}};class Uf extends zf{constructor(t){super(t),this.layerTreeId=this.options.layerTreeId,this.beforeId=this.options.beforeId,this.playInterval=this.options.playInterval||500,this.stepPlayValue=this.options.stepPlayValue||1,this.remainAllLayersAble=this.options.remainAllLayersAble||!1,this.preload=!1!==this.options.preload,this.domId=this.options.domId||"map-image-compare-panel",this.convertData={},this.layerIds={},this.upIndex=0,this.nextIndex=0,this.visibleIndexLayer={0:!0}}addTo(t){if(this.map=t,jf.map=t,this.subscribeMapClear(),this.data)this.showCompare(this.data);else if(this.layerTreeId){let t=this.map.GLSDK.getLayerDataById(this.layerTreeId);this.data=JSON.parse(JSON.stringify(t.children)),this.showCompare(this.data)}else if(this.url){const t=this.url;dr.get({url:t,params:{},nomessage:!0}).then((t=>{t.data&&(this.data=t.data,this.showCompare(this.data))}))}else{let t=this.map.GLSDK.getImageCompareData();this.data=JSON.parse(JSON.stringify(t)),this.showCompare(this.data)}}setPlayInterval(t){this.playInterval=t}async showCompare(t){this.data=t.filter((t=>(!Array.isArray(t.children)||0==t.children.length)&&t.status));const e=this.data.length,i=t=>{if(t>=0){let e=this.data[t];this.layerIds[t]=[];let s=!0;0==t?e.opacity=1:(e.opacity=0,!1===this.preload&&(s=!1)),this.changeMapImage(e,t,s,(()=>{i(t-1)}))}};await i(e-1),this.intance=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_IMAGECOMPARE_OPACITY_DEFAULT",{data:this.data,domId:this.domId,playInterval:this.playInterval,stepPlayValue:this.stepPlayValue}),this.intance.close=()=>{this.destory()},this.intance.changeOpacity=t=>{this.changeOpacity(t)},this.intance.getPlayInterval=()=>this.playInterval,this.map.ExAPI.appendMapControlContainer(this.intance),this.remainAllLayersAble&&(this.layerIds[0]=[],this.data[0].mapResourceList.forEach((t=>{let e=`image-layer-${t.id}-${this.remainAllLayersAble?"remain":Math.random()}`;this.layerIds[0].push(e)})),this.setOpacity(0,1),this.setVisible(0,!0))}changeOpacity(t){let e=t,i=Math.floor(e),s=i+1;this.upIndex!=i&&this.upIndex!=s&&(!1===this.preload?(this.setVisible(this.upIndex,!1),this.visibleIndexLayer[this.upIndex]=!1):this.setOpacity(this.upIndex,0)),this.nextIndex!=i&&this.nextIndex!=s&&(!1===this.preload?(this.setVisible(this.nextIndex,!1),this.visibleIndexLayer[this.nextIndex]=!1):this.setOpacity(this.nextIndex,0)),(!1===this.preload||this.remainAllLayersAble)&&(1!=this.visibleIndexLayer[i]&&(this.setVisible(i,!0),this.visibleIndexLayer[i]=!0),1!=this.visibleIndexLayer[s]&&(this.setVisible(s,!0),this.visibleIndexLayer[s]=!0));let a=1-(e-i);if(this.setOpacity(i,a),this.upIndex=i,this.nextIndex&&this.nextIndex==s)return;this.nextIndex=s,this.setOpacity(s,1)}setOpacity(t,e){this.layerIds[t]&&this.layerIds[t].forEach((t=>{this.map.M.layerManager.setLayerOpacity(t,e)}))}async changeMapImage(t,e,i,s){let a;if(t){-1==t.id.indexOf("image-layer")&&(t.id="image-layer-"+Math.random()),this.convertData[t.id]?a=this.convertData[t.id]:(a=JSON.parse(JSON.stringify(t)),a.mapResourceList&&(a.mapResourceList=a.mapResourceList.map((t=>{a.supportIQuery=0;let e=`image-layer-${t.id}-${this.remainAllLayersAble?"remain":Math.random()}`;return t.id=e,t.layerId=a.id,jf.convertLayer(t,a)}))),this.convertData[t.id]=a);const{mapResourceList:s}=a;if(s&&s.length>0)for(const t of s)this.layerIds[e].push(t.id),t.visible=i,await this.layerCheckedT(!0,t)}s&&s()}async layerCheckedT(t,e){return this.beforeId&&(e.selfBeforeId=this.beforeId),t?await this.map.M.layerManager.addLayer(e,!0):this.remainAllLayersAble?await this.map.M.layerManager.setLayerVisible(e.id,!1):await this.map.M.layerManager.removeLayerById(e.id)}setVisible(t,e){this.layerIds[t]&&this.layerIds[t].forEach((t=>{this.map.M.layerManager.setLayerVisible(t,e)}))}async removeLayer(){for(const t in this.convertData){const e=this.convertData[t];if(e){const{mapResourceList:t}=e;if(t&&t.length>0)for(const e of t)await this.layerCheckedT(!1,e)}}}destoryBefore(){this.intance.timer&&clearInterval(this.intance.timer),this.removeLayer()}}class Vf extends zf{constructor(t){super(t),this.layerTreeId=this.options.layerTreeId,this.beforeId=this.options.beforeId,this.playInterval=this.options.playInterval||2e3,this.immediateNext=this.options.immediateNext||!1,this.domId=this.options.domId||"map-image-compare-panel",this.activeLayerId=null,this.convertData={}}addTo(t){if(this.map=t,jf.map=t,this.subscribeMapClear(),this.data)this.showCompare(this.data);else if(this.layerTreeId){let t=this.map.GLSDK.getLayerDataById(this.layerTreeId);this.data=JSON.parse(JSON.stringify(t.children)),this.showCompare(this.data)}else if(this.url){const t=this.url;dr.get({url:t,params:{},nomessage:!0}).then((t=>{t.data&&(this.data=t.data,this.showCompare(this.data))}))}else{let t=this.map.GLSDK.getImageCompareData();this.data=JSON.parse(JSON.stringify(t)),this.showCompare(this.data)}}setPlayInterval(t){this.playInterval=t}showCompare(t){this.data=t.filter((t=>(!Array.isArray(t.children)||0==t.children.length)&&t.status)),this.intance=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_IMAGECOMPARE_DEFAULT",{data:this.data,domId:this.domId,playInterval:this.playInterval,immediateNext:this.immediateNext}),this.intance.close=()=>{this.destory()},this.intance.changeMapImage=t=>{let e=this.data[t];e&&this.changeMapImage(e)},this.intance.getPlayInterval=()=>this.playInterval,this.map.ExAPI.appendMapControlContainer(this.intance)}async changeMapImage(t,e=!0){let i,s=this.activeLayerId;if(t){-1==t.id.indexOf("image-layer")&&(t.id="image-layer-"+Math.random()),this.convertData[t.id]?i=this.convertData[t.id]:(i=JSON.parse(JSON.stringify(t)),i.mapResourceList&&(i.mapResourceList=i.mapResourceList.map((t=>(i.supportIQuery=0,t.id="image-layer-"+Math.random(),t.layerId=i.id,jf.convertLayer(t,i))))),this.convertData[t.id]=i);const{mapResourceList:s}=i;if(this.activeLayerId=t.id,s&&s.length>0)for(const t of s)await this.layerCheckedT(e,t)}setTimeout((async()=>{e&&s&&this.activeLayerId!=s&&this.removeLayer(s)}),200)}async layerCheckedT(t,e){return this.beforeId&&(e.selfBeforeId=this.beforeId),t?await this.map.M.layerManager.addLayer(e,!0):await this.map.M.layerManager.removeLayerById(e.id)}async removeLayer(t){var e=t;if(e){const t=this.convertData[e];if(t){const{mapResourceList:e}=t;if(e&&e.length>0)for(const t of e)await this.layerCheckedT(!1,t)}}}destoryBefore(){this.intance.timer&&clearInterval(this.intance.timer),this.removeLayer(this.activeLayerId)}}class qf extends zf{constructor(t){super(t),this.title=this.options.title||"资源数据导出",this.crs=this.options.crs||"",this.dwgVersion=this.options.dwgVersion||"ACAD13",this.encoding=this.options.encoding||"UTF-8",this.isConvert=this.options.isConvert||"0",this.domId=this.options.domId||"map-data-export-panel",this.formatList=this.options.formatList||["shp","dwg"],this.drawTypeControls=this.options.drawTypeControls||["map_draw_point_pickup_geo","map_draw_polygon","map_draw_rectangle","map_draw_files","clear"],this.customURL_MapDataExport=""}async addTo(t){this.map=t,this.subscribeMapClear(),this.mapid=this.map.GLSDK.mapContainerID;const e=this.map.GLSDK.getOnemapConfig(),i=e.customURL_getMapDataExportList;this.customURL_MapDataExport=e.customURL_MapDataExport;const s={url:i,method:"get",nocode:!0,nomessage:!0};if(!this.data){const t=await dr.request(s);t.data&&(this.data=t.data)}var a=this.map.ExAPI.getPositionStyle(this.position);return this.intanceDom=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_DATA_EXPORT_DEFAULT",{domId:this.domId,data:this.data||[],title:this.title,formatList:this.formatList,position:a}),this.intanceDom.onExport=t=>{this.onExport(t)},this.intanceDom.close=()=>{this.destory()},this.map.ExAPI.appendMapControlContainer(this.intanceDom),rg.loadMap(this.map),rg.drawTypeControls=this.drawTypeControls,this}async onExport(t){var e=rg.getDrawMergeResult()||"",i={...t};i.exportBounds=e,i.crs=this.crs,i.encoding=this.encoding,i.dwgVersion=this.dwgVersion,i.isConvert=this.isConvert;const s={url:this.customURL_MapDataExport,method:"post",addheaders:{},addtimeout:2e4,data:i,nocode:!0,nomessage:!0,addresponseType:"blob"};try{const t=await dr.request(s),e="zip";sm(t,this.getSourceLayerName(i.layerId),e)}catch(t){window.MapMessage.ShowMessage({type:"warning",message:"文件下载异常,请稍后重试!"})}}getSourceLayerName(t){var e=this.data.find((e=>e.id===t));return e&&e.mapLayerName||this.title}destoryBefore(){rg.clearDraw()}}class Hf extends zf{constructor(t){super(t),this.map=null,this.controls=t.controls||["coordinates","wkt","geojson"],this.intanceDom=null,this.position||(this.position=["60px",null,null,"80px"])}addTo(t){return this.map=t,this.subscribeMapClear(),this.mapid=this.map._container.id,this.intanceDom=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_LOCATIONTOOL_DEFAULT",{domId:this.domId,controls:this.controls,label:this.getLabel(),position:this.map.ExAPI.getPositionStyle(this.position)}),this.intanceDom.mapLocationData=(t,e)=>{this.mapLocationData(t,e)},this.intanceDom.close=()=>{this.destory()},this.map.ExAPI.appendMapControlContainer(this.intanceDom),this}mapLocationData(t,e){switch(e){case"wkt":const i={shape:t,name:"",label:"",id:Math.random(),poiindex:"1",qQueryList:[],iQueryList:[],extras:[]};this.map.$MapEventBus.$emit("map-left-file-list-locations-layer",{data:[i],option:{fitBounds:!0}});break;case"geojson":const s=JSON.parse(t);this.map.$MapEventBus.$emit("map-left-file-list-locations-layer",{data:s,formateType:e,option:{formateType:e,fitBounds:!0}})}}getLabel(){return this.map.M.getCoordinateType()?{x:"经度坐标",y:"纬度坐标"}:{x:"x坐标",y:"y坐标"}}remove(){this.destory()}destory(){this.map&&(this.domId&&this.map.ExAPI.removeMapControlContainer(this.domId),this.map.$MapEventBus.$emit("map-left-list-close"))}}class $f extends zf{constructor(t){super(t),this.title=this.options.title||"拾取面积",this.drawCallbackData={},this.drawCallback,this.active=!1,this.form=Object.assign({label:"拾取个数",label2:"综合面积",count:"0",area:"0 m²"},this.options.form||{}),this.transformType=void 0===this.options.transform?1:this.options.transform,2===this.transformType&&(this.form.area="0 亩"),this.realAreaNum=0}async addTo(t){this.map=t,this.subscribeMapClear(),this.mapid=this.map.GLSDK.mapContainerID;var e=this.map.ExAPI.getPositionStyle(this.position);return this.intanceDom=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_PICK_AREA_DEFAULT",{domId:this.domId,title:this.title,position:e,form:this.form}),this.intanceDom.onSubmit=()=>{this.active||(this.map.GLSDK.clearOverlay(),this.map.GLSDK.ChangeIQuery(!0,!0),this.map.GLSDK.setOnlyPickUp(!0,null,!1,!1),this.map.GLSDK.getIQueryDataCallback=(t,e)=>{this.setPickUpData(t,e)},this.active=!0)},this.intanceDom.onClear=()=>{this.clear()},this.intanceDom.close=()=>{this.destory()},this.intanceDom.transformUnit=()=>{this.transformUnit()},this.map.ExAPI.appendMapControlContainer(this.intanceDom),this}transformUnit(){1===this.transformType?this.transformType=2:this.transformType=1;var t=tr(this.realAreaNum,this.transformType);this.intanceDom.form.area=t}setPickUpData(t,e){"string"!=typeof e||"object"!=typeof t?(t.forEach((t=>{var e=t.name+"_layersPickup";t.records.forEach((t=>{t.shape&&(this.drawCallbackData[e+t.id]=t.shape)}))})),this.drawCallback&&this.drawCallback(this.drawCallbackData),this.setDataStatistic(this.drawCallbackData)):this.clearPickUpDrawData(e,t.id)}setDataStatistic(t){var e=Object.values(t||{}).filter((t=>t));this.intanceDom.form.count=e.length;var i=Ip(e);this.realAreaNum=i;var s=tr(i,this.transformType);this.intanceDom.form.area=s}clearPickUpDrawData(t,e){this.map.GLSDK.clearOnlyPickUpData(t,e),delete this.drawCallbackData[t+e],this.drawCallback&&this.drawCallback(this.drawCallbackData),this.setDataStatistic(this.drawCallbackData)}clear(){this.map&&this.map.GLSDK.clearOverlay(),this.drawCallbackData={},this.drawCallback&&this.drawCallback(this.drawCallbackData),this.intanceDom.form.count="0",this.intanceDom.form.area="0 m²",this.realAreaNum=0}destoryBefore(){this.clear(),this.map&&(this.map.GLSDK.onlyPickUpVisible&&(this.map.GLSDK.ChangeIQuery(!1,!0),this.map.GLSDK.drawCommonPickUpVisible=!1,this.map.GLSDK.setOnlyPickUp(!1,null,!1),this.map.GLSDK.getIQueryDataCallback=null),this.map.ExAPI.setCursor(""))}}const Wf={data:()=>({domId:"map-roaming-panel",data:[],title:"地图漫游",styleConfig:{},position:"",dataList:[],dataHistoryList:[],activeNames:"1",activeHistory:{},groupName:""}),mounted(){},methods:{onSubmit(){},clear(){},close(){},add(){},flyTo(){},onStop(){},onSave(){},changeHistory(){},lookData(t){},deleteData(t,e){this.$confirm(`确定删除漫游路径-${e.groupName}?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.deleteHisData&&this.deleteHisData(t,e)}))},handleDelete(t,e){}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var Kf=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-analysis map-roaming",attrs:{id:t.domId}},[i("mx-map-card",{staticClass:"mx-onemap-content",style:t.styleCss,attrs:{title:t.title},on:{close:t.close}},[i("template",{slot:"content"},[i("div",{staticClass:"mx-analysis-content"},[i("el-collapse",{model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[i("el-collapse-item",{attrs:{title:"绘制漫游路径",name:"1"}},[i("div",{staticClass:"mx-roaming-title"},[t._v("\n 名称:\n "),i("el-input",{attrs:{placeholder:"请输入漫游名称",size:"mini",clearable:""},model:{value:t.groupName,callback:function(e){t.groupName=e},expression:"groupName"}})],1),t._v(" "),i("el-table",{attrs:{data:t.dataList,"max-height":"350px",size:"mini"}},[i("el-table-column",{attrs:{type:"index",label:"序号",width:"50"}}),t._v(" "),i("el-table-column",{attrs:{prop:"centerX",label:"x","show-overflow-tooltip":"",width:"100"}}),t._v(" "),i("el-table-column",{attrs:{prop:"centerY",label:"y","show-overflow-tooltip":"",width:"100"}}),t._v(" "),i("el-table-column",{attrs:{prop:"zoom",label:"z",width:"100"}}),t._v(" "),i("el-table-column",{attrs:{prop:"pitch",label:"俯仰角°",width:"100"}}),t._v(" "),i("el-table-column",{attrs:{prop:"bearing",label:"偏北角°",width:"100"}}),t._v(" "),i("el-table-column",{attrs:{fixed:"right",label:"操作",width:"60"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("i",{staticClass:"el-icon-position",staticStyle:{color:"#326ef0"},on:{click:function(i){return t.flyTo(e.$index,e.row)}}}),t._v(" "),i("i",{staticClass:"el-icon-delete",staticStyle:{color:"#ff0000"},on:{click:function(i){return t.handleDelete(e.$index,e.row)}}})]}}])})],1)],1),t._v(" "),i("el-collapse-item",{attrs:{title:"历史漫游路径",name:"2"}},[i("div",{staticClass:"map-roaming-history-panel"},[0==t.dataHistoryList.length?i("div",{staticClass:"map-roaming-item"},[t._v("\n 暂无数据!\n ")]):t._e(),t._v(" "),t._l(t.dataHistoryList,(function(e,s){return i("div",{key:s,staticClass:"map-roaming-item",class:{active:t.activeHistory.id&&t.activeHistory.id==e.id}},[i("span",{staticClass:"map-roaming-item-name",on:{click:function(i){return t.changeHistory(e)}}},[t._v("\n "+t._s(e.groupName)+"\n ")]),t._v(" "),i("el-button",{attrs:{size:"mini",plain:"",type:"danger",icon:"el-icon-delete"},on:{click:function(i){return t.deleteData(s,e)}}},[t._v("删除")])],1)}))],2)])],1),t._v(" "),i("div",{staticClass:"mx-submit"},[i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-plus"},on:{click:t.add}},[t._v("记录视角")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-position",disabled:0==t.dataList.length},on:{click:t.onSubmit}},[t._v("开始浏览")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSave}},[t._v("保存")]),t._v(" "),i("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.clear}},[t._v("清除")])],1)],1)])],2)],1)};Kf._withStripped=!0;const Yf=bi({render:Kf,staticRenderFns:[]},undefined,Wf,"data-v-d79b46de",false,undefined,!1,void 0,void 0,void 0);class Jf extends zf{constructor(t){super(t),this.position=this.options.position||[null,"20px","20px",null],this.domId=this.options.domId||"map-roaming-panel",this.title=this.options.title||"地图漫游",this.dataList=[],this.dataHistoryList=[],this.speed=this.options.speed||.8,this.curve=this.options.curve||1,this.mouseMove=null,this.activeHistory={},this.oneMapConfig={},this.offOnlineSave=!1,this.closeCallback=null}async addTo(t){this.map=t,this.oneMapConfig=this.map.getOnemapConfig();let e=this.map.ExAPI.getPositionStyle(this.position);this.dataHistoryList=await this.getHistoryList();let i={domId:this.domId,title:this.title,position:e,dataList:this.dataList,dataHistoryList:this.dataHistoryList,activeHistory:this.activeHistory};const s=new(w.default.extend(Yf))({data:i});s.add=()=>{this.add()},s.flyTo=(t,e)=>{this.flyTo(t,e)},s.close=()=>{this.closeCallback&&this.closeCallback(),this.destory()},s.onStop=()=>{this.stop()},s.clear=()=>{s.activeHistory={},this.clear()},s.onSubmit=()=>{this.start()},s.onSave=()=>{this.onSave()},s.handleDelete=(t,e)=>{this.delete(t,e)},s.changeHistory=t=>{this.changeHistory(t)},s.deleteHisData=(t,e)=>{this.deleteHisData(t,e)},this.map.ExAPI.appendMapControlContainer(s),this.instance=s}onSave(){let t=JSON.parse(JSON.stringify(this.dataList));t.map(((t,e)=>(t.sort=e,t)));let e={groupName:this.instance.groupName||"漫游路径"+Math.floor(999*Math.random()),sort:0,geoMapRoamSaveBOList:0==t.length?null:t},i=!0;if(this.activeHistory&&this.activeHistory.id&&(i=!1,e.id=this.activeHistory.id),i&&0==t.length)return;let s=i?this.oneMapConfig.customURL_RoamingSave:this.oneMapConfig.customURL_RoamingUpdate;dr.post({url:s,params:e}).then((async t=>{if(t){window.MapMessage.ShowMessage({message:"保存成功!",type:"success"}),this.changeHistory({id:e.id||t.data,groupName:e.groupName});let i=await this.getHistoryList();this.instance.dataHistoryList=i,this.dataHistoryList=i}}))}async changeHistory(t){await this.clear();let e=this.oneMapConfig.customURL_RoamingDetail,i={id:t.id};this.activeHistory={...t},this.instance.activeHistory={...t},this.instance.groupName=t.groupName;let s=await dr.get({url:e,params:i});if(this.dataList.splice(0,this.dataList.length),s.data){(s.data.geoMapRoamVOList||[]).forEach((t=>{this.dataList.push(t)}))}}async getHistoryList(){try{if(this.offOnlineSave)return window.MapRoamingDataList||[];{let t=this.oneMapConfig.customURL_RoamingList;return(await dr.post({url:t})).data}}catch(t){return[]}}deleteHisData(t,e){this.dataHistoryList.splice(t,1);let i=this.oneMapConfig.customURL_RoamingDelete+"?id="+e.id;dr.post({url:i,params:{id:e.id}}).then((t=>{t&&this.activeHistory&&this.activeHistory.id==e.id&&this.clear()}))}start(){if(0==this.dataList.length)return;if(this.mouseMove)return void this.stop();let t=this.dataList.map((t=>({center:[t.centerX,t.centerY],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch})));this.map.jumpTo(t[0]),this.stop(),this.changeViewers(t)}changeViewers(t){let e=0;this.changeViewer(t[e]),this.mouseMove=()=>{const i=e++;t[i]?this.changeViewer(t[i]):(e=0,this.stop())},this.map.on("moveend",this.mouseMove)}changeViewer(t){this.map.flyTo({...t,speed:this.speed,curve:this.curve,easing:t=>t})}add(){const{lng:t,lat:e}=this.map.getCenter(),i=this.map.getZoom(),s=this.map.getBearing(),a=this.map.getPitch();this.dataList.push({centerX:parseFloat(t.toFixed(8)),centerY:parseFloat(e.toFixed(8)),zoom:parseFloat(i.toFixed(2)),bearing:parseFloat(s.toFixed(2)),pitch:parseFloat(a.toFixed(2))})}flyTo(t,e){const i={center:[e.centerX,e.centerY],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch};this.changeViewer(i)}delete(t,e){this.dataList.splice(t,1)}stop(){this.mouseMove&&this.map.off("moveend",this.mouseMove),this.mouseMove=null}clear(){this.stop(),this.dataList.splice(0,this.dataList.length),this.instance.activeHistory&&(delete this.instance.activeHistory.id,delete this.instance.activeHistory.groupName,delete this.activeHistory.id,delete this.activeHistory.groupName),this.instance.groupName=""}destoryBefore(){this.stop()}}const Xf={data:()=>({domId:"map-pick-point-panel",data:[],title:"坐标拾取",styleConfig:{},position:"",dataList:[]}),mounted(){},methods:{rowClick(t,e){this.rowClick(t)},onSubmit(){},clear(){},close(){},flyTo(){},handleDelete(){},onExport(){},onStop(){},toCopy(t,e){const i=`${e.x},${e.y}`;navigator.clipboard.writeText(i).then((()=>{this.$message.success("复制成功")})).catch((t=>{}))}},computed:{styleCss(){let t=this.styleConfig.position;return this.position&&(t=this.position),t}}};var Qf=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-analysis map-pick-point",attrs:{id:t.domId}},[i("mx-map-card",{staticClass:"mx-onemap-content",style:t.styleCss,attrs:{title:t.title},on:{close:t.close}},[i("template",{slot:"content"},[i("div",{staticClass:"mx-analysis-content"},[i("el-table",{staticStyle:{width:"360px"},attrs:{data:t.dataList,"max-height":"200px",size:"mini"},on:{"row-click":t.rowClick}},[i("el-table-column",{attrs:{type:"index",label:"序号",width:"50"}}),t._v(" "),i("el-table-column",{attrs:{prop:"x",label:"x","show-overflow-tooltip":"",width:"150"}}),t._v(" "),i("el-table-column",{attrs:{prop:"y",label:"y","show-overflow-tooltip":"",width:"150"}}),t._v(" "),i("el-table-column",{attrs:{fixed:"right",label:"操作",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"复制",placement:"top"}},[i("i",{staticClass:"el-icon-document-copy",staticStyle:{color:"#326ef0"},on:{click:function(i){return i.stopPropagation(),t.toCopy(e.$index,e.row)}}})]),t._v(" "),i("i",{staticClass:"el-icon-position",staticStyle:{color:"#326ef0"},on:{click:function(i){return i.stopPropagation(),t.flyTo(e.$index,e.row)}}}),t._v(" "),i("i",{staticClass:"el-icon-delete",staticStyle:{color:"#ff0000"},on:{click:function(i){return i.stopPropagation(),t.handleDelete(e.$index,e.row)}}})]}}])})],1),t._v(" "),i("div",{staticClass:"mx-submit"},[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.onSubmit}},[t._v("开始绘制")]),t._v(" "),i("el-button",{attrs:{size:"small"},on:{click:t.onStop}},[t._v("结束")]),t._v(" "),i("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.clear}},[t._v("清除")]),t._v(" "),i("el-button",{attrs:{size:"small",icon:"el-icon-download",disabled:0==t.dataList.length},on:{click:t.onExport}},[t._v("批量导出")])],1)],1)])],2)],1)};Qf._withStripped=!0;const Zf=bi({render:Qf,staticRenderFns:[]},undefined,Xf,"data-v-b57bc12c",false,undefined,!1,void 0,void 0,void 0);class t_ extends zf{constructor(t){super(t),this.position=this.options.position||[null,"20px","20px",null],this.title=this.options.title||"坐标拾取",this.dataList=[],this.selectId=null,this.closeCallback=null}addTo(t){this.map=t;let e=this.map.ExAPI.getPositionStyle(this.position),i={domId:this.domId,title:this.title,position:e,dataList:this.dataList};const s=new(w.default.extend(Zf))({data:i});s.close=()=>{this.closeCallback&&this.closeCallback(),this.destory()},s.onSubmit=()=>{this.start()},s.onExport=()=>{this.onExport()},s.onStop=()=>{this.stop()},s.clear=()=>{this.clear()},s.flyTo=(t,e)=>{const i=[e.x,e.y];this.flyTo(i)},s.rowClick=t=>{const e=[t.x,t.y];this.flyTo(e),this.selectFeature(t.id)},s.handleDelete=(t,e)=>{this.handleDelete(t,e.id)},this.map.ExAPI.appendMapControlContainer(s),this.instance=s}selectFeature(t){if(this.draw){if(this.selectId){if(this.selectId==t)return this.draw.setChangeStateIconImageById(this.selectId,!1),void(this.selectId=null);this.draw.setChangeStateIconImageById(this.selectId,!1)}this.draw.setChangeStateIconImageById(t,!0),this.selectId=t}}handleDelete(t,e){this.dataList.splice(t,1),this.draw&&this.draw.removeById(e)}start(){let t=this.map.GLSDK.mapStartDraw({type:"map_draw_point_canvas",mode:"persistent",clear:!1},((t,e,i)=>{let s=i.geojson.coordinates,a={id:i.id,x:s[0].toString(),y:s[1].toString()};this.dataList.push(a)}));this.draw=t}stop(){this.map.GLSDK.mapCloseDraw(),this.draw=null}flyTo(t){this.map.GLSDK.flyToCenter(`POINT(${t[0]} ${t[1]})`)}onExport(){if(0==this.dataList.length)return;let t=JSON.parse(JSON.stringify(this.dataList));t=t.map(((t,e)=>({"序号":e+1,x:t.x,y:t.y})));const e=v.utils.json_to_sheet(t),i=v.utils.book_new();v.utils.book_append_sheet(i,e,this.title),v.writeFile(i,this.title+".xlsx",{compression:!0})}clear(){this.draw=null,this.map.GLSDK.mapClearDraw(),this.dataList.splice(0,this.dataList.length)}destoryBefore(){this.clear()}}const e_={name:"MapViewer",components:{FilterSlot:{functional:!0,props:{vnodes:{type:Array|Object},filterKeys:{type:String}},render(t,e){const i=e.props.filterKeys.split(";"),s=(t,e)=>{if(t.componentInstance&&t.componentInstance.$options&&e.indexOf(t.componentInstance.$options.name)>-1)return!0;if(t.children&&t.children.length>0){let i=!1;return t.children.forEach((t=>{s(t,e)&&(i=!0)})),i}return!1};return t("div",{},e.props.vnodes.filter((t=>s(t,i))))}}},props:{id:{type:String,default:"container"},options:{type:Object,default:()=>({})},tokens:{type:Array,default:()=>[]},styleURL:{type:[Object,String],default:null},popupTemplate:{type:Object,default:null},viewport:{type:Number,default:1},viewportFilter:{type:[String,Function],default:()=>"MapSwitch;LayerManager"},accessToken:{type:String,default:""},srid:{type:String,default:"4490"},resolutions:{type:Array,default:null},zoomOffset:{type:Number,default:null},selfMapInit:{type:Boolean,default:!1}},provide(){return{mapWrapP:()=>this}},data:()=>({localViewport:1,cssList:[]}),mounted(){this.localViewport=this.viewport},methods:{changeRole(){this.$refs.mapViewer.changeRole()},setViewport(t){this.localViewport=t},onMapLoaded(t){this.map=t,this.selfMapInit&&!this.map.GLSDK&&(this.mapGL=new Cm,this.mapGL.init(this.map),this.map.GLSDK=this.mapGL),this.$emit("on-loaded",this.map)},onMapLoadedBefore(t){this.$emit("on-loaded-before",t)},onOtherPortLoaded(t,e){this.$emit("on-other-viewport-loaded",t,e)},removeCss(t){const e=this.cssList.indexOf(t);e>-1&&this.cssList.splice(e,1)},addCss(t){this.cssList.push(t)}},computed:{computedCss(){return this.cssList.join(" ")},localOptions(){let t={};return t=Object.assign({},this.options),t&&"local"==this.srid.toLowerCase()&&(t.projection="LOCAL"),t&&"sz2000"==this.srid.toLowerCase()&&(t.projection="SZ2000"),this.srid&&(t.srid=this.srid),this.resolutions&&(t.resolutions=this.resolutions),this.zoomOffset&&(t.zoomOffset=this.zoomOffset),t}}};var i_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-view-container",class:t.computedCss},[i("map-viewport",{ref:"mapViewer",attrs:{id:t.id,options:t.localOptions,tokens:t.tokens,accessToken:t.accessToken,styleURL:t.styleURL,popupTemplate:t.popupTemplate},on:{"on-loaded":t.onMapLoaded,"on-loaded-before":t.onMapLoadedBefore}},[t._t("default")],2),t._v(" "),t._l(t.localViewport-1,(function(e){return i("map-viewport",{key:e,ref:"viewport_"+e,refInFor:!0,attrs:{id:t.id+"_"+e,options:t.localOptions,accessToken:t.accessToken,tokens:t.tokens,styleURL:t.styleURL,popupTemplate:t.popupTemplate},on:{"on-loaded":function(i){return t.onOtherPortLoaded(i,e)},"on-loaded-before":t.onMapLoadedBefore}},[i("filter-slot",{attrs:{vnodes:t.$slots.default,filterKeys:t.viewportFilter}}),t._v(" "),t._t("compare-view")],2)}))],2)};i_._withStripped=!0;const s_=bi({render:i_,staticRenderFns:[]},undefined,e_,"data-v-798c2ea0",false,undefined,!1,void 0,void 0,void 0);const a_={name:"MapSyncMove",props:{layoutVertical:{type:Boolean,default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,activeTools:!1,name:"MapSyncMove"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.close()})),this.map.M.pubsub.subscribe("mapCloseSyncMove",(()=>{this.active=!1})),this.map.M.pubsub.subscribe("mapCloseCloneMap",(()=>{this.active&&this.close()}))},methods:{onClick(){this.active?this.close():(document.addEventListener("keydown",this.keyDown),this.map.GLSDK.MapSyncMoveControlPlugins.open(this.map,1),this.active=!0,this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.GLSDK.OpenMapSyncMoveControls&&this.map.GLSDK.OpenMapSyncMoveControls(),!this.layoutVertical&&document.getElementsByClassName("mx-map-tools")&&(this.map.GLSDK.setMapToolsVisible(!1),this.activeTools=!0),this.active&&this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.close()}}))},close(){this.active&&(this.map.GLSDK.toolsOnClick(this.tool,!1),document.removeEventListener("keydown",this.keyDown),this.map.GLSDK.MapSyncMoveControlPlugins.close(),this.active=!1,this.map.GLSDK.CloseMapSyncMoveControls&&this.map.GLSDK.CloseMapSyncMoveControls(),this.activeTools&&this.map.GLSDK.setMapToolsVisible(!0))},keyDown(t){27==t.keyCode&&this.close()}}};var n_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticStyle:{"enable-background":"new 0 0 30 30"},attrs:{version:"1.1",id:"图层_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 30 30","xml:space":"preserve"}},[i("path",{attrs:{d:"M23,15l-3,3v-2h-4v7h-2v-7h-4v2l-3-3l3-2.9V14h4V7h2v7h4v-2\n\tL23,15z"}})])])};n_._withStripped=!0;const o_=bi({render:n_,staticRenderFns:[]},undefined,a_,undefined,false,undefined,!1,void 0,void 0,void 0);const r_={name:"MapSyncMoveSplit",props:{layoutVertical:{type:Boolean,default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,activeTools:!1,name:"MapSyncMoveSplit"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.close()})),this.map.M.pubsub.subscribe("mapCloseSyncMoveSplit",(()=>{this.active=!1})),this.map.M.pubsub.subscribe("mapCloseCloneMap",(()=>{this.active&&this.close()}))},methods:{onClick(){this.active?this.close():(document.addEventListener("keydown",this.keyDown),this.map.GLSDK.MapSyncMoveControlPlugins.open(this.map,2),this.active=!0,this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.GLSDK.OpenMapSyncMoveControls&&this.map.GLSDK.OpenMapSyncMoveControls(),!this.layoutVertical&&document.getElementsByClassName("mx-map-tools")&&(this.map.GLSDK.setMapToolsVisible(!1),this.activeTools=!0),this.active&&this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.close()}}))},close(){this.active&&(this.map.GLSDK.toolsOnClick(this.tool,!1),document.removeEventListener("keydown",this.keyDown),this.map.GLSDK.MapSyncMoveControlPlugins.close(),this.active=!1,this.map.GLSDK.CloseMapSyncMoveControls&&this.map.GLSDK.CloseMapSyncMoveControls(),this.activeTools&&this.map.GLSDK.setMapToolsVisible(!0))},keyDown(t){27==t.keyCode&&this.close()}}};var l_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticStyle:{"enable-background":"new 0 0 30 30"},attrs:{version:"1.1",id:"图层_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 30 30","xml:space":"preserve"}},[i("path",{attrs:{d:"M7,23V7h16v16H7z M14,9H9v12h5V9z M21,9h-5v12h5V9z"}})])])};l_._withStripped=!0;const h_=bi({render:l_,staticRenderFns:[]},undefined,r_,undefined,false,undefined,!1,void 0,void 0,void 0);const c_={name:"ImportFilesToMap",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,config:{},iqueryActive:!1}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.active&&(this.map.GLSDK.mapImportFilesPlugins.destory(),this.active=!1)}));var t=this.map.getOnemapConfig().controls;"object"==typeof t.MapImportFiles&&(this.config=t.MapImportFiles||{})},methods:{onClick(){if(this.active)return this.map.GLSDK.mapImportFilesPlugins.destory(),this.active=!1,this.iqueryActive&&this.map.GLSDK.ChangeIQuery(!0),void this.map.GLSDK.toolsOnClick(this.tool,!1);this.iqueryActive=this.map.M.iqueryManager.active,this.map.GLSDK.mapImportFilesPlugins.add(Object.assign({title:"文件上图",showList:!0},this.config||{}),this.map,(()=>{})),this.active=!0,this.iqueryActive&&this.map.GLSDK.ChangeIQuery(!1),this.map.GLSDK.toolsOnClick(this.tool,!0)}}};var p_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticStyle:{"enable-background":"new 0 0 200 200"},attrs:{version:"1.1",id:"图层_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 200 200","xml:space":"preserve"}},[i("path",{attrs:{d:"M99.9,0.6C51.3,0.6,12,40.7,12,89.9c0,18.3,4.5,33.6,14.8,49.6c20.4,33.9,60,60.5,73.2,60.5\n\ts52.7-26.8,73.2-60.5c10.1-16,14.8-31.2,14.8-49.6C187.8,40.7,148.5,0.6,99.9,0.6z M99.9,161.9c-40.4,0-73.3-32.8-73.3-73.3\n\ts32.8-73.3,73.3-73.3s73.3,32.8,73.3,73.3C173.2,129.1,140.3,161.9,99.9,161.9z"}}),t._v(" "),i("path",{attrs:{d:"M128.3,53.3c1.7,1.6,3.1,2.9,4.1,4c1,1.1,1.8,1.9,2.4,2.6c0.6,0.7,0.8,1.3,1,1.9c0.1,0.5,0.2,1,0.2,1.3v1.6\n\th-14.2c-0.6,0-1.2-0.2-1.7-0.7c-0.5-0.5-0.8-1.1-1.2-1.7c-0.4-0.6-0.6-1.3-0.7-1.9c-0.1-0.7-0.2-1.2-0.2-1.6V46.9h0.2\n\tc0.5,0,1.1,0.1,1.6,0.2c0.5,0.1,1.2,0.5,1.9,1c0.7,0.5,1.6,1.1,2.6,1.9C125.3,50.7,126.6,51.8,128.3,53.3z M111.9,58.9\n\tc0,1.3,0.2,2.6,0.6,4c0.4,1.3,1,2.6,1.8,3.8s1.9,2.2,3.1,2.9c1.3,0.7,2.8,1.2,4.6,1.2h14v54.1c0,1.8-0.4,3.5-1.1,5\n\tc-0.7,1.4-1.7,2.8-2.9,3.7s-2.5,1.8-4.1,2.4c-1.6,0.6-2.9,0.8-4.3,0.8H76.4c-1.2,0-2.5-0.4-4-1.1c-1.4-0.7-2.8-1.7-4.1-2.8\n\ts-2.3-2.5-3.1-4s-1.2-3-1.2-4.6V59.3c0-1.3,0.4-2.8,1-4.2c0.6-1.4,1.4-2.8,2.5-4s2.3-2.3,3.6-3c1.3-0.8,2.8-1.2,4.2-1.2h36.6V58.9\n\tL111.9,58.9z M117.9,118.7c1.7,0,3.1-0.6,4.2-1.8c1.2-1.2,1.7-2.6,1.7-4.3s-0.6-3.1-1.7-4.2c-1.2-1.2-2.5-1.7-4.2-1.7H82\n\tc-1.7,0-3.1,0.6-4.2,1.7c-1.2,1.2-1.7,2.5-1.7,4.2s0.6,3.1,1.7,4.3c1.2,1.2,2.5,1.8,4.2,1.8H117.9L117.9,118.7z M123.9,88.8\n\tc0-1.7-0.6-3.1-1.7-4.3c-1.1-1.2-2.5-1.8-4.2-1.8H82c-1.7,0-3.1,0.6-4.2,1.8c-1.1,1.2-1.8,2.6-1.8,4.3s0.6,3.1,1.7,4.2\n\ts2.5,1.7,4.2,1.7h36c1.7,0,3.1-0.6,4.2-1.7S123.9,90.5,123.9,88.8z"}})])])};p_._withStripped=!0;const u_=bi({render:p_,staticRenderFns:[]},undefined,c_,"data-v-c2114efc",false,undefined,!1,void 0,void 0,void 0);const d_={name:"MapWebPrint",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,configPrint:{}}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.active&&(this.map.GLSDK.removeWebPrintPlugins(),this.active=!1)}));const t=this.map.getOnemapConfig(),e=t.controls?t.controls.MapWebPrint:{};"object"==typeof e&&(this.configPrint=e)},methods:{onClick(){if(this.map.GLSDK.closeWebPrint=()=>{this.active=!1},this.active)return this.map.GLSDK.removeWebPrintPlugins(),this.active=!1,void this.map.GLSDK.toolsOnClick(this.tool,!1);this.map.GLSDK.mapAddWebPrintPlugins(Object.assign({title:"Web打印出图",mask:!0},this.configPrint||{}),this.map),this.active=!0,this.map.GLSDK.toolsOnClick(this.tool,!0)}}};var m_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1686216766015",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"52913",width:"24",height:"24"}},[i("path",{attrs:{d:"M912 912v-768H271.232l-3.776-10.656A80.032 80.032 0 0 0 112 160v672A80 80 0 0 0 192 912h720z",fill:"#FFFFFF","p-id":"52914"}}),t._v(" "),i("path",{attrs:{d:"M128 832a64 64 0 0 0 64 64h704V160H288v672H256a64 64 0 1 0-128 0z m0-71.552A95.648 95.648 0 0 1 192 736c24.576 0 47.04 9.248 64 24.448V148.928l-3.648-10.24A64.032 64.032 0 0 0 128 160v600.448zM282.56 128H928v800H192a96 96 0 0 1-96-96V160a96 96 0 0 1 186.56-32z","p-id":"52915"}}),t._v(" "),i("path",{attrs:{d:"M448 768c8.512-17.184 19.2-31.52 32-43.04V736h192v-128h32v128h160v32h-160v96h-32v-96h-192v96h-32v-96z m0-189.28V544h-128v-32h128v-51.584l32 19.104V512h54.4l-27.808 28.8-4.96 3.2H480v14.016l-32 20.704zM320 320V288v32z m128-97.344V192h32v61.344l-32-30.688zM516.16 288H672V192h32v45.888L653.088 320h-103.52L516.16 288zM864 288v32-32z m0 224v32-32z",fill:"#CDD1D7","p-id":"52916"}}),t._v(" "),i("path",{attrs:{d:"M640 544v-32h224v64h-216.48C469.76 665.088 384 761.632 384 864h-64c0-121.92 86.976-229.056 256-322.656-0.16-46.048-4.32-54.208-22.88-65.184-1.792-1.024-14.24-8.096-18.464-10.624a233.184 233.184 0 0 1-24.512-16.64c-20.032-15.68-38.56-35.84-56.768-63.136-19.84-29.792-61.408-76.512-124-139.136l45.248-45.248c65.408 65.376 109.184 114.656 132 148.864 25.12 37.664 31.776 42.88 79.04 70.848C625.696 444.768 640 474.432 640 544z",fill:"#30AD98","p-id":"52917"}}),t._v(" "),i("path",{attrs:{d:"M752 224l112 224-112-64-112 64z","p-id":"52918"}})])])};m_._withStripped=!0;const g_=bi({render:m_,staticRenderFns:[]},undefined,d_,"data-v-3dd4ef24",false,undefined,!1,void 0,void 0,void 0);const y_={name:"MapCompass",props:{tool:{type:Object,default:function(){return{}}}},inject:["mapP"],data:()=>({bearing:0}),mounted(){this.map=this.mapP(),this.bearing=this.map.getBearing(),this.map.on("rotate",this.seBearing)},methods:{setRotateZero(){this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.flyTo({center:this.map.getCenter(),bearing:0})},seBearing(){const t=this.map.getBearing();this.bearing=t>0?0-t:Math.abs(t)}},destroyed(){this.map.off("rotate",this.seBearing)}};var f_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item"},[i("div",{staticClass:"map-rotate",style:{transform:"scale(0.9) rotateZ("+t.bearing+"deg)"},on:{click:function(e){return e.stopPropagation(),t.setRotateZero.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1681277668637",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4652",width:"28",height:"28"}},[i("path",{attrs:{d:"M511.552 0l159.616 512.192-159.616 508.16L352 512.384 511.552 0zM512 448a64 64 0 1 0 0 128 64 64 0 0 0 0-128z",fill:"#B6CDFF","p-id":"4653"}}),t._v(" "),i("path",{attrs:{d:"M512 0l160 512H576a64 64 0 1 0-128 0H352L512 0z",fill:"#326EF0","p-id":"4654"}}),t._v(" "),i("path",{attrs:{d:"M751.872 192V58.368h1.024L844.288 192h29.184V9.216h-30.208v131.84h-1.024L751.872 9.216h-29.952V192z","p-id":"4655"}})])])])};f_._withStripped=!0;const __=bi({render:f_,staticRenderFns:[]},undefined,y_,"data-v-797a5367",false,undefined,!1,void 0,void 0,void 0);const v_={name:"MapZoomIn",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1}),inject:["mapP"],mounted(){this.map=this.mapP()},methods:{onClick(){this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.flyTo({center:this.map.getCenter(),zoom:this.map.getZoom()+1})}}};var x_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",attrs:{id:"MapZoomIn"},on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1681475278862",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11072",width:"22",height:"22"}},[i("path",{attrs:{d:"M469.333333 469.333333V170.666667h85.333334v298.666666h298.666666v85.333334h-298.666666v298.666666h-85.333334v-298.666666H170.666667v-85.333334h298.666666z","p-id":"11073"}})])])};x_._withStripped=!0;const C_=bi({render:x_,staticRenderFns:[]},undefined,v_,undefined,false,undefined,!1,void 0,void 0,void 0);const L_={name:"MapZoomOut",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1}),inject:["mapP"],mounted(){this.map=this.mapP()},methods:{onClick(){this.map.GLSDK.toolsOnClick(this.tool,!0),this.map.flyTo({center:this.map.getCenter(),zoom:this.map.getZoom()-1})}}};var M_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",attrs:{id:"MapZoomOut"},on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1681475423856",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"12126",width:"22",height:"22"}},[i("path",{attrs:{d:"M170.666667 469.333333h682.666666v85.333334H170.666667z","p-id":"12127"}})])])};M_._withStripped=!0;const b_=bi({render:M_,staticRenderFns:[]},undefined,L_,undefined,false,undefined,!1,void 0,void 0,void 0);const w_={name:"MapChangeView",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!0}),inject:["mapP"],mounted(){this.map=this.mapP(),this.active=!this.map.dragRotate._pitchWithRotate},methods:{onClick(){this.active=!this.active,this.map.GLSDK.toolsOnClick(this.tool,this.active),this.active?(this.map.setBearing(0),this.map.setPitch(45),this.map.dragRotate.enable(),this.map.touchZoomRotate.enableRotation(),this.map.GLSDK.setMap2ViewMode("3D")):(this.map.setBearing(0),this.map.setPitch(0),this.map.dragRotate.disable(),this.map.touchZoomRotate.disableRotation(),this.map.GLSDK.setMap2ViewMode("2D"))}}};var S_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",attrs:{id:"MapChangeView"},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[t.active?i("svg",{staticClass:"icon",attrs:{t:"1707029532833",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11268",width:"20",height:"20"}},[i("path",{attrs:{d:"M34.133 477.867c20.48 0 34.134 17.066 34.134 34.133 0 215.04 157.013 395.947 361.813 433.493l-75.093-88.746c-13.654-13.654-10.24-37.547 3.413-51.2 13.653-13.654 37.547-10.24 51.2 3.413l129.707 157.013c10.24 10.24 10.24 23.894 3.413 37.547-3.413 13.653-17.067 20.48-30.72 20.48C228.693 1024 0 795.307 0 512c0-20.48 17.067-34.133 34.133-34.133zM512 0c283.307 0 512 228.693 512 512 0 20.48-17.067 34.133-34.133 34.133S955.733 529.067 955.733 512c0-215.04-157.013-395.947-361.813-433.493l75.093 88.746c13.654 13.654 10.24 37.547-3.413 51.2-17.067 10.24-40.96 10.24-51.2-6.826L484.693 54.613c-10.24-10.24-10.24-23.893-3.413-37.546C484.693 6.827 498.347 0 512 0z","p-id":"11269"}}),t._v(" "),i("path",{attrs:{d:"M235.52 655.36c105.813-92.16 160.427-163.84 160.427-221.867 0-37.546-20.48-64.853-61.44-64.853-27.307 0-51.2 17.067-71.68 40.96l-30.72-30.72c30.72-34.133 61.44-54.613 109.226-54.613 64.854 0 109.227 44.373 109.227 109.226 0 68.267-54.613 139.947-129.707 215.04 17.067-3.413 40.96-3.413 58.027-3.413h88.747v47.787H235.52V655.36z m303.787-324.267h92.16c109.226 0 174.08 61.44 174.08 177.494 0 116.053-61.44 180.906-170.667 180.906h-95.573v-358.4z m88.746 310.614c78.507 0 119.467-44.374 119.467-133.12 0-88.747-40.96-133.12-119.467-133.12H593.92v266.24h34.133z","p-id":"11270"}})]):i("svg",{staticClass:"icon",attrs:{t:"1707032821856",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6223",width:"20",height:"20"}},[i("path",{attrs:{d:"M512 0q200.021333 0 347.008 134.997333t162.986667 333.013333l-64 0q-9.984-118.016-79.018667-214.016t-175.018667-146.005333l-57.984 56.021333-162.005333-162.005333zM706.005333 504.021333q0-114.005333-93.994667-114.005333l-40.021333 0 0 246.016 38.016 0q72.021333 0 91.989333-68.010667 4.010667-13.994667 4.010667-48l0-16zM612.010667 342.016q105.984 0 144 93.994667 9.984 24.021333 9.984 68.010667l0 16q0 75.989333-41.984 118.016-43.989333 43.989333-114.005333 43.989333l-98.005333 0 0-340.010667 100.010667 0zM413.994667 507.989333q56.021333 22.016 56.021333 77.994667 0 20.010667-9.984 40.021333-11.989333 24.021333-22.016 32-29.994667 24.021333-80 24.021333-48 0-77.994667-24.021333t-29.994667-70.016l54.016 0q0 22.016 15.018667 36.010667t38.997333 13.994667q56.021333 0 56.021333-54.016t-61.994667-54.016l-32 0 0-43.989333 32 0q57.984 0 57.984-50.005333t-52.010667-50.005333q-50.005333 0-50.005333 45.994667l-56.021333 0q0-34.005333 29.994667-64 32-25.984 75.989333-25.984 70.016 0 98.005333 54.016 8.021333 16 8.021333 40.021333 0 45.994667-50.005333 72.021333zM320 916.010667l57.984-56.021333 162.005333 162.005333-27.989333 2.005333q-200.021333 0-347.008-136.021333t-162.986667-333.994667l64 0q11.989333 120.021333 80 216.021333t173.994667 146.005333z","p-id":"6224"}})])])};S_._withStripped=!0;const I_=bi({render:S_,staticRenderFns:[]},undefined,w_,undefined,false,undefined,!1,void 0,void 0,void 0);var E_={name:"MapSpatial",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,childPanel:!0,activeDrawType:"",name:"MapSpatial"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.destory()}))},methods:{destory(){this.$emit("openTip",this.name),this.active=!1,this.closeDraw()},closeDraw(){this.activeDrawType="",this.map.GLSDK.mapClearDraw(),this.map.M.setCursorIQuery()},onClick(){this.active=!this.active,this.map.GLSDK.toolsOnClick(this.tool,this.active),this.active?this.$emit("activeCurrentTools",this):this.destory(),this.active&&this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.destory()}})},onClickDraw(t){this.activeDrawType=t,this.map.GLSDK.mapStartDraw({type:t,clear:!0},(t=>{this.closeDraw(),t&&this.map.M.iqueryManager.spatialIquery(t,(()=>{this.destory()}))}))}}};const T_=E_;var D_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active}},[i("svg",{staticClass:"icon",attrs:{t:"1693964920414",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"24355",width:"26",height:"26"},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("path",{attrs:{d:"M493.824 200.277333c-50.176 0-91.050667-40.874667-91.050667-91.050666S443.562667 18.090667 493.824 18.090667s91.050667 40.874667 91.050667 91.050666-40.874667 91.136-91.050667 91.136z m0-131.754666c-22.442667 0-40.618667 18.261333-40.618667 40.618666s18.261333 40.618667 40.618667 40.618667c22.442667 0 40.618667-18.261333 40.618667-40.618667s-18.261333-40.618667-40.618667-40.618666zM493.824 1005.909333c-50.176 0-91.050667-40.874667-91.050667-91.050666 0-50.261333 40.874667-91.050667 91.050667-91.050667s91.050667 40.874667 91.050667 91.050667-40.874667 91.050667-91.050667 91.050666z m0-131.754666c-22.442667 0-40.618667 18.261333-40.618667 40.618666 0 22.442667 18.261333 40.618667 40.618667 40.618667 22.442667 0 40.618667-18.261333 40.618667-40.618667 0-22.357333-18.261333-40.618667-40.618667-40.618666zM98.730667 576.085333C48.554667 576.085333 7.68 535.210667 7.68 485.034667s40.874667-91.050667 91.050667-91.050667 91.050667 40.874667 91.050666 91.050667-40.874667 91.050667-91.050666 91.050666z m0-131.754666c-22.442667 0-40.618667 18.261333-40.618667 40.618666 0 22.442667 18.261333 40.618667 40.618667 40.618667s40.618667-18.261333 40.618666-40.618667c0-22.357333-18.261333-40.618667-40.618666-40.618666z","p-id":"24356"}}),t._v(" "),i("path",{attrs:{d:"M114.423467 550.903467l39.6544-31.163734 295.168 375.611734-39.6544 31.163733zM170.752 453.717333l-35.669333-35.669333c49.664-49.664 123.818667-123.733333 185.6-185.429333 30.890667-30.805333 58.709333-58.538667 78.848-78.506667 10.069333-9.984 18.261333-18.090667 23.893333-23.637333 9.301333-9.130667 26.538667 9.386667 26.538667 9.386666l16.810666 18.773334c-3.84 3.498667-47.36 46.506667-296.021333 295.082666zM576.426667 926.464l-39.68-31.146667c3.157333-4.096 6.997333-8.618667 11.349333-13.738666l38.4 32.682666c-3.925333 4.608-7.253333 8.618667-10.069333 12.202667zM608 889.941333l-37.290667-33.962666c6.997333-7.68 14.762667-16.042667 22.954667-24.832l36.778667 34.56c-8.021333 8.533333-15.530667 16.725333-22.442667 24.234666z m45.397333-48.384l-36.437333-34.901333c7.509333-7.850667 15.274667-15.957333 23.296-24.234667l36.181333 35.072-23.04 24.064zM699.733333 793.685333l-36.010666-35.242666c7.68-7.850667 15.530667-15.872 23.552-23.978667l35.925333 35.413333c-8.021333 8.021333-15.786667 15.957333-23.466667 23.808z m46.848-47.530666l-35.754666-35.498667c7.850667-7.936 15.701333-15.872 23.637333-23.722667l35.669333 35.669334c-7.850667 7.765333-15.701333 15.701333-23.552 23.552z m47.189334-47.274667l-35.584-35.754667 23.722666-23.637333 35.498667 35.754667-23.637333 23.637333z m47.445333-47.104l-35.498667-35.84 23.808-23.552 35.413334 35.925333-23.722667 23.466667z m47.616-46.933333l-35.328-36.010667 23.893333-23.466667 35.328 36.010667-23.893333 23.466667z m47.701333-46.762667l-35.242666-36.096 23.978666-23.381333 35.157334 36.181333-23.893334 23.296zM983.978667 511.744l-16.213334-16.64-11.776-12.117333 10.752-13.141334 14.762667-18.005333 34.901333 28.586667zM922.112 468.48l-27.477333-22.442667 31.914666-38.997333 27.477334 22.442667-31.914667 38.997333z m-54.869333-44.885333L839.850667 401.066667l31.914666-38.997334 27.392 22.442667-31.914666 39.082667z m-54.869334-44.970667l-27.392-22.442667 31.914667-39.082666 27.477333 22.442666-32 39.082667z m-54.869333-44.885333l-27.477333-22.442667 31.914666-39.082667 27.477334 22.442667-31.914667 39.082667z m-54.954667-44.885334l-27.477333-22.442666 31.914667-39.082667 27.477333 22.442667-31.914667 39.082666z m-54.869333-44.885333l-27.477333-22.442667 31.914666-39.082666 27.477334 22.442666-31.914667 39.082667z m-54.954667-44.8l-27.477333-22.442667 31.829333-39.082666 27.477334 22.442666-31.829334 39.082667z","p-id":"24357"}}),t._v(" "),i("path",{attrs:{d:"M492.629333 671.658667l-12.970666-15.872c-14.08-17.237333-137.898667-170.24-137.898667-248.064 0-83.2 67.669333-150.869333 150.869333-150.869334s150.869333 67.669333 150.869334 150.869334c0 77.824-123.733333 230.826667-137.898667 248.064l-12.970667 15.872z m0-381.098667c-64.682667 0-117.248 52.565333-117.248 117.248 0 49.92 75.52 156.928 117.248 210.432 41.728-53.504 117.248-160.512 117.248-210.432 0-64.682667-52.650667-117.248-117.248-117.248z","p-id":"24358"}}),t._v(" "),i("path",{attrs:{d:"M619.605333 592.896c83.712 8.106667 104.618667 62.464 17.408 94.037333-90.88 31.146667-215.722667 31.658667-305.152-4.864-59.562667-25.173333-58.368-71.082667 6.912-86.528 12.458667-3.157333 25.088-5.034667 37.717334-5.888-21.845333 8.704-47.274667 17.749333-63.317334 34.304-3.498667 3.84-5.717333 8.021333-5.376 10.752 3.157333 12.629333 20.650667 17.834667 33.621334 22.954667 45.482667 13.909333 95.317333 17.408 143.104 18.176 56.32 2.474667 298.325333-15.445333 135.082666-82.944z","p-id":"24359"}}),t._v(" "),i("path",{attrs:{d:"M492.629333 392.789333m-26.368 0a26.368 26.368 0 1 0 52.736 0 26.368 26.368 0 1 0-52.736 0Z","p-id":"24360"}})]),t._v(" "),i("transition",{attrs:{name:"el-zoom-in-top"}},[t.active?i("div",{staticClass:"mx-map-tools-child"},[i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"圆形",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",class:{active:"map_draw_circle"==t.activeDrawType},on:{click:function(e){return e.stopPropagation(),t.onClickDraw("map_draw_circle")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686212080974",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"36459",width:"24",height:"24"}},[i("path",{attrs:{d:"M512.000512 512m-81.864496 0a81.864496 81.864496 0 1 0 163.728992 0 81.864496 81.864496 0 1 0-163.728992 0Z","p-id":"36460"}}),t._v(" "),i("path",{attrs:{d:"M925.251464 337.411683c-22.590508-53.410444-54.926984-101.373829-96.108919-142.555763s-89.144296-73.517387-142.555763-96.107895c-55.311747-23.394826-114.050546-35.256992-174.587294-35.256992s-119.27657 11.862165-174.587293 35.256992c-53.411467 22.590508-101.373829 54.92596-142.556787 96.107895-41.181935 41.181935-73.517387 89.145319-96.107895 142.555763-23.394826 55.310723-35.256992 114.051569-35.256992 174.588317s11.862165 119.27657 35.256992 174.587294c22.591531 53.410444 54.926984 101.373829 96.107895 142.556786 41.182958 41.181935 89.145319 73.518411 142.556787 96.108918 55.310723 23.394826 114.050546 35.256992 174.587293 35.256992s119.27657-11.862165 174.587294-35.256992c53.410444-22.590508 101.372805-54.926984 142.555763-96.108918s73.518411-89.145319 96.108919-142.556786c23.394826-55.310723 35.256992-114.050546 35.256991-174.587294 0-60.537771-11.862165-119.277594-35.256991-174.588317zM511.999488 909.343657c-219.095997 0-397.343657-178.24766-397.343657-397.343657S292.903491 114.656343 511.999488 114.656343 909.343145 292.904003 909.343145 512 731.095485 909.343657 511.999488 909.343657z","p-id":"36461"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"多边形",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",class:{active:"map_draw_polygon"==t.activeDrawType},on:{click:function(e){return e.stopPropagation(),t.onClickDraw("map_draw_polygon")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686209935389",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"29372",width:"24",height:"24"}},[i("path",{attrs:{d:"M792 826H232c-13.28 0-24-10.72-24-24V490.48c0-6.16 2.4-12.16 6.64-16.64l242.24-252.48c4.72-4.88 11.2-7.6 18.08-7.36 6.8 0.24 13.2 3.28 17.6 8.48l317.76 376.72c3.68 4.32 5.68 9.84 5.68 15.44v187.36c0 13.28-10.72 24-24 24z m-536-48h512V623.44l-294.96-349.6L256 500.16v277.84z","p-id":"29373"}})])])]),t._v(" "),i("el-tooltip",{staticClass:"item",attrs:{effect:"light",content:"矩形",placement:"top"}},[i("div",{staticClass:"mx-map-tools-item",class:{active:"map_draw_rectangle"==t.activeDrawType},on:{click:function(e){return e.stopPropagation(),t.onClickDraw("map_draw_rectangle")}}},[i("svg",{staticClass:"icon",attrs:{t:"1686212503737",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"40288",width:"24",height:"24"}},[i("path",{attrs:{d:"M876.4664713541666 302.9680989583333H776.4029947916665V202.90462239583334c0-11.865234374999998-9.8876953125-21.7529296875-21.7529296875-21.7529296875s-21.7529296875 9.8876953125-21.7529296875 21.7529296875v100.0634765625H632.8336588541666c-11.865234374999998 0-21.7529296875 9.8876953125-21.7529296875 21.7529296875s9.8876953125 21.7529296875 21.7529296875 21.7529296875h100.0634765625v100.0634765625c0 11.865234374999998 9.8876953125 21.7529296875 21.7529296875 21.7529296875s21.7529296875-9.8876953125 21.7529296875-21.7529296875V346.4739583333333H876.4664713541666c11.865234374999998 0 21.7529296875-9.8876953125 21.7529296875-21.7529296875 0-12.2607421875-9.8876953125-21.7529296875-21.7529296875-21.7529296875zM146.75455729166666 386.0247395833333c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625h0.7910156249999999v-21.7529296875h36.38671875c10.678710937499998 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-9.0966796875-19.775390625-19.775390625-19.775390625l-56.953125-0.39550781249999994c-11.07421875 0-19.775390625 8.701171874999998-19.775390625 19.775390625v42.71484374999999c0 9.8876953125 8.701171874999998 18.984374999999996 19.775390625 18.984374999999996z m135.26367187500003-41.92382812499999h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-8.701171874999998-19.775390625-19.775390625-19.775390625h-98.876953125c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625 0 11.07421875 9.0966796875 19.775390625 19.775390625 19.775390625z m177.1875 0h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625s-8.701171874999998-19.775390625-19.775390625-19.775390625h-98.876953125c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625 0.7910156249999999 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625zM774.8209635416665 560.8391927083335c0-11.07421875-8.701171874999998-19.775390625-19.775390625-19.775390625s-19.775390625 8.701171874999998-19.775390625 19.775390625v98.876953125c0 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625s19.775390625-8.701171874999998 19.775390625-19.775390625v-98.876953125z m-19.775390625 157.41210937500003c-11.07421875 0-19.775390625 9.0966796875-19.775390625 19.775390625v64.072265625h-79.1015625v1.1865234374999998c-11.07421875 0-19.775390625 8.701171874999998-19.775390625 19.775390625s8.701171874999998 19.775390625 19.775390625 19.775390625h98.876953125c11.07421875 0 19.775390625-8.701171874999998 19.775390625-19.775390625V738.8177083333334c0-11.865234374999998-9.0966796875-20.56640625-19.775390625-20.56640625zM581.0221354166666 802.0989583333333L166.52994791666666 801.3079427083333V423.2024739583333h-0.7910156249999999c0-11.07421875-8.701171874999998-19.775390625-19.775390625-19.775390625s-19.775390625 8.701171874999998-19.775390625 19.775390625V821.8743489583334c0 11.07421875 8.701171874999998 19.775390625 19.775390625 19.775390625H579.8356119791666c11.07421875 0 19.775390625-9.0966796875 19.775390625-19.775390625 0-11.07421875-9.0966796875-19.775390625-18.5888671875-19.775390625z","p-id":"40289"}})])])])],1):t._e()])],1)};D_._withStripped=!0;const P_=bi({render:D_,staticRenderFns:[]},undefined,T_,undefined,false,undefined,!1,void 0,void 0,void 0);const O_={name:"MapSelfTools",props:["tool"],data:()=>({active:!1,srcImage:null}),inject:["mapP"],mounted(){this.srcImage=this.tool.mapToolIconUrl,this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.active&&(this.map.M.pubsub.publish("MapSelfToolsClose",this.tool),this.active=!1)}))},methods:{onClick(){if(this.active)return this.map.M.pubsub.publish("MapSelfToolsClose",this.tool),this.active=!1,void this.map.GLSDK.toolsOnClick(this.tool,!1);this.map.M.pubsub.publish("MapSelfToolsOpen",this.tool),this.active=!0,this.map.GLSDK.toolsOnClick(this.tool,!0)}}};var k_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("img",{attrs:{src:t.srcImage}})])};k_._withStripped=!0;const N_=bi({render:k_,staticRenderFns:[]},undefined,O_,undefined,false,undefined,!1,void 0,void 0,void 0);var A_={name:"MapImageCompare",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,plugin:null,mapImageComparePid:"",pluginOptions:{}}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.remove()})),"object"==typeof this.MapTools&&(this.mapImageComparePid=this.MapTools.mapImageComparePid,this.pluginOptions="object"==typeof this.MapTools.mapImageCompare?this.MapTools.mapImageCompare:{})},methods:{onClick(){if(this.active)return this.remove(),void this.map.GLSDK.toolsOnClick(this.tool,!1);this.map.GLSDK.toolsOnClick(this.tool,!0);let t=Object.assign({layerTreeId:this.mapImageComparePid},this.pluginOptions);"compare-opacity"===this.pluginOptions.mode?this.plugin=new Uf(t):this.plugin=new Vf(t),this.plugin.addTo(this.map),this.plugin.closeCallback=()=>{this.closeCallback()},this.active=!0},remove(){this.plugin&&(this.plugin.destory(),this.plugin=null),this.active=!1},closeCallback(){this.active=!1}}};const R_=A_;var F_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1725599955184",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"10374",width:"20",height:"20"}},[i("path",{attrs:{d:"M876.09 152.32l-1.96-1.96C781.55 57.55 653.77 0.54 512.85 0h-1.68C371.34 0.54 244.41 56.72 152.12 147.57l-2.22 2.79C57.07 242.57 0 370.59 0 511.97c0 141.43 57.06 269.43 149.9 362.24 92.84 92.21 220.33 149.51 361.28 149.79h1.68c140.92-0.28 268.7-57.58 361.28-149.79 92.84-92.81 149.87-220.8 149.87-362.24-0.01-140.27-55.94-267.15-147.92-359.65zM472.31 943.49c-103.75-9.49-197.13-55.33-266.76-125.2h-0.31 0.31C127.53 740.05 78.59 631.61 78.59 511.97c0-119.58 48.93-227.48 126.95-306.29l1.94-1.65C276.83 135.27 369.69 89.97 472.31 80.48v863.01z m79.13-863.01c19 2.24 38.02 4.75 56.21 8.95l-56.21 56.44V80.48z m0 132.2l107.93-108.16c16.8 6.16 33.01 13.13 48.37 21.23l-156.3 156.52v-69.59z m0 136.09l199.09-198.41c13.99 8.92 26.87 19.01 39.44 29.64L551.44 418.67v-69.9z m0 136.95L824.91 212.14c11.46 12.02 22.38 24.27 32.16 37.71L551.44 555.03v-69.31z m0 136.08l332.21-332.26c9.5 14.52 17.32 29.9 24.05 45.81L551.44 691.43V621.8z m0 136.13l374.7-373.92c5.57 17.88 10.09 36.89 13.42 55.9L551.44 827.78v-69.85z m266.79 60.36c-42.82 43.05-95.11 77.15-153.25 98.92l252.49-252.07c-21.79 57.84-55.93 110.12-99.24 153.15zM575.21 940.71c-7.82 1.11-15.92 1.96-23.77 2.79v-48.62l393.72-393.79v10.89c0 21.54-1.42 42.51-4.46 63.17L575.21 940.71z","p-id":"10375"}})])])};F_._withStripped=!0;const B_=bi({render:F_,staticRenderFns:[]},undefined,R_,undefined,false,undefined,!1,void 0,void 0,void 0);const G_={name:"MapDataExport",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:()=>({})}},inject:["mapP"],data(){return{dataExport:{title:this.tool.mapToolName,crs:""}}},mounted(){if(this.map=this.mapP(),"object"==typeof this.MapTools){var t=void 0!==this.MapTools.dataExport?this.MapTools.dataExport:{};Object.assign(this.dataExport,t)}},methods:{onClick(){new qf(this.dataExport).addTo(this.map),this.map.GLSDK.toolsOnClick(this.tool,!0)}}};var z_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1726819447346",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1493",width:"24",height:"24"}},[i("path",{attrs:{d:"M512 640.64a42.666667 42.666667 0 0 0 42.666667-42.666667v-341.333333h130.986666a21.333333 21.333333 0 0 0 14.250667-5.461333l2.688-2.901334a21.333333 21.333333 0 0 0-4.010667-29.909333l-165.717333-126.464a32 32 0 0 0-38.912 0.042667L329.472 218.453333a21.333333 21.333333 0 0 0 12.970667 38.229334H469.333333v341.333333a42.666667 42.666667 0 0 0 42.666667 42.666667z m229.674667-298.368a42.666667 42.666667 0 0 0 4.992 85.034667H853.333333v426.666666H170.666667v-426.666666h106.666666a42.666667 42.666667 0 0 0 0-85.333334H170.666667a85.333333 85.333333 0 0 0-85.333334 85.333334v426.666666a85.333333 85.333333 0 0 0 85.333334 85.333334h682.666666a85.333333 85.333333 0 0 0 85.333334-85.333334v-426.666666a85.333333 85.333333 0 0 0-85.333334-85.333334h-106.666666z","p-id":"1494"}})])])};z_._withStripped=!0;const j_=bi({render:z_,staticRenderFns:[]},undefined,G_,undefined,false,undefined,!1,void 0,void 0,void 0);const U_={name:"MapLocationTool",props:{tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,activeTools:""}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.remove()}))},methods:{onClick(){this.map.GLSDK.toolsOnClick(this.tool,!0),this.activeTools&&this.active&&(this.activeTools.destory(),this.active=!1),this.activeTools=new Hf({domid:"map-locationtool-container"}),this.activeTools=this.activeTools.addTo(this.map),this.active=!0},remove(){this.activeTools&&this.activeTools.destory()}}};var V_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1701134563569",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4376",width:"22",height:"22"}},[i("path",{attrs:{d:"M896 544v256a96 96 0 0 1-96 96h-256v96h-64v-96H224a96 96 0 0 1-96-96v-256H32v-64h96V224a96 96 0 0 1 96-96h256V32h64v96h256a96 96 0 0 1 96 96v256h96v64h-96z m-64 0h-96v-64h96V224a32 32 0 0 0-32-32h-256v96h-64V192H224a32 32 0 0 0-32 32v256h96v64H192v256a32 32 0 0 0 32 32h256v-96h64v96h256a32 32 0 0 0 32-32v-256z","p-id":"4377"}})])])};V_._withStripped=!0;const q_=bi({render:V_,staticRenderFns:[]},undefined,U_,undefined,false,undefined,!1,void 0,void 0,void 0);const H_={name:"MapPickArea",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,plugin:null,pickArea:{},name:"MapPickArea"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.remove()})),"object"==typeof this.MapTools&&(this.pickArea=this.MapTools.pickArea||{})},methods:{onClick(){if(this.active)return this.remove(),void this.map.GLSDK.toolsOnClick(this.tool,!1);this.map.GLSDK.toolsOnClick(this.tool,!0),this.plugin=new $f(this.pickArea),this.plugin.addTo(this.map),this.plugin.closeCallback=()=>{this.closeCallback()},this.active=!0,this.active&&this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.remove()}})},remove(){this.plugin&&(this.plugin.destory(),this.plugin=null),this.active=!1},closeCallback(){this.active=!1}}};var $_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},on:{click:function(e){return e.preventDefault(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1733793559434",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11413",id:"mx_n_1733793559435",width:"24",height:"24"}},[i("path",{attrs:{d:"M341.504 674.304h49.152c13.824 0 24.064-11.264 24.064-24.064v-122.368c0-13.824-11.264-24.064-24.064-24.064h-49.152c-13.824 0-24.064 11.264-24.064 24.064V650.24c-0.512 13.312 10.24 24.064 24.064 24.064m146.944 0h49.152c13.824 0 24.064-11.264 24.064-24.064V355.84c0-13.824-11.264-24.064-24.064-24.064h-49.152c-13.824 0-24.064 11.264-24.064 24.064V650.24c-0.512 13.312 10.24 24.064 24.064 24.064m146.944 0h49.152c13.824 0 24.064-11.264 24.064-24.064V454.144c0-13.824-11.264-24.064-24.064-24.064h-49.152c-13.824 0-24.064 11.264-24.064 24.064V650.24c-0.512 13.312 10.752 24.064 24.064 24.064m110.592 46.592H280.576c-6.656 0-12.288 5.632-12.288 12.288 0 6.656 5.632 12.288 12.288 12.288h465.92c6.656 0 12.288-5.632 12.288-12.288 0-7.168-5.632-12.288-12.8-12.288m103.424 109.056c-11.776-10.24-29.184-9.216-39.936 2.048-79.872 87.552-188.416 135.68-305.152 135.68-112.128 0-217.6-45.056-297.472-126.976-1.536-1.536-3.072-2.56-5.632-4.096-4.608-2.56-9.216-4.096-14.848-4.096-7.68 0-14.848 3.072-19.968 8.704-9.728 10.24-10.24 27.136-0.512 37.888C256.512 972.8 376.32 1024 504.32 1024c65.536 0 129.536-13.824 188.928-40.448s112.64-65.024 157.184-113.664c5.632-5.632 8.192-12.8 7.68-20.48v-0.512c0-6.656-3.584-13.824-8.704-18.944zM702.464 152.064c26.624 14.336 51.2 30.72 73.728 50.176C849.92 265.216 901.12 351.744 920.064 450.048c1.536 7.68 6.656 13.824 13.312 17.408 4.608 2.56 8.704 4.096 13.824 4.096 1.536 0 3.072 0 5.12-0.512h1.536c5.12-1.024 9.728-4.096 13.312-7.68 6.656-6.144 9.728-14.848 8.704-24.064-14.336-71.168-44.032-139.264-86.528-197.632-43.008-58.368-98.304-106.496-160.768-140.288-14.336-6.656-30.72 0-37.376 14.336-4.096 8.192-3.072 16.896 1.024 24.576 2.048 4.608 5.632 9.216 10.24 11.776z m-193.024 24.576c47.616 0 86.016-39.936 86.016-88.064 0-23.552-8.704-45.568-25.6-62.464-16.384-16.384-37.888-26.112-61.44-26.112-23.04 0-44.544 8.704-61.44 26.112-16.384 16.384-25.6 38.4-25.6 62.464 1.536 48.128 39.936 88.064 88.064 88.064z m0-38.4c-27.136 0-48.64-22.528-48.64-50.688s22.016-50.688 48.64-50.688c27.136 0 48.64 22.528 48.64 50.688s-22.016 50.688-48.64 50.688z m-322.56 509.44c0-49.664-39.936-90.112-88.064-90.112S10.24 598.528 10.24 647.68c0 49.664 39.936 90.112 88.064 90.112s88.576-40.448 88.576-90.112z m-88.064-52.224c28.16 0 50.688 23.04 50.688 52.224 0 14.336-5.632 28.16-15.36 37.888-8.704 8.704-21.504 14.336-34.304 14.336h-0.512c-28.16 0-50.688-23.552-50.688-52.224-0.512-29.184 22.016-52.224 50.176-52.224z m-33.792-127.488c1.536 0.512 4.096 0.512 5.632 0.512 5.632 0 11.264-1.536 15.36-4.608 6.656-4.608 10.24-11.264 12.288-18.432 25.6-124.416 106.496-234.496 217.6-293.888 12.8-8.192 16.896-25.6 9.216-38.912-6.144-9.216-15.872-13.824-26.624-13.312-3.072 0-6.656 1.024-9.728 2.56C189.44 155.648 113.152 241.664 70.656 345.088 58.368 374.272 49.152 403.968 42.496 435.2c-1.536 7.168 0 14.848 4.608 20.992 4.096 6.656 10.752 10.24 17.92 11.776z m862.72 91.648c-47.616 0-86.016 38.912-86.016 88.064s38.4 88.064 86.016 88.064 86.016-38.912 86.016-88.064c0-48.64-38.912-88.064-86.016-88.064z m0 139.264c-27.648 0-49.152-23.04-49.152-51.2s22.016-51.2 49.152-51.2 49.152 23.04 49.152 51.2c-0.512 27.648-22.016 51.2-49.152 51.2z","p-id":"11414"}})])])};$_._withStripped=!0;const W_=bi({render:$_,staticRenderFns:[]},undefined,H_,undefined,false,undefined,!1,void 0,void 0,void 0);const K_={name:"SightLineAnalysis",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,config:{},name:"SightLineAnalysis"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.remove()})),"object"==typeof this.MapTools&&(this.config=this.MapTools.sightLineAnalysis||{})},methods:{onClick(){if(this.active)return this.remove(),void this.map.GLSDK.toolsOnClick(this.tool,!1);this.map.GLSDK.toolsOnClick(this.tool,!0),this.plugin=new ef(this.config),this.plugin.addTo(this.map),this.plugin.closeCallback=()=>{this.closeCallback()},this.active=!0,this.active&&this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.remove()}})},remove(){this.plugin&&(this.plugin.destory(),this.plugin=null),this.active=!1},closeCallback(){this.active=!1}}};var Y_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},attrs:{id:"SightLineAnalysis"},on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1746684075476",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3912",width:"22",height:"22"}},[i("path",{attrs:{d:"M0 512m25.6 0l140.8 0q25.6 0 25.6 25.6l0 140.8q0 25.6-25.6 25.6l-140.8 0q-25.6 0-25.6-25.6l0-140.8q0-25.6 25.6-25.6Z","p-id":"3913"}}),t._v(" "),i("path",{attrs:{d:"M832 832m25.6 0l140.8 0q25.6 0 25.6 25.6l0 140.8q0 25.6-25.6 25.6l-140.8 0q-25.6 0-25.6-25.6l0-140.8q0-25.6 25.6-25.6Z","p-id":"3914"}}),t._v(" "),i("path",{attrs:{d:"M113.664 604.672l28.608-57.216 768.192 384.192-28.608 57.216zM576 640c-115.84 0-221.44-73.6-312.96-217.6a43.52 43.52 0 0 1 0-48C354.56 227.84 460.16 154.88 576 154.88s221.44 72.96 312.96 217.6a43.52 43.52 0 0 1 0 48C797.44 564.48 691.84 640 576 640z m0-426.24c-91.52 0-177.92 60.16-256 179.2v3.2C398.08 518.4 484.48 576 576 576s177.92-60.16 256-179.2v-3.2c-78.08-119.68-164.48-179.84-256-179.84z m0 260.48a78.08 78.08 0 1 1 78.08-78.08A78.08 78.08 0 0 1 576 474.24z","p-id":"3915"}})])])};Y_._withStripped=!0;const J_=bi({render:Y_,staticRenderFns:[]},undefined,K_,undefined,false,undefined,!1,void 0,void 0,void 0);const X_={name:"CubeSectionAnalysis",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,config:{},name:"CubeSectionAnalysis"}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.remove()})),"object"==typeof this.MapTools&&(this.config=this.MapTools.cubeSectionAnalysis||{})},methods:{onClick(){if(this.active)return this.remove(),void this.map.GLSDK.toolsOnClick(this.tool,!1);this.map.GLSDK.toolsOnClick(this.tool,!0),this.plugin=new of(this.config),this.plugin.addTo(this.map),this.plugin.closeCallback=()=>{this.closeCallback()},this.active=!0,this.active&&this.map.GLSDK.mapActiveTools({name:this.name,close:()=>{this.remove()}})},remove(){this.plugin&&(this.plugin.destory(),this.plugin=null),this.active=!1},closeCallback(){this.active=!1}}};var Q_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},attrs:{id:"CubeSectionAnalysis"},on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1746693649180",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"24374",width:"24",height:"24"}},[i("path",{attrs:{d:"M509.7472 1.9712v199.16288l270.40256 156.36992v309.83168l-205.056 118.58944-233.64608 136.69376 170.83392 98.7904 440.08448-254.49984V257.93536L509.74208 1.9712z m15.36 26.624l411.89888 238.19776v491.25376l-424.72448 245.61664-140.28288-81.1264 210.816-123.3408 212.68992-122.99776V348.6464L525.1072 192.26624V28.5952z","p-id":"24375"}}),t._v(" "),i("path",{attrs:{d:"M513.30048 201.13408V1.97632L70.33344 257.93536v511.90784l172.3392-99.584 0.00512-312.75008 270.62272-156.37504zM497.9456 28.58496v163.68128L227.31776 348.6464v312.74496l-141.6192 81.83296V266.79808L497.9456 28.58496z","p-id":"24376"}}),t._v(" "),i("path",{attrs:{d:"M784.33792 357.25312L509.44 197.44256 234.54208 357.25312 509.44 517.0688l274.89792-159.81056zM509.44 215.20896l244.34176 142.04416L509.44 499.29216 265.10336 357.25312 509.44 215.20896z","p-id":"24377"}}),t._v(" "),i("path",{attrs:{d:"M784.37376 669.1328v-319.488L509.21984 509.4144l-3.79904 321.6896 278.95296-161.97632zM769.024 376.32v283.96544l-247.92064 143.95392 3.3792-285.9264L769.01888 376.32z","p-id":"24378"}}),t._v(" "),i("path",{attrs:{d:"M238.32064 349.63456v319.72864l271.28832 157.7472 3.74784-317.55776-275.03616-159.91808z m15.36512 26.7008l244.20864 141.98784-3.33312 282.2656-240.87552-140.06272V376.33536z","p-id":"24379"}}),t._v(" "),i("path",{attrs:{d:"M517.09952 826.1888l-275.06176-158.75584L70.28736 766.5664l276.05504 159.32928 170.75712-99.70688zM242.04288 685.1584l244.46464 141.09696-140.20608 81.87392L101.0176 766.56128l141.02528-81.39776z","p-id":"24380"}}),t._v(" "),i("path",{attrs:{d:"M254.94016 357.25312L514.56 206.336l259.61984 150.92224L514.56 508.18048zM251.12064 664.94464V362.98752l259.61984 150.95296-3.5328 299.90912zM90.76736 766.5664l156.3904-90.2656 259.76832 149.92384-155.48416 90.78784z",opacity:".496","p-id":"24381"}})])])};Q_._withStripped=!0;const Z_=bi({render:Q_,staticRenderFns:[]},undefined,X_,undefined,false,undefined,!1,void 0,void 0,void 0);const tv={name:"MapRoamingPlugin",props:{MapTools:{type:[Boolean,Object],default:()=>!0},tool:{type:Object,default:function(){return{}}}},data:()=>({active:!1,config:{}}),inject:["mapP"],mounted(){this.map=this.mapP(),this.map.M.pubsub.subscribe("clear",(()=>{this.remove()})),"object"==typeof this.MapTools&&(this.config=this.MapTools.mapRoaming||{})},methods:{onClick(){if(this.active)return this.remove(),void this.map.GLSDK.toolsOnClick(this.tool,!1);this.map.GLSDK.toolsOnClick(this.tool,!0),this.plugin=new Jf(this.config),this.plugin.addTo(this.map),this.plugin.closeCallback=()=>{this.closeCallback()},this.active=!0},remove(){this.plugin&&(this.plugin.destory(),this.plugin=null),this.active=!1},closeCallback(){this.active=!1}}};var ev=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-tools-item",class:{active:t.active},attrs:{id:"MapRoaming"},on:{click:function(e){return e.stopPropagation(),t.onClick.apply(null,arguments)}}},[i("svg",{staticClass:"icon",attrs:{t:"1746780430115",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11855",width:"24",height:"24"}},[i("path",{attrs:{d:"M100.445091 688.081455c-87.738182-68.794182-98.304 0-98.304 0a271.080727 271.080727 0 0 0 61.207273 89.367272l107.054545-44.171636a784.989091 784.989091 0 0 1-69.957818-45.195636z","p-id":"11856"}}),t._v(" "),i("path",{attrs:{d:"M1018.368 592.896c-30.673455-71.633455-163.886545-31.744-163.886545-31.744l-196.701091 63.488a88.808727 88.808727 0 0 1-65.582546 0c-45.056-34.443636-295.051636-222.068364-295.051636-222.068364-138.193455-30.254545-98.304 31.744-98.304 31.744l196.747636 285.556364-131.165091 31.837091a96.349091 96.349091 0 0 1-63.488 1.675636l-115.386182 46.964364a234.682182 234.682182 0 0 0 244.456728 78.196364s507.345455-143.918545 557.335272-158.673455 163.281455-51.898182 131.025455-126.976z","p-id":"11857"}}),t._v(" "),i("path",{attrs:{d:"M490.263273 434.874182h89.879272a20.712727 20.712727 0 0 0 17.408-15.825455l42.309819-170.496 70.609454 304.314182a20.107636 20.107636 0 0 0 38.586182-1.489454l52.130909-184.73891 28.904727 59.019637a20.154182 20.154182 0 0 0 16.849455 9.309091h89.693091a21.922909 21.922909 0 0 0 21.922909-21.922909 20.759273 20.759273 0 0 0-20.712727-20.759273h-78.522182l-46.545455-94.999273a20.061091 20.061091 0 0 0-36.445091 5.864727l-45.149091 159.930182-71.866181-309.853091a20.107636 20.107636 0 0 0-38.772364 2.234182L561.803636 392.238545h-72.005818a19.921455 19.921455 0 0 0-19.921454 19.968v2.234182a20.48 20.48 0 0 0 20.386909 20.433455z","p-id":"11858"}})])])};ev._withStripped=!0;const iv=bi({render:ev,staticRenderFns:[]},undefined,tv,undefined,false,undefined,!1,void 0,void 0,void 0);const sv={name:"MapCard",props:{title:{type:String,default:"窗口"}},methods:{close(){this.$emit("close")}}};var av=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"mx-map-card"},[i("div",{staticClass:"mx-map-header"},[i("span",[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),i("div",{staticClass:"mx-close"},[i("i",{staticClass:"el-icon-close",on:{click:t.close}})])]),t._v(" "),i("div",{staticClass:"mx-map-content"},[t._t("content")],2)])};av._withStripped=!0;const nv=bi({render:av,staticRenderFns:[]},undefined,sv,"data-v-ac1bdf5a",false,undefined,!1,void 0,void 0,void 0);window.jqueryMap=R.default,w.default.use(S.default,{locale:$,size:"small"}),w.default.use((function t(e){t.installed||(e.component("MapSwitch",Pi),e.component("LayerManager",If),e.component("MapViewer",s_),e.component("MapViewport",Bg),e.component("MapTools",ly),e.component("MapSearch",iy),e.component("MapCoordinate",Jg),e.component("TFullScreen",py),e.component("TResetView",my),e.component("TIQuery",fy),e.component("TMapSyncMove",o_),e.component("TMapSyncMoveSplit",h_),e.component("TImportFilesToMap",u_),e.component("TMeasureLocation",Sy),e.component("TMeasureLength",Ly),e.component("TMeasureArea",Dy),e.component("TMapPrint",ky),e.component("TMapWebPrint",g_),e.component("TMapCompass",__),e.component("TMapZoomIn",C_),e.component("TMapZoomOut",b_),e.component("TClear",Ry),e.component("TMapSpatial",P_),e.component("TMapSelfTools",N_),e.component("MapWaterMark",Zu),e.component("TMapChangeView",I_),e.component("TMapImageCompare",B_),e.component("TMapDataExport",j_),e.component("TMapLocationTool",q_),e.component("TMapOpacity",Gy),e.component("TMapPickArea",W_),e.component("TLocationQuery",Uy),e.component("TMeasure3DArea",$y),e.component("TMeasure3DLength",Jy),e.component("TLinearExtrudeAnalysis",df),e.component("TSightLineAnalysis",J_),e.component("TCubeSectionAnalysis",Z_),e.component("TMapRoaming",iv),e.component("MxMapCard",nv))})),w.default.component("mx-vue-drag-resize",G.default),window.$MapEventBus=new w.default,w.default.config.productionTip=!1,window.globalThis||(window.globalThis=window);var ov="sipsgmedo-mapmost-onemap-x",rv="wangs <744637066@qq.com>",lv="3.5.0-beta1",hv="基于Mapmost的地图应用组件";Zu.install=t=>{t.component(Zu.name,Zu)},pg.install=t=>{t.component(pg.name,pg)};var cv={name:"DmfxSpatialResult",props:{isHover:{type:Boolean,default:!0},area:{type:Array,default:function(){return[650,250]}},data:{type:Array,default:function(){return[]}},categoryStyle:{type:Array,default:function(){return[{label:"雨水",value:"雨水",color:"#5697FF"},{label:"污水",value:"污水",color:"#8B7258"}]}},offsetValue:{type:Number,default:1},xWidth:{type:Number,default:560},yHeight:{type:Number,default:240},renderColor:{type:Object,default:{}}},data:()=>({canvas:"",ctx:"",YkeyValue:{},XkeyValue:{},xLeft:30,xPx:560,xLen:0,xAxisLen:0,xSpacing:0,xMinReal:0,xOffset:30,yTop:25,yBottom:0,yPx:240,yLen:0,yAxisLen:0,yAxisLenTop:10,xSpacing:0,yMinReal:0,newData:[],chTypeColor:[],circles:[],tooltip:null,colorCanvas:{YAXIS_COLOR:"#0058BB",XAXIS_COLOR:"#0058BB",LAND_COLOR:"#A1A3B2",TEXT_COLOR:"#0058BB",TEXT_AXIS_COLOR:"#0058BB",LAND_TEXT_COLOR:"#333333",GRID_COLOR:"lightgray"}}),computed:{},methods:{initData(){let t=this.data;this.parseData(t),setTimeout((()=>{this.drawCanvas()}),3e3)},parseData(t){let e=t;const i=t=>(e,i)=>e[t]-i[t];e.sort(i("xval"));let s=e[0].xval*this.offsetValue,a=e[e.length-1].xval*this.offsetValue;e.forEach((t=>{t.xval=t.xval*this.offsetValue,t.xval-=s})),this.xLen=Math.ceil(a-s)+1,this.xAxisLen=this.xPx-this.xLeft,this.xSpacing=(this.xAxisLen/this.xLen).toFixed(2),this.xMinReal=0,e.sort(i("height"));let n=e[0].height,o=e[e.length-1].height;this.yLen=Math.ceil(o-n)+1,this.yAxisLen=this.yPx-this.yTop-this.yBottom-this.yAxisLenTop,this.ySpacing=(this.yAxisLen/this.yLen).toFixed(2),this.yMinReal=n<0?-Math.ceil(Math.abs(n)):Math.floor(n),this.newData=e},drawCanvas(){const t=this;t.canvas=document.getElementById("canvas");let e=t.canvas.getContext("2d"),i=t.colorCanvas,s=t.yTop,a=i.YAXIS_COLOR,n=i.XAXIS_COLOR,o=i.TEXT_COLOR,r=i.TEXT_AXIS_COLOR,l=i.LAND_COLOR,h=i.LAND_TEXT_COLOR;const c=[{key:"height",name:"高程(米)"}],p=c.length;!function(){!function(t="lightgray",i=10,s=10){e.strokeStyle=t,e.lineWidth=.5;for(let t=i+.5;t<e.canvas.width;t+=i)e.beginPath(),e.moveTo(t,0),e.lineTo(t,e.canvas.height),e.stroke();for(let t=s+.5;t<e.canvas.height;t+=s)e.beginPath(),e.moveTo(0,t),e.lineTo(e.canvas.width,t),e.stroke()}(i.GRID_COLOR);let a=new Image;a.src="data:image/png;base64,UklGRkwMAABXRUJQVlA4IEAMAAAwfgCdASpiAuoBPpFCnEylriwrITDJUcASCWlu//+9+4o1+X87ypNvgcx7oCMge519OnI0ZRdqQ6dfDYW3rLe36z3n9xO/fT1Pe5+lz1vpvaJmvkAWrYrySbSdL0aqDI3ue/+88SBpeo8LS+erVlHfnG2FYqpTaDO6ZToQEMA5IbKdkIlCBeBk7DxFfeK58A6AWor/r+QqeFhD6se/uQOFqKCL5kkuDiAhMAeAZcddpbso4HcTTsVSnXC3edSm3h+Ydxw5YvC4ySfQwrp0jk11gFq+AA+/1U5A27wDlIwj/dX/ZhQbI5h2RlJoTE7MLAUjbeqBHkHm4uWO/1jFAfLSCU5neVCRawKNCmUfEdwXoJIFn1u9gEmZQMERnqHjTrlADA4GCnhtaK/lLywKjAYq1Nt2qy6otOxiKmX+EWHE3FzihalZDuOxTdZ/+RgTFL4rtQ7Bg0v01gLIHg1s1BVx5HSnhoLLHpqssX+jfiP9QH1Z3WBEWKZloknBcj0ZMuvdbtTjZi3X2CyhMkwrD29EyNUsX0YC6jbds8Lo6HQZ4Gcm+pWEk2DXCx78h/2xmUGEJkJ6OBW7L0W4rGyXUPZ085wfnt+SQXX2YsB1B72rLZ3jizms1qLCsLXkIqb7VV5MiahvcgqwB/L7UjrGty10q6URQq9X+DdhPJexuePem/ZvMrEKF+weYR/WNbVq8gHfe6D7pmGXKNtzK4DltQf5udb6u+6G313DTizX2qcPPVlYUjf3UlbZSNrEQOC/yxy92uJI2kEBbCPTQNpjTQ6UUm92Rm/JWF7t315jSpw5g4kt6VMgH+8PkYxXy338W92UgtSsbf03P+slvuxpc/64VgbGeRVeyzD+eymg+OLbIDK41xJ8UbHyU4t5fj7g4lz/BLGD2y9Brfu1b05pVwcpIZIEpm31ByqltHkuak6GYFzVgsNBPZJDpy3w8rA2NZcodbp5FkfszBLRbnWobf81Db/o3Lipx/3DT0SiVYeTdC2QtoBxLDiSLaoSXjSY6xrzzTt4VkuL0NjS5/1wp9wIoH/XCsDY0uRM7bwrGlz/rhWBsaXP+uFYGxpc/64VgQEOTdyzGHL9OWFvt/O105YW9n9CrVpN/mfffxjqA+zcD6//Ps4dSgIBlkp04fVia2l6Gxpc/64VgbGlz/rhWBxJSwNjS53Lslq28Kxpc/64VgbGlz/rhWBsaMz8ym2mRwHtFwSq/OZipOiln5zMVJ0Us/OZSntLBayQIqrwpauygRF2UM1qFlOrfXDXYCY3LmTfyuXf/VkPGIB54xXoXuC9wXuC9wXuC9wXuC9wXuC9wXuC9wXuC9wXuC9wXuC9wXuC9wXuC9wXuCmAAP761kz2F/3A6a8oh1x0w5e5b4LN4WsTdG2a9yr6QUByDGD68GiP6Ps6gcspyS4tzEI+9U9T/3+3IqswZv8CPQCXSpNZlW6YkTSzYDq4f9mHmxO74+DLV2mLfEiRAGMT+wkre/q1CP9GT6fjVjN/JmtIqYZxsl8vaDGDgGxW4MAUR9dzZS0moc4aj+wZrksfnasBloLKu0cZdn3X/yEX097P9KMCEfdXRfr6BfA4UiA9ZN6oaXmYYLeBR02zKagF7gB/dL4XqwzCZ7OjvnyOXybLKssgqEWMZiAqrorWN0TmzNW63JYFYN6KhpqhCJpU6bKk1bMG83dC0ZP4ErdEEqxkVfcRhqnikn0QRzzJCDJsLWzwCrG8VzfXuawg9znZZomOeDKRG49yO7+P3qv1lOV+siwMxz0uLTUgAMjiJHMhlyDniEkUlXKEnSzzmJVF+ZcDkCFHMQqb5fpbYXvRXPYf2Cd0QgMU3pZjYZgNAzsJdGNx618zbFTAlphDm3OCDs97nCP1Iq7SXbsk11Dh5/RnK6CVyk3QtsCJ7Wjjgr3A028l8nvQ+pJBOCRbn+5g6VjUdKm6i8Mjp1iW1iZdmUvemrlOFBor+sYqOu4M6RJQZD/wKgnfvbP5We4Ggrb8qGzbkB0ad33tXnzE4UgTFsbIG6enGpW6Yl0nW3CimdtFriZlfzEl9uE28Z5XZxfVwZSpt2hhg2foswSIHXG0k515zeKxMOBzHs64V1eBrwoCQ1ycw4i8mO7w6jvNWJ+QnC4LCVnaMZR/rWLSqZ/snOEjwMplqtejqXBmVgRDU8udaskYl4c6boAfPs7+hA0N4JMfI7ro+WPyRDqqAjqZx+IYjUmw+Qx+3tVAv7lyEKrjw3PgOn0MAWDXfuIKDuDwvSKq00k1iJp7rXsATskSxgVhGDCrR2L0hQ1DYugX/5Y18fkpU6VrW1l8mj4i1sblrhbTas2GzowMuRXFZnKoC0JpJzV+NBFBL9u+Koi8d2yndqFAu1bP05DLS1Zjn3h1WfeTL6TWwNPrrqRPodrsLxH9w901tw4PqnjV4xvxFGFjU002SVYuMwojtBq1gEcX1ufA6eLjJ4gD1oTsGZo1nUMCrXUJbt549ezL6JdRAoIAyUbOS33YWXaxCECZ9wbfT/V66t4/1JWjCZi2hzbmjWEuVwNis1iEjPUJiRoJVuecc59C5KosuP2KCaMA59qel3UxP5ARWyij35muP+wfPAGlRNBDS8vXfBS26wRMrs/pm2vVXf1D8HgnGjxkiLhKCEaHk9P9bYxm4XkIWjo6iKPAWo18y50P66B5cMCMs9s3QqRePeBhCw2+jO3KEWcDt5sFqqfkt2t7u0vAL2t35f+dW6bpjUUsp+VI0pEq1RHOcSWdl1vTDqiAtLv9Mj8k0ohzp0eNgvjfBjXY0uWOiX3/BRb2tcKL4/7Qt5nXoQnYqAQ8Co0rzlWfRR82n6jpn9MzsO9DX+f5PLaOnfnmi1QJWyPkGXrAgjQOAA3VxvSqcGhKMISSspup8BS31T4b+CO+rU0DZzYia+bs/jl1g1iiqrYfERZJCdZTyc6guVxjqg177i8r+2CLcehI6boaBf0o3jVnmzEa9WdKxvlhmQDQLCyv2NCoOTOmbsW0qZP5PUh09frMXyJ77eSlm70oJg/Yy695Fb45ZPN2EmYrEILPs2NVEUMRBXq/OhllMHvRke7GBVjtQ0Fcr9b8HH9rbW7HX608OoTtg37w1KLMQTsB9Ie6xkRsrGa9JURjQ2dIIA3LFP4RrMWl42Visn0ichCfJXW6/MrfGm2QVGWjbS36gHIDitUDKQsLFo9Jr1guNv/2u0Z2WsPNFWNsvW609R6tnMCynxedGm3L2KQBUhNylyTpKJJdp6TLeFQ53EJPwMGPYRl3W2EpF1o96WhznnJ4N1CwJfxZ3Kwy8V+eb0A6Ze0BNPQrQH1SV+1elZX4SIjaV0QXDhqUvLgd6UEhrWlpgvBQfMNqUzQFcqqtildcQc2CqCoL3oCoOnsmzyLGJOZ6WlBNA5W4w33Vm+nwp1lGP9cGF7zz7pZT9cy6FUuqNO+8POnvmXhYZB/HjZDx6CsT2f1VPbfgx16/kKcyngDyfduodycPxPtlwVwACrBPWLO+zGHcIX/phCOOroVkXslMNetMNWzOimT4QOL45Y162eGGBggQAFSZFeMcPfCAAAAAAmKa4SAKY8BYJybs+n5UIri5D0HsLoVxJ4cfeRqCWF9N0GaFEOV81YWNzBla4627N9V5smYNyB1HkPRsmtNeJOV2oVXY6e1lmkFv5pb3HCOtomwCOXKE1DZZtWZM0i+0ucPw5OLvGftZdYSOSZ7+Pa52JuX8d4g21tv0YK1xoGtISIhaTHmTwYQQ8mtcZXUSLjhi33QccMNdSAfIp//MRS2WmorIfaQcQ+Vc3N0GI0nIV4Fmc4QCSnEitNUloAAAipVCdWdIBgDXXVo4O/kEuqMs8+FzrAAIezJuuUOWYHHfIAAAAaNmMoAAAAAAAAAAKUQvW6KXGI2edzNQJJ0qsLWrhvAsU3QhFQkOAv6A3JWZyGy1KU4EhPrODYms4iw5V9zhPNdaDO2CK1Wmg7++5ldh/AaIXSn90cLFYRrMiQx07BoV8ZAqUIE4mk9BtvgC2tEejviq1aGAAs4RKg4d+yBHnYwAAAAAAAADShvwAAAAAAFigxpEka4xHuO0tQ9tLGN2dIGkDSBpA0gaQNIGjdfb/wxk4lFFnPN74lA0Wh6lKNKDKpw411CjLnvHneJFAqAAAAULxeEaMQAAAAAADo5wAAAAAAAM7AAAAAAAAAAA",a.onload=()=>{e.drawImage(a,0,0,t.canvas.width,t.yTop),function(){e.strokeStyle=l,e.lineWidth=2,e.beginPath(t.yTop),e.moveTo(0,t.yTop),e.lineTo(t.canvas.width,t.yTop),e.stroke(),e.fillStyle=h,e.font="12px Calibri",e.fillText("地平线",t.canvas.width-50,t.yTop-8),e.fillText("高程(米)",4,t.yTop-8),e.stroke();let i=new Image;i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQmUVNWZ/u99ay1NQ3dXN5sSlFZAMWOC4AIirtBV1c3StqBiMlnGZGYyiXHGzGiOMsczTjIZJ9tMTvQcNfQGAiYjiCaTjCSiiMIQtm6gFVBZVECgge7qrqr37pz7uguqu+tVvdq6br13r4fTx1N3+e//3e/9d/nvfxHwxDXANWCqAcR1wzXANWCuAU4QPjq4BpJogBOEDw+uAU4QPga4BjLTALcgmemNl3KIBjhBHAI072ZmGuAEyUxvvJRDNMAJ4hCgeTcz0wAnSGZ646UcogFOEEaAXk6W4/Ht40fKwohSKlJYO9t5ZOqRM8vRcp0RER0pBidIAWBv3d9aQTQyVQe4FgDGIIBSncCIRKJgBGcJQCcAfKzpZJvbJe9puLyB/j9Pw6ABTpBhUDJtonVf6zWaBpMByFQCUB1rFgu4CiGkAgIX/YsAXICRCoRECSE9QCAEACGikx5C4DNd13sQgl0EoXYhQtruu+a+g8PUBUc2wwmSR9iXL1+OqxuqZxFAs3VCptKmEEYlWMA+hGAMxngsQkhCGAH9jxACRCdJJSKEnNR1ckTX9OO6rp9EAG+DKGxaduWSnXnsimOr5gTJA/SrD6wuDYXDszFBswiBSxAgWZTx57AgjBclcbQgCpQogFDfv8GJkoSSRdM00KIa6NHEyxBCyFmd6If1KDmkg7YZ6eTNZVct25SHLjm2Sk6QHEO/Yk/rLIxJPSHgE6i1kMUqWZEmiqLowwLOqDWDLNE+smgRbWgdCDSi6Yc0XT9ENPIngrW1yyYv259RY7zQAA1wguRoQDyz7ZlSl9tbDwRuxQg8kiJNkBR5iiiLSiIrkWmzlCTRSDQxUQCo5Tms6Xq7Hon8YtlVy9Zl2g4v16cBTpAcjITm/auuA02v1wkZL8jCKJdb/bwkS2NzULVpFbqmG0SJhqOJLArRo9quqKY1i4DXLp2y9IN8ymLnujlBskS3aW/rUqKTAMJIUVzKKNWt3JpLi5FKPEqSSG8k4eKeEHJMi2pbNY387IGr7n09VV3890TfGq6VjDXQvLf1YV0nX5AUEale13RREC5s32ZcaQYF6aI+Eo4ktCYESETT9N1E1398/+R7mzOo3tFFuAXJAH663nC7vU8QAlWqW/a6vO7aDKrJeRFKkkhPJGG9uq4djEa0Z5dNve+HOW/YxhVygqQJbktHy2VaBJ6kxVwe10TVo9yQZhV5zU6nXOGeMECC4xR6hhKNRF68f8p9f5tXIWxUOSdIGmCu3L3ykgjWf0CLeEZ4ZsiqNCmN4sOWlW4L93T1mK1LItGI9sr9U5YuGjaBirghThCL4K3ev3pcTzTybzT7iLKSRYIoqBaLFiwbJQnd7UqUotHoi/dduXRJwYQrkoY5QSwAFU+OklEl80RJKLNQjIksoa4QEC2x+4qmaT+594olDzEhKKNCcIKkAKaPHOHvAaBy70jPdEmWrmAUy4RiJZtu0QJaNPqv91659NFi6tNwysoJkkTbjTsbK7EkPkwPAN0l6hWKS50+nODkqi06zerp7jFbuEd0Tft3TpLE2uYESTIKV7Q1fwsBul51K9NcXte0XA3YQtRj7G6FwomtDJBOAH35ksuX/KQQsrHcJieICTqN7S01QOA+WZGmuUpc0zDOzNGQJfDDvWGI9iZwTTF8uPST4ah2zwOT+Yl7PGacIAlGcNO+pitBx48KIq52ed03iJLI0jjPSpbe7l7DKzhRIoS09Wqhu7505ZeOZtWIjQpzggwCcyPZKB7ed/RRjIXrXG71RlmVi2bHysq41HUdKElML2YRsu6eSQ11VupyQh5OkEEoN+1ruY9oUKN6lWkud3GvO8wGMLUglCQmiRBEnlpyWcP3nUCAVH3kBInTUPP+5uv0KPqOJImT3KXuGXZYd5gNgKTrESCndQL1905qcLwHMCdI/whqfq95BETwY0hAX3R73beJsn3WHSZbV8bWr9lJOyDYgbaR6Q0NDYkXLKk+vTb5nRMkRpC25q8AxrerbmWG4lYvtwm+SbuRYqoFGMOP755493edoAuzPnKCAEDznuabdIT+WlKkKzwl7uk0oIJTEr1sRf+ZpDM6RO9YevnSbU7Rx+B+OmckmCDcuq21IurWHxOx8BeuEe5b7LSla3VQJ3NqBITeuOey+jlW67JbPscTpKm96WsA+E7Vrdyoelzj7Aawlf4kO2Wn5RFG/9Qwsd5w83dacjRBXmhvqRYILJdk4Qsur3syjVfl1JTsABEhOHKim0z5m6sbzjtNP44mSFN7yzcxFuoUt3yX4lKchv2A/qZasCOMftUwsf4vnaYkxxKkua15qg7oMUmWrneXuC7LNKibnQZMbygMWiSxrxYAOa/r+Oal1fV/tlOfU/XFsQRpbGv5O0EUgqpbuV1W5VR6csTvhlt8V49pX5GAXmv4XH2NI5TR30lHEqRp/6rPk6j2iKRIN7m8rglChiFB7ThQekO9plEbAYEmEHRP/eX1L9mx74n65EiC0HhWCIFfcatznb72GDwoLKxFtjZMrJ/BCWJTDTS2N14NRPgnSZFudnnU8U7euTKDONmOFi0jyuLXFl+y8DmbDpEB3XKcBWlub/5rJIj1sirNVd3MByYpyBhMdS4iiHh7/YTFXyyIcMPcqKMI8vyulstEAZ6kaw/VrUxw4qm51fGV/HQdQFGk2gXjFqy3Wl+x5nMUQZr3tn4JAN0rq9KdLo+Lx7ZPMmpT+GiBqIh/WDx+4R3FOvCtyu0YgrTubq3SBXhKkMXZsiJV863d5EMk1ZYvPTdyu9Vr/ZX+HVYHWzHmcwxBGtta7sYifkCSxPmqWxX4wWDq4WrcFzF5/o2WlhRp1aLxC5amrql4cziCIC9sfEEVKuUfirJ4uySLU/ni3NqATRYtntYgiEJIkF1TF46Zb9sHehxBkNa9rXM0gG9JsuhXVEW1/W1Ba+M/ZS4a4KHnvPnJurHlq8g/WTy+zrbhSx1BkKb2lu8JorBQEIWZLq8r4cuyKUeLQzOkPBNRxA8Wj1840a7qsT1BVuxddQXStSdkRZojyuI4fnKe3lCmbyAa742YJHr7UlHVQN2YwIb0ai6O3LYnSFN7ywOA0T2yJNXQnSs+vUpvYNL4WaHzoaSFRFX678XjFixMr+biyG1rgjy377kSWVd/KIjCTYIgXKN6VbBzKJ98DblU0yws4HNiKb504aiFZ/IlQ6HqtTVBmtqb7iAEf1mWpXmCJJSpHu5akslASzXNMrZ8VfmRRePqfpRJ/SyXsTVBWtpbHgKMA6Ik3ioqIsgKv/eRyWC0NM1ShC2Lxy9i6r3GTPo6uIxtCbL+2Hr3mTNnf0pPzgWEr1TcCt23z4XOHFlHqmkW1a27VJ1UM7LmgJ0UZFuCNO5unA5YeEhWpQBCaATf3s1u2KbyzQIEIHvkv19YVfd0di2xVdq+BGlvWSZg9GVRkm7FIgZ+ep7dwEt1kYrWLqvSpoXjFtycXUtslbYtQZr3tj6FRaFOwHiqpEjUb4gtzSeTRtdBOH8eiCSB7nIxI3f3ue6Ez7jFBBRkIaK4pInBiqBt3hexJUFa2lsmaASeklVpPgI0qpjWH57dO8GzcweA3vd8c3jceOicMxeIWPhg2qmcF5GAwO12fzVQWfM8M6zOUhBbEqRpX+s8jNB3RVG8g86N3SXuLNU0PMXFU6eg7JWXhzTWPfVqOD/9uuERIkkrKdchdJrlUl5dOLbWX3BhcySALQlCQ/pIkvB1LAhXF9P6Q33/PRix+c0h0EYqq+D0vMJH29E0DXq7TB/eMeSWVblLRPhzwbHBkzkaowWtxpYEaWpr+bmkSEsQQhXUtaRYLke53uuAkrffGkoQnw9Ozw8UdKDQxumb66Fzyd1OBEkA1S0vDlQEfl1wgXMggO0I0rivcSIm4tOSLBm+QcXkf8U6Qag+Uy3UqfOi6lH/pbYyYIsn3GxHkJa9LXchjL8viOIsCmgxLdCLgSCpFuqGzj3yxgWj627NwQe84FXYjiB0/SHKwjcFLEym2jUOCIvkQZxiIAh1fae+WcmSpEqnFo1bUF7w0Z0DAWxHkPj1RzHtYBlkZnwNQmVMdQ2X5qHrEJdLudLv83fkYIwWtApbEaRxZ2MlloSfSYp8D9UqDcxQTB68xUAQKyfq1GJ7vK57/T7/yoKO7hw0bi+CdKycKRB4ShRFY/5Lv2TFdIOwGAiSKhxQbEy6Sjw/r62s+bscjNGCVmErgjS3NddjWXpcwHga1WqxubgPB0Hko0fAvWc3dF89zTilTzdZcX03dg9dytaFY2uLPsi1vQjS3vodQRYewghfWmxbvPlegwjnzsKITX8C6eTF87twWTmcCdSmyxHoPtudsoykSKFF4xcUhwtDkt7YiiBNbS1PS6r0VQSotNi2ePNJEBwKQenrfwDps6GH26dm3ADRycaGn+WU6izEsN6yCKoqF/1C3TYE2Ug2iofbj61QVPneGNLFdgc9H1MsFIlA6cY/gPzJJwkJcP7SiXD2xllpBbOgQRzoVCtZMkKTetSiX6jbhiCNOxsnYln8uSRLFxzlXCXFFQMr5wQhBEZSchw5YjqWP55zB4TLy43dPoSsDYekkd9jLRlOop6ng76av7dsmhjMaE0jDAo+WKSmtpWzBRGeip2gF9sZSD6mWKVv/BGUDw6Zotc19hI4MeNG43e620d3/awkK6fptB7V63qrripgeDQUa7INQVa0N98jSdJjsR0spxOEegVT72CzFKoaA8dn3ARE6COFpEogydYulSV9xzCuQdWtdtWNCXqLlRxUbtsQpGlv64OiJDwa28Gih1XUzaSYUq6mWCXvbgHXvr2mXe+p8MHxGbNAly9GeUnn1qVVglBHUVkWi3qhbhuCrNjT/I+KS/4HBKjMYL5DCeLdvs045zBL4ZFlcHzmTRB1DdyBTYcgVvyxaPt951BKbdBXU7QvUdmGIE3tLT+QFOnbCJARHa7Y3ExysQbx7NoJnh3bTckRKRlhTKvo38EpHa9nqwTp98n6ht/nf6aYLHm8rPYhyN6Vz8iy+FexzjmNIO72NvBue9d0HFKLQS0HtSCJUjpez1au3l78SClPBn2BxzlBCqiBjRs3isfGfLxGlKQFFwhShKF+Ml2DuDr2Q8mWzaYI0LUGXXPQtUeiRIO+UQtiNVklCF3hekrczwV8/q9ZrZu1fLawIM9vf96nuN1NoiTc5TQLoh48ACPefMN0XNFdKjqtortWiRKNREK3eNMJ6m11imVMG73u39dW+e9kbeBblccWBGlpb6lGAn5OEMXZsY5T4I2XbIsopWtBlI8+hNI/vp60h/Scg5535IoctJ50CKK6lX11Y2qnFBEMA0S1BUFW7F5xjSQrzwmiMP0CQWy+iyUfOwqlG/8XkKaZjr2TX5gJ5y/9XE7JQSuzus1L8you5cyCsbWjOEEKqIGWvS1fxILwKxrm54IYRRQPKyazVQsiHf/UIAfuNQ/B89nnvwjnJk7KOTnSJohbgR2jg8JyhPoi4RVZsocF2dt6gyzg57AgXDTlNiWIeOozKN34Oghd502H2umrPg+d1Yk9dDNZcwxuKFWk9/j8skuGc1j1PjD6rq4i44Yhri0I0ri3cY4kys9iLFwRD4J7RHFdR0hlQYSznQY5xE7zh5zOTL4Kzky+aEjj9ZELctD6rPpi0byUIMTrqVg04vbPOEEKpIGW9pbbsST+EmN8ebwIdnJ3p/F5KTkS3emI9ZlaDWo9EqVckYPWbcXdPSYDdTfRiXTJ4vE15i7FBRo3Vpq1hwVpb6mRZPG/MMIDVqTpnA5bUVa+85hakIoKI3i12Z0OKhddb9B1R77JQeu3cmEqJgd1ghQktbquct77+dZfPuq3BUGa2lsXiLLwM4zwgP3MYoqqSME1IwiRZUBh86eY6U4V3bEaDnIYBLFw5fYCQRQJsChds2C039xBLB8jO0d12ocgkvBfGOOx8Xoppri8yQiSDOv4Ox2D8+VyWhWr22rQhniCiKoyo7Zi/tYcjdlhrcYWBGnsm2I9jxGuiteeXcL+mI0I407H9bOAIDwkSz7IQRuxGvZn4BRLmlNX6Tc/7h/WIZ9eY7YgiLFIl6VGjNAAf4piO003m2IlgtS40zFzNujS0EtO+SIHlSMaiUI4ZD7dGyyrMc0V8Y3BquDb6Q1NNnLbgiDGNq+kNmOEhgR6KqatXqsEoR65n14/CzR1qCtNPslBh6xlR8X+8U23eWVRvNZf6d/BxpBPTwpbEGQFPSgU8UqMhQmDu0+DEVDX92JIVghi3OmYOQsi3pJhm1bFN5TOISEtRwmCJZhc56vbXwwYDFnHFaPQg2U2XE0k8UWMBp6DxAASpcK/72dFz6kIYtzpuH42hEtHFoQctNF0zkBofrrVjnWYUDuu9iMrOmAtjz0syO4V18iqugZjPOAknSo7lztZQlcXUPdy5cNDoLvc0D3lKgiPHbBxlhW+1G2d1p8o0Tsdn14/G3rLKgpGDisvTA0WzjiL8pT4giPmFuWTbLYgyAvtLdWqJL6MMR7iVp3LNwoTBUPouvYL0DUt8el1umzx7NkNnu3bhhZDCD694WYIVY4uGDlow1beKEw0xVVB9t7FfbHSHQ65y7+6bXWZJut/wjjOmzeu+pwEkNN0qGxZkVBo+gItfYk222R6ku4tgaO3D33EM98L8sH9CfeGIdqb/PGcwWWo7oM+v4C4N2+2wyO78q37V22Nvw8SX1u2Lid0ahE93QnjXvmNqZDnZt4AoSvTi3E7ZDCZPKDTW1YOH998+4Dsw00OY/3RFQKiJQ85Gi+kEVnGo54MVgYS3/XNDvJhKW2LKRbVVOv+VRsEUUj4VnK265DY1mblO5vA/fExU2BojNueSdUZA2dmQRIRJJ0wPRkLFFdQ13XoOd+TVlX909sdQZ//2rQKMpTZPgR5b+WzAha/nki3WcXIIv1fTp2A5+hh8G01D45A2z47ew70TLwsI4hZJoiVp9cGd7r/w7Qh6PMX/g3rjBCxyX0Q2veV+1Z+H0vik2Z6yHSaNdi1wvvRB1Cx/Z2k6u685VbovXTIkUxKiFgmSLrnH7Sz1JNXlMVna32BB1N2ntEMtrEgzW3N90supRFI4ktgmU6zEu3clHxwAMp3JNht6geZYAE6596a9gtOrBIkXf+r2FinHyVRFB8P+GpMP1yM8uKCWHYiyG2iS34ZEeQxm2alE+I/VoeZ9+qIAx1QtvvPpvhSF/XOW26D8OihW7NmhVglSDpRTOL7Ri+sCQh9NVAZeJ51IpjJZxuC/Gr3qstVF96CEBp6ktbfe+r2kMmputl7GKUde2FU+y5T7HWXyyBJxGdtE4dFghiHg+dDANY3r/r00R8TAOlkXqAq8DtOkAJrYDVZLWjvk30Y48ShPLJ49TbZAdnIfXtg5L42095rXq9BkmhZ4pCf8QVZJEgmi3Pap9gBLZJIWWBk4HSBh0fGzdvGglANrHrvxd8ijC9EV0yklUydF5ORZFTbLih9z/y5gWhpqUESrdR4OtE0sUgQS69JJehR35pP2RX01eTGzSDjIZ5dQVsRpPW9Vf8qYOEfk6kk08U6rVOLakB3cxIluh6h6xKzFC0rB7q7RS2KWWKNIOne/YjvlzGdFYX/DFYGvpXdEC1saVsRpLmteb6kKq+mUmmmVoTWm2zQVOzcBt5DiZ0NadmIr9IgCV2bJEqsESSTrd1Yv6iOAaOGusrAmlR4sPy7rQjS2LFqiizgN2OP6JgpPhsrkookvj+/C54Pzd8FDI8eY5CE7nINTiwRJBPHxPj+0ItqRNAm1JYVp5t7rC+2Igjt1MoDq/diQCmdorKxIoY1CEcg0hNJyMHKbW+D+4j59YfwuPF9JOl/HzBWCUsEyXRrl/alLxaAvC/oCxRt0GrbEmTVgTXPI4C/TGW2cxHQwfT6KSFQtfUtcB07aipG74QJ0Dnn1gG/s0KQZGutVHqlv9P1hySJzwR8/m9Yyc9yHttZkOaOVQFJECy9iZfpuUg8oGYu4Cgahaptm0H95GNT/HsuuxzOzrr5wu+sECSd0KIJ11JeFyARfSVY7n+B5cFvRTbbEWTF3hXlsqjS8xDTA8ML5hMjyOR0fbBizaYjONwLo7duBvnEcVMsQtVXwLkbbjJ+Z4EgmZ57xDoYe/oOaWRaYHRgj5VByHIe2xGEKnvVgTV/QAC3WVF8tgv2WBtmb2aIoW6o2roZpFPmsZtDk6fAuRnXF5wghs9Vd0/6p+Zxiu53wz8Q9PlND2yt4MJKHlsSZPWh1Y8THf2zVSXnYqpF2zIjidR13liTiGfMo7J3X3U1aCNKoeTtt4aIPVz3QbLZ1o0JbXhNS2JLsKLmfqv6ZzmfLQnScqClWgBpJwJk6Q02el/EiL6Bsw8PZDZ/l891QtW7b4Fw7pzpeAiPvwTkI4cLQpB0410l6sSFQH0EvhOs9P+U5YFvVTZbEoR2fvXBtdsJIZZvsuViVyumdDP3DKXzNFS+8yYI3d1W8THy5duCZLtrFeuMqIggKzINhVq0sXgHA2Nbgqw5tOYJXYfl6YzEXF5jNbu/7Tr9Gfi2bEr6fNpgmfNJEHqVlk6tqFt/tknxKCAIwvqgz1+bbV2slLctQVbvXz1OE8gOjFLvZsWDEfsKZg1Q3FXdwXV5Th2His2bgG4FW0n5IkguyRHbvQJA9wd9NS1W+lUMeWxLEKr8Fw+sXgeAgukCkaudrWR3KUpOfgLlb70BQFJ/ufNBkIzveZgos9/6dhz78MjVD05/MLGLQbpAMJDf1gRp7XhxsSBg+jVT0tV1rqZbxo3ErsQXjkqOH4XyzW+mFC0fBEnnlaiUAiIA1U1jIKMng77A4ynzF1EGWxPEsCIH174LhFyXCSa5IkmykDmlHx+GUe8kj5RCY/EemzvwmkumsmUSPjSV7mIWl2Dh6tryeea3x1JVxODvtifImkNrHtR1+GWmus90IA5uL1ngg5FHP4SRW7eYihh1u+HInQNnipnIlWnwhaS6o9aDRtBHuDFY6f9SpnpmtZztCUIVv/rQ2l1EJ9MyBYF+IemARCg7dSW9cHX4IIz4v8SvlOmiBB8FFg0QP12C5Gord7AOL27tottqK2pez1THrJbLDnFWezVIrrUf/fohLaL9Rzbi0l0aOigFUcimGvNbiQhg9LYtoB7+cEj99C2QwbF50yFILg4BE3WaHrDStQfC6JWgz5/2ZkhWihymwo4giGFFPlj7HtFI1v5BNBiaJA999iwdvMxuJZZ8dBDKtw+1Ipku0umUinob61E9HfEs542RFBHSECjym4NmnXYMQV46+vIj0Z7wDy2jnyQjPXWnJMnm5apoOArUCzg+lXxwEMp35IYghldubyQrx8NkujKsh4daD/x2sKLmxlzolcU6HEMQqvy1h3+9VwtrKW8bWgWKzr8pUTJdmwx2Lc8FQah1ouSj1iOf6cIb9AS+Eqws/nsfjrcgVAHrP311QSjU/Zt0QvinGmTUQU+SJOOaaSZEiV8fZEMQLaIZASXoYjzf6eKpObwY9PmX5Lu9QtbvKAtCFf3S4V+viYa1+pwrHYGxgKeRG9NdyMcuXKVLEEpKgxjRaFrvdmTbd3o9QJDETqLjm+uq5puHlsy2IQbKO44g68+ur+g5Fdmja1pVvvRP5+f0K0uJQv9ZsSyUJK6OjqRrEGqt6H806UQHyO8sKqF64ryeHwn6/D/Klw5ZqddxBKGK/82nL38z0h35RS48WK0AScNw0rsmlDTGX3rvJIHmxbY2KPu/d4dUSXexPp17J9BT8OGSOVG/qPz03gwg9Hqtz2/pxqYV/bCcx5EEMUhy5OWXwr3hgadvw4kUouOsT/3GXwTgPXgAyrYnJsjgJ9iGU9Q+Ifv8rZCAOwGjebXlNeZH/8MuXP4adCxBftv527Kus6Gt0XA0s+eg8oBJOmuQPDSftMoL15Jtvms1WAmOJQhVxPrPXr2zt6vnd3Shy0JilSBxh6M/Cvr8j7Cgq+GSwdEEoUp+5eSrj4a6Qv+Sr9PmdIBkkSAX78ag9UFfjW1uClrFxfEEMSzJyVfWhM731OfyfMQqAPH5WCNI7I0PALRfJ5FAXWXd+5n0q5jLcIL0o7fu+IbXerpC8wq5S8QSQWIvAyOATkSg1l/pf6OYB3qmsnOCxGlu/YkNb3Sf7Z6dqTKzLccSQWh09r6kzw36gn/Mtm/FWp4TZBBy605seLfnfOi6QlgSFggS50bieHLQocEJkuDTtv7EhnW93b3B4fBrYmkNMiBYBcY3Bsvnv12sX/5cyc0JYqLJ9Sc2PN0b6v3ucG4BF9KCxIU7Ok7C2nW144r74RtOkFxpIEk9L3+6fnk0HH2Cuo8PRyoIQRAYNyWNS2AEXouEe5ctGr/IPNL2cCiCoTa4BUkBBiWJrulPULf0fK9LhpsgdBuXhgo1Ln4Rstbb5Vk2d+LcHobGZ8FF4QSxAMG64xsagOg/CPdGJuZzyjWcBImbUmkIoccCFTU5uW1pQZ1FlYUTxCJc6079/lKk9T4VDWv30ZuA+bAmw0EQajXodMq4s0JgMyD9MSdv46aCnxMklYYG/b7+5Kt/S3T98Wg46qNEgdSRQy23kE+CGDcfZcm40NWf/sNb4X5sLuJTqmQAcYJYHr4XM64787uJKBr9tq7p36YLeHrVNRdEyQdB6Im4EddLkvo29Qm8hID8NFAZ2JRB1x1XhBMkC8g3nNwwkxD4tq6TpUawhCyvvuaSIHQqFbv+23/vZBPB8NPacv9LWXTZcUU5QXIA+SsnXvETgKUAaEk0EhXoQl7TtLStStYEQXCBFLF78YTA7xHASjtHHskBhKZVcILkULv//fGrUwVRp1E+lhICk+hJfOyflSlYJgShU6jY3fe4YBFnKSkI6Kv4Ajw7gDlBstNfwtIbyUb1/MnuRQjBHYSQOwHQWGpR6M4XjfQe/zeeOEkJMud24y67ERAi9rf/jnvwcLTVAAACZElEQVS/EPSNhd8DQv9DsLy+tuyOj/LQNcdVyQkyDJCvP7H+FgA8HyGYQwhUA0BZfLM0GAMlivp+B5RuGfoUQsTng9PzA4MkJWGE0H5C4B2EyGvdoe7XGi5pCA1DdxzVBCdIAeCm9+F7Qlq1IKBJuq5VY4y8CJDXvWP7X3h27Zw5WCTNW/LJZwvrXwCMjgGCjmgYdSwcM/+DAojuuCY5QRiC/O2nF38dA3p2qEhoy8yH19zAkKiOEYUThCGoOUEYAqNfFE4QhjDhBGEIDE4Q9sDgBGEPE25BGMKEE4QhMLgFYQ8MThD2MOEWhCFMOEEYAoNbEPbA4ARhDxNuQRjChBOEITC4BWEPDE4Q9jDhFoQhTDhBGAKDWxD2wOAEYQ8TbkEYwoQThCEwuAVhDwxOEPYw4RaEIUw4QRgCg1sQ9sDgBGEPE25BGMKEE4QhMLgFYQ8MThD2MOEWhCFMOEEYAoNbEPbA4ARhDxNuQRjChBOEITC4BWEPDE4Q9jDhFoQhTDhBGAKDWxD2wOAEYQ8TbkEYwoQThCEwuAVhDwxOEPYw4RaEIUw4QRgCg1sQ9sDgBGEPE25BGMKEE4QhMLgFYQ8MThD2MOEWhCFMOEEYAoNbEPbA4ARhDxNuQRjChBOEITC4BWEPDE4Q9jDhFoQhTDhBGAKDWxD2wOAEYQ8TbkEYwoQThCEwuAVhDwxOEPYw4RaEIUy2/PjuZUgnjQlE+tPMh9fewpCojhGFE4QhqLf82+JqJKCOBCItn/nw2n9mSFTHiMIJwhjU7z5995cByPcIwGQE0EkAVs18eO03GBPTMeL8PzpKnIy1WN/5AAAAAElFTkSuQmCC",i.onload=()=>{e.drawImage(i,t.canvas.width/4,0,s,s),e.drawImage(i,t.canvas.width/4*3-s/2,0,s,s)}}()}}(),function(){e.strokeStyle=a,e.lineWidth=1,e.beginPath(),e.moveTo(t.xLeft,t.yTop),e.lineTo(t.xLeft,t.yPx-t.yBottom),e.stroke(),e.lineWidth=.5,e.strokeStyle="#0058BB",t.yLen;for(let i=0;i<=t.yLen;i++)e.strokeStyle=a,e.beginPath(),e.moveTo(t.xLeft,t.yPx-t.yBottom-i*t.ySpacing),e.lineTo(t.xLeft+5,t.yPx-t.yBottom-i*t.ySpacing),e.stroke(),e.fillStyle=r,e.font="16px Calibri",e.fillText(t.yMinReal,t.xLeft-15-5,t.yPx-t.yBottom-i*t.ySpacing+5),t.YkeyValue[t.yMinReal]=t.yPx-t.yBottom-i*t.ySpacing,t.yMinReal++,e.stroke();e.lineWidth=1,e.strokeStyle=a,e.beginPath(),e.moveTo(t.xLeft,t.yPx-t.yBottom),e.lineTo(t.xLeft,t.yPx),e.stroke();for(let e=0;e<=t.xLen;e++)t.XkeyValue[t.xMinReal]=t.xMinReal+e*t.xSpacing+t.xLeft,t.xMinReal++;e.restore()}(),function(i){function s(t,e,i,s="Y"){if("Y"==s){let s;s=t<0?-Math.ceil(Math.abs(t)):Math.floor(t);let a,n=(""+t).split(".");if(t<0){return a=n.length>1?e*(1-Number("0."+n[1])):0*e,i[s]-a}return a=n.length>1?e*Number("0."+n[1]):0*e,i[s]-a}{let s=Math.floor(t),a=(""+t).split("."),n=e;return n=a.length>1?e*Number("0."+a[1]):0*e,i[s]+n}}e.strokeStyle="#9C5260",e.lineWidth=1,i.forEach((i=>{let a=s(i.xval,t.xSpacing,t.XkeyValue,"X")+t.xOffset,n=s(i.height,t.ySpacing,t.YkeyValue,"Y");var r=t.chTypeColor.filter((t=>t.value==i.category))[0].color;e.strokeStyle=r,e.lineWidth=1;var l=t.chTypeColor.filter((t=>t.value==i.category))[0].img;if(l){let t=new Image;t.src=l,t.onload=()=>{e.drawImage(t,a-9,n-9,18,18)}}e.setLineDash([5]),e.beginPath(),e.moveTo(a,t.yPx),e.lineTo(a,n),e.stroke(),e.strokeStyle="#ffffff",e.setLineDash([]),e.beginPath(),e.moveTo(a,t.yPx+100),e.lineTo(a,t.canvas.height),e.stroke();var h=a,c=n-2;e.setLineDash([]),e.beginPath(),e.arc(h,c,5,0,2*Math.PI),e.fillStyle=r,e.strokeStyle="#E0E3EA",e.fill(),e.stroke(),t.circles.push({x:h,y:c,radius:5,text:i.text}),e.save(),e.fillStyle=o,e.translate(a,n-10),e.font="12px Calibri",e.fillText(i.height,-10,0),e.restore()}))}(t.newData),function(){const i=(t.canvas.height-t.yPx)/p;for(let s=0;s<p;s++){let a=t.yPx+i*s;e.strokeStyle=n,e.lineWidth=1,e.setLineDash([]),e.beginPath(),e.moveTo(t.xLeft,a),e.lineTo(t.canvas.width,a),e.stroke()}for(let i=0;i<p;i++)t.yPx,e.fillStyle=o,e.font="12px Calibri",e.fillText(c[i].name,0,20)}(),this.isHover&&(t.tooltip=document.getElementById("tooltip"),t.canvas.addEventListener("mousemove",t.handleMouseMove))},handleMouseMove(t){t.preventDefault();const e=this.canvas.getBoundingClientRect(),i=t.clientX-e.left,s=t.clientY-e.top;for(const t of this.circles){if(Math.hypot(t.x-i,t.y-s)<=t.radius){this.showTooltip(i,s,t.text);break}this.tooltip.style.display="none"}},showTooltip(t,e,i){this.tooltip.style.left=t+10+"px",this.tooltip.style.top=e-20+"px",this.tooltip.style.display="block",this.tooltip.innerHTML=i}},beforeDestroy(){this.isHover&&this.canvas.removeEventListener("mousemove",this.handleMouseMove)},mounted(){this.chTypeColor=this.categoryStyle,this.colorCanvas=Object.assign(this.colorCanvas,this.renderColor||{}),this.xPx=this.xWidth,this.yPx=this.yHeight,0!=this.data.length&&this.initData()}};const pv=cv;var uv=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"map-spatial-dmfx"},[i("canvas",{attrs:{id:"canvas",width:t.area[0],height:t.area[1]}}),t._v(" "),i("div",{attrs:{id:"tooltip"}})])};uv._withStripped=!0;const dv=bi({render:uv,staticRenderFns:[]},undefined,pv,"data-v-9ba4ad66",false,undefined,!1,void 0,void 0,void 0);var mv=[dv];const gv=function(t){gv.installed||(gv.installed=!0,mv.map((e=>t.component(e.name,e))))};"undefined"!=typeof window&&window.Vue&&gv(window.Vue);const yv=[ad,bm],fv=function(t){fv.installed||(fv.installed=!0,yv.map((e=>t.component(e.name,e))))};"undefined"!=typeof window&&window.Vue&&fv(window.Vue);const _v={name:ov,author:rv,version:lv,description:hv,install:fv,...yv};console.log(`@medo/mapmost-onemap-x v${lv} Copyright © 2020-${(new Date).getFullYear()}, 苏州华创智城科技有限公司`),t.BaseAnalysis=Xy,t.BursaWolfUtils=Zc,t.CubeSectionAnalysis=of,t.DataPointLayer=class extends Af{constructor(t){super(t,"circle")}getDefaultBeforeId(){return"t_point"}},t.DataPolygonExtrusionLayer=class extends Af{constructor(t){super(t,"fill-extrusion"),this.texture=!1}getDefaultBeforeId(){return"t_polygon"}},t.DataPolygonLayer=class extends Af{constructor(t){super(t,"fill")}getDefaultBeforeId(){return"t_polygon"}},t.DataPolylineLayer=class extends Af{constructor(t){super(t,"line")}getDefaultBeforeId(){return"t_line"}},t.DataSymbolLayer=class extends Af{constructor(t){super(t,"symbol"),this.iconName=this.options.iconName||this.id,this.iconNameLight=this.iconName+"_light",this.iconUrl=this.options.iconUrl||"",this.iconList=this.options.iconList||[],this.iconUrl&&this.iconList.push({name:this.iconName,url:this.iconUrl}),this.optionsHighLight=this.options.highLight||{},this.optionsHighLightLayout=this.options.highLightLayout||{},this.optionsPaint=this.options.paint||{},this.symbolStyle(),this.svgIconEnable=!1}getDefaultBeforeId(){return"t_point"}symbolStyle(){let t=kf(this.layerType,{highLight:this.optionsHighLight,highLightLayout:this.optionsHighLightLayout,layout:Object.assign({"icon-image":this.iconName},this.options.layout||{}),paint:this.optionsPaint});this.layout=t.layout,this.paint=t.paint}addIcon(){Fd.addMapSymbolImage(this.map,this.iconList),0==this.iconList.length&&(Fd.createMarkerCanvas(this.map,this.iconName,this.optionsPaint["icon-color"]||"#326EF0"),Fd.createMarkerCanvas(this.map,this.iconNameLight,this.optionsHighLight["icon-color"]||"rgba(255, 255, 0, 1)"),this.svgIconEnable=!0)}},t.DataTextLayer=class extends Af{constructor(t){super(t,"text")}getDefaultBeforeId(){return"t_point"}},t.DmfxSpatialResult=dv,t.DrawCommonUtils=rg,t.ExcavationAnalysis=class extends Xy{constructor(t){super(t),this.renderStyle=this.options.renderStyle||{},this.type=this.options.type||"map_draw_polygon",this.depth=this.options.depth||5,this.sideImg=this.options.sideImg||require("./assets/excavate_kuangqu.jpg"),this.bottomImg=this.options.bottomImg||require("./assets/excavate_bottom.jpg"),this.callback=this.options.callback||""}addTo(t){this.map=t,this.init("ExcavationAnalysis"),this.subscribeMapClear(),this.map.GLSDK.mapStartDraw({type:this.type,clear:!0,renderStyle:this.renderStyle},((t,e,i)=>{this.destoryEvent(),this.closeDraw(),this.callback&&this.callback(t,e),i&&(this.range=i.geoDraw.coordinates,this.analyse(this.range))})),this.mouseMove=t=>{const e=this.map.getPosition(t);this.showTipsPopup(e,"绘制开挖区域!双击结束")},this.map.on("mousemove",this.mouseMove)}changeDepth(t){this.depth<0||(this.depth=t,this.analysis&&this.range&&(this.analysis.clear(),this.analyse(this.range)))}analyse(t){this.analysis.analyse({range:t,depth:this.depth,sideImg:this.sideImg,bottomImg:this.bottomImg})}closeDraw(){this.map.GLSDK.mapClearDraw()}destory(){this.closeDraw(),this.destoryEvent(),this.analysis&&this.analysis.clear(),this.destoryCallback&&this.destoryCallback()}},t.GeoUtil=Pp,t.LayerManagerFactory=class{constructor(t){this.map=t||null,this.layers={},this.geometryMapping={polygon:"面",point:"点",line:"线","面":"面","点":"点","线":"线"},jf.map=this.map,this.oneMapConfig=this.map.getOnemapConfig()}async onNodeChecked(t,e){var i=[];if((i="object"==typeof t?await this.getMapLayers(t,!1):await this.getMapLayers(t)).length>0)for(const t of i)await this.layerChecked(e,t)}async layerChecked(t,e){if("style"!=e.layerType)return t?await this.map.M.layerManager.addLayer(e):await this.map.M.layerManager.removeLayerById(e.id);console.warn("不支持图层style类型加载!")}async getMapLayers(t,e=!0){const i=e?t:t.id;if(this.layers[i])return this.layers[i];const s={url:this.oneMapConfig.customURL_MapLayer,nocode:!0,nomessage:!0,method:"get",params:{id:i}};let a;if(e){const t=await dr.request(s);t&&(a=t.data)}else a=t;if(a){const t=a;t.mapResourceList=t.mapResourceList.map((e=>jf.convertLayer(e,t))),this.layers[i]=t.mapResourceList}return this.layers[i]||[]}getOpacity(t){var e=this.layers[t];if(e){var i=e[0];const t=this.map.M.layerManager.getLayerById(i.id);return t.getOpacity?t.getOpacity():1}return 1}setOpacity(t,e){(this.layers[t]||[]).forEach((t=>{const i=this.map.M.layerManager.getLayerById(t.id);i.setOpacity&&i.setOpacity(e)}))}},t.LinearExtrudeAnalysis=cf,t.MapDataExportPlugin=qf,t.MapDraw=Bd,t.MapDraw3D=class{constructor(t,e){this.map=t,this.options=e||{},this.type=this.options.type,this.clearToolPub=void 0===this.options.clearToolPub,this.draw=null,this.mapClearPubEvent}subscribeMapClear(){this.mapClearPubEvent||(this.mapClearPubEvent=this.map.M.pubsub.subscribe("clear",(()=>{this.destory()})))}start(){switch(this.type){case"map_draw_point":this.draw=new Tf(this.map,this.options);break;case"map_draw_polyline":this.draw=new Df(this.map,this.options);break;case"map_draw_polygon":this.draw=new Pf(this.map,this.options);break;default:return}this.draw.start(),this.clearToolPub&&this.subscribeMapClear()}on(t,e){this.draw&&this.draw.on(t,e)}stop(t){this.draw&&(t&&this.draw.completeCallback(),this.draw.stop())}clear(){this.draw&&this.draw.clear()}destory(){this.draw&&this.draw.destory(),this.mapClearPubEvent&&this.map.M.pubsub.remove("clear",this.mapClearPubEvent)}},t.MapImageCompareOpacityPlugin=Uf,t.MapImageComparePlugin=Vf,t.MapImportFilesPlugins=lm,t.MapLocationQuery=hm,t.MapLocationQueryPlugin=hm,t.MapLocationToolPlugin=Hf,t.MapLocationsLayer=Wd,t.MapMaskLayer=class{constructor(t){this.options=t,this.id=this.options.id||"MapMaskLayer_"+Math.random(),this.beforeId=this.options.beforeId||null,this.beforeIdTMask="t_mask",this.opacity=this.options.opacity||.75,this.color=this.options.color||"rgb(0,0,0)",this.layerFillStyle=this.options.layerFillStyle||{},this.layerLineStyle=this.options.layerLineStyle||{},this.geojsonData=null,this.source=null,this.layersIds=[],this.initData()}initData(){var t=this.options.data;this.geojsonData="string"==typeof t?{type:"FeatureCollection",features:[cp(t)]}:t,this.source={type:"geojson",data:this.geojsonData}}async addTo(t){this.map=t,this.map.getLayer(this.beforeIdTMask)||this.map.addLayer({id:this.beforeIdTMask,type:"background",paint:{"background-color":"transparent"}},this.beforeId),this.source.data=await Sp(this.map,this.geojsonData),this.map.addSource(this.id,this.source),console.log(this.source,"this.source"),this.map.addLayer(Object.assign({id:this.id,type:"fill",source:this.id,layout:{},paint:{"fill-antialias":!0,"fill-opacity":this.opacity,"fill-color":this.color}},this.layerFillStyle)),this.layersIds.push(this.id);const e=this.id+"_line";this.map.addLayer(Object.assign({id:this.id+"_line",type:"line",source:this.id,layout:{"line-cap":"round","line-join":"round"},paint:{"line-width":2,"line-color":"rgb(255, 255, 255)","line-opacity":this.opacity}},this.layerLineStyle)),this.layersIds.push(e)}eventMapLayer(){this.renderMap&&this.map.off("render",this.renderMap),this.renderMap=t=>{if(this.layersIds.length){if(this.map.getStyle().layers[this.map.getStyle().layers.length-1].id===this.layersIds[this.layersIds.length-1])return;this.layersIds.forEach((t=>{this.map.getLayer(t)&&this.map.moveLayer(t)}))}},this.map.on("render",this.renderMap)}remove(){this.renderMap&&this.map.off("render",this.renderMap),new Promise((t=>{var e=this.layersIds.length;0==e?t():this.layersIds.forEach(((i,s)=>{this.map.getLayer(i)&&this.map.removeLayer(i),s==e-1&&t()}))})).then((()=>{this.map.getSource(this.id)&&this.map.removeSource(this.id)}))}},t.MapMostTraceSlider=Vd,t.MapPickAreaPlugin=$f,t.MapPickPointPlugin=t_,t.MapQueryPanelPlugin=class extends rm{constructor(t){super(t),this.domid=this.domid||"map-query-panel",this.searchCode=t.searchCode,this.searchData=t.data||null,this.expand=void 0!==t.expand&&t.expand,this.closeBtn=void 0!==t.closeBtn&&t.closeBtn,this.renderAxiosPage=void 0!==t.renderAxiosPage&&t.renderAxiosPage,this.size=void 0!==t.size?t.size:10,this.customAxios=void 0!==t.customAxios?t.customAxios:mr}addTo(t){if(this.map=t,this.subscribeMapClear(),this.mapid=this.map.GLSDK.mapContainerID,this.searchCode){var e=this.map.GLSDK.getOptionData("QuickSearch")||[],i=this.map.getOnemapConfig(),s={customURL_QQuery:i.customURL_QQuery,customURL_dict:i.customURL_dict};this.setQuickSearch(e,(()=>{this.intanceDom=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_QUERY_PANEL_DEFAULT",{domid:this.domid,data:this.searchData,selectCode:this.searchCode,position:this.map.ExAPI.getPositionStyle(this.position),expand:this.expand,closeBtn:this.closeBtn,renderAxiosPage:this.renderAxiosPage,renderPageSize:this.size,customAxios:this.customAxios,urlConfig:s}),this.intanceDom.map=this.map,this.intanceDom.onClearMap=()=>{this.onClearMap()},this.intanceDom.close=()=>{this.destory()},this.map.ExAPI.appendMapControlContainer(this.intanceDom)}))}return this}remove(){this.destory()}setQuickSearch(t,e){t.forEach((t=>{t.apiCode==this.searchCode&&(this.searchData=t,e())}))}onClearMap(){this.map&&this.map.$MapEventBus.$emit("map-left-list-close")}destory(){this.map&&(this.onClearMap(),this.map.ExAPI.removeMapControlContainer(this.domid))}},t.MapRoamingPlugin=Jf,t.MapTextPopup=class{constructor(t){this.options=t||{},this.map=null,this.fitBounds=this.options.fitBounds||!1,this.popupText=[],this.data=this.options.data||[],this.offset=this.options.offset||[0,0],this.closeButton=this.options.closeButton||!0,this.renderStyleClose=this.options.renderStyleClose||!1,this.maxWidth=this.options.maxWidth||"300px",this.renderStyle=Object.assign({textColor:"rgba(0, 0, 0, 0.9)",textFontSize:"14px",textHaloColor:"rgba(255, 255, 255, 0.7)"},this.options.renderStyle||{})}getDivStyle(){return this.renderStyleClose?{}:{color:this.renderStyle.textColor,fontSize:this.renderStyle.textFontSize,background:this.renderStyle.textHaloColor}}getTransformCenter(t){const e=this.map.enableTransform,i=t[0]||0;return e&&i>180&&(t=this.map.M.projTransform(e.srid,null,t)),t}add(t){this.map=t,this.data.forEach((t=>{this.textToMap(t)})),this.fitBounds&&Pp.st_fitBoundsToQData(this.map,this.data,null,null,this.fitBounds)}async textToMap(t){var e=Pp.st_getcenterbywkt(t.shape);e=this.getTransformCenter(e),this.map.sz2000sdk&&(e=this.map.MapmostSDKConvert.fromDefinedProj(e));const i=t.domContent||await this.getDomContentText(t.iQueryList||[]);var s;this.map.projection?((s=new I.default.Popup({closeButton:this.closeButton,className:"map-text-popup-body"}).setOffset(this.offset).setDOMContent(i).setMaxWidth(this.maxWidth)).setCoordinate(e).addTo(this.map),this.popupText.push(s)):((s=new I.default.Popup({closeButton:this.closeButton,className:"map-text-popup-body"}).setOffset(this.offset).setDOMContent(i).setMaxWidth(this.maxWidth)).setLngLat(e).addTo(this.map),this.popupText.push(s))}getDomContentText(t){var e=window.document.createElement("div");e.className="mx-text-popup";var i=this.getDivStyle();return i.color&&(e.style.color=i.color,e.style.background=i.background,e.style.fontSize=i.fontSize),t.forEach((t=>{var i=document.createElement("div");i.className="mx-text-item-popup",i.appendChild(this.getSpanLabel(t.label,"mx-text-label")),i.appendChild(this.getSpanLabel(t.value,"mx-text-value")),i.appendChild(this.getSpanLabel(t.unit,"mx-text-unit")),e.appendChild(i)})),e}getSpanLabel(t,e){var i=document.createElement("span");return i.className=e,i.innerText=t,i}remove(){this.destory()}destory(){this.popupText.forEach((t=>{t.remove()}))}},t.MapToolsFactory=class{constructor(t){this.map=t||null,this.isScreenFull=!1,this.activeDrawTools=null,this.pluginImageCompare=null,this.pluginLocation=null,this.activeSyncMap,this.closeMapSyncCallback=null,this.FullScreenOnchange(),this.addMapSyncSubscribeEvent()}destory(){this.event&&this.map.M.pubsub.remove("mapCloseCloneMap",this.event)}addMapSyncSubscribeEvent(){this.event=this.map.M.pubsub.subscribe("mapCloseCloneMap",(()=>{1==this.activeSyncMap&&this.MapSyncMoveTool(!1),2==this.activeSyncMap&&this.MapSyncMoveSplitTool(!1),this.closeMapSyncCallback&&this.closeMapSyncCallback()}))}MapChangeView(t){switch(t){case"2D":case"2d":this.map.setBearing(0),this.map.setPitch(0),this.map.dragRotate.disable(),this.map.touchZoomRotate.disableRotation();break;case"3D":case"3d":this.map.setBearing(0),this.map.setPitch(45),this.map.dragRotate.enable(),this.map.touchZoomRotate.enableRotation()}}ClearTool(){this.map.M.clear(),this.MeasureLengthTool(!1),this.MeasureAreaTool(!1),this.MeasureLocationTool(!1)}FullScreenOnchange(){A.default.isEnabled&&A.default.onchange((()=>{this.isScreenFull=A.default.isFullscreen,this.changeEvent&&this.changeEvent(this.isScreenFull)}))}FullScreenTool(t){this.changeEvent=t,A.default.toggle(this.map._container||document.getElementById("app"))}ResetViewTool(){var t=this.map.M.view.get(),e=this.map.enableTransform,i=t.center;e&&i[0]>180&&(t.center=this.map.M.projTransform(this.map.enableTransform.srid,null,i));let s={center:t.center,bearing:t.bearing,pitch:t.pitch,zoom:t.zoom};this.map.flyTo(s)}IQueryTool(t){t?(this.map.M.clear("map-iquery-clear"),this.map.M.iqueryManager.create()):this.map.M.iqueryManager.clear()}MeasureLengthTool(t,e){if(t){this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new vy(this.map);return t.start(),e&&(t.endCallback=e),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1},t}return this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,null}MeasureAreaTool(t,e){if(t){this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new Iy(this.map);return t.start(),e&&(t.endCallback=e),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1},t}return this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,null}MeasureLocationTool(t,e){if(t){this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new My(this.map);return t.start(),e&&(t.endCallback=e),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1},t}return this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,null}MapZoomInTool(){this.map.flyTo({center:this.map.getCenter(),zoom:this.map.getZoom()+1})}MapZoomOutTool(){this.map.flyTo({center:this.map.getCenter(),zoom:this.map.getZoom()-1})}MapCompassTool(t,e,i){if(t){const t=e||"map-compass-rotate";this.seBearing&&this.map.off("rotate",this.seBearing),this.seBearing=()=>{this.getRotateDeg(t,i)},this.map.on("rotate",this.seBearing),this.getRotateDeg(t,i)}else this.seBearing&&this.map.off("rotate",this.seBearing)}getRotateDeg(t,e){const i=this.map.getBearing(),s=i>0?0-i:Math.abs(i);e&&e(s);var a=document.getElementById(t);a&&(a.style.transform="rotateZ("+s+"deg)")}MapPrintTool(){const t=this.map.getCanvas().toDataURL();this.map.MapLayerLegend&&this.map.MapLayerLegend.printMap?this.map.MapLayerLegend.getLengedImage((e=>{e?im(t,e,(t=>{this.printMap(t)})):this.printMap(t)})):this.printMap(t)}printMap(t){const e=this.map.getWaterMarkImg();if("object"==typeof e.MapWaterMark&&!0===e.MapWaterMark.printMap){var i=e.img;if(i)return void im(t,i,(t=>{em(t,"map","png")}))}em(t,"map","png")}MapSpatialTool(t,e){this.map.GLSDK.mapStartDraw({type:t,clear:!0},(t=>{this.map.GLSDK.mapClearDraw(),t&&this.map.M.iqueryManager.spatialIquery(t,(t=>{this.map.GLSDK.mapClearDraw(),e&&e(t)}))}))}MapSyncMoveTool(t){t?(this.activeSyncMap=1,this.map.GLSDK.MapSyncMoveControlPlugins.close(),this.map.GLSDK.CloseMapSyncMoveControls&&this.map.GLSDK.CloseMapSyncMoveControls(),setTimeout((()=>{this.map.GLSDK.MapSyncMoveControlPlugins.open(this.map,1),this.map.GLSDK.OpenMapSyncMoveControls&&this.map.GLSDK.OpenMapSyncMoveControls()}),200)):(this.map.GLSDK.MapSyncMoveControlPlugins.close(),this.map.GLSDK.CloseMapSyncMoveControls&&this.map.GLSDK.CloseMapSyncMoveControls())}MapSyncMoveSplitTool(t){t?(this.activeSyncMap=2,this.map.GLSDK.MapSyncMoveControlPlugins.close(),this.map.GLSDK.CloseMapSyncMoveControls&&this.map.GLSDK.CloseMapSyncMoveControls(),setTimeout((()=>{this.map.GLSDK.MapSyncMoveControlPlugins.open(this.map,2),this.map.GLSDK.OpenMapSyncMoveControls&&this.map.GLSDK.OpenMapSyncMoveControls()}),200)):(this.map.GLSDK.MapSyncMoveControlPlugins.close(),this.map.GLSDK.CloseMapSyncMoveControls&&this.map.GLSDK.CloseMapSyncMoveControls())}MapDrawTool(t,e,i){if(t){this.activeDrawTools&&this.activeDrawTools.destory();let t=new undefined(Object.assign({domid:"map-drawtools-container"},e||{}));t=t.addTo(this.map),i&&(t.drawCallback=i),this.activeDrawTools=t}else this.activeDrawTools&&this.activeDrawTools.destory();return this.activeDrawTools}ImportFilesToMapTool(t,e,i){return t?(this.map.GLSDK.mapImportFilesPlugins.destory(),setTimeout((()=>{this.map.GLSDK.mapImportFilesPlugins.add(Object.assign({title:"文件上图",showList:!0},e||{}),this.map,(t=>{i&&i(t)}))}),200)):this.map.GLSDK.mapImportFilesPlugins.destory(),this.map.GLSDK.mapImportFilesPlugins}LocationQueryTool(t,e){t?(this.map.GLSDK.removeLocationQuery(),this.map.GLSDK.addLocationQuery(e||{})):this.map.GLSDK.removeLocationQuery()}MapImageCompareTool(t,e){t?(this.pluginImageCompare&&(this.pluginImageCompare.destory(),this.pluginImageCompare=null),setTimeout((()=>{this.pluginImageCompare=new Vf(e),this.pluginImageCompare.addTo(this.map)}),200)):this.pluginImageCompare&&(this.pluginImageCompare.destory(),this.pluginImageCompare=null)}MapWebPrintTool(t,e){t?(this.map.GLSDK.removeWebPrintPlugins(),this.map.GLSDK.mapAddWebPrintPlugins(Object.assign({title:"Web打印出图",mask:!0},e||{}),this.map)):this.map.GLSDK.removeWebPrintPlugins()}MapLocationTool(t,e={}){t?(this.pluginLocation&&(this.pluginLocation.destory(),this.pluginLocation=null),setTimeout((()=>{this.pluginLocation=new Hf(e),this.pluginLocation.addTo(this.map)}),200)):this.pluginLocation&&(this.pluginLocation.destory(),this.pluginLocation=null)}Measure3DAreaTool(t,e){if(t){this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new Vy(this.map);return t.start(),e&&(t.endCallback=e),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1},t}return this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,null}Measure3DLengthTool(t,e){if(t){this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,this.map.M.isDoingDraw&&this.map.M.action.closeActive(),this.map.GLSDK.mapClearDraw(),this.map.M.action.clear(),this.map.M.setCursor("Crosshair");const t=new Wy(this.map);return t.start(),e&&(t.endCallback=e),this.map.M.action.measure=t,this.active=!0,this.map.M.isDoingDraw=!0,this.map.M.action.closeActive=()=>{this.map.M.action.measure&&this.map.M.action.measure.clear(),this.active=!1},t}return this.map.M.action.measure&&this.map.M.action.measure.clear(),this.map.M.isDoingDraw=!1,null}cubeSectionAnalysisTool(t,e){if(t){this.pluginCube&&(this.pluginCube.destory(),this.pluginCube=null);let t=new of(e);t.addTo(this.map),t.closeCallback=()=>{e&&e.closeCallback&&e.closeCallback()},this.pluginCube=t}else this.pluginCube&&(this.pluginCube.destory(),this.pluginCube=null);return this.pluginCube}linearExtrudeAnalysisTool(t,e){if(t){this.pluginExtrude&&(this.pluginExtrude.destory(),this.pluginExtrude=null);let t=new cf(e);t.addTo(this.map),t.closeCallback=()=>{e&&e.closeCallback&&e.closeCallback()},this.pluginExtrude=t}else this.pluginExtrude&&(this.pluginExtrude.destory(),this.pluginExtrude=null);return this.pluginExtrude}sightLineAnalysisTool(t,e){if(t){this.pluginSight&&(this.pluginSight.destory(),this.pluginSight=null);let t=new ef(e);t.addTo(this.map),t.closeCallback=()=>{e&&e.closeCallback&&e.closeCallback()},this.pluginSight=t}else this.pluginSight&&(this.pluginSight.destory(),this.pluginSight=null);return this.pluginSight}mapRoamingTool(t,e){if(t){this.pluginRoaming&&(this.pluginRoaming.destory(),this.pluginRoaming=null);let t=new Jf(e);t.addTo(this.map),t.closeCallback=()=>{e&&e.closeCallback&&e.closeCallback()},this.pluginRoaming=t}else this.pluginRoaming&&(this.pluginRoaming.destory(),this.pluginRoaming=null);return this.pluginRoaming}mapPickPointTool(t,e){if(t){this.pluginPick&&(this.pluginPick.destory(),this.pluginPick=null);let t=new t_(e);t.addTo(this.map),t.closeCallback=()=>{e&&e.closeCallback&&e.closeCallback()},this.pluginPick=t}else this.pluginPick&&(this.pluginPick.destory(),this.pluginPick=null);return this.pluginPick}},t.MapWaterMark=Zu,t.MapWebPrintPlugins=om,t.MapmostOnemapGL=Cm,t.MapmostOnemapViewX=bm,t.MarkerFactory=Fd,t.Measure3DArea=Vy,t.Measure3DLength=Wy,t.MedoxMapDraw=pg,t.Popup=class{constructor(t){this.options=t,this.id=t.id||"popup_"+Math.random(),this.layerId=t.layerId,this.data=t.data||{},this.location=this.getLocation(t.location||this.data.shape),this.anchor=t.anchor||"bottom",this.offsets=t.offsets||[0,-10],this.className=t.className||"map-popup",this.template=t.template||Gf,this.globalPopup=0!=t.globalPopup,this.isCenter=void 0===t.isCenter||t.isCenter,this.mapMoreInfoDomid="map-moreinfo",this.map=null,this.activePopup=null}addTo(t){this.map=t;var e=this.map.enableTransform;e&&(this.location=np(e.srid,null,this.location)),this.map.sz2000sdk&&(this.location=this.map.MapmostSDKConvert.fromDefinedProj(this.location)),this.globalPopup&&this.map.GLSDK.removeDataToMapPopup(),this.map.projection?(this.activePopup=new I.default.Popup({closeOnClick:!1,closeButton:!1,offset:this.offsets,anchor:this.anchor,className:this.className}).setCoordinate(this.location).setOffset(this.offsets).setHTML(`<div id="${this.id}"></div>`).addTo(this.map),this.activePopup.setCoordinate(this.location).addTo(this.map)):(this.activePopup=new I.default.Popup({closeOnClick:!1,closeButton:!1,anchor:this.anchor,className:this.className}).setLngLat(this.location).setOffset(this.offsets).setHTML(`<div id="${this.id}"></div>`).addTo(this.map),this.activePopup.setLngLat(this.location).addTo(this.map));const i=new(w.default.extend(this.template))({data:{onemapConfig:this.map.GLSDK.getOnemapConfig(),data:this.data}});i.close=()=>{this.remove(),this.map.GLSDK.unHighLight(),this.close()},i.actions=(t,e)=>{switch(t.extraCode){case"justMapActionCallback":default:this.actions(t,this.options);break;case"moreinfo":this.moreinfo(t,this.options,e)}};const s=document.getElementById(`${this.id}`);return i.$mount(s),this.isCenter&&this.map.flyTo({center:this.location}),this.globalPopup&&(this.map.GLSDK.dataToMapPopup=this),this}getLocation(t){var e=t;switch(typeof t){case"string":e=rp(e);break;case"object":t.coordinates&&(e=lp(t={type:"feature",geometry:t})),t.shape&&(e=rp(t.shape))}return e}close(){}actions(t,e){}moreinfo(t,e,i){const s=t,a=s.extraMethod.replace("*","#");s.srcUrl=a;const n=this.map.MedomapTemplateFactory.getInstance("MEDOMAP_MOREINFO_DEFAULT",{domid:this.mapMoreInfoDomid,data:i,area:this.getArea(a),actionData:s});this.map.ExAPI.appendMapControlContainer(n)}getArea(t){let e=Yo.getQueryString("layer_w",t)||.4*document.documentElement.clientWidth,i=Yo.getQueryString("layer_h",t)||.5*document.documentElement.clientHeight;e<300&&(e=800),i<300&&(i=500);return[e,i]}remove(){this.activePopup&&this.activePopup.remove(),this.globalPopup&&(this.map.GLSDK.dataToMapPopup=null)}},t.PopupTemplate=Gf,t.SightLineAnalysis=ef,t.Viewshed3DAnalysis=class extends Xy{constructor(t){super(t),this.position=null,this.pitch=90,this.bearing=0,this.distance=0,this.viewHeight=void 0!==this.options.viewHeight?this.options.viewHeight:1.8,this.analysisOptions=Object.assign({fovX:90,fovY:60,visibleColor:"#007f00",visibleOpacity:.5,invisibleColor:"#990000",invisibleOpacity:.5,wireframeColor:"#ffffff",wireframeDisplay:!0,wireframeDensity:8},this.options.analysis),this.viewPointId="viewPoint",this.destoryCallback=null}addTo(t){this.map=t,this.init("ViewshedAnalysis"),this.subscribeMapClear();var e=0;this.map.M.isDoingDraw=!1,this.mouseMove=t=>{const i=this.getPosition(t);if(i[2]<=1&&(i[2]=0),!this.position)return void this.showTipsPopup(i,"点击拾取观察点!");this.showTipsPopup(i,"再次点击完成可视域!"),e=1;const s=this.position,a=_p(s,i);this.bearing=-a,this.pitch=90+vp(s,i,0),this.distance=xp(s,i),this.updateAnalysis(Object.assign({position:2==s.length?s.concat([this.viewHeight]):s,pitch:this.pitch,bearing:this.bearing,distance:this.distance},this.analysisOptions))},this.mouseDown=t=>{if(1==e)return this.map.ExAPI.setCursor(""),void this.destoryEvent();this.position=this.getPosition(t),this.add3DPoint(JSON.parse(JSON.stringify(this.position)))},this.map.on("click",this.mouseDown),this.map.on("mousemove",this.mouseMove),this.map.M.isDoingDraw=!0}updateAnalysis(t){this.analysis.analyse(JSON.parse(JSON.stringify(t)))}add3DPoint(t){2==t.length&&t.push(this.viewHeight);let e={id:this.viewPointId,type:"model",callback:function(e,i){i.addPoints({type:"sphere",size:2,color:16777215,opacity:1,data:[{coordinate:t}]})}};this.map.addLayer(e)}getPosition(t){const e={type:t.coordinate?"coordinate":"lngLat",location:[t.lngLat.lng,t.lngLat.lat]};return"coordinate"==e.type&&(e.location=t.coordinate),e.location}destory(){this.map.removeLayer(this.viewPointId),this.destoryEvent(),this.analysis&&this.analysis.clear(),this.destoryCallback&&this.destoryCallback()}},t.convertGeoJSONCoordinate=Sp,t.default=_v,t.getLineDistance=Lp,t.getPolygonArea=Cp,t.getResolutionFromScaleDpi=dp,t.getResolutionFromZoom=gp,t.getScaleFromResolutionDpi=mp,t.getZoomFromResolution=yp,t.jsts=ys,t.jstsIsVaild=ep,t.normalizeScale=up,t.projTransform=np,t.projTransformToGeoJSON=sp,t.projTransformToWkt=ip,t.st_area=xs,t.st_boundsbydistance=Tp,t.st_calc2bearing=_p,t.st_calc2pitch=vp,t.st_calcarea2wkt=Ip,t.st_centroid=Cs,t.st_clockLine=Dp,t.st_fitBoundsToMap=pp,t.st_geojson2wkt=_s,t.st_getbufferbydata=fp,t.st_getcenterbyfeature=lp,t.st_getcenterbywkt=rp,t.st_length=vs,t.st_length_point=xp,t.st_mergegeojson=wp,t.st_mergewkt=bp,t.st_shape2geojson2=cp,t.st_wkt2bounds=Ep,t.st_wkt2geojson=fs,t.tileRowColToXY=Mp,Object.defineProperty(t,"__esModule",{value:!0})}));