@supermapgis/vue-iclient-leaflet 11.2.1 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iclient-leaflet-vue.css +23 -9
- package/dist/iclient-leaflet-vue.js +21689 -44354
- package/dist/iclient-leaflet-vue.min.css +2 -2
- package/dist/iclient-leaflet-vue.min.js +39 -293
- package/lib/_assets/iconfont/icon-sm-components.css +21 -7
- package/lib/_assets/iconfont/icon-sm-components.ttf +0 -0
- package/lib/_assets/iconfont/icon-sm-components.woff +0 -0
- package/lib/_assets/iconfont/icon-sm-components.woff2 +0 -0
- package/lib/_lang/en.js +20 -8
- package/lib/_lang/index.js +18 -18
- package/lib/_lang/zh.js +20 -8
- package/lib/_mixin/AntdRender.js +15 -17
- package/lib/_mixin/Card.js +10 -11
- package/lib/_mixin/GridLayer.js +4 -4
- package/lib/_mixin/Layer.js +4 -4
- package/lib/_mixin/Options.js +2 -2
- package/lib/_mixin/Popper.js +2 -2
- package/lib/_mixin/Theme.js +13 -15
- package/lib/_mixin/ThirdService.js +15 -16
- package/lib/_mixin/TileLayer.js +4 -4
- package/lib/_mixin/Timer.js +8 -9
- package/lib/_mixin/VmUpdater.js +10 -11
- package/lib/_mixin/map-events.js +8 -9
- package/lib/_mixin/map-getter.js +13 -14
- package/lib/_types/AddressMatchParameter.js +2 -2
- package/lib/_types/GeoJSONParamter.js +2 -2
- package/lib/_types/RestDataParameter.js +5 -6
- package/lib/_types/RestMapParameter.js +5 -6
- package/lib/_types/RestParameter.js +2 -2
- package/lib/_types/event/BaseTypes.js +2 -2
- package/lib/_types/event/Event.js +4 -4
- package/lib/_types/event/Events.js +10 -10
- package/lib/_types/event/Pixel.js +2 -2
- package/lib/_types/event/Util.js +2 -2
- package/lib/_types/iPortalDataParameter.js +3 -2
- package/lib/_types/iServerBaseParameter.js +3 -2
- package/lib/_types/iServerDataParameter.js +5 -6
- package/lib/_types/iServerMapParameter.js +5 -6
- package/lib/_types/index.js +18 -18
- package/lib/_types/map-event.js +6 -6
- package/lib/_utils/EchartsDataService.js +24 -24
- package/lib/_utils/RestService.js +1345 -1149
- package/lib/_utils/epsg-define.js +45 -34
- package/lib/_utils/get-features.js +23 -10
- package/lib/_utils/global-event.js +6 -6
- package/lib/_utils/iPortalDataService.js +1368 -1147
- package/lib/_utils/iServerRestService.js +1518 -1269
- package/lib/_utils/props-binder.js +2 -2
- package/lib/_utils/statistics.js +8 -17
- package/lib/_utils/style/color/colorPalette.js +4 -4
- package/lib/_utils/style/color/serialColors.js +8 -8
- package/lib/_utils/style/theme/chart.js +1343 -1146
- package/lib/_utils/style/theme/set-theme.js +10 -10
- package/lib/_utils/style/theme/theme.json +6 -6
- package/lib/_utils/util.js +12 -12
- package/lib/_utils/vue-types/utils.js +2 -2
- package/lib/attribute-panel/style/attribute-panel.css +1 -0
- package/lib/attribute-panel/style/css.js +7 -0
- package/lib/attribute-panel/style/index.js +7 -0
- package/lib/avatar/index.js +25 -25
- package/lib/border/index.js +77 -77
- package/lib/breadcrumb/index.js +47 -41
- package/lib/button/index.js +53 -50
- package/lib/card/index.js +47 -41
- package/lib/chart/index.js +1437 -1238
- package/lib/checkbox/index.js +36 -33
- package/lib/collapse/index.js +39 -36
- package/lib/collapse-card/index.js +71 -76
- package/lib/color-picker/index.js +48 -49
- package/lib/date-picker/index.js +107 -95
- package/lib/dropdown/index.js +27 -27
- package/lib/empty/index.js +27 -27
- package/lib/icon/index.js +25 -25
- package/lib/identify/index.js +58 -59
- package/lib/iframe/index.js +31 -31
- package/lib/image/index.js +226 -42
- package/lib/image/style/image.css +1 -1
- package/lib/index.js +4 -4
- package/lib/indicator/index.js +70 -67
- package/lib/init.js +8 -8
- package/lib/input/index.js +150 -135
- package/lib/input-number/index.js +100 -97
- package/lib/layout/index.js +72 -60
- package/lib/liquid-fill/index.js +73 -73
- package/lib/marker/index.js +43 -44
- package/lib/menu/index.js +47 -41
- package/lib/message/index.js +3 -3
- package/lib/message/style/message.css +1 -1
- package/lib/modal/index.js +67 -67
- package/lib/modal/style/modal.css +1 -1
- package/lib/notification/index.js +6 -6
- package/lib/notification/style/notification.css +1 -1
- package/lib/pagination/index.js +34 -34
- package/lib/popup/index.js +45 -46
- package/lib/progress/index.js +440 -440
- package/lib/radio/index.js +48 -42
- package/lib/select/index.js +47 -41
- package/lib/slider/index.js +27 -27
- package/lib/slideshow/index.js +103 -160
- package/lib/spin/index.js +30 -30
- package/lib/steps/index.js +35 -32
- package/lib/switch/index.js +25 -25
- package/lib/table/index.js +50 -44
- package/lib/table/style/table.css +1 -1
- package/lib/table-popup/index.js +43 -37
- package/lib/table-popup/style/table-popup.css +1 -1
- package/lib/tabs/index.js +35 -32
- package/lib/text/index.js +39 -39
- package/lib/tile-layer/index.js +35 -36
- package/lib/time-line/index.js +41 -43
- package/lib/time-picker/index.js +27 -27
- package/lib/time-range/index.js +53 -55
- package/lib/time-slider/index.js +73 -75
- package/lib/time-text/index.js +31 -31
- package/lib/tooltip/index.js +25 -25
- package/lib/tooltip/style/tooltip.css +1 -0
- package/lib/transfer/index.js +27 -27
- package/lib/tree/index.js +48 -42
- package/lib/tree-select/index.js +37 -34
- package/lib/video-player/index.js +98 -97
- package/lib/video-player/style/video-player.css +1 -1
- package/lib/web-map/index.js +2336 -103
- package/package.json +2 -4
- package/src/common/_assets/iconfont/icon-sm-components.css +21 -7
- package/src/common/_assets/iconfont/icon-sm-components.ttf +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.woff +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.woff2 +0 -0
- package/src/common/_lang/en.js +19 -8
- package/src/common/_lang/zh.js +18 -6
- package/src/common/_mixin/Card.ts +1 -1
- package/src/common/_types/iPortalDataParameter.js +1 -0
- package/src/common/_types/iServerBaseParameter.ts +3 -0
- package/src/common/_utils/epsg-define.js +32 -27
- package/src/common/_utils/get-features.js +13 -2
- package/src/common/_utils/iPortalDataService.js +14 -3
- package/src/common/_utils/iServerRestService.js +144 -78
- package/src/common/_utils/statistics.js +6 -14
- package/src/common/_utils/style/theme/theme.json +6 -6
- package/src/common/attribute-panel/AttributePanel.vue +58 -0
- package/src/common/attribute-panel/__test__/AttributePanel.spec.js +39 -0
- package/src/common/attribute-panel/index.js +9 -0
- package/src/common/attribute-panel/style/attribute-panel.scss +35 -0
- package/src/common/attribute-panel/style/index.js +4 -0
- package/src/common/collapse-card/style/collapse-card.scss +2 -2
- package/src/common/iframe/Iframe.vue +1 -1
- package/src/common/image/Image.vue +68 -6
- package/src/common/image/style/image.scss +32 -0
- package/src/common/message/style/message.scss +1 -0
- package/src/common/modal/style/modal.scss +36 -0
- package/src/common/notification/style/notification.scss +9 -0
- package/src/common/slideshow/Slideshow.vue +42 -95
- package/src/common/slideshow/Swiper.js +1 -1
- package/src/common/table/style/table.scss +36 -0
- package/src/common/table-popup/TablePopup.vue +5 -0
- package/src/common/tooltip/style/tooltip.scss +3 -0
- package/src/common/video-player/style/video-player.scss +1 -1
- package/src/leaflet/entrys.json +0 -2
- package/src/leaflet/package.json +2 -4
- package/src/leaflet/web-map/WebMap.vue +4 -4
- package/src/leaflet/web-map/WebMapViewModel.ts +64 -17
- package/static/libs/iclient-common/iclient-common-webmapv2base.js +2 -0
- package/static/libs/iclient-common/iclient-common.js +1 -1
- package/static/libs/iclient-leaflet/iclient-leaflet.min.js +5 -1738
- package/lib/_assets/iconfont/icon-sm-components.eot +0 -0
- package/lib/_assets/iconfont/icon-sm-components.svg +0 -197
- package/lib/_mixin/WebMapBase.js +0 -3467
- package/lib/_utils/WebMapService.js +0 -1607
- package/src/common/_assets/iconfont/icon-sm-components.eot +0 -0
- package/src/common/_assets/iconfont/icon-sm-components.svg +0 -197
- package/src/common/_utils/WebMapService.ts +0 -1292
- package/src/common/web-map/WebMapBase.ts +0 -1178
- package/src/common/web-map/config/MunicipalCenter.json +0 -1
- package/src/common/web-map/config/ProvinceCenter.json +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see iclient-common.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return function(){var e={693:function(e){!function(t){"use strict";if(t.__disableNativeFetch||!t.fetch){a.prototype.append=function(e,t){e=o(e),t=i(t);var r=this.map[e];r||(r=[],this.map[e]=r),r.push(t)},a.prototype.delete=function(e){delete this.map[o(e)]},a.prototype.get=function(e){var t=this.map[o(e)];return t?t[0]:null},a.prototype.getAll=function(e){return this.map[o(e)]||[]},a.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},a.prototype.set=function(e,t){this.map[o(e)]=[i(t)]},a.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach((function(r){this.map[r].forEach((function(n){e.call(t,n,r,this)}),this)}),this)};var r={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},n=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this)},c.call(p.prototype),c.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new a(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var s=[301,302,303,307,308];m.redirect=function(e,t){if(-1===s.indexOf(t))throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},t.Headers=a,t.Request=p,t.Response=m,t.fetch=function(e,t){return new Promise((function(n,s){var o;o=p.prototype.isPrototypeOf(e)&&!t?e:new p(e,t);var i=new XMLHttpRequest,a=!1;function l(){if(4===i.readyState){var e=1223===i.status?204:i.status;if(e<100||e>599){if(a)return;return a=!0,void s(new TypeError("Network request failed"))}var t={status:e,statusText:i.statusText,headers:f(i),url:"responseURL"in i?i.responseURL:/^X-Request-URL:/m.test(i.getAllResponseHeaders())?i.getResponseHeader("X-Request-URL"):void 0},r="response"in i?i.response:i.responseText;a||(a=!0,n(new m(r,t)))}}i.onreadystatechange=l,i.onload=l,i.onerror=function(){a||(a=!0,s(new TypeError("Network request failed")))},i.open(o.method,o.url,!0);try{"include"===o.credentials&&("withCredentials"in i?i.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(e){console&&console.warn&&console.warn("set withCredentials error:"+e)}"responseType"in i&&r.blob&&(i.responseType="blob"),o.headers.forEach((function(e,t){i.setRequestHeader(t,e)})),i.send(void 0===o._bodyInit?null:o._bodyInit)}))},t.fetch.polyfill=!0,e.exports&&(e.exports=t.fetch)}function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){this.map={},e instanceof a?e.forEach((function(e,t){this.append(t,e)}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function h(e){var t=new FileReader;return t.readAsArrayBuffer(e),u(t)}function c(){return this.bodyUsed=!1,this._initBody=function(e,t){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(r.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(r.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.blob?(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(h)},this.text=function(){var e,t,r,n,s,o,i,a=l(this);if(a)return a;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,r=new FileReader,n=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",s=/charset\=[0-9a-zA-Z\-\_]*;?/,o=e.type.match(s)||n.match(s),i=[e],o&&i.push(o[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,i),u(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){return l(this)||Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(e,t){var r,s,o=(t=t||{}).body;if(p.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new a(e.headers)),this.method=e.method,this.mode=e.mode,o||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new a(t.headers)),this.method=(s=(r=t.method||this.method||"GET").toUpperCase(),n.indexOf(s)>-1?s:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o,t)}function d(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(s))}})),t}function f(e){var t=new a;return e.getAllResponseHeaders().trim().split("\n").forEach((function(e){var r=e.trim().split(":"),n=r.shift().trim(),s=r.join(":").trim();t.append(n,s)})),t}function m(e,t){t||(t={}),this._initBody(e,t),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof a?t.headers:new a(t.headers),this.url=t.url||""}}("undefined"!=typeof self?self:this)},144:function(e,t){var r,n;r=function(e,t){"use strict";var r=5e3,n="callback";function s(e){try{delete window[e]}catch(t){window[e]=void 0}}function o(e){var t=document.getElementById(e);t&&document.getElementsByTagName("head")[0].removeChild(t)}t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=e,a=t.timeout||r,l=t.jsonpCallback||n,u=void 0;return new Promise((function(r,n){var h=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),c=l+"_"+h;window[h]=function(e){r({ok:!0,json:function(){return Promise.resolve(e)}}),u&&clearTimeout(u),o(c),s(h)},i+=-1===i.indexOf("?")?"?":"&";var p=document.createElement("script");p.setAttribute("src",""+i+l+"="+h),t.charset&&p.setAttribute("charset",t.charset),p.id=c,document.getElementsByTagName("head")[0].appendChild(p),u=setTimeout((function(){n(new Error("JSONP request to "+e+" timed out")),s(h),o(c),window[h]=function(){s(h)}}),a),p.onerror=function(){n(new Error("JSONP request to "+e+" failed")),s(h),o(c),u&&clearTimeout(u)}}))}},void 0===(n=r.apply(t,[t,e]))||(e.exports=n)},107:function(e,t,r){!function(){"use strict";function e(e){var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){return t.reject(r)}))}))}function t(e){return new this((function(t,r){if(!e||void 0===e.length)return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(e);if(0===n.length)return t([]);var s=n.length;function o(e,r){if(r&&("object"==typeof r||"function"==typeof r)){var i=r.then;if("function"==typeof i)return void i.call(r,(function(t){o(e,t)}),(function(r){n[e]={status:"rejected",reason:r},0==--s&&t(n)}))}n[e]={status:"fulfilled",value:r},0==--s&&t(n)}for(var i=0;i<n.length;i++)o(i,n[i])}))}var n=setTimeout;function s(e){return Boolean(e&&void 0!==e.length)}function o(){}function i(e){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn((function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var n;try{n=r(e._value)}catch(e){return void u(t.promise,e)}l(t.promise,n)}else(1===e._state?l:u)(t.promise,e._value)}))):e._deferreds.push(t)}function l(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var r=t.then;if(t instanceof i)return e._state=3,e._value=t,void h(e);if("function"==typeof r)return void p((n=r,s=t,function(){n.apply(s,arguments)}),e)}e._state=1,e._value=t,h(e)}catch(t){u(e,t)}var n,s}function u(e,t){e._state=2,e._value=t,h(e)}function h(e){2===e._state&&0===e._deferreds.length&&i._immediateFn((function(){e._handled||i._unhandledRejectionFn(e._value)}));for(var t=0,r=e._deferreds.length;t<r;t++)a(e,e._deferreds[t]);e._deferreds=null}function c(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function p(e,t){var r=!1;try{e((function(e){r||(r=!0,l(t,e))}),(function(e){r||(r=!0,u(t,e))}))}catch(e){if(r)return;r=!0,u(t,e)}}i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var r=new this.constructor(o);return a(this,new c(e,t,r)),r},i.prototype.finally=e,i.all=function(e){return new i((function(t,r){if(!s(e))return r(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(e);if(0===n.length)return t([]);var o=n.length;function i(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,(function(t){i(e,t)}),r)}n[e]=s,0==--o&&t(n)}catch(e){r(e)}}for(var a=0;a<n.length;a++)i(a,n[a])}))},i.allSettled=t,i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i((function(t){t(e)}))},i.reject=function(e){return new i((function(t,r){r(e)}))},i.race=function(e){return new i((function(t,r){if(!s(e))return r(new TypeError("Promise.race accepts an array"));for(var n=0,o=e.length;n<o;n++)i.resolve(e[n]).then(t,r)}))},i._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var d=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();"function"!=typeof d.Promise?d.Promise=i:(d.Promise.prototype.finally||(d.Promise.prototype.finally=e),d.Promise.allSettled||(d.Promise.allSettled=t))}()},251:function(e,t,r){var n,s;!function(o,i){"use strict";e.exports?e.exports=i():void 0===(s="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=s)}(0,(function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),s=n.length,o=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[s-1]&&""===n[s-2]&&n.pop(),-1!==n[(s=n.length)-1].indexOf(".")&&(o=7),t=0;t<s&&""!==n[t];t++);if(t<o)for(n.splice(t,1,"0000");n.length<o;)n.splice(t,0,"0000");for(var i=0;i<o;i++){r=n[i].split("");for(var a=0;a<3&&"0"===r[0]&&r.length>1;a++)r.splice(0,1);n[i]=r.join("")}var l=-1,u=0,h=0,c=-1,p=!1;for(i=0;i<o;i++)p?"0"===n[i]?h+=1:(p=!1,h>u&&(l=c,u=h)):"0"===n[i]&&(p=!0,c=i,h=1);h>u&&(l=c,u=h),u>1&&n.splice(l,u,""),s=n.length;var d="";for(""===n[0]&&(d=":"),i=0;i<s&&(d+=n[i],i!==s-1);i++)d+=":";return""===n[s-1]&&(d+=":"),d},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}}))},106:function(e,t,r){var n,s;!function(o,i){"use strict";e.exports?e.exports=i():void 0===(s="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=s)}(0,(function(e){"use strict";var t=e&&e.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var s=r.list[e.slice(t+1)];return!!s&&s.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var s=r.list[e.slice(t+1)];return s?s.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r}))},998:function(e,t,r){var n,s,o;!function(i,a){"use strict";e.exports?e.exports=a(r(132),r(251),r(106)):(s=[r(132),r(251),r(106)],void 0===(o="function"==typeof(n=a)?n.apply(t,s):n)||(e.exports=o))}(0,(function(e,t,r,n){"use strict";var s=n&&n.URI;function o(e,t){var r=arguments.length>=1;if(!(this instanceof o))return r?arguments.length>=2?new o(e,t):new o(e):new o;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}o.version="1.19.11";var i=o.prototype,a=Object.prototype.hasOwnProperty;function l(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function h(e){return"Array"===u(e)}function c(e,t){var r,n,s={};if("RegExp"===u(t))s=null;else if(h(t))for(r=0,n=t.length;r<n;r++)s[t[r]]=!0;else s[t]=!0;for(r=0,n=e.length;r<n;r++)(s&&void 0!==s[e[r]]||!s&&t.test(e[r]))&&(e.splice(r,1),n--,r--);return e}function p(e,t){var r,n;if(h(t)){for(r=0,n=t.length;r<n;r++)if(!p(e,t[r]))return!1;return!0}var s=u(t);for(r=0,n=e.length;r<n;r++)if("RegExp"===s){if("string"==typeof e[r]&&e[r].match(t))return!0}else if(e[r]===t)return!0;return!1}function d(e,t){if(!h(e)||!h(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function f(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return o.domAttributes[t]}},o.encode=g,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=g,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(e,t){var r=o.encode(e+"");return void 0===t&&(t=o.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},o.decodeQuery=function(e,t){e+="",void 0===t&&(t=o.escapeQuerySpace);try{return o.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var y,v={encode:"encode",decode:"decode"},b=function(e,t){return function(r){try{return o[t](r+"").replace(o.characters[e][t].expression,(function(r){return o.characters[e][t].map[r]}))}catch(e){return r}}};for(y in v)o[y+"PathSegment"]=b("pathname",v[y]),o[y+"UrnPathSegment"]=b("urnpath",v[y]);var S=function(e,t,r){return function(n){var s;s=r?function(e){return o[t](o[r](e))}:o[t];for(var i=(n+"").split(e),a=0,l=i.length;a<l;a++)i[a]=s(i[a]);return i.join(e)}};function w(e){return function(t,r){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!r),this)}}function x(e,t){return function(r,n){return void 0===r?this._parts[e]||"":(null!==r&&(r+="").charAt(0)===t&&(r=r.substring(1)),this._parts[e]=r,this.build(!n),this)}}o.decodePath=S("/","decodePathSegment"),o.decodeUrnPath=S(":","decodeUrnPathSegment"),o.recodePath=S("/","encodePathSegment","decode"),o.recodeUrnPath=S(":","encodeUrnPathSegment","decode"),o.encodeReserved=b("reserved","encode"),o.parse=function(e,t){var r;return t||(t={preventInvalidHostname:o.preventInvalidHostname}),(r=(e=(e=e.replace(o.leading_whitespace_expression,"")).replace(o.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=o.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(o.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=o.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},o.parseHost=function(e,t){e||(e="");var r,n,s=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===s&&(s=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,s)||null,"/"===t.port&&(t.port=null);else{var i=e.indexOf(":"),a=e.indexOf("/"),l=e.indexOf(":",i+1);-1!==l&&(-1===a||l<a)?(t.hostname=e.substring(0,s)||null,t.port=null):(n=e.substring(0,s).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(s).charAt(0)&&(s++,e="/"+e),t.preventInvalidHostname&&o.ensureValidHostname(t.hostname,t.protocol),t.port&&o.ensureValidPort(t.port),e.substring(s)||"/"},o.parseAuthority=function(e,t){return e=o.parseUserinfo(e,t),o.parseHost(e,t)},o.parseUserinfo=function(e,t){var r=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var n,s=e.indexOf("/"),i=e.lastIndexOf("@",s>-1?s:e.length-1);return i>-1&&(-1===s||i<s)?(n=e.substring(0,i).split(":"),t.username=n[0]?o.decode(n[0]):null,n.shift(),t.password=n[0]?o.decode(n.join(":")):null,e=r.substring(i+1)):(t.username=null,t.password=null),e},o.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,s,i={},l=e.split("&"),u=l.length,h=0;h<u;h++)r=l[h].split("="),n=o.decodeQuery(r.shift(),t),s=r.length?o.decodeQuery(r.join("="),t):null,"__proto__"!==n&&(a.call(i,n)?("string"!=typeof i[n]&&null!==i[n]||(i[n]=[i[n]]),i[n].push(s)):i[n]=s);return i},o.build=function(e){var t="",r=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",r=!0),t+=o.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&r&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},o.buildHost=function(e){var t="";return e.hostname?(o.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},o.buildAuthority=function(e){return o.buildUserinfo(e)+o.buildHost(e)},o.buildUserinfo=function(e){var t="";return e.username&&(t+=o.encode(e.username)),e.password&&(t+=":"+o.encode(e.password)),t&&(t+="@"),t},o.buildQuery=function(e,t,r){var n,s,i,l,u="";for(s in e)if("__proto__"!==s&&a.call(e,s))if(h(e[s]))for(n={},i=0,l=e[s].length;i<l;i++)void 0!==e[s][i]&&void 0===n[e[s][i]+""]&&(u+="&"+o.buildQueryParameter(s,e[s][i],r),!0!==t&&(n[e[s][i]+""]=!0));else void 0!==e[s]&&(u+="&"+o.buildQueryParameter(s,e[s],r));return u.substring(1)},o.buildQueryParameter=function(e,t,r){return o.encodeQuery(e,r)+(null!==t?"="+o.encodeQuery(t,r):"")},o.addQuery=function(e,t,r){if("object"==typeof t)for(var n in t)a.call(t,n)&&o.addQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=r);"string"==typeof e[t]&&(e[t]=[e[t]]),h(r)||(r=[r]),e[t]=(e[t]||[]).concat(r)}},o.setQuery=function(e,t,r){if("object"==typeof t)for(var n in t)a.call(t,n)&&o.setQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===r?null:r}},o.removeQuery=function(e,t,r){var n,s,i;if(h(t))for(n=0,s=t.length;n<s;n++)e[t[n]]=void 0;else if("RegExp"===u(t))for(i in e)t.test(i)&&(e[i]=void 0);else if("object"==typeof t)for(i in t)a.call(t,i)&&o.removeQuery(e,i,t[i]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===u(r)?!h(e[t])&&r.test(e[t])?e[t]=void 0:e[t]=c(e[t],r):e[t]!==String(r)||h(r)&&1!==r.length?h(e[t])&&(e[t]=c(e[t],r)):e[t]=void 0:e[t]=void 0}},o.hasQuery=function(e,t,r,n){switch(u(t)){case"String":break;case"RegExp":for(var s in e)if(a.call(e,s)&&t.test(s)&&(void 0===r||o.hasQuery(e,s,r)))return!0;return!1;case"Object":for(var i in t)if(a.call(t,i)&&!o.hasQuery(e,i,t[i]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(r)){case"Undefined":return t in e;case"Boolean":return r===Boolean(h(e[t])?e[t].length:e[t]);case"Function":return!!r(e[t],t,e);case"Array":return!!h(e[t])&&(n?p:d)(e[t],r);case"RegExp":return h(e[t])?!!n&&p(e[t],r):Boolean(e[t]&&e[t].match(r));case"Number":r=String(r);case"String":return h(e[t])?!!n&&p(e[t],r):e[t]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var e=[],t=[],r=0,n=0;n<arguments.length;n++){var s=new o(arguments[n]);e.push(s);for(var i=s.segment(),a=0;a<i.length;a++)"string"==typeof i[a]&&t.push(i[a]),i[a]&&r++}if(!t.length||!r)return new o("");var l=new o("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||l.path("/"+l.path()),l.normalize()},o.commonPath=function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r)){r--;break}return r<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(r)&&"/"===t.charAt(r)||(r=e.substring(0,r).lastIndexOf("/")),e.substring(0,r+1))},o.withinString=function(e,t,r){r||(r={});var n=r.start||o.findUri.start,s=r.end||o.findUri.end,i=r.trim||o.findUri.trim,a=r.parens||o.findUri.parens,l=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var u=n.exec(e);if(!u)break;var h=u.index;if(r.ignoreHtml){var c=e.slice(Math.max(h-3,0),h);if(c&&l.test(c))continue}for(var p=h+e.slice(h).search(s),d=e.slice(h,p),f=-1;;){var m=a.exec(d);if(!m)break;var g=m.index+m[0].length;f=Math.max(f,g)}if(!((d=f>-1?d.slice(0,f)+d.slice(f).replace(i,""):d.replace(i,"")).length<=u[0].length||r.ignore&&r.ignore.test(d))){var y=t(d,h,p=h+d.length,e);void 0!==y?(y=String(y),e=e.slice(0,h)+y+e.slice(p),n.lastIndex=h+y.length):n.lastIndex=p}}return n.lastIndex=0,e},o.ensureValidHostname=function(t,r){var n=!!t,s=!1;if(!!r&&(s=p(o.hostProtocols,r)),s&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},o.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=s),this},i.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},i.clone=function(){return new o(this)},i.valueOf=i.toString=function(){return this.build(!1)._string},i.protocol=w("protocol"),i.username=w("username"),i.password=w("password"),i.hostname=w("hostname"),i.port=w("port"),i.query=x("query","?"),i.fragment=x("fragment","#"),i.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},i.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},i.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?o.decodeUrnPath:o.decodePath)(r):r}return this._parts.urn?this._parts.path=e?o.recodeUrnPath(e):"":this._parts.path=e?o.recodePath(e):"/",this.build(!t),this},i.path=i.pathname,i.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=o._parts();var n=e instanceof o,s="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[o.getDomAttribute(e)]||"",s=!1),!n&&s&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=o.parse(String(e),this._parts);else{if(!n&&!s)throw new TypeError("invalid input");var i=n?e._parts:e;for(r in i)"query"!==r&&a.call(this._parts,r)&&(this._parts[r]=i[r]);i.query&&this.query(i.query,!1)}return this.build(!t),this},i.is=function(e){var t=!1,n=!1,s=!1,i=!1,a=!1,l=!1,u=!1,h=!this._parts.urn;switch(this._parts.hostname&&(h=!1,n=o.ip4_expression.test(this._parts.hostname),s=o.ip6_expression.test(this._parts.hostname),a=(i=!(t=n||s))&&r&&r.has(this._parts.hostname),l=i&&o.idn_expression.test(this._parts.hostname),u=i&&o.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return h;case"absolute":return!h;case"domain":case"name":return i;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return s;case"idn":return l;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return u}return null};var _=i.protocol,C=i.port,A=i.hostname;i.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(o.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return _.call(this,e,t)},i.scheme=i.protocol,i.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),o.ensureValidPort(e))),C.call(this,e,t))},i.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==o.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(e,this._parts.protocol)}return A.call(this,e,t)},i.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=o(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},i.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?o.buildHost(this._parts):"";if("/"!==o.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?o.buildAuthority(this._parts):"";if("/"!==o.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=o.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==e[e.length-1]&&(e+="@"),o.parseUserinfo(e,this._parts),this.build(!t),this},i.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=o.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},i.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,s=this._parts.hostname.substring(0,n),i=new RegExp("^"+l(s));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&o.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(i,e),this.build(!t),this},i.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var s=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(s,e)}return this.build(!t),this},i.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),s=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[s.toLowerCase()]&&r.get(this._parts.hostname)||s}var o;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},i.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return e?o.decodePath(n):n}var s=this._parts.path.length-this.filename().length,i=this._parts.path.substring(0,s),a=new RegExp("^"+l(i));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=o.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},i.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return e?o.decodePathSegment(n):n}var s=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(s=!0);var i=new RegExp(l(this.filename())+"$");return e=o.recodePath(e),this._parts.path=this._parts.path.replace(i,e),s?this.normalizePath(t):this.build(!t),this},i.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,s=this.filename(),i=s.lastIndexOf(".");return-1===i?"":(r=s.substring(i+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?o.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var a,u=this.suffix();if(u)a=e?new RegExp(l(u)+"$"):new RegExp(l("."+u)+"$");else{if(!e)return this;this._parts.path+="."+o.recodePath(e)}return a&&(e=o.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},i.segment=function(e,t,r){var n=this._parts.urn?":":"/",s=this.path(),o="/"===s.substring(0,1),i=s.split(n);if(void 0!==e&&"number"!=typeof e&&(r=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(o&&i.shift(),e<0&&(e=Math.max(i.length+e,0)),void 0===t)return void 0===e?i:i[e];if(null===e||void 0===i[e])if(h(t)){i=[];for(var a=0,l=t.length;a<l;a++)(t[a].length||i.length&&i[i.length-1].length)&&(i.length&&!i[i.length-1].length&&i.pop(),i.push(f(t[a])))}else(t||"string"==typeof t)&&(t=f(t),""===i[i.length-1]?i[i.length-1]=t:i.push(t));else t?i[e]=f(t):i.splice(e,1);return o&&i.unshift(""),this.path(i.join(n),r)},i.segmentCoded=function(e,t,r){var n,s,i;if("number"!=typeof e&&(r=t,t=e,e=void 0),void 0===t){if(h(n=this.segment(e,t,r)))for(s=0,i=n.length;s<i;s++)n[s]=o.decode(n[s]);else n=void 0!==n?o.decode(n):void 0;return n}if(h(t))for(s=0,i=t.length;s<i;s++)t[s]=o.encode(t[s]);else t="string"==typeof t||t instanceof String?o.encode(t):t;return this.segment(e,t,r)};var E=i.query;return i.query=function(e,t){if(!0===e)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var r=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=e.call(this,r);return this._parts.query=o.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=o.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):E.call(this,e,t)},i.setQuery=function(e,t,r){var n=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)n[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var s in e)a.call(e,s)&&(n[s]=e[s])}return this._parts.query=o.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.addQuery=function(e,t,r){var n=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(n,e,void 0===t?null:t),this._parts.query=o.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.removeQuery=function(e,t,r){var n=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(n,e,t),this._parts.query=o.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.hasQuery=function(e,t,r){var n=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(n,e,t,r)},i.setSearch=i.setQuery,i.addSearch=i.addQuery,i.removeSearch=i.removeQuery,i.hasSearch=i.hasQuery,i.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},i.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},i.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},i.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},i.normalizePath=function(e){var t,r=this._parts.path;if(!r)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var n,s,i="";for("/"!==(r=o.recodePath(r)).charAt(0)&&(t=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(i=r.substring(1).match(/^(\.\.\/)+/)||"")&&(i=i[0]);-1!==(n=r.search(/\/\.\.(\/|$)/));)0!==n?(-1===(s=r.substring(0,n).lastIndexOf("/"))&&(s=n),r=r.substring(0,s)+r.substring(n+3)):r=r.substring(3);return t&&this.is("relative")&&(r=i+r.substring(1)),this._parts.path=r,this.build(!e),this},i.normalizePathname=i.normalizePath,i.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},i.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},i.normalizeSearch=i.normalizeQuery,i.normalizeHash=i.normalizeFragment,i.iso8859=function(){var e=o.encode,t=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=e,o.decode=t}return this},i.unicode=function(){var e=o.encode,t=o.decode;o.encode=g,o.decode=unescape;try{this.normalize()}finally{o.encode=e,o.decode=t}return this},i.readable=function(){var t=this.clone();t.username("").password("").normalize();var r="";if(t._parts.protocol&&(r+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(r+=e.toUnicode(t._parts.hostname),t._parts.port&&(r+=":"+t._parts.port)):r+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(r+="/"),r+=t.path(!0),t._parts.query){for(var n="",s=0,i=t._parts.query.split("&"),a=i.length;s<a;s++){var l=(i[s]||"").split("=");n+="&"+o.decodeQuery(l[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==l[1]&&(n+="="+o.decodeQuery(l[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}r+="?"+n.substring(1)}return r+o.decodeQuery(t.hash(),!0)},i.absoluteTo=function(e){var t,r,n,s=this.clone(),i=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof o||(e=new o(e)),s._parts.protocol)return s;if(s._parts.protocol=e._parts.protocol,this._parts.hostname)return s;for(r=0;n=i[r];r++)s._parts[n]=e._parts[n];return s._parts.path?(".."===s._parts.path.substring(-2)&&(s._parts.path+="/"),"/"!==s.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),s._parts.path=(t?t+"/":"")+s._parts.path,s.normalizePath())):(s._parts.path=e._parts.path,s._parts.query||(s._parts.query=e._parts.query)),s.build(),s},i.relativeTo=function(e){var t,r,n,s,i,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new o(e).normalize(),t=a._parts,r=e._parts,s=a.path(),i=e.path(),"/"!==s.charAt(0))throw new Error("URI is already relative");if("/"!==i.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===r.protocol&&(t.protocol=null),t.username!==r.username||t.password!==r.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==r.hostname||t.port!==r.port)return a.build();if(t.hostname=null,t.port=null,s===i)return t.path="",a.build();if(!(n=o.commonPath(s,i)))return a.build();var l=r.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=l+t.path.substring(n.length)||"./",a.build()},i.equals=function(e){var t,r,n,s,i,l=this.clone(),u=new o(e),c={};if(l.normalize(),u.normalize(),l.toString()===u.toString())return!0;if(n=l.query(),s=u.query(),l.query(""),u.query(""),l.toString()!==u.toString())return!1;if(n.length!==s.length)return!1;for(i in t=o.parseQuery(n,this._parts.escapeQuerySpace),r=o.parseQuery(s,this._parts.escapeQuerySpace),t)if(a.call(t,i)){if(h(t[i])){if(!d(t[i],r[i]))return!1}else if(t[i]!==r[i])return!1;c[i]=!0}for(i in r)if(a.call(r,i)&&!c[i])return!1;return!0},i.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},i.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},i.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},o}))},132:function(e,t,r){var n;e=r.nmd(e),function(s){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var i,a=2147483647,l=36,u=26,h=38,c=700,p=/^xn--/,d=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=l-1,y=Math.floor,v=String.fromCharCode;function b(e){throw new RangeError(m[e])}function S(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function w(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+S((e=e.replace(f,".")).split("."),t).join(".")}function x(e){for(var t,r,n=[],s=0,o=e.length;s<o;)(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<o?56320==(64512&(r=e.charCodeAt(s++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),s--):n.push(t);return n}function _(e){return S(e,(function(e){var t="";return e>65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,r){var n=0;for(e=r?y(e/c):e>>1,e+=y(e/t);e>g*u>>1;n+=l)e=y(e/g);return y(n+(g+1)*e/(e+h))}function E(e){var t,r,n,s,o,i,h,c,p,d,f,m=[],g=e.length,v=0,S=128,w=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&b("not-basic"),m.push(e.charCodeAt(n));for(s=r>0?r+1:0;s<g;){for(o=v,i=1,h=l;s>=g&&b("invalid-input"),((c=(f=e.charCodeAt(s++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:l)>=l||c>y((a-v)/i))&&b("overflow"),v+=c*i,!(c<(p=h<=w?1:h>=w+u?u:h-w));h+=l)i>y(a/(d=l-p))&&b("overflow"),i*=d;w=A(v-o,t=m.length+1,0==o),y(v/t)>a-S&&b("overflow"),S+=y(v/t),v%=t,m.splice(v++,0,S)}return _(m)}function P(e){var t,r,n,s,o,i,h,c,p,d,f,m,g,S,w,_=[];for(m=(e=x(e)).length,t=128,r=0,o=72,i=0;i<m;++i)(f=e[i])<128&&_.push(v(f));for(n=s=_.length,s&&_.push("-");n<m;){for(h=a,i=0;i<m;++i)(f=e[i])>=t&&f<h&&(h=f);for(h-t>y((a-r)/(g=n+1))&&b("overflow"),r+=(h-t)*g,t=h,i=0;i<m;++i)if((f=e[i])<t&&++r>a&&b("overflow"),f==t){for(c=r,p=l;!(c<(d=p<=o?1:p>=o+u?u:p-o));p+=l)w=c-d,S=l-d,_.push(v(C(d+w%S,0))),c=y(w/S);_.push(v(C(c,0))),o=A(r,g,n==s),r=0,++n}++r,++t}return _.join("")}i={version:"1.3.2",ucs2:{decode:x,encode:_},decode:E,encode:P,toASCII:function(e){return w(e,(function(e){return d.test(e)?"xn--"+P(e):e}))},toUnicode:function(e){return w(e,(function(e){return p.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var n={};return function(){"use strict";r.r(n),r.d(n,{ColorsPickerUtil:function(){return je},FeatureService:function(){return ke},FetchRequest:function(){return F},FilterParameter:function(){return I},GetFeaturesBySQLParameters:function(){return ge},GetFeaturesBySQLService:function(){return ve},QueryBySQLParameters:function(){return O},QueryBySQLService:function(){return fe},Util:function(){return y}});var e={startsWith:function(e,t){return 0==e.indexOf(t)},contains:function(e,t){return-1!=e.indexOf(t)},trim:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(e){for(var t=e.split("-"),r=t[0],n=1,s=t.length;n<s;n++){var o=t[n];r+=o.charAt(0).toUpperCase()+o.substring(1)}return r},format:function(t,r,n){return r||(r=window),t.replace(e.tokenRegEx,(function(e,t){for(var s,o=t.split(/\.+/),i=0;i<o.length;i++)0==i&&(s=r),s=s[o[i]];return"function"==typeof s&&(s=n?s.apply(null,n):s()),void 0===s?"undefined":s}))},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(t){return e.numberRegEx.test(t)},numericIf:function(t){return e.isNumeric(t)?parseFloat(t):t}},t={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(e,t){var r=0;return t>0&&(r=parseFloat(e.toPrecision(t))),r},format:function(e,r,n,s){r=void 0!==r?r:0,n=void 0!==n?n:t.thousandsSeparator,s=void 0!==s?s:t.decimalSeparator,null!=r&&(e=parseFloat(e.toFixed(r)));var o=e.toString().split(".");1===o.length&&null==r&&(r=0);var i,a=o[0];if(n)for(var l=/(-?[0-9]+)([0-9]{3})/;l.test(a);)a=a.replace(l,"$1"+n+"$2");if(0==r)i=a;else{var u=o.length>1?o[1]:"0";null!=r&&(u+=new Array(r-u.length+1).join("0")),i=a+s+u}return i}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return t.limitSigDigs(this,e)});var s=function(e,t){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var n=r.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,n)}};class o{constructor(){this.CLASS_NAME="SuperMap.Geometry",this.id=y.createUniqueID(this.CLASS_NAME+"_"),this.parent=null,this.bounds=null,this.SRID=null}destroy(){this.id=null,this.bounds=null,this.SRID=null}clone(){return new o}setBounds(e){e&&(this.bounds=e.clone())}clearBounds(){this.bounds=null,this.parent&&this.parent.clearBounds()}extendBounds(e){this.getBounds()?this.bounds.extend(e):this.setBounds(e)}getBounds(){return null==this.bounds&&this.calculateBounds(),this.bounds}calculateBounds(){}getVertices(e){}getArea(){return 0}}var i=r(998),a=r.n(i);const l=(h="",c="",p="pc",(d=navigator.userAgent.toLowerCase()).indexOf("msie")>-1||d.indexOf("trident")>-1&&d.indexOf("rv")>-1?(h="msie",u=d.match(/msie ([\d.]+)/)||d.match(/rv:([\d.]+)/)):d.indexOf("chrome")>-1?(h="chrome",u=d.match(/chrome\/([\d.]+)/)):d.indexOf("firefox")>-1?(h="firefox",u=d.match(/firefox\/([\d.]+)/)):d.indexOf("opera")>-1?(h="opera",u=d.match(/version\/([\d.]+)/)):d.indexOf("safari")>-1&&(h="safari",u=d.match(/version\/([\d.]+)/)),c=u?u[1]:"",d.indexOf("ipad")>-1||d.indexOf("ipod")>-1||d.indexOf("iphone")>-1?p="apple":d.indexOf("android")>-1&&(c=(u=d.match(/version\/([\d.]+)/))?u[1]:"",p="android"),{name:h,version:c,device:p});var u,h,c,p,d;const f=(m=!0,g=l,document.createElement("canvas").getContext?("firefox"===g.name&&parseFloat(g.version)<5&&(m=!1),"safari"===g.name&&parseFloat(g.version)<4&&(m=!1),"opera"===g.name&&parseFloat(g.version)<10&&(m=!1),"msie"===g.name&&parseFloat(g.version)<9&&(m=!1)):m=!1,m);var m,g;!function(){var e=navigator.userAgent.toLowerCase();-1===e.indexOf("webkit")&&e.indexOf("gecko")}();const y={assign(e){for(var t=0;t<Object.getOwnPropertyNames(arguments).length;t++){var r=Object.getOwnPropertyNames(arguments)[t];if("caller"!=r&&"callee"!=r&&"length"!=r&&"arguments"!=r){var n=arguments[r];if(n)for(var s=0;s<Object.getOwnPropertyNames(n).length;s++){var o=Object.getOwnPropertyNames(n)[s];"caller"!=r&&"callee"!=r&&"length"!=r&&"arguments"!=r&&(e[o]=n[o])}}}return e},extend:function(e,t){if(e=e||{},t){for(var r in t){var n=t[r];void 0!==n&&(e[r]=n)}!("function"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},copy:function(e,t){var r;if(e=e||{},t)for(var n in e)void 0!==(r=t[n])&&(e[n]=r)},reset:function(e){for(var t in e=e||{})if(e.hasOwnProperty(t)){if("object"==typeof e[t]&&e[t]instanceof Array){for(var r in e[t])e[t][r].destroy&&e[t][r].destroy();e[t].length=0}else"object"==typeof e[t]&&e[t]instanceof Object&&e[t].destroy&&e[t].destroy();e[t]=null}},getElement:function(){for(var e=[],t=0,r=arguments.length;t<r;t++){var n=arguments[t];if("string"==typeof n&&(n=document.getElementById(n)),1===arguments.length)return n;e.push(n)}return e},isElement:function(e){return!(!e||1!==e.nodeType)},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},removeItem:function(e,t){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1);return e},indexOf:function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},modifyDOMElement:function(e,t,r,n,s,o,i,a){t&&(e.id=t),r&&(e.style.left=r.x+"px",e.style.top=r.y+"px"),n&&(e.style.width=n.w+"px",e.style.height=n.h+"px"),s&&(e.style.position=s),o&&(e.style.border=o),i&&(e.style.overflow=i),parseFloat(a)>=0&&parseFloat(a)<1?(e.style.filter="alpha(opacity="+100*a+")",e.style.opacity=a):1===parseFloat(a)&&(e.style.filter="",e.style.opacity="")},applyDefaults:function(e,t){e=e||{};var r="function"==typeof window.Event&&t instanceof window.Event;for(var n in t)(void 0===e[n]||!r&&t.hasOwnProperty&&t.hasOwnProperty(n)&&!e.hasOwnProperty(n))&&(e[n]=t[n]);return!r&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},getParameterString:function(e){var t=[];for(var r in e){var n,s=e[r];null!=s&&"function"!=typeof s&&(n=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(r)+"="+n))}return t.join("&")},urlAppend:function(e,t){var r=e;if(t){0===t.indexOf("?")&&(t=t.substring(1));var n=(e+" ").split(/[?&]/);r+=" "===n.pop()?t:n.length?"&"+t:"?"+t}return r},urlPathAppend:function(e,t){let r=e;if(!t)return r;0===t.indexOf("/")&&(t=t.substring(1));const n=e.split("?");return n[0].indexOf("/",n[0].length-1)<0&&(n[0]+="/"),r=`${n[0]}${t}${n.length>1?`?${n[1]}`:""}`,r},DEFAULT_PRECISION:14,toFloat:function(e,t){return null==t&&(t=y.DEFAULT_PRECISION),"number"!=typeof e&&(e=parseFloat(e)),0===t?e:parseFloat(e.toPrecision(t))},rad:function(e){return e*Math.PI/180},getParameters:function(t){t=null==t?window.location.href:t;var r="";if(e.contains(t,"?")){var n=t.indexOf("?")+1,s=e.contains(t,"#")?t.indexOf("#"):t.length;r=t.substring(n,s)}for(var o={},i=r.split(/[&;]/),a=0,l=i.length;a<l;++a){var u=i[a].split("=");if(u[0]){var h=u[0];try{h=decodeURIComponent(h)}catch(e){h=unescape(h)}var c=(u[1]||"").replace(/\+/g," ");try{c=decodeURIComponent(c)}catch(e){c=unescape(c)}1==(c=c.split(",")).length&&(c=c[0]),o[h]=c}}return o},lastSeqID:0,createUniqueID:function(e){return null==e&&(e="id_"),y.lastSeqID+=1,e+y.lastSeqID},normalizeScale:function(e){return e>1?1/e:e},getResolutionFromScale:function(e,t){var r;return e&&(null==t&&(t="degrees"),r=1/(y.normalizeScale(e)*v[t]*96)),r},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*v[t]*96},getBrowser:function(){return l},isSupportCanvas:f,supportCanvas:function(){return y.isSupportCanvas},isInTheSameDomain:function(e){return!e||(-1===e.indexOf("//")||y.isSameDomain(e,document.location.toString()))},isSameDomain(e,t){return new(a())(e).normalize().origin()===new(a())(t).normalize().origin()},calculateDpi:function(e,t,r,n,s){if(e&&t&&r){var o,i=e.getWidth(),a=e.getHeight(),l=t.w,u=t.h;if(s=s||6378137,"degree"===(n=n||"degrees").toLowerCase()||"degrees"===n.toLowerCase()||"dd"===n.toLowerCase()){let e=i/l,t=a/u;o=254/(e>t?e:t)/r/(2*Math.PI*s/360)/1e4}else o=254/(i/l)/r/1e4;return o}},toJSON:function(e){var t=e;if(null==t)return null;switch(t.constructor){case String:return(t=(t=(t=(t=(t=(t='"'+t.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",n=0,s=t.length;n<s;n++)r+=y.toJSON(t[n]),n!==t.length-1&&(r+=",");return"["+r+"]";case Number:return isFinite(t)?String(t):null;case Boolean:return String(t);case Date:return"{'__type':\"System.DateTime\",'Year':"+t.getFullYear()+",'Month':"+(t.getMonth()+1)+",'Day':"+t.getDate()+",'Hour':"+t.getHours()+",'Minute':"+t.getMinutes()+",'Second':"+t.getSeconds()+",'Millisecond':"+t.getMilliseconds()+",'TimezoneOffset':"+t.getTimezoneOffset()+"}";default:if(null!=t.toJSON&&"function"==typeof t.toJSON)return t.toJSON();if("object"==typeof t){if(t.length){let e=[];for(let r=0,n=t.length;r<n;r++)e.push(y.toJSON(t[r]));return"["+e.join(",")+"]"}let e=[];for(let r in t)"function"!=typeof t[r]&&"CLASS_NAME"!==r&&"parent"!==r&&e.push("'"+r+"':"+y.toJSON(t[r]));return e.length>0?"{"+e.join(",")+"}":"{}"}return t.toString()}},getResolutionFromScaleDpi:function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?(e=y.normalizeScale(e),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4):-1},getScaleFromResolutionDpi:function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4:-1},transformResult:function(e){return e.responseText&&"string"==typeof e.responseText&&(e=JSON.parse(e.responseText)),e},copyAttributes:function(e,t){if(e=e||{},t)for(var r in t){var n=t[r];void 0!==n&&"CLASS_NAME"!==r&&"function"!=typeof n&&(e[r]=n)}return e},copyAttributesWithClip:function(e,t,r){if(e=e||{},t)for(var n in t){var s=!1;if(r&&r.length)for(var o=0,i=r.length;o<i;o++)if(n===r[o]){s=!0;break}if(!0!==s){var a=t[n];void 0!==a&&"CLASS_NAME"!==n&&"function"!=typeof a&&(e[n]=a)}}return e},cloneObject:function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date){let t=new Date;return t.setTime(e.getTime()),t}if(e instanceof Array)return e.slice(0);if(e instanceof Object){let r={};for(var t in e)e.hasOwnProperty(t)&&(r[t]=y.cloneObject(e[t]));return r}throw new Error("Unable to copy obj! Its type isn't supported.")},lineIntersection:function(e,t,r,n){var s,i,a=null,l=(n.x-r.x)*(e.y-r.y)-(n.y-r.y)*(e.x-r.x),u=(t.x-e.x)*(e.y-r.y)-(t.y-e.y)*(e.x-r.x),h=(n.y-r.y)*(t.x-e.x)-(n.x-r.x)*(t.y-e.y);if(0!=h)i=u/h,a=(s=l/h)>=0&&i<=1&&s<=1&&i>=0?new o.Point(e.x+s*(t.x-e.x),e.y+s*(t.y-e.y)):"No Intersection";else if(0==l&&0==u){var c=Math.max(e.y,t.y),p=Math.min(e.y,t.y),d=Math.max(e.x,t.x),f=Math.min(e.x,t.x);a=(r.y>=p&&r.y<=c||n.y>=p&&n.y<=c)&&r.x>=f&&r.x<=d||n.x>=f&&n.x<=d?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(e,t,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",e.fontSize&&(r.style.fontSize=e.fontSize),e.fontFamily&&(r.style.fontFamily=e.fontFamily),e.fontWeight&&(r.style.fontWeight=e.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=t;var n=r.clientWidth,s=r.clientHeight;return document.body.removeChild(r),{textWidth:n,textHeight:s}},convertPath:function(e,t){return t?e.replace(/\{([\w-\.]+)\}/g,((e,r)=>{var n,s;return n=t.hasOwnProperty(r)?null==(s=t[r])||null==s?"":s instanceof Date?s.toJSON():function(e){if("string"!=typeof e&&"object"!=typeof e)return!1;try{const t=e.toString();return"[object Object]"===t||"[object Array]"===t}catch(e){return!1}}(s)?JSON.stringify(s):s.toString():e,encodeURIComponent(n)})):e}},v={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};v.in=v.inches,v.degrees=v.dd,v.nmi=1852*v.m,y.extend(v,{Inch:v.inches,Meter:39.37,Foot:12,IFoot:11.999976,ClarkeFoot:11.999868327581488,SearsFoot:11.999955194477684,GoldCoastFoot:11.999964589846002,IInch:.9999979999999999,MicroInch:999998e-9,Mil:9.99998e-7,Centimeter:.3937,Kilometer:39370,Yard:36,SearsYard:35.99986558343306,IndianYard:35.99987015540864,IndianYd37:35.999740205100004,IndianYd62:35.999880755999996,IndianYd75:35.999868945,IndianFoot:11.9999567087,IndianFt37:11.9999134017,IndianFt62:11.999960252000001,IndianFt75:11.999956315,Mile:63360,IYard:35.999928,IMile:63359.87328,NautM:72913.24,"Lat-66":4367838.370169282,"Lat-83":4367954.152606599,Decimeter:3.9370000000000003,Millimeter:.03937,Dekameter:393.7,Decameter:393.7,Hectometer:3937,GermanMeter:39.370535294205006,CaGrid:39.359685060000004,ClarkeChain:791.991309620512,GunterChain:792.0000000000001,BenoitChain:791.9977268035781,SearsChain:791.9970428354235,ClarkeLink:7.91991309620512,GunterLink:7.920000000000001,BenoitLink:7.919977268035781,SearsLink:7.919970428354236,Rod:198.00000000000014,IntnlChain:791.998416,IntnlLink:7.91998416,Perch:198.00000000000014,Pole:198.00000000000014,Furlong:7919.999999999997,Rood:148.75036777426,CapeFoot:11.999868185255002,Brealey:14763.75,ModAmFt:12.000458400000001,Fathom:71.999856,"NautM-UK":72959.85408,"50kilometers":1968500,"150kilometers":5905500}),y.extend(v,{mm:v.Meter/1e3,cm:v.Meter/100,dm:100*v.Meter,km:1e3*v.Meter,kmi:v.nmi,fath:v.Fathom,ch:v.IntnlChain,link:v.IntnlLink,"us-in":v.inches,"us-ft":v.Foot,"us-yd":v.Yard,"us-ch":v.GunterChain,"us-mi":v.Mile,"ind-yd":v.IndianYd37,"ind-ft":v.IndianFt37,"ind-ch":791.9942845122}),v.degree=v.dd,v.meter=v.m,v.foot=v.ft,v.inch=v.inches,v.mile=v.mi,v.kilometer=v.km,v.yard=v.yd;var b="GEOJSON",S="ISERVER",w="FGB",x="LINE",_="POINT",C="REGION",A="CONTAIN",E="delete";class P{constructor(e){e&&(this.customParams=null,this.prjCoordSys=null,this.expectCount=1e5,this.networkType=x,this.queryOption="ATTRIBUTEANDGEOMETRY",this.queryParams=null,this.startRecord=0,this.holdTime=10,this.returnCustomResult=!1,this.returnFeatureWithFieldCaption=!1,y.extend(this,e),this.CLASS_NAME="SuperMap.QueryParameters")}destroy(){var e=this;if(e.customParams=null,e.expectCount=null,e.networkType=null,e.queryOption=null,e.queryParams){for(var t=0,r=e.queryParams,n=r.length;t<n;t++)r[t].destroy();e.queryParams=null}e.startRecord=null,e.holdTime=null,e.returnCustomResult=null,e.prjCoordSys=null}}class O extends P{constructor(e){super(e=e||{}),this.returnContent=!0,y.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy(),this.returnContent=null}}class I{constructor(e){this.attributeFilter=null,this.name=null,this.joinItems=null,this.linkItems=null,this.ids=null,this.orderBy=null,this.groupBy=null,this.fields=null,e&&y.extend(this,e),this.CLASS_NAME="SuperMap.FilterParameter"}destroy(){var e=this;if(e.attributeFilter=null,e.name=null,e.joinItems){for(let t=0,r=e.joinItems,n=r.length;t<n;t++)r[t].destroy();e.joinItems=null}if(e.linkItems){for(let t=0,r=e.linkItems,n=r.length;t<n;t++)r[t].destroy();e.linkItems=null}e.ids=null,e.orderBy=null,e.groupBy=null,e.fields=null}}r(107),r(693);var T=r(144),M=r.n(T);let N=window.fetch;var k={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=y.toJSON(e[t]));var r=encodeURIComponent(e[t]);this.queryValues.push(r)}},issue:function(e){for(var t=this,r=t.getUid(),n=e.url,s=[],o=n,i=0,a=t.queryKeys?t.queryKeys.length:0,l=0;l<a;l++)if(o.length+t.queryKeys[l].length+2>=t.limitLength){if(0==i)return!1;s.push(o),o=n,i=0,l--}else if(o.length+t.queryKeys[l].length+2+t.queryValues[l].length>t.limitLength)for(var u=t.queryValues[l];u.length>0;){var h=t.limitLength-o.length-t.queryKeys[l].length-2;o.indexOf("?")>-1?o+="&":o+="?";var c=u.substring(0,h);"%"===c.substring(h-1,h)?(h-=1,c=u.substring(0,h)):"%"===c.substring(h-2,h-1)&&(h-=2,c=u.substring(0,h)),o+=t.queryKeys[l]+"="+c,u=u.substring(h),c.length>0&&(s.push(o),o=n,i=0)}else i++,o.indexOf("?")>-1?o+="&":o+="?",o+=t.queryKeys[l]+"="+t.queryValues[l];return s.push(o),t.send(s,"SuperMapJSONPCallbacks_"+r,e&&e.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,r){var n=e.length;if(n>0)return new Promise((s=>{for(var o=(new Date).getTime(),i=0;i<n;i++){var a=e[i];a.indexOf("?")>-1?a+="&":a+="?",a+="sectionCount="+n,a+="§ionIndex="+i,a+="&jsonpUserID="+o,r&&(a=decodeURIComponent(a),a=r+encodeURIComponent(a)),M()(a,{jsonpCallbackFunction:t,timeout:3e4}).then((e=>{s(e.json())}))}}))},GET:function(e){var t=this;return t.queryKeys.length=0,t.queryValues.length=0,t.addQueryStrings(e.params),t.issue(e)},POST:function(e){var t=this;return t.queryKeys.length=0,t.queryValues.length=0,t.addQueryStrings({requestEntity:e.data}),t.issue(e)},PUT:function(e){var t=this;return t.queryKeys.length=0,t.queryValues.length=0,t.addQueryStrings({requestEntity:e.data}),t.issue(e)},DELETE:function(e){var t=this;return t.queryKeys.length=0,t.queryValues.length=0,t.addQueryStrings({requestEntity:e.data}),t.issue(e)}},F={commit:function(e,t,r,n){switch(e=e?e.toUpperCase():e){case"GET":default:return this.get(t,r,n);case"POST":return this.post(t,r,n);case"PUT":return this.put(t,r,n);case"DELETE":return this.delete(t,r,n)}},supportDirectRequest:function(e,t){return!!y.isInTheSameDomain(e)||(null!=t.crossOrigin?t.crossOrigin:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest||t.proxy)},get:function(e,t,r){if(r=r||{},e=y.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){var n={url:e=e.replace(".json",".jsonp"),data:t};return k.GET(n)}return this.urlIsLong(e)?this._postSimulatie("GET",e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,"GET")},delete:function(e,t,r){r=r||{};var n="DELETE";if(e=y.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var s={url:e+="&_method=DELETE",data:t};return k.DELETE(s)}return this.urlIsLong(e)?this._postSimulatie(n,e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,n)},post:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var n={url:y.urlAppend(e,"_method=POST"),data:t};return k.POST(n)}return this._fetch(e,t,r,"POST")},put:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var n={url:e+="&_method=PUT",data:t};return k.PUT(n)}return this._fetch(e,t,r,"PUT")},urlIsLong:function(e){for(var t=0,r=null,n=0,s=e.length;n<s;n++)(r=e.charCodeAt(n))<127?t++:128<=r&&r<=2047?t+=2:2048<=r&&r<=65535&&(t+=3);return!(t<2e3)},_postSimulatie:function(e,t,r,n){var s=t.indexOf("?")>-1?"&":"?";return t+=s+"_method="+e,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(t,r,n)},_processUrl:function(e,t){if(this._isMVTRequest(e))return e;if(-1===e.indexOf(".json")&&!t.withoutFormatSuffix)if(e.indexOf("?")<0)e+=".json";else{var r=e.split("?");2===r.length&&(e=r[0]+".json?"+r[1])}return t&&t.proxy&&("function"==typeof t.proxy?e=t.proxy(e):(e=decodeURIComponent(e),e=t.proxy+encodeURIComponent(e))),e},_fetch:function(e,t,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(t)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,N(e,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?t:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:45e3}).then((function(e){return e}))):N(e,{method:n,body:"PUT"===n||"POST"===n?t:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:45e3}).then((function(e){return e}))},_getWithCredentials:function(e){return!0===e.withCredentials?"include":!1===e.withCredentials?"omit":"same-origin"},_fetchJsonp:function(e,t){return t=t||{},M()(e,{method:"GET",timeout:t.timeout}).then((function(e){return e}))},_timeout:function(e,t){return new Promise((function(r,n){setTimeout((function(){n(new Error("timeout"))}),e),t.then(r,n)}))},_getParameterString:function(e){var t=[];for(var r in e){var n,s=e[r];null!=s&&"function"!=typeof s&&(n=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(r)+"="+n))}return t.join("&")},_isMVTRequest:function(e){return e.indexOf(".mvt")>-1||e.indexOf(".pbf")>-1}};class L{constructor(e,t,r){this.x=e?parseFloat(e):0,this.y=t?parseFloat(t):0,this.mode=r,this.CLASS_NAME="SuperMap.Pixel"}toString(){return"x="+this.x+",y="+this.y}clone(){return new L(this.x,this.y,this.mode)}equals(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}add(e,t){if(null==e||null==t)throw new TypeError("Pixel.add cannot receive null values");return new L(this.x+e,this.y+t)}offset(e){var t=this.clone();return e&&(t=this.add(e.x,e.y)),t}destroy(){this.x=null,this.y=null,this.mode=null}}L.Mode={LeftTop:"lefttop",RightTop:"righttop",RightBottom:"rightbottom",LeftBottom:"leftbottom"};var R={observers:!1,KEY_SPACE:32,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(e){return e.target||e.srcElement},isSingleTouch:function(e){return e.touches&&1===e.touches.length},isMultiTouch:function(e){return e.touches&&e.touches.length>1},isLeftClick:function(e){return e.which&&1===e.which||e.button&&1===e.button},isRightClick:function(e){return e.which&&3===e.which||e.button&&2===e.button},stop:function(e,t){t||(e.preventDefault?e.preventDefault():e.returnValue=!1),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},findElement:function(e,t){for(var r=R.element(e);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=t.toUpperCase());)r=r.parentNode;return r},observe:function(e,t,r,n){var s=y.getElement(e);if(n=n||!1,"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!s._eventCacheID){var o="eventCacheID_";s.id&&(o=s.id+"_"+o),s._eventCacheID=y.createUniqueID(o)}var i=s._eventCacheID;this.observers[i]||(this.observers[i]=[]),this.observers[i].push({element:s,name:t,observer:r,useCapture:n}),s.addEventListener?"mousewheel"===t?s.addEventListener(t,r,{useCapture:n,passive:!1}):s.addEventListener(t,r,n):s.attachEvent&&s.attachEvent("on"+t,r)},stopObservingElement:function(e){var t=y.getElement(e)._eventCacheID;this._removeElementObservers(R.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var r=e[t],n=new Array(r.element,r.name,r.observer,r.useCapture);R.stopObserving.apply(this,n)}},stopObserving:function(e,t,r,n){n=n||!1;var s=y.getElement(e),o=s._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.detachEvent)&&(t="keydown");var i=!1,a=R.observers[o];if(a)for(var l=0;!i&&l<a.length;){var u=a[l];if(u.name===t&&u.observer===r&&u.useCapture===n){a.splice(l,1),0==a.length&&delete R.observers[o],i=!0;break}l++}return i&&(s.removeEventListener?s.removeEventListener(t,r,n):s&&s.detachEvent&&s.detachEvent("on"+t,r)),i},unloadCache:function(){if(R&&R.observers){for(var e in R.observers){var t=R.observers[e];R._removeElementObservers.apply(this,[t])}R.observers=!1}},CLASS_NAME:"SuperMap.Event"};R.observe(window,"resize",R.unloadCache,!1);class j{constructor(e,t,r,n,s){if(this.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"],this.listeners={},this.object=e,this.element=null,this.eventTypes=[],this.eventHandler=null,this.fallThrough=n,this.includeXY=!1,this.extensions={},this.extensionCount={},this.clearMouseListener=null,y.extend(this,s),null!=r)for(var o=0,i=r.length;o<i;o++)this.addEventType(r[o]);null!=t&&this.attachToElement(t),this.CLASS_NAME="SuperMap.Events"}destroy(){for(var e in this.extensions)"boolean"!=typeof this.extensions[e]&&this.extensions[e].destroy();this.extensions=null,this.element&&(R.stopObservingElement(this.element),this.element.hasScrollEvent&&R.stopObserving(window,"scroll",this.clearMouseListener)),this.element=null,this.listeners=null,this.object=null,this.eventTypes=null,this.fallThrough=null,this.eventHandler=null}addEventType(e){this.listeners[e]||(this.eventTypes.push(e),this.listeners[e]=[])}attachToElement(e){var t,r;this.element?R.stopObservingElement(this.element):(this.eventHandler=(t=this.handleBrowserEvent,r=this,function(e){return t.call(r,e||window.event)}),this.clearMouseListener=s(this.clearMouseCache,this)),this.element=e;for(var n=0,o=this.BROWSER_EVENTS.length;n<o;n++){var i=this.BROWSER_EVENTS[n];this.addEventType(i),R.observe(e,i,this.eventHandler)}R.observe(e,"dragstart",R.stop)}on(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.register(t,e.scope,e[t])}register(e,t,r,n){if(e in j&&!this.extensions[e]&&(this.extensions[e]=new j[e](this)),null!=r&&-1!==y.indexOf(this.eventTypes,e)){null==t&&(t=this.object);var s=this.listeners[e];s||(s=[],this.listeners[e]=s,this.extensionCount[e]=0);var o={obj:t,func:r};n?(s.splice(this.extensionCount[e],0,o),"object"==typeof n&&n.extension&&this.extensionCount[e]++):s.push(o)}}registerPriority(e,t,r){this.register(e,t,r,!0)}un(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.unregister(t,e.scope,e[t])}unregister(e,t,r){null==t&&(t=this.object);var n=this.listeners[e];if(null!=n)for(var s=0,o=n.length;s<o;s++)if(n[s].obj===t&&n[s].func===r){n.splice(s,1);break}}remove(e){null!=this.listeners[e]&&(this.listeners[e]=[])}triggerEvent(e,t){var r=this.listeners[e];if(r&&0!=r.length){var n;null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=e);for(var s=0,o=(r=r.slice()).length;s<o;s++){var i=r[s];if(null!=(n=i.func.apply(i.obj,[t]))&&!1===n)break}return this.fallThrough||R.stop(t,!0),n}}handleBrowserEvent(e){var t=e.type,r=this.listeners[t];if(r&&0!=r.length){var n=e.touches;if(n&&n[0]){for(var s,o=0,i=0,a=n.length,l=0;l<a;++l)o+=(s=n[l]).clientX,i+=s.clientY;e.clientX=o/a,e.clientY=i/a}this.includeXY&&(e.xy=this.getMousePosition(e)),this.triggerEvent(t,e)}}clearMouseCache(){this.element.scrolls=null,this.element.lefttop=null;var e=document.body;e&&(0==e.scrollTop&&0==e.scrollLeft||!navigator.userAgent.match(/iPhone/i))&&(this.element.offsets=null)}getMousePosition(e){if(this.includeXY?this.element.hasScrollEvent||(R.observe(window,"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),!this.element.scrolls){var t=y.getViewportElement();this.element.scrolls=[t.scrollLeft,t.scrollTop]}return this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]),this.element.offsets||(this.element.offsets=y.pagePosition(this.element)),new L(e.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],e.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])}}j.prototype.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"];class D{constructor(e,t){this.value=e||"",this.name=t||"token",this.CLASS_NAME="SuperMap.Credential"}getUrlParameters(){return this.name+"="+this.value}getValue(){return this.value}destroy(){this.value=null,this.name=null}}D.CREDENTIAL=null;class B{static generateToken(e,t){var r=this.servers[e];if(r)return F.post(r.tokenServiceUrl,JSON.stringify(t.toJSON())).then((function(e){return e.text()}))}static registerServers(e){this.servers=this.servers||{},y.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var r=e[t];this.servers[r.server]=r}}static registerToken(e,t){if(this.tokens=this.tokens||{},e&&t){var r=this._getTokenStorageKey(e);this.tokens[r]=t}}static registerKey(e,t){if(this.keys=this.keys||{},e&&!(e.length<1)&&t){e=y.isArray(e)?e:[e];for(var r=0;r<e.length;r++){var n=this._getUrlRestString(e[0])||e[0];this.keys[n]=t}}}static getServerInfo(e){return this.servers=this.servers||{},this.servers[e]}static getToken(e){if(e){this.tokens=this.tokens||{};var t=this._getTokenStorageKey(e);return this.tokens[t]}}static getKey(e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;return this.keys[t]}static loginiServer(e,t,r,n){e=y.urlPathAppend(e,"services/security/login");var s={username:t&&t.toString(),password:r&&r.toString(),rememberme:n};return s=JSON.stringify(s),F.post(e,s,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then((function(e){return e.json()}))}static logoutiServer(e){return e=y.urlPathAppend(e,"services/security/logout"),F.get(e,"",{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withoutFormatSuffix:!0}).then((function(){return!0})).catch((function(){return!1}))}static loginOnline(e,t){var r=B.SSO+"/login?service="+e;this._open(r,t)}static loginiPortal(e,t,r){e=y.urlPathAppend(e,"web/login");var n={username:t&&t.toString(),password:r&&r.toString()};return n=JSON.stringify(n),F.post(e,n,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!1}).then((function(e){return e.json()}))}static logoutiPortal(e){return e=y.urlPathAppend(e,"services/security/logout"),F.get(e,"",{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!0,withoutFormatSuffix:!0}).then((function(){return!0})).catch((function(){return!1}))}static loginManager(e,t){var r=y.urlPathAppend(e,"/security/tokens"),n=t||{},s={username:n.userName&&n.userName.toString(),password:n.password&&n.password.toString()};s=JSON.stringify(s);var o=this;return F.post(r,s,{headers:{Accept:"*/*","Content-Type":"application/json; charset=UTF-8"}}).then((function(e){return e.text()})).then((function(e){return o.imanagerToken=e,e}))}static destroyAllCredentials(){this.keys=null,this.tokens=null,this.servers=null}static destroyToken(e){if(e){var t=this._getTokenStorageKey(e);this.tokens=this.tokens||{},this.tokens[t]&&delete this.tokens[t]}}static destroyKey(e){if(e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;this.keys[t]&&delete this.keys[t]}}static appendCredential(e){var t=e,r=this.getToken(e),n=r?new D(r,"token"):null;return n||(n=(r=this.getKey(e))?new D(r,"key"):null),n&&(t=y.urlAppend(t,n.getUrlParameters())),t}static _open(e,t){t=null==t||t;var r=window.screen.availWidth/2-this.INNER_WINDOW_WIDTH/2,n=window.screen.availHeight/2-this.INNER_WINDOW_HEIGHT/2,s="height="+this.INNER_WINDOW_HEIGHT+", width="+this.INNER_WINDOW_WIDTH+",top="+n+", left="+r+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";t?window.open(e,"login"):window.open(e,"login",s)}static _getTokenStorageKey(e){var t=e.match(/(.*?):\/\/([^\/]+)/i);return t?t[0]:e}static _getUrlRestString(e){if(!e)return e;var t=e.match(/(http|https):\/\/(.*\/rest)/i);return t?t[0]:e}}B.INNER_WINDOW_WIDTH=600,B.INNER_WINDOW_HEIGHT=600,B.SSO="https://sso.supermap.com",B.ONLINE="https://www.supermapol.com";class G{constructor(e){this.data=null,this.keepData=!1,y.extend(this,e),this.options=e,this.CLASS_NAME="SuperMap.Format"}destroy(){}read(e){}write(e){}}class q extends G{constructor(e){super(e),this.indent=" ",this.space=" ",this.newline="\n",this.level=0,this.pretty=!1,this.nativeJSON=!(!window.JSON||"function"!=typeof JSON.parse||"function"!=typeof JSON.stringify),this.CLASS_NAME="SuperMap.Format.JSON",this.serialize={object:function(e){if(null==e)return"null";if(e.constructor===Date)return this.serialize.date.apply(this,[e]);if(e.constructor===Array)return this.serialize.array.apply(this,[e]);var t,r,n,s=["{"];this.level+=1;var o=!1;for(t in e)e.hasOwnProperty(t)&&(r=this.write.apply(this,[t,this.pretty]),n=this.write.apply(this,[e[t],this.pretty]),null!=r&&null!=n&&(o&&s.push(","),s.push(this.writeNewline(),this.writeIndent(),r,":",this.writeSpace(),n),o=!0));return this.level-=1,s.push(this.writeNewline(),this.writeIndent(),"}"),s.join("")},array:function(e){var t,r=["["];this.level+=1;for(var n=0,s=e.length;n<s;++n)null!=(t=this.write.apply(this,[e[n],this.pretty]))&&(n>0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,(function(e,r){var n=t[r];return n||(n=r.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))}))+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}}}read(e,t){var r;if(this.nativeJSON)try{r=JSON.parse(e,t)}catch(t){return{data:e}}return this.keepData&&(this.data=r),r}write(e,t){this.pretty=!!t;var r=null,n=typeof e;if(this.serialize[n])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[n].apply(this,[e])}catch(e){}return r}writeIndent(){var e=[];if(this.pretty)for(var t=0;t<this.level;++t)e.push(this.indent);return e.join("")}writeNewline(){return this.pretty?this.newline:""}writeSpace(){return this.pretty?this.space:""}}class U{constructor(e,t){let r=this;this.EVENT_TYPES=["processCompleted","processFailed"],this.events=null,this.eventListeners=null,this.url=null,this.urls=null,this.proxy=null,this.index=null,this.length=null,this.totalTimes=null,this.POLLING_TIMES=3,this.isInTheSameDomain=null,this.withCredentials=!1,y.isArray(e)?(r.urls=e,r.length=e.length,r.totalTimes=r.length,1===r.length?r.url=e[0]:(r.index=parseInt(Math.random()*r.length),r.url=e[r.index])):(r.totalTimes=1,r.url=e),y.isArray(e)&&!r.isServiceSupportPolling()&&(r.url=e[0],r.totalTimes=1),t=t||{},this.crossOrigin=t.crossOrigin,this.headers=t.headers,y.extend(this,t),r.isInTheSameDomain=y.isInTheSameDomain(r.url),r.events=new j(r,null,r.EVENT_TYPES,!0),r.eventListeners instanceof Object&&r.events.on(r.eventListeners),this.CLASS_NAME="SuperMap.CommonServiceBase"}destroy(){let e=this;y.isArray(e.urls)&&(e.urls=null,e.index=null,e.length=null,e.totalTimes=null),e.url=null,e.isInTheSameDomain=null,e.EVENT_TYPES=null,e.events&&(e.events.destroy(),e.events=null),e.eventListeners&&(e.eventListeners=null)}request(e){let t=e.scope.format;if("string"==typeof e.success&&(e.scope.format=e.success,t=e.success,e.success=null,e.failure=null),t&&!this.supportDataFormat(t))throw new Error(`${this.CLASS_NAME} is not surport ${t} format!`);let r=this;return e.url=e.url||r.url,this._returnContent(e)&&!e.url.includes("returnContent=true")&&(e.url=y.urlAppend(e.url,"returnContent=true")),e.proxy=e.proxy||r.proxy,e.withCredentials=null!=e.withCredentials?e.withCredentials:r.withCredentials,e.crossOrigin=null!=e.crossOrigin?e.crossOrigin:r.crossOrigin,e.headers=e.headers||r.headers,e.isInTheSameDomain=r.isInTheSameDomain,e.withoutFormatSuffix=e.scope.withoutFormatSuffix||!1,e.url=B.appendCredential(e.url),r.calculatePollingTimes(),e.scope=r,r.totalTimes>0?(r.totalTimes--,r.ajaxPolling(e)):r._commit(e)}ajaxPolling(e){let t=this,r=e.url,n=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],r=r.replace(n,n.exec(t.url)[0]),e.url=r,e.isInTheSameDomain=y.isInTheSameDomain(r),t._commit(e)}calculatePollingTimes(){let e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.times<e.totalTimes&&(e.totalTimes=e.times):e.totalTimes>e.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}isServiceSupportPolling(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}transformResult(e,t){return{result:e=y.transformResult(e),options:t}}transformErrorResult(e,t){return{error:(e=y.transformResult(e)).error||e,options:t}}serviceProcessCompleted(e,t){e=this.transformResult(e).result,this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){let r=(e=this.transformErrorResult(e).error).error||e;this.events.triggerEvent("processFailed",{error:r,options:t})}_returnContent(e){return e.scope.format!==w&&!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[b,S]}_commit(e){if("POST"===e.method||"PUT"===e.method||"PATCH"===e.method)if(e.params&&(e.url=y.urlAppend(e.url,y.getParameterString(e.params||{}))),"object"!=typeof e.data||e.data instanceof FormData)e.params=e.data;else try{e.params=y.toJSON(e.data)}catch(e){console.log("不是json对象")}return F.commit(e.method,e.url,e.params,{headers:e.headers,withoutFormatSuffix:e.withoutFormatSuffix,withCredentials:e.withCredentials,crossOrigin:e.crossOrigin,timeout:e.async?0:null,proxy:e.proxy}).then((function(e){return e.text?e.text():e.json?e.json():e})).then((function(t){let r=t;return"string"==typeof t&&(r=(new q).read(t)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&e.scope.format===w&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r})).catch((function(e){return{error:e}})).then((t=>{let r={object:this};if(t.error){const o="processFailed";if(this.events&&this.events.listeners[o]&&this.events.listeners[o].length){var n=e.failure&&(e.scope?s(e.failure,e.scope):e.failure);n?n(t,e):this.serviceProcessFailed(t,e)}else r={...r,...this.transformErrorResult(t,e)},r.type=o,e.failure&&e.failure(r)}else{const n="processCompleted";if(this.events&&this.events.listeners[n]&&this.events.listeners[n].length){var o=e.success&&(e.scope?s(e.success,e.scope):e.success);o?o(t,e):this.serviceProcessCompleted(t,e)}else t.succeed=null==t.succeed||t.succeed,r={...r,...this.transformResult(t,e)},r.type=n,e.success&&e.success(r)}return r}))}}class z{constructor(e,t,r){this.CLASS_NAME="SuperMap.Feature",this.layer=e,this.id=y.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=t,this.data=null!=r?r:{}}destroy(){this.id=null,this.lonlat=null,this.data=null}}const Q="Unknown",H="Insert",J="Update",W="Delete";class V extends z{constructor(e,t,r){super(null,null,t),this.fid=null,this.geometry=e||null,this.attributes={},t&&(this.attributes=y.extend(this.attributes,t)),this.bounds=null,this.state=null,this.style=r||null,this.url=null,this.lonlat=null,this.CLASS_NAME="SuperMap.Feature.Vector",V.style={default:{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},select:{fillColor:"blue",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},temporary:{fillColor:"#66cccc",fillOpacity:.2,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"default",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},delete:{display:"none"}}}destroy(){this.layer&&(this.layer.removeFeatures(this),this.layer=null),this.geometry=null,super.destroy()}clone(){return new V(this.geometry?this.geometry.clone():null,this.attributes,this.style)}toState(e){if(e===J)switch(this.state){case Q:case W:this.state=e}else if(e===H)this.state===Q||(this.state=e);else if(e===W)switch(this.state){case H:case W:break;case Q:case J:this.state=e}else e===Q&&(this.state=e)}}class ${constructor(e,t){this.w=e?parseFloat(e):0,this.h=e?parseFloat(t):0,this.CLASS_NAME="SuperMap.Size"}toString(){return"w="+this.w+",h="+this.h}clone(){return new $(this.w,this.h)}equals(e){var t=!1;return null!=e&&(t=this.w===e.w&&this.h===e.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(e.w)&&isNaN(e.h)),t}destroy(){this.w=null,this.h=null}}class Y{constructor(e,t){y.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?y.toFloat(e):0,this.lat=t?y.toFloat(t):0,this.CLASS_NAME="SuperMap.LonLat"}toString(){return"lon="+this.lon+",lat="+this.lat}toShortString(){return this.lon+","+this.lat}clone(){return new Y(this.lon,this.lat)}add(e,t){if(null==e||null==t)throw new TypeError("LonLat.add cannot receive null values");return new Y(this.lon+y.toFloat(e),this.lat+y.toFloat(t))}equals(e){var t=!1;return null!=e&&(t=this.lon===e.lon&&this.lat===e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t}wrapDateLine(e){var t=this.clone();if(e){for(;t.lon<e.left;)t.lon+=e.getWidth();for(;t.lon>e.right;)t.lon-=e.getWidth()}return t}destroy(){this.lon=null,this.lat=null}static fromString(e){var t=e.split(",");return new Y(t[0],t[1])}static fromArray(e){var t=y.isArray(e),r=t&&e[0],n=t&&e[1];return new Y(r,n)}}class K{constructor(e,t,r,n){y.isArray(e)&&(n=e[3],r=e[2],t=e[1],e=e[0]),this.left=null!=e?y.toFloat(e):this.left,this.bottom=null!=t?y.toFloat(t):this.bottom,this.right=null!=r?y.toFloat(r):this.right,this.top=null!=n?y.toFloat(n):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new K(this.left,this.bottom,this.right,this.top)}equals(e){var t=!1;return null!=e&&(t=this.left===e.left&&this.right===e.right&&this.top===e.top&&this.bottom===e.bottom),t}toString(){return[this.left,this.bottom,this.right,this.top].join(",")}toArray(e){return!0===e?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]}toBBOX(e,t){null==e&&(e=6);var r=Math.pow(10,e),n=Math.round(this.left*r)/r,s=Math.round(this.bottom*r)/r,o=Math.round(this.right*r)/r,i=Math.round(this.top*r)/r;return!0===t?s+","+n+","+i+","+o:n+","+s+","+o+","+i}getWidth(){return this.right-this.left}getHeight(){return this.top-this.bottom}getSize(){return new $(this.getWidth(),this.getHeight())}getCenterPixel(){return new L((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new Y((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat}scale(e,t){var r,n;e=e||1,null==t&&(t=this.getCenterLonLat()),"SuperMap.LonLat"===t.CLASS_NAME?(r=t.lon,n=t.lat):(r=t.x,n=t.y);var s=(this.left-r)*e+r,o=(this.bottom-n)*e+n,i=(this.right-r)*e+r,a=(this.top-n)*e+n;return new K(s,o,i,a)}add(e,t){if(null==e||null==t)throw new TypeError("Bounds.add cannot receive null values");return new K(this.left+e,this.bottom+t,this.right+e,this.top+t)}extend(e){var t=null;if(e){switch(e.CLASS_NAME){case"SuperMap.LonLat":t=new K(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new K(e.x,e.y,e.x,e.y);break;case"SuperMap.Bounds":t=e}t&&(this.centerLonLat=null,(null==this.left||t.left<this.left)&&(this.left=t.left),(null==this.bottom||t.bottom<this.bottom)&&(this.bottom=t.bottom),(null==this.right||t.right>this.right)&&(this.right=t.right),(null==this.top||t.top>this.top)&&(this.top=t.top))}}containsLonLat(e,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var r=this.contains(e.lon,e.lat,t.inclusive),n=t.worldBounds;if(n&&!r){var s=n.getWidth(),o=(n.left+n.right)/2,i=Math.round((e.lon-o)/s);r=this.containsLonLat({lon:e.lon-i*s,lat:e.lat},{inclusive:t.inclusive})}return r}containsPixel(e,t){return this.contains(e.x,e.y,t)}contains(e,t,r){return null==r&&(r=!0),null!=e&&null!=t&&(r?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&e<this.right&&t>this.bottom&&t<this.top)}intersectsBounds(e,t){if("boolean"==typeof t&&(t={inclusive:t}),(t=t||{}).worldBounds){var r=this.wrapDateLine(t.worldBounds);e=e.wrapDateLine(t.worldBounds)}else r=this;null==t.inclusive&&(t.inclusive=!0);var n=!1,s=r.left===e.right||r.right===e.left||r.top===e.bottom||r.bottom===e.top;if(t.inclusive||!s){var o=e.bottom>=r.bottom&&e.bottom<=r.top||r.bottom>=e.bottom&&r.bottom<=e.top,i=e.top>=r.bottom&&e.top<=r.top||r.top>e.bottom&&r.top<e.top,a=e.left>=r.left&&e.left<=r.right||r.left>=e.left&&r.left<=e.right,l=e.right>=r.left&&e.right<=r.right||r.right>=e.left&&r.right<=e.right;n=(o||i)&&(a||l)}if(t.worldBounds&&!n){var u=t.worldBounds,h=u.getWidth(),c=!u.containsBounds(r),p=!u.containsBounds(e);c&&!p?(e=e.add(-h,0),n=r.intersectsBounds(e,{inclusive:t.inclusive})):p&&!c&&(r=r.add(-h,0),n=e.intersectsBounds(r,{inclusive:t.inclusive}))}return n}containsBounds(e,t,r){null==t&&(t=!1),null==r&&(r=!0);var n=this.contains(e.left,e.bottom,r),s=this.contains(e.right,e.bottom,r),o=this.contains(e.left,e.top,r),i=this.contains(e.right,e.top,r);return t?n||s||o||i:n&&s&&o&&i}determineQuadrant(e){var t="",r=this.getCenterLonLat();return(t+=e.lat<r.lat?"b":"t")+(e.lon<r.lon?"l":"r")}wrapDateLine(e,t){var r=(t=t||{}).leftTolerance||0,n=t.rightTolerance||0,s=this.clone();if(e){for(var o=e.getWidth();s.left<e.left&&s.right-n<=e.left;)s=s.add(o,0);for(;s.left+r>=e.right&&s.right>e.right;)s=s.add(-o,0);var i=s.left+r;i<e.right&&i>e.left&&s.right-n>e.right&&(s=s.add(-o,0))}return s}toServerJSONObject(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}destroy(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}static fromString(e,t){var r=e.split(",");return K.fromArray(r,t)}static fromArray(e,t){return!0===t?new K(e[1],e[0],e[3],e[2]):new K(e[0],e[1],e[2],e[3])}static fromSize(e){return new K(0,e.h,e.w,0)}static oppositeQuadrant(e){var t="";return(t+="t"===e.charAt(0)?"b":"t")+("l"===e.charAt(1)?"r":"l")}}class X extends o{constructor(e){super(),this.components=[],this.componentTypes=null,null!=e&&this.addComponents(e),this.CLASS_NAME="SuperMap.Geometry.Collection",this.geometryType="Collection"}destroy(){this.components.length=0,this.components=null,super.destroy()}clone(){for(var e=new X,t=0,r=this.components.length;t<r;t++)e.addComponent(this.components[t].clone());return y.applyDefaults(e,this),e}getComponentsString(){for(var e=[],t=0,r=this.components.length;t<r;t++)e.push(this.components[t].toShortString());return e.join(",")}calculateBounds(){this.bounds=null;var e=new K,t=this.components;if(t)for(var r=0,n=t.length;r<n;r++)e.extend(t[r].getBounds());null!=e.left&&null!=e.bottom&&null!=e.right&&null!=e.top&&this.setBounds(e)}addComponents(e){y.isArray(e)||(e=[e]);for(var t=0,r=e.length;t<r;t++)this.addComponent(e[t])}addComponent(e,t){var r=!1;if(e&&(null==this.componentTypes||y.indexOf(this.componentTypes,e.CLASS_NAME)>-1)){if(null!=t&&t<this.components.length){var n=this.components.slice(0,t),s=this.components.slice(t,this.components.length);n.push(e),this.components=n.concat(s)}else this.components.push(e);e.parent=this,this.clearBounds(),r=!0}return r}removeComponents(e){var t=!1;y.isArray(e)||(e=[e]);for(var r=e.length-1;r>=0;--r)t=this.removeComponent(e[r])||t;return t}removeComponent(e){return y.removeItem(this.components,e),this.clearBounds(),!0}getArea(){for(var e=0,t=0,r=this.components.length;t<r;t++)e+=this.components[t].getArea();return e}equals(e){var t=!0;if(e&&e.CLASS_NAME&&this.CLASS_NAME===e.CLASS_NAME)if(y.isArray(e.components)&&e.components.length===this.components.length){for(var r=0,n=this.components.length;r<n;++r)if(!this.components[r].equals(e.components[r])){t=!1;break}}else t=!1;else t=!1;return t}getVertices(e){for(var t=[],r=0,n=this.components.length;r<n;++r)Array.prototype.push.apply(t,this.components[r].getVertices(e));return t}}class Z extends o{constructor(e,t,r,n){super(e,t,r,n),this.x=parseFloat(e),this.y=parseFloat(t),this.tag=n||0==n?parseFloat(n):null,this.type=r||"Point",this.CLASS_NAME="SuperMap.Geometry.Point",this.geometryType="Point"}clone(e){return null==e&&(e=new Z(this.x,this.y)),y.applyDefaults(e,this),e}calculateBounds(){this.bounds=new K(this.x,this.y,this.x,this.y)}equals(e){var t=!1;return null!=e&&(t=this.x===e.x&&this.y===e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}move(e,t){this.x=this.x+e,this.y=this.y+t,this.clearBounds()}toShortString(){return this.x+", "+this.y}destroy(){this.x=null,this.y=null,this.tag=null,super.destroy()}getVertices(){return[this]}}class ee extends X{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.MultiPoint",this.geometryType="MultiPoint"}addPoint(e,t){this.addComponent(e,t)}removePoint(e){this.removeComponent(e)}}class te extends ee{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point","SuperMap.PointWithMeasure"],this.CLASS_NAME="SuperMap.Geometry.Curve",this.geometryType="Curve"}}class re extends te{constructor(e){super(e),this.CLASS_NAME="SuperMap.Geometry.LineString",this.geometryType="LineString"}removeComponent(e){var t=this.components&&this.components.length>2;return t&&super.removeComponent.apply(this,arguments),t}getSortedSegments(){for(var e,t,r=this.components.length-1,n=new Array(r),s=0;s<r;++s)e=this.components[s],t=this.components[s+1],e.x<t.x?n[s]={x1:e.x,y1:e.y,x2:t.x,y2:t.y}:n[s]={x1:t.x,y1:t.y,x2:e.x,y2:e.y};return n.sort((function(e,t){return e.x1-t.x1}))}getVertices(e){return!0===e?[this.components[0],this.components[this.components.length-1]]:!1===e?this.components.slice(1,this.components.length-1):this.components.slice()}static calculateCircle(e){if(e.length<3)return e;var t={},r=e[0],n=e[1],s=e[2],o=0,i=0,a=!0,l=0,u=0,h=0,c=[],p=(s.y-r.y)/(s.x-r.x),d=s.y-p*s.x;if(s.x!=r.x&&s.y!=r.y&&n.y==p*n.x+d||s.x==r.x&&n.x==r.x||s.y==r.y&&n.y==r.y||s.x==r.x&&s.y==r.y||s.x==n.x&&s.y==n.y||r.x==n.x&&r.y==n.y)c.push(r),c.push(n),c.push(s);else{var f=(n.x*n.x+n.y*n.y-(r.x*r.x+r.y*r.y))*(2*(s.y-r.y))-(s.x*s.x+s.y*s.y-(r.x*r.x+r.y*r.y))*(2*(n.y-r.y)),m=2*(n.x-r.x)*(s.x*s.x+s.y*s.y-(r.x*r.x+r.y*r.y))-2*(s.x-r.x)*(n.x*n.x+n.y*n.y-(r.x*r.x+r.y*r.y)),g=4*((n.x-r.x)*(s.y-r.y)-(s.x-r.x)*(n.y-r.y));t.x=f/g,t.y=m/g;var y=(2*(o=Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)))*o-((r.x-s.x)*(r.x-s.x)+(r.y-s.y)*(r.y-s.y)))/(2*o*o);y=(y=y>=1?1:y)<=-1?-1:y,h=180*Math.acos(y)/Math.PI,i=(h=s.x==r.x?t.x>r.x&&n.x>r.x||t.x<r.x&&n.x<r.x?360-h:h:t.y>p*t.x+d&&n.y>p*n.x+d||t.y<p*t.x+d&&n.y<p*n.x+d?360-h:h)/72,s.y!=r.y?s.x==r.x?s.y>r.y?n.x<r.x&&(a=!1):n.x>r.x&&(a=!1):s.x<r.x?n.y<p*n.x+d&&(a=!1):n.y>p*n.x+d&&(a=!1):s.x>r.x?n.y>r.y&&(a=!1):n.y<r.y&&(a=!1);var v=(r.y-t.y)/(r.x-t.x),b=v>=0?180*Math.atan(v)/Math.PI:Math.abs(180*Math.atan(v)/Math.PI)+90,S=Math.abs(t.y);r.y==S&&S==s.y&&r.x<s.x&&(b+=180);var w=r.y-t.y;c.push(r);for(var x=1;x<72;x++){l=i*x,u=b,a?w>=0?v>=0?u+=l:u=180-(u-90)+l:u=v>0?u-180+l:90-u+l:w>=0?v>=0?u-=l:u=180-(u-90)-l:u=v>=0?u-180-l:90-u-l,u=u*Math.PI/180;var _=t.x+o*Math.cos(u),C=t.y+o*Math.sin(u);c.push(new Z(_,C))}c.push(s)}return c}static createLineEPS(e){var t=[],r=e.length;if(r<2)return e;for(var n=0;n<r;)if("LTypeArc"==e[n].type){var s=re.createLineArc(t,n,r,e);t=s[0],n=s[1]}else t.push(e[n]),n++;return t}static createLineArc(e,t,r,n){if(0==t){let s=re.addPointEPS(n,t,r,"LTypeArc");Array.prototype.push.apply(e,s[0]),t=s[1]+1}else if(t==r-1){var s=[n[t-1],n[t]],o=re.calculateCircle(s);Array.prototype.push.apply(e,o),t++}else{let s=re.addPointEPS(n,t,r,"LTypeArc");e.pop(),Array.prototype.push.apply(e,s[0]),t=s[1]+1}return[e,t]}static addPointEPS(e,t,r,n){var s,o=[],i=t+1;return 0==t?Array.prototype.push.apply(o,[e[t],e[t+1]]):t==r-1?Array.prototype.push.apply(o,[e[t-1],e[t]]):Array.prototype.push.apply(o,[e[t-1],e[t],e[t+1]]),"LTypeCurve"==n?s=re.calculatePointsFBZN(o):"LTypeArc"==n&&(s=re.calculateCircle(o)),[s,i]}}class ne extends X{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LineString"],this.CLASS_NAME="SuperMap.Geometry.MultiLineString",this.geometryType="MultiLineString"}}class se extends re{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.LinearRing",this.geometryType="LinearRing"}addComponent(e,t){var r=!1,n=this.components.pop();null==t&&e.equals(n)||(r=super.addComponent.apply(this,arguments));var s=this.components[0];return super.addComponent.apply(this,[s]),r}removeComponent(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),super.removeComponent.apply(this,arguments);var r=this.components[0];super.addComponent.apply(this,[r])}return t}getArea(){var e=0;if(this.components&&this.components.length>2){for(var t=0,r=0,n=this.components.length;r<n-1;r++){var s=this.components[r],o=this.components[r+1];t+=(s.x+o.x)*(o.y-s.y)}e=-t/2}return e}getVertices(e){return!0===e?[]:this.components.slice(0,this.components.length-1)}}class oe extends X{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LinearRing"],this.CLASS_NAME="SuperMap.Geometry.Polygon",this.geometryType="Polygon"}getArea(){var e=0;if(this.components&&this.components.length>0){e+=Math.abs(this.components[0].getArea());for(var t=1,r=this.components.length;t<r;t++)e-=Math.abs(this.components[t].getArea())}return e}}class ie extends X{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Polygon"],this.CLASS_NAME="SuperMap.Geometry.MultiPolygon",this.geometryType="MultiPolygon"}}class ae{constructor(e,t,r){this.red=e||0==e?e:255,this.green=t||0,this.blue=r||0,this.CLASS_NAME="SuperMap.ServerColor"}destroy(){var e=this;e.red=null,e.green=null,e.blue=null}static fromJson(e){if(e){var t=new ae,r=255;null!==e.red&&(r=Number(e.red)),t.red=r;var n=0;null!==e.green&&(n=Number(e.green)),t.green=n;var s=0;return null!==e.blue&&(s=Number(e.blue)),t.blue=s,t}}}class le{constructor(e){this.fillBackColor=new ae(255,255,255),this.fillBackOpaque=!1,this.fillForeColor=new ae(255,0,0),this.fillGradientMode=null,this.fillGradientAngle=0,this.fillGradientOffsetRatioX=0,this.fillGradientOffsetRatioY=0,this.fillOpaqueRate=100,this.fillSymbolID=0,this.lineColor=new ae(0,0,0),this.lineSymbolID=0,this.lineWidth=1,this.markerAngle=0,this.markerSize=1,this.markerSymbolID=-1,e&&y.extend(this,e),this.CLASS_NAME="SuperMap.ServerStyle"}destroy(){var e=this;e.fillBackColor&&(e.fillBackColor.destroy(),e.fillBackColor=null),e.fillBackOpaque=null,e.fillForeColor&&(e.fillForeColor.destroy(),e.fillForeColor=null),e.fillGradientMode=null,e.fillGradientAngle=null,e.fillGradientOffsetRatioX=null,e.fillGradientOffsetRatioY=null,e.fillOpaqueRate=null,e.fillSymbolID=null,e.lineColor&&(e.lineColor.destroy(),e.lineColor=null),e.lineSymbolID=null,e.lineWidth=null,e.markerAngle=null,e.markerSize=null,e.markerSymbolID=null}toServerJSONObject(){var e={};return y.copyAttributes(e,this)}static fromJson(e){if(e)return new le({fillBackColor:ae.fromJson(e.fillBackColor),fillBackOpaque:e.fillBackOpaque,fillForeColor:ae.fromJson(e.fillForeColor),fillGradientMode:e.fillGradientMode,fillGradientAngle:e.fillGradientAngle,fillGradientOffsetRatioX:e.fillGradientOffsetRatioX,fillGradientOffsetRatioY:e.fillGradientOffsetRatioY,fillOpaqueRate:e.fillOpaqueRate,fillSymbolID:e.fillSymbolID,lineColor:ae.fromJson(e.lineColor),lineSymbolID:e.lineSymbolID,lineWidth:e.lineWidth,markerAngle:e.markerAngle,markerSize:e.markerSize,markerSymbolID:e.markerSymbolID})}}class ue extends Z{constructor(e){super(e),this.measure=null,e&&y.extend(this,e),this.CLASS_NAME="SuperMap.PointWithMeasure"}equals(e){var t=!1;if(null!=e){var r=this.x===e.x&&this.y===e.y&&this.measure===e.measure,n=isNaN(this.x)&&isNaN(this.y)&&isNaN(this.measure),s=isNaN(e.x)&&isNaN(e.y)&&isNaN(e.measure);t=r||n&&s}return t}toJson(){var e="{";return null!=this.measure&&null!=this.measure&&(e+='"measure":'+this.measure+","),e+='"x":'+this.x+",",(e+='"y":'+this.y)+"}"}destroy(){var e=this;e.measure=null,e.x=null,e.y=null}static fromJson(e){if(e)return new ue({x:e.x,y:e.y,measure:e.measure})}}class he extends X{constructor(e,t){super(e,t),this.id=null,this.center=null,this.style=null,this.length=null,this.maxM=null,this.minM=null,this.parts=null,this.points=null,this.type=null,this.componentTypes=["SuperMap.Geometry.LinearRing","SuperMap.Geometry.LineString"],t&&y.extend(this,t),this.CLASS_NAME="SuperMap.Route",this.geometryType="LINEM"}toJson(){var e="{";if(null!=this.id&&null!=this.id&&(e+='"id":'+this.id+","),null!=this.center&&null!=this.center&&(e+='"center":'+this.center+","),null!=this.style&&null!=this.style&&(e+='"style":'+this.style+","),null!=this.length&&null!=this.length&&(e+='"length":'+this.length+","),null!=this.maxM&&null!=this.maxM&&(e+='"maxM":'+this.maxM+","),null!=this.minM&&null!=this.minM&&(e+='"minM":'+this.minM+","),null!=this.type&&null!=this.type&&(e+='"type":"'+this.type+'",'),null!=this.parts&&null!=this.parts){e+='"parts":['+this.parts[0];for(var t=1;t<this.parts.length;t++)e+=","+this.parts[t];e+="],"}if(null!=this.components&&this.components.length>0){e+='"points":[';for(var r=0,n=this.components.length;r<n;r++)for(var s=0,o=this.components[r].components.length;s<o;s++)e+=this.components[r].components[s].toJson()+",";e=e.replace(/,$/g,""),e+="]"}return(e=e.replace(/,$/g,""))+"}"}destroy(){var e=this;e.id=null,e.center=null,e.style=null,e.length=null,e.maxM=null,e.minM=null,e.type=null,e.parts=null,e.components.length=0,e.components=null,e.componentTypes=null}static fromJson(e){if(e){var t=e.parts||[],r=e.points||[],n=t.length,s=[];if(!(n>0))return null;for(var o=0,i=0,a=[];o<n;o++){for(var l=0;l<t[o];l++)a.push(ue.fromJson(r[i+l]));i+=t[o],a[0].equals(a[t[o]-1])?s.push(new se(a)):s.push(new re(a)),a=[]}return new he(s,{id:e.id,center:e.center,style:e.style,length:e.length,maxM:e.maxM,minM:e.minM,type:e.type,parts:e.parts})}}}class ce{constructor(e){this.id=0,this.style=null,this.parts=null,this.points=null,this.type=null,this.prjCoordSys=null,e&&y.extend(this,e),this.CLASS_NAME="SuperMap.ServerGeometry"}destroy(){var e=this;e.id=null,e.style=null,e.parts=null,e.partTopo=null,e.points=null,e.type=null,e.prjCoordSys=null}toGeometry(){var e=this;switch(e.type.toUpperCase()){case _:return e.toGeoPoint();case x:return e.toGeoLine();case"LINEM":return e.toGeoLinem();case C:return e.toGeoRegion();case"POINTEPS":return e.toGeoPoint();case"LINEEPS":return e.toGeoLineEPS();case"REGIONEPS":return e.toGeoRegionEPS();case"GEOCOMPOUND":return e.transformGeoCompound()}}toGeoPoint(){var e=this.parts||[],t=this.points||[],r=e.length;if(r>0){if(1===r)return new Z(t[0].x,t[0].y);var n=[];for(let e=0;e<r;e++)n.push(new Z(t[e].x,t[e].y));return new ee(n)}return null}toGeoLine(){var e=this.parts||[],t=this.points||[],r=e.length;if(r>0){if(1===r){let r=[];for(let n=0;n<e[0];n++)r.push(new Z(t[n].x,t[n].y));return r[0].equals(r[e[0]-1])?new se(r):new re(r)}{let n=[];for(let s=0;s<r;s++){let r=[];for(let n=0;n<e[s];n++)r.push(new Z(t[n].x,t[n].y));n.push(new re(r)),t.splice(0,e[s])}return new ne(n)}}return null}toGeoLineEPS(){var e,t,r,n,s,o=this.parts||[],i=this.points||[],a=o.length;if(a>0){if(1===a){for(e=0,r=[];e<o[0];e++)r.push(new Z(i[e].x,i[e].y,i[e].type));return r[0].equals(r[o[0]-1])?(s=re.createLineEPS(r),new se(s)):(s=re.createLineEPS(r),new re(s))}for(e=0,n=[];e<a;e++){for(t=0,r=[];t<o[e];t++)r.push(new Z(i[t].x,i[t].y));s=re.createLineEPS(r),n.push(new re(s)),i.splice(0,o[e])}return new ne(n)}return null}toGeoLinem(){return he.fromJson(this)}toGeoRegion(){var e=this,t=e.parts||[],r=e.partTopo||[],n=e.points||[],s=t.length;if(s<=0)return null;var o=[],i=[];if(1==s){for(let e=0;e<n.length;e++)i.push(new Z(n[e].x,n[e].y));return o.push(new oe([new se(i)])),new ie(o)}var a=[],l=[],u=[],h=[],c=[];for(let e=0,o=0;e<s;e++){for(let r=0;r<t[e];r++)i.push(new Z(n[o+r].x,n[o+r].y));o+=t[e];var p=new oe([new se(i)]);i=[],u.push(p),0===r.length&&h.push(p.getBounds()),c.push(1),l.push(p.getArea())}if(0===r.length){ce.bubbleSort(l,u,r,h);var d=[];for(let e=1;e<u.length;e++)for(let t=e-1;t>=0;t--)if(d[e]=-1,h[t].containsBounds(h[e])){c[e]=-1*c[t],c[e]<0&&(d[e]=t);break}for(let e=0;e<u.length;e++)c[e]>0?o.push(u[e]):(o[d[e]].components=o[d[e]].components.concat(u[e].components),o.push(""))}else{o=new Array;for(let e=0;e<u.length;e++)if(r[e]&&-1==r[e]?a=a.concat(u[e].components):(a.length>0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(a),a=[]),o.push(u[e])),e==s-1){var f=o.length;if(f)o[f-1].components=o[f-1].components.concat(a);else for(let e=0,t=a.length;e<t;e++)o.push(new oe(a))}}return new ie(o)}toGeoRegionEPS(){var e=this,t=e.parts||[],r=e.partTopo||[],n=e.points||[],s=t.length;if(s<=0)return null;var o,i=[],a=[];if(1==s){for(var l=0;l<n.length;l++)a.push(new Z(n[l].x,n[l].y));return o=re.createLineEPS(a),i.push(new oe([new se(o)])),new ie(i)}var u=[],h=[],c=[],p=[],d=[];for(let e=0,i=0;e<s;e++){for(let r=0;r<t[e];r++)a.push(new Z(n[i+r].x,n[i+r].y));i+=t[e],o=re.createLineEPS(a);var f=new oe([new se(o)]);a=[],c.push(f),0===r.length&&p.push(f.getBounds()),d.push(1),h.push(f.getArea())}if(0===r.length){ce.bubbleSort(h,c,r,p);var m=[];for(let e=1;e<c.length;e++)for(let t=e-1;t>=0;t--)if(m[e]=-1,p[t].containsBounds(p[e])){d[e]=-1*d[t],d[e]<0&&(m[e]=t);break}for(let e=0;e<c.length;e++)d[e]>0?i.push(c[e]):(i[m[e]].components=i[m[e]].components.concat(c[e].components),i.push(""))}else{i=new Array;for(let e=0;e<c.length;e++)if(r[e]&&-1==r[e]?u=u.concat(c[e].components):(u.length>0&&i.length>0&&(i[i.length-1].components=i[i.length-1].components.concat(u),u=[]),i.push(c[e])),e==s-1){var g=i.length;if(g)i[g-1].components=i[g-1].components.concat(u);else for(let e=0,t=u.length;e<t;e++)i.push(new oe(u))}}return new ie(i)}transformGeoCompound(){const e=this.geoParts||[],t=e.length;if(t<=0)return null;const r=[];for(let n=0;n<t;n++){const t=e[n];r.push(new ce(t).toGeometry())}return new X(r)}static fromJson(e){if(e)return new ce({id:e.id,style:le.fromJson(e.style),parts:e.parts,partTopo:e.partTopo,points:e.points,center:e.center,length:e.length,maxM:e.maxM,minM:e.minM,type:e.type})}static fromGeometry(e){if(e){var t=0,r=[],n=[],s=null,o=e.components,i=e.CLASS_NAME,a={epsgCode:e.SRID};if(isNaN(e.id)||(t=e.id),"SuperMap.Geometry.LinearRing"!=i&&"SuperMap.Geometry.LineString"!=i&&(e instanceof ee||e instanceof ne)){let e=o.length;for(let t=0;t<e;t++){const e=o[t].getVertices();let s=e.length;r.push(s);for(let t=0;t<s;t++)n.push(new Z(e[t].x,e[t].y))}s="SuperMap.Geometry.MultiPoint"==i?_:x}else if(e instanceof ie){let e=o.length;for(let t=0;t<e;t++){let e=o[t].components,s=e.length;for(let t=0;t<s;t++){const s=e[t].getVertices(),o=s.length+1;r.push(o);for(let e=0;e<o-1;e++)n.push(new Z(s[e].x,s[e].y));n.push(new Z(s[0].x,s[0].y))}}s=C}else if(e instanceof oe){let e=o.length;for(let t=0;t<e;t++){const e=o[t].getVertices();let s=e.length+1;r.push(s);for(let t=0;t<s-1;t++)n.push(new Z(e[t].x,e[t].y));n.push(new Z(e[0].x,e[0].y))}s=C}else{const t=e.getVertices();let o=t.length;for(let e=0;e<o;e++)n.push(new Z(t[e].x,t[e].y));e instanceof se&&(n.push(new Z(t[0].x,t[0].y)),o++),r.push(o),s=e instanceof Z?_:x}return new ce({id:t,style:null,parts:r,points:n,type:s,prjCoordSys:a})}}static IsClockWise(e){var t=e.length;if(t<3)return 0;var r=e[0].y*(e[t-1].x-e[1].x);e.push(e[0]);for(var n=1;n<t;n++)r+=e[n].y*(e[n-1].x-e[n+1].x);return.5*r}static bubbleSort(e,t,r,n){for(var s=0;s<e.length;s++)for(var o=0;o<e.length;o++)if(e[s]>e[o]){var i=e[o];e[o]=e[s],e[s]=i;var a=t[o];if(t[o]=t[s],t[s]=a,r&&r.length>0){var l=r[o];r[o]=r[s],r[s]=l}if(n&&n.length>0){var u=n[o];n[o]=n[s],n[s]=u}}}}class pe extends q{constructor(e){super(e),this.ignoreExtraDims=!0,this.CLASS_NAME="SuperMap.Format.GeoJSON",this.parseCoords={point:function(e){if(!1===this.ignoreExtraDims&&2!=e.length)throw"Only 2D points are supported: "+e;return new Z(e[0],e[1])},multipoint:function(e){for(var t=[],r=null,n=0,s=e.length;n<s;++n){try{r=this.parseCoords.point.apply(this,[e[n]])}catch(e){throw e}t.push(r)}return new ee(t)},linestring:function(e){for(var t=[],r=null,n=0,s=e.length;n<s;++n){try{r=this.parseCoords.point.apply(this,[e[n]])}catch(e){throw e}t.push(r)}return new re(t)},multilinestring:function(e){for(var t=[],r=null,n=0,s=e.length;n<s;++n){try{r=this.parseCoords.linestring.apply(this,[e[n]])}catch(e){throw e}t.push(r)}return new ne(t)},polygon:function(e){for(var t,r,n=[],s=0,o=e.length;s<o;++s){try{r=this.parseCoords.linestring.apply(this,[e[s]])}catch(e){throw e}t=new se(r.components),n.push(t)}return new oe(n)},multipolygon:function(e){for(var t=[],r=null,n=0,s=e.length;n<s;++n){try{r=this.parseCoords.polygon.apply(this,[e[n]])}catch(e){throw e}t.push(r)}return new ie(t)},box:function(e){if(2!=e.length)throw"GeoJSON box coordinates must have 2 elements";return new oe([new se([new Z(e[0][0],e[0][1]),new Z(e[1][0],e[0][1]),new Z(e[1][0],e[1][1]),new Z(e[0][0],e[1][1]),new Z(e[0][0],e[0][1])])])}},this.extract={feature:function(e){var t=this.extract.geometry.apply(this,[e.geometry]),r={type:"Feature",properties:this.createAttributes(e),geometry:t};return e.geometry&&"TEXT"===e.geometry.type&&(r.properties.texts=e.geometry.texts,r.properties.textStyle=e.geometry.textStyle),e.fid&&(r.id=e.fid),e.ID&&(r.id=e.ID),r},geometry:function(e){if(null==e)return null;!e.parts&&e.points&&(e.parts=[e.points.length]);var t,r=e.hasOwnProperty("geometryType")?e:new ce(e).toGeometry()||e,n=r.geometryType||r.type;return"LinearRing"===n&&(n="LineString"),"LINEM"===n&&(n="MultiLineString"),t=this.extract[n.toLowerCase()].apply(this,[r]),"Collection"===(n="TEXT"===n?"Point":n)?{type:"GeometryCollection",geometries:t}:{type:n,coordinates:t}},point:function(e){var t=[e.x,e.y];for(var r in e)"x"===r||"y"===r||null===e[r]||isNaN(e[r])||t.push(e[r]);return t},text:function(e){return[e.points[0].x,e.points[0].y]},multipoint:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.point.apply(this,[e.components[r]]));return t},linestring:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.point.apply(this,[e.components[r]]));return t},multilinestring:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.linestring.apply(this,[e.components[r]]));return t},polygon:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.linestring.apply(this,[e.components[r]]));return t},multipolygon:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.polygon.apply(this,[e.components[r]]));return t},collection:function(e){for(var t=e.components.length,r=new Array(t),n=0;n<t;++n)r[n]=this.extract.geometry.apply(this,[e.components[n]]);return r}}}read(e,t,r){t=t||"FeatureCollection";var n,s=null;if(n="string"==typeof e?super.read(e,r):e)if("string"!=typeof n.type);else if(this.isValidType(n,t))switch(t){case"Geometry":try{s=this.parseGeometry(n)}catch(e){}break;case"Feature":try{(s=this.parseFeature(n)).type="Feature"}catch(e){}break;case"FeatureCollection":switch(s=[],n.type){case"Feature":try{s.push(this.parseFeature(n))}catch(e){s=null}break;case"FeatureCollection":for(var o=0,i=n.features.length;o<i;++o)try{s.push(this.parseFeature(n.features[o]))}catch(e){s=null}break;default:try{var a=this.parseGeometry(n);s.push(new V(a))}catch(e){s=null}}}return s}write(e,t){return super.write(this.toGeoJSON(e),t)}fromGeoJSON(e,t,r){let n=this.read(e,t,r);return y.isArray(n)?n.map((e=>this._toiSevrerFeature(e))):this._toiSevrerFeature(n)}toGeoJSON(e){var t={type:null};if(y.isArray(e)){t.type="FeatureCollection";var r=e.length;t.features=new Array(r);for(var n=0;n<r;++n){var s=e[n];if(o(s)){let e={};e.geometry=s,t.features[n]=this.extract.feature.apply(this,[e])}else t.features[n]=this.extract.feature.apply(this,[s])}}else if(o(e)){let r={};r.geometry=e,t=this.extract.feature.apply(this,[r])}else t=this.extract.feature.apply(this,[e]);function o(e){return e.hasOwnProperty("parts")&&e.hasOwnProperty("points")||e.hasOwnProperty("geoParts")}return t}isValidType(e,t){var r=!1;switch(t){case"Geometry":-1==y.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],e.type)||(r=!0);break;case"FeatureCollection":r=!0;break;default:e.type==t&&(r=!0)}return r}parseFeature(e){var t,r,n,s;n=e.properties?e.properties:{},s=e.geometry&&e.geometry.bbox||e.bbox;try{r=this.parseGeometry(e.geometry)}catch(e){throw e}return t=new V(r,n),s&&(t.bounds=K.fromArray(s)),e.id&&(t.geometry.id=e.id,t.fid=e.id),t}parseGeometry(e){if(null==e)return null;var t;if("GeometryCollection"==e.type){if(!y.isArray(e.geometries))throw"GeometryCollection must have geometries array: "+e;for(var r=e.geometries.length,n=new Array(r),s=0;s<r;++s)n[s]=this.parseGeometry.apply(this,[e.geometries[s]]);t=new X(n)}else{if(!y.isArray(e.coordinates))throw"Geometry must have coordinates array: "+e;if(!this.parseCoords[e.type.toLowerCase()])throw"Unsupported geometry type: "+e.type;try{t=this.parseCoords[e.type.toLowerCase()].apply(this,[e.coordinates])}catch(e){throw e}}return t}createCRSObject(e){var t=e.layer.projection.toString(),r={};if(t.match(/epsg:/i)){var n=parseInt(t.substring(t.indexOf(":")+1));r=4326==n?{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+n}}}return r}_toiSevrerFeature(e){const t=e.attributes,r=[],n=[];for(var s in t)r.push(s),n.push(t[s]);const o={fieldNames:r,fieldValues:n,geometry:ce.fromGeometry(e.geometry)};return o.geometry.id=e.fid,o}createAttributes(e){if(!e)return null;var t={};!function(e,t){if(e.hasOwnProperty("fieldNames")&&e.hasOwnProperty("fieldValues")){var r=e.fieldNames,n=e.fieldValues;for(var s in r)t[r[s]]=n[s]}}(e,t);var r=["fieldNames","fieldValues","geometry","stringID","ID"];for(var n in e)r.indexOf(n)>-1||(t[n]=e[n]);return t}}class de extends U{constructor(e,t){super(e,t),this.returnContent=!1,this.format=b,this.returnFeatureWithFieldCaption=!1,t&&y.extend(this,t),this.CLASS_NAME="SuperMap.QueryService",this.url&&(t&&t.format&&(this.format=t.format.toUpperCase()),this.url=y.urlPathAppend(this.url,"queryResults"))}destroy(){super.destroy(),this.returnContent=null,this.format=null}processAsync(e,t){if(e instanceof P){var r,n=this,s=null;return n.returnContent=e.returnContent,r=n.getJsonParameters(e),n.returnContent||(s=e.returnCustomResult)&&(n.url=y.urlAppend(n.url,"returnCustomResult="+s)),n.returnFeatureWithFieldCaption=e.returnFeatureWithFieldCaption,n.request({method:"POST",data:r,scope:n,success:t,failure:t})}}transformResult(e,t){e=y.transformResult(e);var r=new pe;if(e&&e.recordsets)for(var n=0,s=e.recordsets,o=s.length;n<o;n++)s[n].features&&(!0===this.returnFeatureWithFieldCaption&&s[n].features.map((e=>(e.fieldNames=s[n].fieldCaptions,e))),this.format===b&&(s[n].features=r.toGeoJSON(s[n].features)));return{result:e,options:t}}dataFormat(){return[b,S,w]}getQueryParameters(e){return new P({customParams:e.customParams,expectCount:e.expectCount,networkType:e.networkType,queryOption:e.queryOption,queryParams:e.queryParams,startRecord:e.startRecord,prjCoordSys:e.prjCoordSys,holdTime:e.holdTime})}}class fe extends de{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof O){var t,r="";return t=this.getQueryParameters(e),r+="'queryMode':'SqlQuery','queryParameters':","{"+(r+=y.toJSON(t))+"}"}}}class me{constructor(e){this.datasetNames=null,this.targetEpsgCode=null,this.targetPrj=null,this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.returnFeaturesOnly=!1,this.maxFeatures=null,this.hasGeometry=!0,this.aggregations=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesParametersBase"}destroy(){var e=this;e.datasetNames=null,e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.hasGeometry=null,e.maxFeatures=null,e.targetEpsgCode=null,e.targetPrj=null,e.aggregation&&(e.aggregation=null)}}class ge extends me{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesBySQLParameters"}destroy(){super.destroy();var e=this;e.getFeatureMode=null,e.queryParameter&&(e.queryParameter.destroy(),e.queryParameter=null)}static toJsonParameters(e){var t={datasetNames:e.datasetNames,getFeatureMode:"SQL",queryParameter:e.queryParameter};return e.maxFeatures&&!isNaN(e.maxFeatures)&&(t.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(t.hasGeometry=e.hasGeometry),e.aggregations&&(t.aggregations=e.aggregations),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),y.toJSON(t)}}class ye extends U{constructor(e,t){super(e,t),t=t||{},this.returnContent=!0,this.returnFeaturesOnly=!1,this.fromIndex=0,this.toIndex=19,this.hasGeometry=!0,this.maxFeatures=null,this.format=b,y.extend(this,t),this.url=y.urlPathAppend(this.url,"featureResults"),this.CLASS_NAME="SuperMap.GetFeaturesServiceBase"}destroy(){super.destroy();var e=this;e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.maxFeatures=null,e.format=null,e.hasGeometry=null}processAsync(e,t){if(e){var r,n=this,s=!0;return n.returnContent=e.returnContent,n.returnFeaturesOnly=e.returnFeaturesOnly,n.fromIndex=e.fromIndex,n.toIndex=e.toIndex,n.maxFeatures=e.maxFeatures,n.hasGeometry=e.hasGeometry,n.returnContent&&(s=!1),null!=n.fromIndex&&null!=n.toIndex&&!isNaN(n.fromIndex)&&!isNaN(n.toIndex)&&n.fromIndex>=0&&n.toIndex>=0&&!s&&(n.url=y.urlAppend(n.url,`fromIndex=${n.fromIndex}&toIndex=${n.toIndex}`)),n.returnContent&&(e.returnCountOnly||e.returnDatasetInfoOnly||e.returnFeaturesOnly||console.warn("recommend set returnFeaturesOnly config to true to imporve performance. if need get Total amount and Dataset information. FeatureService provide getFeaturesCount and getFeaturesDatasetInfo method"),e.returnCountOnly&&(n.url=y.urlAppend(n.url,"returnCountOnly="+e.returnCountOnly)),e.returnDatasetInfoOnly&&(n.url=y.urlAppend(n.url,"returnDatasetInfoOnly="+e.returnDatasetInfoOnly)),e.returnFeaturesOnly&&(n.url=y.urlAppend(n.url,"returnFeaturesOnly="+e.returnFeaturesOnly))),r=n.getJsonParameters(e),n.request({method:"POST",data:r,scope:n,success:t,failure:t})}}transformResult(e,t){e=y.transformResult(e);var r=new pe;return this.format===b&&e.features&&(e.features=r.toGeoJSON(e.features)),this.returnFeaturesOnly&&Array.isArray(e)&&(e={succeed:e.succeed,features:r.toGeoJSON(e)}),{result:e,options:t}}dataFormat(){return[b,S,w]}}class ve extends ye{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return ge.toJsonParameters(e)}}class be extends me{constructor(e){super(e),this.getFeatureMode="ID",this.IDs=null,this.fields=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByIDsParameters"}destroy(){super.destroy();var e=this;if(e.IDs=null,e.getFeatureMode=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}}static toJsonParameters(e){var t,r;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&((r=new I).name=e.datasetNames,r.fields=e.fields,t.queryParameter=r),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),"boolean"==typeof e.hasGeometry&&(t.hasGeometry=e.hasGeometry),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),y.toJSON(t)}}class Se extends ye{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return be.toJsonParameters(e)}}class we extends me{constructor(e){super(e),this.getFeatureMode=we.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=A,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsParameters"}destroy(){super.destroy();var e=this;if(e.bounds&&(e.bounds.destroy(),e.bounds=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,n;return r={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},n={datasetNames:e.datasetNames,getFeatureMode:we.getFeatureMode.BOUNDS,bounds:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new I).name=e.datasetNames,t.fields=e.fields,n.queryParameter=t),e.attributeFilter&&(n.attributeFilter=e.attributeFilter,n.getFeatureMode=we.getFeatureMode.BOUNDS_ATTRIBUTEFILTER),e.maxFeatures&&!isNaN(e.maxFeatures)&&(n.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(n.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(n.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(n.targetPrj=e.targetPrj),e.aggregations&&(n.aggregations=e.aggregations),y.toJSON(n)}}we.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class xe extends ye{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return we.toJsonParameters(e)}}class _e extends me{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBufferParameters"}destroy(){super.destroy();var e=this;if(e.bufferDistance=null,e.attributeFilter=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.geometry&&(e.geometry.destroy(),e.geometry=null)}static toJsonParameters(e){var t,r,n;return n=ce.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:n},e.fields&&((t=new I).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="BUFFER_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(r.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(r.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(r.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(r.targetPrj=e.targetPrj),y.toJSON(r)}}class Ce extends ye{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){return _e.toJsonParameters(e)}}class Ae extends me{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=A,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryParameters"}destroy(){super.destroy();var e=this;if(e.geometry&&(e.geometry.destroy(),e.geometry=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,n;return r=ce.fromGeometry(e.geometry),n={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new I).name=e.datasetNames,t.fields=e.fields,n.queryParameter=t),e.attributeFilter&&(n.attributeFilter=e.attributeFilter,n.getFeatureMode="SPATIAL_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(n.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(n.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(n.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(n.targetPrj=e.targetPrj),e.aggregations&&(n.aggregations=e.aggregations),y.toJSON(n)}}class Ee extends ye{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return Ae.toJsonParameters(e)}}class Pe{constructor(e){this.dataSourceName=null,this.dataSetName=null,this.featureId=null,y.extend(this,e),this.CLASS_NAME="SuperMap.AttachmentsParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.featureId=null}}class Oe extends Pe{constructor(e){super(e),this.file=null,this.IDs=null,this.editType="add",y.extend(this,e),this.CLASS_NAME="SuperMap.EditAttachmentsParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.featureId=null,e.file=null,e.IDs=null,e.editType=null}}class Ie extends U{constructor(e,t){super(e,t),t&&y.extend(this,t),this.CLASS_NAME="SuperMap.FeatureAttachmentsService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof Oe){y.extend(this,e);var r=this,n=e.editType;if(r.featureId=e.featureId,r.IDs=e.IDs,n===E){if(!r.IDs||Array.isArray(r.IDs)&&0===r.IDs.length)return;r.method="DELETE";var s=[];for(let e=0;e<r.IDs.length;e++){var o=y.urlPathAppend(r.url,`/features/${r.featureId}/attachments/${r.IDs[e]}`),i=r.request({url:o,method:r.method,data:null,scope:r,success:null,failure:null});s.push(i)}return Promise.all(s).then((e=>(t&&t(e),e)))}{if(!e.file||!(e.file instanceof File||e.file instanceof Blob))return;const n=new FormData;return n.append("file",e.file),r.method="POST",r.url=y.urlPathAppend(r.url,`/features/${r.featureId}/attachments`),r.request({method:r.method,data:n,scope:r,success:t,failure:t})}}}getAttachments(e,t){if(e instanceof Pe){y.extend(this,e);var r=this;return r.method="GET",r.featureId=e.featureId,r.url=y.urlPathAppend(r.url,`/features/${r.featureId}/attachments`),r.request({method:r.method,data:null,scope:r,success:t,failure:t})}}}class Te{constructor(e){this.dataSourceName=null,this.dataSetName=null,this.features=null,this.editType="add",this.IDs=null,this.returnContent=!1,this.isUseBatch=!1,y.extend(this,e),this.CLASS_NAME="SuperMap.EditFeaturesParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.features=null,e.editType=null,e.IDs=null,e.returnContent=null}static toJsonParameters(e){var t,r,n;if(e.editType===E){if(null===e.IDs)return;n={ids:e.IDs}}else if(n=[],e.features){r=e.features.length;for(var s=0;s<r;s++)(t=e.features[s]).geometry=ce.fromGeometry(t.geometry),n.push(t)}return y.toJSON(n)}}class Me extends U{constructor(e,t){super(e,t),this.returnContent=!1,this.isUseBatch=!1,t&&y.extend(this,t),this.url=y.urlPathAppend(this.url,"features"),this.CLASS_NAME="SuperMap.EditFeaturesService"}destroy(){super.destroy();var e=this;e.returnContent=null,e.isUseBatch=null,e.fromIndex=null,e.toIndex=null}processAsync(e,t){if(e instanceof Te){var r=this,n="POST",s="",o=e.editType,i=null;if(r.returnContent=e.returnContent,r.isUseBatch=e.isUseBatch,i=Te.toJsonParameters(e),o===E){i=s=y.toJSON(e.IDs);var a=y.urlAppend(r.url,y.getParameterString({ids:s}));F.urlIsLong(a)?(r.url=y.urlAppend(r.url,y.getParameterString({_method:"DELETE"})),n="POST"):(r.url=a,n="DELETE")}else"update"===o?n="PUT":(r.isUseBatch&&(r.url=y.urlAppend(r.url,`isUseBatch=${r.isUseBatch}`),r.returnContent=!1),r.returnContent&&(r.url=y.urlAppend(r.url,"returnContent=true"),n="POST"));return r.request({method:n,data:i,scope:r,success:t,failure:t})}}getMetaData(e,t){var r=this,n=e.featureId;return r.url=y.urlPathAppend(r.url,n+"/metadata"),r.request({method:"GET",data:null,scope:r,success:t,failure:t})}}const Ne={id:Se,sql:ve,bounds:xe,buffer:Ce,geometry:Ee};class ke{constructor(e,t){this.url=e,this.options=t||{}}getFeaturesByIDs(e,t,r){var n=this;return new Se(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:r}).processAsync(e,t)}getFeaturesByBounds(e,t,r){var n=this;return new xe(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}getFeaturesByBuffer(e,t,r){var n=this;return new Ce(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}getFeaturesBySQL(e,t,r){var n=this;return new ve(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}getFeaturesByGeometry(e,t,r){var n=this;return new Ee(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}editFeatures(e,t){if(e&&e.dataSourceName&&e.dataSetName){var r=this,n=r.url,s=e.dataSourceName,o=e.dataSetName;return n=y.urlPathAppend(n,"datasources/"+s+"/datasets/"+o),new Me(n,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}}getMetadata(e,t){var r=this,n=r.url,s=e.dataSourceName,o=e.dataSetName;return n=y.urlPathAppend(n,"datasources/"+s+"/datasets/"+o),new Me(n,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).getMetaData(e,t)}getFeatureAttachments(e,t){if(e&&e.dataSourceName&&e.dataSetName&&null!=!e.featureId){var r=this,n=r.url,s=e.dataSourceName,o=e.dataSetName;return n=y.urlPathAppend(n,"datasources/"+s+"/datasets/"+o),new Ie(n,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).getAttachments(e,t)}}editFeatureAttachments(e,t){if(e&&e.dataSourceName&&e.dataSetName&&null!=!e.featureId&&e.editType){var r=this,n=r.url,s=e.dataSourceName,o=e.dataSetName;return n=y.urlPathAppend(n,"datasources/"+s+"/datasets/"+o),new Ie(n,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}}getFeaturesCount(e,t){var r=this,n={...e,returnCountOnly:!0,returnContent:!0,returnFeaturesOnly:!1};let s=Object.keys(Ne).find((e=>n.CLASS_NAME.toLowerCase().includes(e)));return new Ne[s](r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(n,t)}getFeaturesDatasetInfo(e,t){var r=this,n={...e,returnDatasetInfoOnly:!0,returnContent:!0,returnFeaturesOnly:!1};let s=Object.keys(Ne).find((e=>n.CLASS_NAME.toLowerCase().includes(e)));return new Ne[s](r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(n,t)}_processFormat(e){return e||b}}class Fe{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Util"}clone(e){var t=this.BUILTIN_OBJECT;if("object"==typeof e&&null!==e){var r=e;if(e instanceof Array){r=[];for(var n=0,s=e.length;n<s;n++)r[n]=this.clone(e[n])}else if(!t[Object.prototype.toString.call(e)])for(var o in r={},e)e.hasOwnProperty(o)&&(r[o]=this.clone(e[o]));return r}return e}mergeItem(e,t,r,n){var s=this.BUILTIN_OBJECT;t.hasOwnProperty(r)&&("object"!=typeof e[r]||s[Object.prototype.toString.call(e[r])]?!n&&r in e||(e[r]=t[r]):this.merge(e[r],t[r],n))}merge(e,t,r){for(var n in t)this.mergeItem(e,t,n,r);return e}getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}getPixelContext(){return this._pixelCtx||(this._canvas=document.createElement("canvas"),this._width=this._canvas.width,this._height=this._canvas.height,this._pixelCtx=this._canvas.getContext("2d")),this._pixelCtx}adjustCanvasSize(e,t){var r,n=this._canvas,s=this._pixelCtx,o=this._width,i=this._height,a=this._offsetX,l=this._offsetY,u=100;e+a>o&&(o=e+a+u,n.width=o,r=!0),t+l>i&&(i=t+l+u,n.height=i,r=!0),e<-a&&(o+=a=Math.ceil(-e/u)*u,n.width=o,r=!0),t<-l&&(i+=l=Math.ceil(-t/u)*u,n.height=i,r=!0),r&&s.translate(a,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}inherits(e,t){var r=e.prototype;function n(){}for(var s in n.prototype=t.prototype,e.prototype=new n,r)e.prototype[s]=r[s];e.constructor=e}}class Le{constructor(){this.util=new Fe,this._ctx=null,this.palette=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],this._palette=this.palette,this.highlightColor="rgba(0,0,255,1)",this._highlightColor=this.highlightColor,this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Color"}customPalette(e){this.palette=e}resetPalette(){this.palette=this._palette}getColor(e,t){return e|=0,(t=t||this.palette)[e%t.length]}customHighlight(e){this.highlightColor=e}resetHighlight(){this.highlightColor=this._highlightColor}getHighlightColor(){return this.highlightColor}getRadialGradient(e,t,r,n,s,o,i){var a=this.util;this._ctx||(this._ctx=a.getContext());for(var l=this._ctx.createRadialGradient(e,t,r,n,s,o),u=0,h=i.length;u<h;u++)l.addColorStop(i[u][0],i[u][1]);return l.__nonRecursion=!0,l}getLinearGradient(e,t,r,n,s){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var i=this._ctx.createLinearGradient(e,t,r,n),a=0,l=s.length;a<l;a++)i.addColorStop(s[a][0],s[a][1]);return i.__nonRecursion=!0,i}getStepColors(e,t,r){e=this.toRGBA(e),t=this.toRGBA(t),e=this.getData(e);for(var n=[],s=((t=this.getData(t))[0]-e[0])/r,o=(t[1]-e[1])/r,i=(t[2]-e[2])/r,a=(t[3]-e[3])/r,l=0,u=e[0],h=e[1],c=e[2],p=e[3];l<r;l++)n[l]=this.toColor([this.adjust(Math.floor(u),[0,255]),this.adjust(Math.floor(h),[0,255]),this.adjust(Math.floor(c),[0,255]),p.toFixed(4)-0],"rgba"),u+=s,h+=o,c+=i,p+=a;return u=t[0],h=t[1],c=t[2],p=t[3],n[l]=this.toColor([u,h,c,p],"rgba"),n}getGradientColors(e,t){var r=[],n=e.length;if(void 0===t&&(t=20),1===n)r=this.getStepColors(e[0],e[0],t);else if(n>1)for(var s=0,o=n-1;s<o;s++){var i=this.getStepColors(e[s],e[s+1],t);s<o-1&&i.pop(),r=r.concat(i)}return r}toColor(e,t){if(t=t||"rgb",e&&(3===e.length||4===e.length)){if(e=this.map(e,(function(e){return e>1?Math.ceil(e):e})),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var r=this.map(e.slice(1,3),(function(e){return e+"%"}));e[1]=r[0],e[2]=r[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}toArray(e){(e=this.trim(e)).indexOf("rgba")<0&&(e=this.toRGBA(e));var t=[],r=0;return e.replace(/[\d.]+/g,(function(e){r<3?e|=0:e=+e,t[r++]=e})),t}convert(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),n=r[3];return void 0===n&&(n=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):t.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,t)}toRGBA(e){return this.convert(e,"rgba")}toRGB(e){return this.convert(e,"rgb")}toHex(e){return this.convert(e,"hex")}toHSVA(e){return this.convert(e,"hsva")}toHSV(e){return this.convert(e,"hsv")}toHSBA(e){return this.convert(e,"hsba")}toHSB(e){return this.convert(e,"hsb")}toHSLA(e){return this.convert(e,"hsla")}toHSL(e){return this.convert(e,"hsl")}toName(e){for(var t in this._nameColors)if(this.toHex(this._nameColors[t])===this.toHex(e))return t;return null}trim(e){return String(e).replace(/\s+/g,"")}normalize(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=(e=this.trim(e)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){var t=(3840&(e=parseInt(e.slice(1),16)))<<8,r=(240&e)<<4,n=15&e;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return e}lift(e,t){if(!this.isCalculableColor(e))return e;var r=t>0?1:-1;void 0===t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var n=this.getData(e),s=0;s<3;s++)n[s]=1===r?n[s]*(1-t)|0:(255-n[s])*t+n[s]|0;return"rgb("+n.join(",")+")"}reverse(e){if(!this.isCalculableColor(e))return e;var t=this.getData(this.toRGBA(e));return t=this.map(t,(function(e){return 255-e})),this.toColor(t,"rgb")}mix(e,t,r){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,s=this.getData(this.toRGBA(e)),o=this.getData(this.toRGBA(t)),i=s[3]-o[3],a=((n*i==-1?n:(n+i)/(1+n*i))+1)/2,l=1-a,u=[],h=0;h<3;h++)u[h]=s[h]*a+o[h]*l;var c=s[3]*r+o[3]*(1-r);return c=Math.max(0,Math.min(1,c)),1===s[3]&&1===o[3]?this.toColor(u,"rgb"):(u[3]=c,this.toColor(u,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(e){var t,r,n=(e=this.normalize(e)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var s,o=[];if(n[2])s=[(t=n[2].replace("#","").split(""))[0]+t[1],t[2]+t[3],t[4]+t[5]],o=this.map(s,(function(e){return Le.prototype.adjust.call(this,parseInt(e,16),[0,255])}));else if(n[4]){var i=n[4].split(",");r=i[3],s=i.slice(0,3),o=this.map(s,(function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),Le.prototype.adjust.call(this,e,[0,255])})),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}else if(n[5]||n[6]){var a=(n[5]||n[6]).split(","),l=parseInt(a[0],0)/360,u=a[1],h=a[2];r=a[3],(o=this.map([u,h],(function(e){return Le.prototype.adjust.call(this,parseFloat(e)/100,[0,1])}))).unshift(l),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}return o}alpha(e,t){if(!this.isCalculableColor(e))return e;null===t&&(t=1);var r=this.getData(this.toRGBA(e));return r[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(r,"rgba")}map(e,t){if("function"!=typeof t)throw new TypeError;for(var r=e?e.length:0,n=0;n<r;n++)e[n]=t(e[n]);return e}adjust(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e}isCalculableColor(e){return e instanceof Array||"string"==typeof e}_HSV_2_RGB(e){var t,r,n,s=e[0],o=e[1],i=e[2];if(0===o)t=255*i,r=255*i,n=255*i;else{var a=6*s;6===a&&(a=0);var l=0|a,u=i*(1-o),h=i*(1-o*(a-l)),c=i*(1-o*(1-(a-l))),p=0,d=0,f=0;0===l?(p=i,d=c,f=u):1===l?(p=h,d=i,f=u):2===l?(p=u,d=i,f=c):3===l?(p=u,d=h,f=i):4===l?(p=c,d=u,f=i):(p=i,d=u,f=h),t=255*p,r=255*d,n=255*f}return[t,r,n]}_HSL_2_RGB(e){var t,r,n,s=e[0],o=e[1],i=e[2];if(0===o)t=255*i,r=255*i,n=255*i;else{var a,l=2*i-(a=i<.5?i*(1+o):i+o-o*i);t=255*this._HUE_2_RGB(l,a,s+1/3),r=255*this._HUE_2_RGB(l,a,s),n=255*this._HUE_2_RGB(l,a,s-1/3)}return[t,r,n]}_HUE_2_RGB(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}_RGB_2_HSB(e){var t,r,n=e[0]/255,s=e[1]/255,o=e[2]/255,i=Math.min(n,s,o),a=Math.max(n,s,o),l=a-i,u=a;if(0===l)t=0,r=0;else{r=l/a;var h=((a-n)/6+l/2)/l,c=((a-s)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?t=p-c:s===a?t=1/3+h-p:o===a&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,u*=100]}_RGB_2_HSL(e){var t,r,n=e[0]/255,s=e[1]/255,o=e[2]/255,i=Math.min(n,s,o),a=Math.max(n,s,o),l=a-i,u=(a+i)/2;if(0===l)t=0,r=0;else{r=u<.5?l/(a+i):l/(2-a-i);var h=((a-n)/6+l/2)/l,c=((a-s)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?t=p-c:s===a?t=1/3+h-p:o===a&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,u*=100]}}var Re=new Le;class je{static createCanvas(e,t){var r=document.createElement("canvas");return r.height=e,r.width=t,r.getContext("2d")}static getLinearGradient(e,t,r,n,s){this._ctx||(this._ctx=this.getContext());for(var o=this._ctx.createLinearGradient(e,t,r,n),i=s.length,a=1/(i-1),l=0,u=0;u<i;u++)o.addColorStop(l,s[u]),l+=a;return o.__nonRecursion=!0,o}static getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}static getStepColors(e,t,r){e=Re.toRGBA(e),t=Re.toRGBA(t),e=Re.getData(e);for(var n=[],s=((t=Re.getData(t))[0]-e[0])/r,o=(t[1]-e[1])/r,i=(t[2]-e[2])/r,a=(t[3]-e[3])/r,l=0,u=e[0],h=e[1],c=e[2],p=e[3];l<r;l++)n[l]=Re.toColor([Re.adjust(Math.floor(u),[0,255]),Re.adjust(Math.floor(h),[0,255]),Re.adjust(Math.floor(c),[0,255]),p.toFixed(4)-0],"hex"),u+=s,h+=o,c+=i,p+=a;return u=t[0],h=t[1],c=t[2],p=t[3],n[l]=Re.toColor([u,h,c,p],"hex"),n}static getGradientColors(e,t,r){var n,s,o,i=[],a=e.length;if(void 0!==t){if(a>=t)if("RANGE"===r)for(s=0;s<t;s++)i.push(e[s]);else for(s=0;s<t;s++){let t=Math.floor(s/2);if(s%2==0)i.push(e[t]);else{let r=e.length-1-t;i.push(e[r])}}else{for(n=Math.ceil(t/(a-1)),s=0,o=a-1;s<o;s++){var l=this.getStepColors(e[s],e[s+1],n);s<o-1&&l.pop(),i=i.concat(l)}for(var u=i.length-t,h=0;h<u;h++)i.splice(2,1)}return i}}}}(),n}()}));
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return function(){var e={444:function(e){!function(t){"use strict";if(t.__disableNativeFetch||!t.fetch){u.prototype.append=function(e,t){e=a(e),t=l(t);var r=this.map[e];r||(r=[],this.map[e]=r),r.push(t)},u.prototype.delete=function(e){delete this.map[a(e)]},u.prototype.get=function(e){var t=this.map[a(e)];return t?t[0]:null},u.prototype.getAll=function(e){return this.map[a(e)]||[]},u.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},u.prototype.set=function(e,t){this.map[a(e)]=[l(t)]},u.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach((function(r){this.map[r].forEach((function(n){e.call(t,n,r,this)}),this)}),this)};var r="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),n="FormData"in t,s="ArrayBuffer"in t,o=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];f.prototype.clone=function(){return new f(this)},d.call(f.prototype),d.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var i=[301,302,303,307,308];y.redirect=function(e,t){if(-1===i.indexOf(t))throw new RangeError("Invalid status code");return new y(null,{status:t,headers:{location:e}})},t.Headers=u,t.Request=f,t.Response=y,t.fetch=function(e,t){return new Promise((function(n,s){var o;o=f.prototype.isPrototypeOf(e)&&!t?e:new f(e,t);var i=new XMLHttpRequest,a=!1;function l(){if(4===i.readyState){var e=1223===i.status?204:i.status;if(e<100||e>599){if(a)return;return a=!0,void s(new TypeError("Network request failed"))}var t={status:e,statusText:i.statusText,headers:g(i),url:"responseURL"in i?i.responseURL:/^X-Request-URL:/m.test(i.getAllResponseHeaders())?i.getResponseHeader("X-Request-URL"):void 0},r="response"in i?i.response:i.responseText;a||(a=!0,n(new y(r,t)))}}i.onreadystatechange=l,i.onload=l,i.onerror=function(){a||(a=!0,s(new TypeError("Network request failed")))},i.open(o.method,o.url,!0);try{"include"===o.credentials&&("withCredentials"in i?i.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(e){console&&console.warn&&console.warn("set withCredentials error:"+e)}"responseType"in i&&r&&(i.responseType="blob"),o.headers.forEach((function(e,t){i.setRequestHeader(t,e)})),i.send(void 0===o._bodyInit?null:o._bodyInit)}))},t.fetch.polyfill=!0,e.exports&&(e.exports=t.fetch)}function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function p(e){var t=new FileReader;return t.readAsArrayBuffer(e),c(t)}function d(){return this.bodyUsed=!1,this._initBody=function(e,t){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(r&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(n&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!s||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r?(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(p)},this.text=function(){var e,t,r,n,s,o,i,a=h(this);if(a)return a;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,r=new FileReader,n=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",s=/charset\=[0-9a-zA-Z\-\_]*;?/,o=e.type.match(s)||n.match(s),i=[e],o&&i.push(o[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,i),c(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){return h(this)||Promise.resolve(this._bodyText)},n&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}function f(e,t){var r,n,s=(t=t||{}).body;if(f.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,s||(s=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),o.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(s,t)}function m(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(s))}})),t}function g(e){var t=new u;return e.getAllResponseHeaders().trim().split("\n").forEach((function(e){var r=e.trim().split(":"),n=r.shift().trim(),s=r.join(":").trim();t.append(n,s)})),t}function y(e,t){t||(t={}),this._initBody(e,t),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof u?t.headers:new u(t.headers),this.url=t.url||""}}("undefined"!=typeof self?self:this)},348:function(e,t){var r,n;r=function(e,t){"use strict";var r=5e3,n="callback";function s(e){try{delete window[e]}catch(t){window[e]=void 0}}function o(e){var t=document.getElementById(e);t&&document.getElementsByTagName("head")[0].removeChild(t)}t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=e,a=t.timeout||r,l=t.jsonpCallback||n,u=void 0;return new Promise((function(r,n){var h=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),c=l+"_"+h;window[h]=function(e){r({ok:!0,json:function(){return Promise.resolve(e)}}),u&&clearTimeout(u),o(c),s(h)},i+=-1===i.indexOf("?")?"?":"&";var p=document.createElement("script");p.setAttribute("src",""+i+l+"="+h),t.charset&&p.setAttribute("charset",t.charset),p.id=c,document.getElementsByTagName("head")[0].appendChild(p),u=setTimeout((function(){n(new Error("JSONP request to "+e+" timed out")),s(h),o(c),window[h]=function(){s(h)}}),a),p.onerror=function(){n(new Error("JSONP request to "+e+" failed")),s(h),o(c),u&&clearTimeout(u)}}))}},void 0===(n=r.apply(t,[t,e]))||(e.exports=n)},836:function(e,t,r){!function(){"use strict";function e(e){var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){return t.reject(r)}))}))}function t(e){return new this((function(t,r){if(!e||void 0===e.length)return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(e);if(0===n.length)return t([]);var s=n.length;function o(e,r){if(r&&("object"==typeof r||"function"==typeof r)){var i=r.then;if("function"==typeof i)return void i.call(r,(function(t){o(e,t)}),(function(r){n[e]={status:"rejected",reason:r},0==--s&&t(n)}))}n[e]={status:"fulfilled",value:r},0==--s&&t(n)}for(var i=0;i<n.length;i++)o(i,n[i])}))}var n=setTimeout;function s(e){return Boolean(e&&void 0!==e.length)}function o(){}function i(e){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn((function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var n;try{n=r(e._value)}catch(e){return void u(t.promise,e)}l(t.promise,n)}else(1===e._state?l:u)(t.promise,e._value)}))):e._deferreds.push(t)}function l(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var r=t.then;if(t instanceof i)return e._state=3,e._value=t,void h(e);if("function"==typeof r)return void p((n=r,s=t,function(){n.apply(s,arguments)}),e)}e._state=1,e._value=t,h(e)}catch(t){u(e,t)}var n,s}function u(e,t){e._state=2,e._value=t,h(e)}function h(e){2===e._state&&0===e._deferreds.length&&i._immediateFn((function(){e._handled||i._unhandledRejectionFn(e._value)}));for(var t=0,r=e._deferreds.length;t<r;t++)a(e,e._deferreds[t]);e._deferreds=null}function c(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function p(e,t){var r=!1;try{e((function(e){r||(r=!0,l(t,e))}),(function(e){r||(r=!0,u(t,e))}))}catch(e){if(r)return;r=!0,u(t,e)}}i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var r=new this.constructor(o);return a(this,new c(e,t,r)),r},i.prototype.finally=e,i.all=function(e){return new i((function(t,r){if(!s(e))return r(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(e);if(0===n.length)return t([]);var o=n.length;function i(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,(function(t){i(e,t)}),r)}n[e]=s,0==--o&&t(n)}catch(e){r(e)}}for(var a=0;a<n.length;a++)i(a,n[a])}))},i.allSettled=t,i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i((function(t){t(e)}))},i.reject=function(e){return new i((function(t,r){r(e)}))},i.race=function(e){return new i((function(t,r){if(!s(e))return r(new TypeError("Promise.race accepts an array"));for(var n=0,o=e.length;n<o;n++)i.resolve(e[n]).then(t,r)}))},i._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var d=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();"function"!=typeof d.Promise?d.Promise=i:(d.Promise.prototype.finally||(d.Promise.prototype.finally=e),d.Promise.allSettled||(d.Promise.allSettled=t))}()},430:function(e,t,r){var n,s;!function(o,i){"use strict";e.exports?e.exports=i():void 0===(s="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=s)}(0,(function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),s=n.length,o=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[s-1]&&""===n[s-2]&&n.pop(),-1!==n[(s=n.length)-1].indexOf(".")&&(o=7),t=0;t<s&&""!==n[t];t++);if(t<o)for(n.splice(t,1,"0000");n.length<o;)n.splice(t,0,"0000");for(var i=0;i<o;i++){r=n[i].split("");for(var a=0;a<3&&"0"===r[0]&&r.length>1;a++)r.splice(0,1);n[i]=r.join("")}var l=-1,u=0,h=0,c=-1,p=!1;for(i=0;i<o;i++)p?"0"===n[i]?h+=1:(p=!1,h>u&&(l=c,u=h)):"0"===n[i]&&(p=!0,c=i,h=1);h>u&&(l=c,u=h),u>1&&n.splice(l,u,""),s=n.length;var d="";for(""===n[0]&&(d=":"),i=0;i<s&&(d+=n[i],i!==s-1);i++)d+=":";return""===n[s-1]&&(d+=":"),d},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}}))},704:function(e,t,r){var n,s;!function(o,i){"use strict";e.exports?e.exports=i():void 0===(s="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=s)}(0,(function(e){"use strict";var t=e&&e.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var s=r.list[e.slice(t+1)];return!!s&&s.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var s=r.list[e.slice(t+1)];return s?s.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r}))},193:function(e,t,r){var n,s,o;!function(i,a){"use strict";e.exports?e.exports=a(r(340),r(430),r(704)):(s=[r(340),r(430),r(704)],void 0===(o="function"==typeof(n=a)?n.apply(t,s):n)||(e.exports=o))}(0,(function(e,t,r,n){"use strict";var s=n&&n.URI;function o(e,t){var r=arguments.length>=1;if(!(this instanceof o))return r?arguments.length>=2?new o(e,t):new o(e):new o;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}o.version="1.19.11";var i=o.prototype,a=Object.prototype.hasOwnProperty;function l(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function h(e){return"Array"===u(e)}function c(e,t){var r,n,s={};if("RegExp"===u(t))s=null;else if(h(t))for(r=0,n=t.length;r<n;r++)s[t[r]]=!0;else s[t]=!0;for(r=0,n=e.length;r<n;r++)(s&&void 0!==s[e[r]]||!s&&t.test(e[r]))&&(e.splice(r,1),n--,r--);return e}function p(e,t){var r,n;if(h(t)){for(r=0,n=t.length;r<n;r++)if(!p(e,t[r]))return!1;return!0}var s=u(t);for(r=0,n=e.length;r<n;r++)if("RegExp"===s){if("string"==typeof e[r]&&e[r].match(t))return!0}else if(e[r]===t)return!0;return!1}function d(e,t){if(!h(e)||!h(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function f(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return o.domAttributes[t]}},o.encode=g,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=g,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(e,t){var r=o.encode(e+"");return void 0===t&&(t=o.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},o.decodeQuery=function(e,t){e+="",void 0===t&&(t=o.escapeQuerySpace);try{return o.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var y,v={encode:"encode",decode:"decode"},b=function(e,t){return function(r){try{return o[t](r+"").replace(o.characters[e][t].expression,(function(r){return o.characters[e][t].map[r]}))}catch(e){return r}}};for(y in v)o[y+"PathSegment"]=b("pathname",v[y]),o[y+"UrnPathSegment"]=b("urnpath",v[y]);var S=function(e,t,r){return function(n){var s;s=r?function(e){return o[t](o[r](e))}:o[t];for(var i=(n+"").split(e),a=0,l=i.length;a<l;a++)i[a]=s(i[a]);return i.join(e)}};function x(e){return function(t,r){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!r),this)}}function w(e,t){return function(r,n){return void 0===r?this._parts[e]||"":(null!==r&&(r+="").charAt(0)===t&&(r=r.substring(1)),this._parts[e]=r,this.build(!n),this)}}o.decodePath=S("/","decodePathSegment"),o.decodeUrnPath=S(":","decodeUrnPathSegment"),o.recodePath=S("/","encodePathSegment","decode"),o.recodeUrnPath=S(":","encodeUrnPathSegment","decode"),o.encodeReserved=b("reserved","encode"),o.parse=function(e,t){var r;return t||(t={preventInvalidHostname:o.preventInvalidHostname}),(r=(e=(e=e.replace(o.leading_whitespace_expression,"")).replace(o.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=o.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(o.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=o.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},o.parseHost=function(e,t){e||(e="");var r,n,s=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===s&&(s=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,s)||null,"/"===t.port&&(t.port=null);else{var i=e.indexOf(":"),a=e.indexOf("/"),l=e.indexOf(":",i+1);-1!==l&&(-1===a||l<a)?(t.hostname=e.substring(0,s)||null,t.port=null):(n=e.substring(0,s).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(s).charAt(0)&&(s++,e="/"+e),t.preventInvalidHostname&&o.ensureValidHostname(t.hostname,t.protocol),t.port&&o.ensureValidPort(t.port),e.substring(s)||"/"},o.parseAuthority=function(e,t){return e=o.parseUserinfo(e,t),o.parseHost(e,t)},o.parseUserinfo=function(e,t){var r=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var n,s=e.indexOf("/"),i=e.lastIndexOf("@",s>-1?s:e.length-1);return i>-1&&(-1===s||i<s)?(n=e.substring(0,i).split(":"),t.username=n[0]?o.decode(n[0]):null,n.shift(),t.password=n[0]?o.decode(n.join(":")):null,e=r.substring(i+1)):(t.username=null,t.password=null),e},o.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,s,i={},l=e.split("&"),u=l.length,h=0;h<u;h++)r=l[h].split("="),n=o.decodeQuery(r.shift(),t),s=r.length?o.decodeQuery(r.join("="),t):null,"__proto__"!==n&&(a.call(i,n)?("string"!=typeof i[n]&&null!==i[n]||(i[n]=[i[n]]),i[n].push(s)):i[n]=s);return i},o.build=function(e){var t="",r=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",r=!0),t+=o.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&r&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},o.buildHost=function(e){var t="";return e.hostname?(o.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},o.buildAuthority=function(e){return o.buildUserinfo(e)+o.buildHost(e)},o.buildUserinfo=function(e){var t="";return e.username&&(t+=o.encode(e.username)),e.password&&(t+=":"+o.encode(e.password)),t&&(t+="@"),t},o.buildQuery=function(e,t,r){var n,s,i,l,u="";for(s in e)if("__proto__"!==s&&a.call(e,s))if(h(e[s]))for(n={},i=0,l=e[s].length;i<l;i++)void 0!==e[s][i]&&void 0===n[e[s][i]+""]&&(u+="&"+o.buildQueryParameter(s,e[s][i],r),!0!==t&&(n[e[s][i]+""]=!0));else void 0!==e[s]&&(u+="&"+o.buildQueryParameter(s,e[s],r));return u.substring(1)},o.buildQueryParameter=function(e,t,r){return o.encodeQuery(e,r)+(null!==t?"="+o.encodeQuery(t,r):"")},o.addQuery=function(e,t,r){if("object"==typeof t)for(var n in t)a.call(t,n)&&o.addQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=r);"string"==typeof e[t]&&(e[t]=[e[t]]),h(r)||(r=[r]),e[t]=(e[t]||[]).concat(r)}},o.setQuery=function(e,t,r){if("object"==typeof t)for(var n in t)a.call(t,n)&&o.setQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===r?null:r}},o.removeQuery=function(e,t,r){var n,s,i;if(h(t))for(n=0,s=t.length;n<s;n++)e[t[n]]=void 0;else if("RegExp"===u(t))for(i in e)t.test(i)&&(e[i]=void 0);else if("object"==typeof t)for(i in t)a.call(t,i)&&o.removeQuery(e,i,t[i]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===u(r)?!h(e[t])&&r.test(e[t])?e[t]=void 0:e[t]=c(e[t],r):e[t]!==String(r)||h(r)&&1!==r.length?h(e[t])&&(e[t]=c(e[t],r)):e[t]=void 0:e[t]=void 0}},o.hasQuery=function(e,t,r,n){switch(u(t)){case"String":break;case"RegExp":for(var s in e)if(a.call(e,s)&&t.test(s)&&(void 0===r||o.hasQuery(e,s,r)))return!0;return!1;case"Object":for(var i in t)if(a.call(t,i)&&!o.hasQuery(e,i,t[i]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(r)){case"Undefined":return t in e;case"Boolean":return r===Boolean(h(e[t])?e[t].length:e[t]);case"Function":return!!r(e[t],t,e);case"Array":return!!h(e[t])&&(n?p:d)(e[t],r);case"RegExp":return h(e[t])?!!n&&p(e[t],r):Boolean(e[t]&&e[t].match(r));case"Number":r=String(r);case"String":return h(e[t])?!!n&&p(e[t],r):e[t]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var e=[],t=[],r=0,n=0;n<arguments.length;n++){var s=new o(arguments[n]);e.push(s);for(var i=s.segment(),a=0;a<i.length;a++)"string"==typeof i[a]&&t.push(i[a]),i[a]&&r++}if(!t.length||!r)return new o("");var l=new o("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||l.path("/"+l.path()),l.normalize()},o.commonPath=function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r)){r--;break}return r<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(r)&&"/"===t.charAt(r)||(r=e.substring(0,r).lastIndexOf("/")),e.substring(0,r+1))},o.withinString=function(e,t,r){r||(r={});var n=r.start||o.findUri.start,s=r.end||o.findUri.end,i=r.trim||o.findUri.trim,a=r.parens||o.findUri.parens,l=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var u=n.exec(e);if(!u)break;var h=u.index;if(r.ignoreHtml){var c=e.slice(Math.max(h-3,0),h);if(c&&l.test(c))continue}for(var p=h+e.slice(h).search(s),d=e.slice(h,p),f=-1;;){var m=a.exec(d);if(!m)break;var g=m.index+m[0].length;f=Math.max(f,g)}if(!((d=f>-1?d.slice(0,f)+d.slice(f).replace(i,""):d.replace(i,"")).length<=u[0].length||r.ignore&&r.ignore.test(d))){var y=t(d,h,p=h+d.length,e);void 0!==y?(y=String(y),e=e.slice(0,h)+y+e.slice(p),n.lastIndex=h+y.length):n.lastIndex=p}}return n.lastIndex=0,e},o.ensureValidHostname=function(t,r){var n=!!t,s=!1;if(!!r&&(s=p(o.hostProtocols,r)),s&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},o.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=s),this},i.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},i.clone=function(){return new o(this)},i.valueOf=i.toString=function(){return this.build(!1)._string},i.protocol=x("protocol"),i.username=x("username"),i.password=x("password"),i.hostname=x("hostname"),i.port=x("port"),i.query=w("query","?"),i.fragment=w("fragment","#"),i.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},i.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},i.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?o.decodeUrnPath:o.decodePath)(r):r}return this._parts.urn?this._parts.path=e?o.recodeUrnPath(e):"":this._parts.path=e?o.recodePath(e):"/",this.build(!t),this},i.path=i.pathname,i.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=o._parts();var n=e instanceof o,s="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[o.getDomAttribute(e)]||"",s=!1),!n&&s&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=o.parse(String(e),this._parts);else{if(!n&&!s)throw new TypeError("invalid input");var i=n?e._parts:e;for(r in i)"query"!==r&&a.call(this._parts,r)&&(this._parts[r]=i[r]);i.query&&this.query(i.query,!1)}return this.build(!t),this},i.is=function(e){var t=!1,n=!1,s=!1,i=!1,a=!1,l=!1,u=!1,h=!this._parts.urn;switch(this._parts.hostname&&(h=!1,n=o.ip4_expression.test(this._parts.hostname),s=o.ip6_expression.test(this._parts.hostname),a=(i=!(t=n||s))&&r&&r.has(this._parts.hostname),l=i&&o.idn_expression.test(this._parts.hostname),u=i&&o.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return h;case"absolute":return!h;case"domain":case"name":return i;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return s;case"idn":return l;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return u}return null};var _=i.protocol,C=i.port,A=i.hostname;i.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(o.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return _.call(this,e,t)},i.scheme=i.protocol,i.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),o.ensureValidPort(e))),C.call(this,e,t))},i.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==o.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(e,this._parts.protocol)}return A.call(this,e,t)},i.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=o(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},i.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?o.buildHost(this._parts):"";if("/"!==o.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?o.buildAuthority(this._parts):"";if("/"!==o.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=o.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==e[e.length-1]&&(e+="@"),o.parseUserinfo(e,this._parts),this.build(!t),this},i.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=o.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},i.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,s=this._parts.hostname.substring(0,n),i=new RegExp("^"+l(s));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&o.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(i,e),this.build(!t),this},i.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var s=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(s,e)}return this.build(!t),this},i.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),s=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[s.toLowerCase()]&&r.get(this._parts.hostname)||s}var o;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},i.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return e?o.decodePath(n):n}var s=this._parts.path.length-this.filename().length,i=this._parts.path.substring(0,s),a=new RegExp("^"+l(i));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=o.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},i.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return e?o.decodePathSegment(n):n}var s=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(s=!0);var i=new RegExp(l(this.filename())+"$");return e=o.recodePath(e),this._parts.path=this._parts.path.replace(i,e),s?this.normalizePath(t):this.build(!t),this},i.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,s=this.filename(),i=s.lastIndexOf(".");return-1===i?"":(r=s.substring(i+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?o.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var a,u=this.suffix();if(u)a=e?new RegExp(l(u)+"$"):new RegExp(l("."+u)+"$");else{if(!e)return this;this._parts.path+="."+o.recodePath(e)}return a&&(e=o.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},i.segment=function(e,t,r){var n=this._parts.urn?":":"/",s=this.path(),o="/"===s.substring(0,1),i=s.split(n);if(void 0!==e&&"number"!=typeof e&&(r=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(o&&i.shift(),e<0&&(e=Math.max(i.length+e,0)),void 0===t)return void 0===e?i:i[e];if(null===e||void 0===i[e])if(h(t)){i=[];for(var a=0,l=t.length;a<l;a++)(t[a].length||i.length&&i[i.length-1].length)&&(i.length&&!i[i.length-1].length&&i.pop(),i.push(f(t[a])))}else(t||"string"==typeof t)&&(t=f(t),""===i[i.length-1]?i[i.length-1]=t:i.push(t));else t?i[e]=f(t):i.splice(e,1);return o&&i.unshift(""),this.path(i.join(n),r)},i.segmentCoded=function(e,t,r){var n,s,i;if("number"!=typeof e&&(r=t,t=e,e=void 0),void 0===t){if(h(n=this.segment(e,t,r)))for(s=0,i=n.length;s<i;s++)n[s]=o.decode(n[s]);else n=void 0!==n?o.decode(n):void 0;return n}if(h(t))for(s=0,i=t.length;s<i;s++)t[s]=o.encode(t[s]);else t="string"==typeof t||t instanceof String?o.encode(t):t;return this.segment(e,t,r)};var E=i.query;return i.query=function(e,t){if(!0===e)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var r=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=e.call(this,r);return this._parts.query=o.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=o.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):E.call(this,e,t)},i.setQuery=function(e,t,r){var n=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)n[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var s in e)a.call(e,s)&&(n[s]=e[s])}return this._parts.query=o.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.addQuery=function(e,t,r){var n=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(n,e,void 0===t?null:t),this._parts.query=o.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.removeQuery=function(e,t,r){var n=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(n,e,t),this._parts.query=o.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.hasQuery=function(e,t,r){var n=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(n,e,t,r)},i.setSearch=i.setQuery,i.addSearch=i.addQuery,i.removeSearch=i.removeQuery,i.hasSearch=i.hasQuery,i.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},i.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},i.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},i.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},i.normalizePath=function(e){var t,r=this._parts.path;if(!r)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var n,s,i="";for("/"!==(r=o.recodePath(r)).charAt(0)&&(t=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(i=r.substring(1).match(/^(\.\.\/)+/)||"")&&(i=i[0]);-1!==(n=r.search(/\/\.\.(\/|$)/));)0!==n?(-1===(s=r.substring(0,n).lastIndexOf("/"))&&(s=n),r=r.substring(0,s)+r.substring(n+3)):r=r.substring(3);return t&&this.is("relative")&&(r=i+r.substring(1)),this._parts.path=r,this.build(!e),this},i.normalizePathname=i.normalizePath,i.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},i.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},i.normalizeSearch=i.normalizeQuery,i.normalizeHash=i.normalizeFragment,i.iso8859=function(){var e=o.encode,t=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=e,o.decode=t}return this},i.unicode=function(){var e=o.encode,t=o.decode;o.encode=g,o.decode=unescape;try{this.normalize()}finally{o.encode=e,o.decode=t}return this},i.readable=function(){var t=this.clone();t.username("").password("").normalize();var r="";if(t._parts.protocol&&(r+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(r+=e.toUnicode(t._parts.hostname),t._parts.port&&(r+=":"+t._parts.port)):r+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(r+="/"),r+=t.path(!0),t._parts.query){for(var n="",s=0,i=t._parts.query.split("&"),a=i.length;s<a;s++){var l=(i[s]||"").split("=");n+="&"+o.decodeQuery(l[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==l[1]&&(n+="="+o.decodeQuery(l[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}r+="?"+n.substring(1)}return r+o.decodeQuery(t.hash(),!0)},i.absoluteTo=function(e){var t,r,n,s=this.clone(),i=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof o||(e=new o(e)),s._parts.protocol)return s;if(s._parts.protocol=e._parts.protocol,this._parts.hostname)return s;for(r=0;n=i[r];r++)s._parts[n]=e._parts[n];return s._parts.path?(".."===s._parts.path.substring(-2)&&(s._parts.path+="/"),"/"!==s.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),s._parts.path=(t?t+"/":"")+s._parts.path,s.normalizePath())):(s._parts.path=e._parts.path,s._parts.query||(s._parts.query=e._parts.query)),s.build(),s},i.relativeTo=function(e){var t,r,n,s,i,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new o(e).normalize(),t=a._parts,r=e._parts,s=a.path(),i=e.path(),"/"!==s.charAt(0))throw new Error("URI is already relative");if("/"!==i.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===r.protocol&&(t.protocol=null),t.username!==r.username||t.password!==r.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==r.hostname||t.port!==r.port)return a.build();if(t.hostname=null,t.port=null,s===i)return t.path="",a.build();if(!(n=o.commonPath(s,i)))return a.build();var l=r.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=l+t.path.substring(n.length)||"./",a.build()},i.equals=function(e){var t,r,n,s,i,l=this.clone(),u=new o(e),c={};if(l.normalize(),u.normalize(),l.toString()===u.toString())return!0;if(n=l.query(),s=u.query(),l.query(""),u.query(""),l.toString()!==u.toString())return!1;if(n.length!==s.length)return!1;for(i in t=o.parseQuery(n,this._parts.escapeQuerySpace),r=o.parseQuery(s,this._parts.escapeQuerySpace),t)if(a.call(t,i)){if(h(t[i])){if(!d(t[i],r[i]))return!1}else if(t[i]!==r[i])return!1;c[i]=!0}for(i in r)if(a.call(r,i)&&!c[i])return!1;return!0},i.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},i.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},i.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},o}))},340:function(e,t,r){var n;e=r.nmd(e),function(s){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var i,a=2147483647,l=36,u=26,h=38,c=700,p=/^xn--/,d=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=l-1,y=Math.floor,v=String.fromCharCode;function b(e){throw new RangeError(m[e])}function S(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function x(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+S((e=e.replace(f,".")).split("."),t).join(".")}function w(e){for(var t,r,n=[],s=0,o=e.length;s<o;)(t=e.charCodeAt(s++))>=55296&&t<=56319&&s<o?56320==(64512&(r=e.charCodeAt(s++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),s--):n.push(t);return n}function _(e){return S(e,(function(e){var t="";return e>65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,r){var n=0;for(e=r?y(e/c):e>>1,e+=y(e/t);e>g*u>>1;n+=l)e=y(e/g);return y(n+(g+1)*e/(e+h))}function E(e){var t,r,n,s,o,i,h,c,p,d,f,m=[],g=e.length,v=0,S=128,x=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&b("not-basic"),m.push(e.charCodeAt(n));for(s=r>0?r+1:0;s<g;){for(o=v,i=1,h=l;s>=g&&b("invalid-input"),((c=(f=e.charCodeAt(s++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:l)>=l||c>y((a-v)/i))&&b("overflow"),v+=c*i,!(c<(p=h<=x?1:h>=x+u?u:h-x));h+=l)i>y(a/(d=l-p))&&b("overflow"),i*=d;x=A(v-o,t=m.length+1,0==o),y(v/t)>a-S&&b("overflow"),S+=y(v/t),v%=t,m.splice(v++,0,S)}return _(m)}function P(e){var t,r,n,s,o,i,h,c,p,d,f,m,g,S,x,_=[];for(m=(e=w(e)).length,t=128,r=0,o=72,i=0;i<m;++i)(f=e[i])<128&&_.push(v(f));for(n=s=_.length,s&&_.push("-");n<m;){for(h=a,i=0;i<m;++i)(f=e[i])>=t&&f<h&&(h=f);for(h-t>y((a-r)/(g=n+1))&&b("overflow"),r+=(h-t)*g,t=h,i=0;i<m;++i)if((f=e[i])<t&&++r>a&&b("overflow"),f==t){for(c=r,p=l;!(c<(d=p<=o?1:p>=o+u?u:p-o));p+=l)x=c-d,S=l-d,_.push(v(C(d+x%S,0))),c=y(x/S);_.push(v(C(c,0))),o=A(r,g,n==s),r=0,++n}++r,++t}return _.join("")}i={version:"1.3.2",ucs2:{decode:w,encode:_},decode:E,encode:P,toASCII:function(e){return x(e,(function(e){return d.test(e)?"xn--"+P(e):e}))},toUnicode:function(e){return x(e,(function(e){return p.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var n={};return function(){"use strict";r.r(n),r.d(n,{ColorsPickerUtil:function(){return Qe},FeatureService:function(){return Ge},FetchRequest:function(){return L},FilterParameter:function(){return N},GeometryLinearRing:function(){return oe},GeometryPoint:function(){return ee},GeometryPolygon:function(){return ie},GetFeaturesByBoundsParameters:function(){return Ee},GetFeaturesBySQLParameters:function(){return _e},GetFeaturesBySQLService:function(){return Ae},QueryByGeometryParameters:function(){return M},QueryBySQLParameters:function(){return O},QueryBySQLService:function(){return me},QueryService:function(){return xe},Util:function(){return y}});var e={startsWith:function(e,t){return 0==e.indexOf(t)},contains:function(e,t){return-1!=e.indexOf(t)},trim:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(e){for(var t=e.split("-"),r=t[0],n=1,s=t.length;n<s;n++){var o=t[n];r+=o.charAt(0).toUpperCase()+o.substring(1)}return r},format:function(t,r,n){return r||(r=window),t.replace(e.tokenRegEx,(function(e,t){for(var s,o=t.split(/\.+/),i=0;i<o.length;i++)0==i&&(s=r),s=s[o[i]];return"function"==typeof s&&(s=n?s.apply(null,n):s()),void 0===s?"undefined":s}))},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(t){return e.numberRegEx.test(t)},numericIf:function(t){return e.isNumeric(t)?parseFloat(t):t}},t={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(e,t){var r=0;return t>0&&(r=parseFloat(e.toPrecision(t))),r},format:function(e,r,n,s){r=void 0!==r?r:0,n=void 0!==n?n:t.thousandsSeparator,s=void 0!==s?s:t.decimalSeparator,null!=r&&(e=parseFloat(e.toFixed(r)));var o=e.toString().split(".");1===o.length&&null==r&&(r=0);var i,a=o[0];if(n)for(var l=/(-?[0-9]+)([0-9]{3})/;l.test(a);)a=a.replace(l,"$1"+n+"$2");if(0==r)i=a;else{var u=o.length>1?o[1]:"0";null!=r&&(u+=new Array(r-u.length+1).join("0")),i=a+s+u}return i}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return t.limitSigDigs(this,e)});var s=function(e,t){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var n=r.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,n)}};class o{constructor(){this.CLASS_NAME="SuperMap.Geometry",this.id=y.createUniqueID(this.CLASS_NAME+"_"),this.parent=null,this.bounds=null,this.SRID=null}destroy(){this.id=null,this.bounds=null,this.SRID=null}clone(){return new o}setBounds(e){e&&(this.bounds=e.clone())}clearBounds(){this.bounds=null,this.parent&&this.parent.clearBounds()}extendBounds(e){this.getBounds()?this.bounds.extend(e):this.setBounds(e)}getBounds(){return null==this.bounds&&this.calculateBounds(),this.bounds}calculateBounds(){}getVertices(e){}getArea(){return 0}}var i=r(193),a=r.n(i);const l=(h="",c="",p="pc",(d=navigator.userAgent.toLowerCase()).indexOf("msie")>-1||d.indexOf("trident")>-1&&d.indexOf("rv")>-1?(h="msie",u=d.match(/msie ([\d.]+)/)||d.match(/rv:([\d.]+)/)):d.indexOf("chrome")>-1?(h="chrome",u=d.match(/chrome\/([\d.]+)/)):d.indexOf("firefox")>-1?(h="firefox",u=d.match(/firefox\/([\d.]+)/)):d.indexOf("opera")>-1?(h="opera",u=d.match(/version\/([\d.]+)/)):d.indexOf("safari")>-1&&(h="safari",u=d.match(/version\/([\d.]+)/)),c=u?u[1]:"",d.indexOf("ipad")>-1||d.indexOf("ipod")>-1||d.indexOf("iphone")>-1?p="apple":d.indexOf("android")>-1&&(c=(u=d.match(/version\/([\d.]+)/))?u[1]:"",p="android"),{name:h,version:c,device:p});var u,h,c,p,d;const f=(m=!0,g=l,document.createElement("canvas").getContext?("firefox"===g.name&&parseFloat(g.version)<5&&(m=!1),"safari"===g.name&&parseFloat(g.version)<4&&(m=!1),"opera"===g.name&&parseFloat(g.version)<10&&(m=!1),"msie"===g.name&&parseFloat(g.version)<9&&(m=!1)):m=!1,m);var m,g;!function(){var e=navigator.userAgent.toLowerCase();-1===e.indexOf("webkit")&&e.indexOf("gecko")}();const y={assign(e){for(var t=0;t<Object.getOwnPropertyNames(arguments).length;t++){var r=Object.getOwnPropertyNames(arguments)[t];if("caller"!=r&&"callee"!=r&&"length"!=r&&"arguments"!=r){var n=arguments[r];if(n)for(var s=0;s<Object.getOwnPropertyNames(n).length;s++){var o=Object.getOwnPropertyNames(n)[s];"caller"!=r&&"callee"!=r&&"length"!=r&&"arguments"!=r&&(e[o]=n[o])}}}return e},extend:function(e,t){if(e=e||{},t){for(var r in t){var n=t[r];void 0!==n&&(e[r]=n)}!("function"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},copy:function(e,t){var r;if(e=e||{},t)for(var n in e)void 0!==(r=t[n])&&(e[n]=r)},reset:function(e){for(var t in e=e||{})if(e.hasOwnProperty(t)){if("object"==typeof e[t]&&e[t]instanceof Array){for(var r in e[t])e[t][r].destroy&&e[t][r].destroy();e[t].length=0}else"object"==typeof e[t]&&e[t]instanceof Object&&e[t].destroy&&e[t].destroy();e[t]=null}},getElement:function(){for(var e=[],t=0,r=arguments.length;t<r;t++){var n=arguments[t];if("string"==typeof n&&(n=document.getElementById(n)),1===arguments.length)return n;e.push(n)}return e},isElement:function(e){return!(!e||1!==e.nodeType)},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},removeItem:function(e,t){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1);return e},indexOf:function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},modifyDOMElement:function(e,t,r,n,s,o,i,a){t&&(e.id=t),r&&(e.style.left=r.x+"px",e.style.top=r.y+"px"),n&&(e.style.width=n.w+"px",e.style.height=n.h+"px"),s&&(e.style.position=s),o&&(e.style.border=o),i&&(e.style.overflow=i),parseFloat(a)>=0&&parseFloat(a)<1?(e.style.filter="alpha(opacity="+100*a+")",e.style.opacity=a):1===parseFloat(a)&&(e.style.filter="",e.style.opacity="")},applyDefaults:function(e,t){e=e||{};var r="function"==typeof window.Event&&t instanceof window.Event;for(var n in t)(void 0===e[n]||!r&&t.hasOwnProperty&&t.hasOwnProperty(n)&&!e.hasOwnProperty(n))&&(e[n]=t[n]);return!r&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},getParameterString:function(e){var t=[];for(var r in e){var n,s=e[r];null!=s&&"function"!=typeof s&&(n=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(r)+"="+n))}return t.join("&")},urlAppend:function(e,t){var r=e;if(t){0===t.indexOf("?")&&(t=t.substring(1));var n=(e+" ").split(/[?&]/);r+=" "===n.pop()?t:n.length?"&"+t:"?"+t}return r},urlPathAppend:function(e,t){let r=e;if(!t)return r;0===t.indexOf("/")&&(t=t.substring(1));const n=e.split("?");return n[0].indexOf("/",n[0].length-1)<0&&(n[0]+="/"),r=`${n[0]}${t}${n.length>1?`?${n[1]}`:""}`,r},DEFAULT_PRECISION:14,toFloat:function(e,t){return null==t&&(t=y.DEFAULT_PRECISION),"number"!=typeof e&&(e=parseFloat(e)),0===t?e:parseFloat(e.toPrecision(t))},rad:function(e){return e*Math.PI/180},getParameters:function(t){t=null==t?window.location.href:t;var r="";if(e.contains(t,"?")){var n=t.indexOf("?")+1,s=e.contains(t,"#")?t.indexOf("#"):t.length;r=t.substring(n,s)}for(var o={},i=r.split(/[&;]/),a=0,l=i.length;a<l;++a){var u=i[a].split("=");if(u[0]){var h=u[0];try{h=decodeURIComponent(h)}catch(e){h=unescape(h)}var c=(u[1]||"").replace(/\+/g," ");try{c=decodeURIComponent(c)}catch(e){c=unescape(c)}1==(c=c.split(",")).length&&(c=c[0]),o[h]=c}}return o},lastSeqID:0,createUniqueID:function(e){return null==e&&(e="id_"),y.lastSeqID+=1,e+y.lastSeqID},normalizeScale:function(e){return e>1?1/e:e},getResolutionFromScale:function(e,t){var r;return e&&(null==t&&(t="degrees"),r=1/(y.normalizeScale(e)*v[t]*96)),r},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*v[t]*96},getBrowser:function(){return l},isSupportCanvas:f,supportCanvas:function(){return y.isSupportCanvas},isInTheSameDomain:function(e){return!e||(-1===e.indexOf("//")||y.isSameDomain(e,document.location.toString()))},isSameDomain(e,t){return new(a())(e).normalize().origin()===new(a())(t).normalize().origin()},calculateDpi:function(e,t,r,n,s){if(e&&t&&r){var o,i=e.getWidth(),a=e.getHeight(),l=t.w,u=t.h;if(s=s||6378137,"degree"===(n=n||"degrees").toLowerCase()||"degrees"===n.toLowerCase()||"dd"===n.toLowerCase()){let e=i/l,t=a/u;o=254/(e>t?e:t)/r/(2*Math.PI*s/360)/1e4}else o=254/(i/l)/r/1e4;return o}},toJSON:function(e){var t=e;if(null==t)return null;switch(t.constructor){case String:return(t=(t=(t=(t=(t=(t='"'+t.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",n=0,s=t.length;n<s;n++)r+=y.toJSON(t[n]),n!==t.length-1&&(r+=",");return"["+r+"]";case Number:return isFinite(t)?String(t):null;case Boolean:return String(t);case Date:return"{'__type':\"System.DateTime\",'Year':"+t.getFullYear()+",'Month':"+(t.getMonth()+1)+",'Day':"+t.getDate()+",'Hour':"+t.getHours()+",'Minute':"+t.getMinutes()+",'Second':"+t.getSeconds()+",'Millisecond':"+t.getMilliseconds()+",'TimezoneOffset':"+t.getTimezoneOffset()+"}";default:if(null!=t.toJSON&&"function"==typeof t.toJSON)return t.toJSON();if("object"==typeof t){if(t.length){let e=[];for(let r=0,n=t.length;r<n;r++)e.push(y.toJSON(t[r]));return"["+e.join(",")+"]"}let e=[];for(let r in t)"function"!=typeof t[r]&&"CLASS_NAME"!==r&&"parent"!==r&&e.push("'"+r+"':"+y.toJSON(t[r]));return e.length>0?"{"+e.join(",")+"}":"{}"}return t.toString()}},getResolutionFromScaleDpi:function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?(e=y.normalizeScale(e),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4):-1},getScaleFromResolutionDpi:function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4:-1},transformResult:function(e){return e.responseText&&"string"==typeof e.responseText&&(e=JSON.parse(e.responseText)),e},copyAttributes:function(e,t){if(e=e||{},t)for(var r in t){var n=t[r];void 0!==n&&"CLASS_NAME"!==r&&"function"!=typeof n&&(e[r]=n)}return e},copyAttributesWithClip:function(e,t,r){if(e=e||{},t)for(var n in t){var s=!1;if(r&&r.length)for(var o=0,i=r.length;o<i;o++)if(n===r[o]){s=!0;break}if(!0!==s){var a=t[n];void 0!==a&&"CLASS_NAME"!==n&&"function"!=typeof a&&(e[n]=a)}}return e},cloneObject:function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date){let t=new Date;return t.setTime(e.getTime()),t}if(e instanceof Array)return e.slice(0);if(e instanceof Object){let r={};for(var t in e)e.hasOwnProperty(t)&&(r[t]=y.cloneObject(e[t]));return r}throw new Error("Unable to copy obj! Its type isn't supported.")},lineIntersection:function(e,t,r,n){var s,i,a=null,l=(n.x-r.x)*(e.y-r.y)-(n.y-r.y)*(e.x-r.x),u=(t.x-e.x)*(e.y-r.y)-(t.y-e.y)*(e.x-r.x),h=(n.y-r.y)*(t.x-e.x)-(n.x-r.x)*(t.y-e.y);if(0!=h)i=u/h,a=(s=l/h)>=0&&i<=1&&s<=1&&i>=0?new o.Point(e.x+s*(t.x-e.x),e.y+s*(t.y-e.y)):"No Intersection";else if(0==l&&0==u){var c=Math.max(e.y,t.y),p=Math.min(e.y,t.y),d=Math.max(e.x,t.x),f=Math.min(e.x,t.x);a=(r.y>=p&&r.y<=c||n.y>=p&&n.y<=c)&&r.x>=f&&r.x<=d||n.x>=f&&n.x<=d?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(e,t,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",e.fontSize&&(r.style.fontSize=e.fontSize),e.fontFamily&&(r.style.fontFamily=e.fontFamily),e.fontWeight&&(r.style.fontWeight=e.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=t;var n=r.clientWidth,s=r.clientHeight;return document.body.removeChild(r),{textWidth:n,textHeight:s}},convertPath:function(e,t){return t?e.replace(/\{([\w-\.]+)\}/g,((e,r)=>{var n,s;return n=t.hasOwnProperty(r)?null==(s=t[r])||null==s?"":s instanceof Date?s.toJSON():function(e){if("string"!=typeof e&&"object"!=typeof e)return!1;try{const t=e.toString();return"[object Object]"===t||"[object Array]"===t}catch(e){return!1}}(s)?JSON.stringify(s):s.toString():e,encodeURIComponent(n)})):e}},v={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};v.in=v.inches,v.degrees=v.dd,v.nmi=1852*v.m,y.extend(v,{Inch:v.inches,Meter:39.37,Foot:12,IFoot:11.999976,ClarkeFoot:11.999868327581488,SearsFoot:11.999955194477684,GoldCoastFoot:11.999964589846002,IInch:.9999979999999999,MicroInch:999998e-9,Mil:9.99998e-7,Centimeter:.3937,Kilometer:39370,Yard:36,SearsYard:35.99986558343306,IndianYard:35.99987015540864,IndianYd37:35.999740205100004,IndianYd62:35.999880755999996,IndianYd75:35.999868945,IndianFoot:11.9999567087,IndianFt37:11.9999134017,IndianFt62:11.999960252000001,IndianFt75:11.999956315,Mile:63360,IYard:35.999928,IMile:63359.87328,NautM:72913.24,"Lat-66":4367838.370169282,"Lat-83":4367954.152606599,Decimeter:3.9370000000000003,Millimeter:.03937,Dekameter:393.7,Decameter:393.7,Hectometer:3937,GermanMeter:39.370535294205006,CaGrid:39.359685060000004,ClarkeChain:791.991309620512,GunterChain:792.0000000000001,BenoitChain:791.9977268035781,SearsChain:791.9970428354235,ClarkeLink:7.91991309620512,GunterLink:7.920000000000001,BenoitLink:7.919977268035781,SearsLink:7.919970428354236,Rod:198.00000000000014,IntnlChain:791.998416,IntnlLink:7.91998416,Perch:198.00000000000014,Pole:198.00000000000014,Furlong:7919.999999999997,Rood:148.75036777426,CapeFoot:11.999868185255002,Brealey:14763.75,ModAmFt:12.000458400000001,Fathom:71.999856,"NautM-UK":72959.85408,"50kilometers":1968500,"150kilometers":5905500}),y.extend(v,{mm:v.Meter/1e3,cm:v.Meter/100,dm:100*v.Meter,km:1e3*v.Meter,kmi:v.nmi,fath:v.Fathom,ch:v.IntnlChain,link:v.IntnlLink,"us-in":v.inches,"us-ft":v.Foot,"us-yd":v.Yard,"us-ch":v.GunterChain,"us-mi":v.Mile,"ind-yd":v.IndianYd37,"ind-ft":v.IndianFt37,"ind-ch":791.9942845122}),v.degree=v.dd,v.meter=v.m,v.foot=v.ft,v.inch=v.inches,v.mile=v.mi,v.kilometer=v.km,v.yard=v.yd;var b="GEOJSON",S="ISERVER",x="FGB",w="LINE",_="POINT",C="REGION",A="CONTAIN",E="delete";class P{constructor(e){e&&(this.customParams=null,this.prjCoordSys=null,this.expectCount=1e5,this.networkType=w,this.queryOption="ATTRIBUTEANDGEOMETRY",this.queryParams=null,this.startRecord=0,this.holdTime=10,this.returnCustomResult=!1,this.returnFeatureWithFieldCaption=!1,y.extend(this,e),this.CLASS_NAME="SuperMap.QueryParameters")}destroy(){var e=this;if(e.customParams=null,e.expectCount=null,e.networkType=null,e.queryOption=null,e.queryParams){for(var t=0,r=e.queryParams,n=r.length;t<n;t++)r[t].destroy();e.queryParams=null}e.startRecord=null,e.holdTime=null,e.returnCustomResult=null,e.prjCoordSys=null}}class O extends P{constructor(e){super(e=e||{}),this.returnContent=!0,y.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy(),this.returnContent=null}}class M extends P{constructor(e){super(e=e||{}),this.returnContent=!0,this.geometry=null,this.spatialQueryMode="INTERSECT",y.extend(this,e),this.CLASS_NAME="SuperMap.QueryByGeometryParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.geometry=null,e.spatialQueryMode=null}}class N{constructor(e){this.attributeFilter=null,this.name=null,this.joinItems=null,this.linkItems=null,this.ids=null,this.orderBy=null,this.groupBy=null,this.fields=null,e&&y.extend(this,e),this.CLASS_NAME="SuperMap.FilterParameter"}destroy(){var e=this;if(e.attributeFilter=null,e.name=null,e.joinItems){for(let t=0,r=e.joinItems,n=r.length;t<n;t++)r[t].destroy();e.joinItems=null}if(e.linkItems){for(let t=0,r=e.linkItems,n=r.length;t<n;t++)r[t].destroy();e.linkItems=null}e.ids=null,e.orderBy=null,e.groupBy=null,e.fields=null}}r(836),r(444);var T=r(348),I=r.n(T);let k=window.fetch;var F={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=y.toJSON(e[t]));var r=encodeURIComponent(e[t]);this.queryValues.push(r)}},issue:function(e){for(var t=this,r=t.getUid(),n=e.url,s=[],o=n,i=0,a=t.queryKeys?t.queryKeys.length:0,l=0;l<a;l++)if(o.length+t.queryKeys[l].length+2>=t.limitLength){if(0==i)return!1;s.push(o),o=n,i=0,l--}else if(o.length+t.queryKeys[l].length+2+t.queryValues[l].length>t.limitLength)for(var u=t.queryValues[l];u.length>0;){var h=t.limitLength-o.length-t.queryKeys[l].length-2;o.indexOf("?")>-1?o+="&":o+="?";var c=u.substring(0,h);"%"===c.substring(h-1,h)?(h-=1,c=u.substring(0,h)):"%"===c.substring(h-2,h-1)&&(h-=2,c=u.substring(0,h)),o+=t.queryKeys[l]+"="+c,u=u.substring(h),c.length>0&&(s.push(o),o=n,i=0)}else i++,o.indexOf("?")>-1?o+="&":o+="?",o+=t.queryKeys[l]+"="+t.queryValues[l];return s.push(o),t.send(s,"SuperMapJSONPCallbacks_"+r,e&&e.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,r){var n=e.length;if(n>0)return new Promise((s=>{for(var o=(new Date).getTime(),i=0;i<n;i++){var a=e[i];a.indexOf("?")>-1?a+="&":a+="?",a+="sectionCount="+n,a+="§ionIndex="+i,a+="&jsonpUserID="+o,r&&(a=decodeURIComponent(a),a=r+encodeURIComponent(a)),I()(a,{jsonpCallbackFunction:t,timeout:3e4}).then((e=>{s(e.json())}))}}))},GET:function(e){var t=this;return t.queryKeys.length=0,t.queryValues.length=0,t.addQueryStrings(e.params),t.issue(e)},POST:function(e){var t=this;return t.queryKeys.length=0,t.queryValues.length=0,t.addQueryStrings({requestEntity:e.data}),t.issue(e)},PUT:function(e){var t=this;return t.queryKeys.length=0,t.queryValues.length=0,t.addQueryStrings({requestEntity:e.data}),t.issue(e)},DELETE:function(e){var t=this;return t.queryKeys.length=0,t.queryValues.length=0,t.addQueryStrings({requestEntity:e.data}),t.issue(e)}},L={commit:function(e,t,r,n){switch(e=e?e.toUpperCase():e){case"GET":default:return this.get(t,r,n);case"POST":return this.post(t,r,n);case"PUT":return this.put(t,r,n);case"DELETE":return this.delete(t,r,n)}},supportDirectRequest:function(e,t){return!!y.isInTheSameDomain(e)||(null!=t.crossOrigin?t.crossOrigin:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest||t.proxy)},get:function(e,t,r){if(r=r||{},e=y.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){var n={url:e=e.replace(".json",".jsonp"),data:t};return F.GET(n)}return this.urlIsLong(e)?this._postSimulatie("GET",e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,"GET")},delete:function(e,t,r){r=r||{};var n="DELETE";if(e=y.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var s={url:e+="&_method=DELETE",data:t};return F.DELETE(s)}return this.urlIsLong(e)?this._postSimulatie(n,e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,n)},post:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var n={url:y.urlAppend(e,"_method=POST"),data:t};return F.POST(n)}return this._fetch(e,t,r,"POST")},put:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var n={url:e+="&_method=PUT",data:t};return F.PUT(n)}return this._fetch(e,t,r,"PUT")},urlIsLong:function(e){for(var t=0,r=null,n=0,s=e.length;n<s;n++)(r=e.charCodeAt(n))<127?t++:128<=r&&r<=2047?t+=2:2048<=r&&r<=65535&&(t+=3);return!(t<2e3)},_postSimulatie:function(e,t,r,n){var s=t.indexOf("?")>-1?"&":"?";return t+=s+"_method="+e,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(t,r,n)},_processUrl:function(e,t){if(this._isMVTRequest(e))return e;if(-1===e.indexOf(".json")&&!t.withoutFormatSuffix)if(e.indexOf("?")<0)e+=".json";else{var r=e.split("?");2===r.length&&(e=r[0]+".json?"+r[1])}return t&&t.proxy&&("function"==typeof t.proxy?e=t.proxy(e):(e=decodeURIComponent(e),e=t.proxy+encodeURIComponent(e))),e},_fetch:function(e,t,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(t)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,k(e,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?t:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:45e3}).then((function(e){return e}))):k(e,{method:n,body:"PUT"===n||"POST"===n?t:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:45e3}).then((function(e){return e}))},_getWithCredentials:function(e){return!0===e.withCredentials?"include":!1===e.withCredentials?"omit":"same-origin"},_fetchJsonp:function(e,t){return t=t||{},I()(e,{method:"GET",timeout:t.timeout}).then((function(e){return e}))},_timeout:function(e,t){return new Promise((function(r,n){setTimeout((function(){n(new Error("timeout"))}),e),t.then(r,n)}))},_getParameterString:function(e){var t=[];for(var r in e){var n,s=e[r];null!=s&&"function"!=typeof s&&(n=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(r)+"="+n))}return t.join("&")},_isMVTRequest:function(e){return e.indexOf(".mvt")>-1||e.indexOf(".pbf")>-1}};class R{constructor(e,t,r){this.x=e?parseFloat(e):0,this.y=t?parseFloat(t):0,this.mode=r,this.CLASS_NAME="SuperMap.Pixel"}toString(){return"x="+this.x+",y="+this.y}clone(){return new R(this.x,this.y,this.mode)}equals(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}add(e,t){if(null==e||null==t)throw new TypeError("Pixel.add cannot receive null values");return new R(this.x+e,this.y+t)}offset(e){var t=this.clone();return e&&(t=this.add(e.x,e.y)),t}destroy(){this.x=null,this.y=null,this.mode=null}}R.Mode={LeftTop:"lefttop",RightTop:"righttop",RightBottom:"rightbottom",LeftBottom:"leftbottom"};var B={observers:!1,KEY_SPACE:32,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(e){return e.target||e.srcElement},isSingleTouch:function(e){return e.touches&&1===e.touches.length},isMultiTouch:function(e){return e.touches&&e.touches.length>1},isLeftClick:function(e){return e.which&&1===e.which||e.button&&1===e.button},isRightClick:function(e){return e.which&&3===e.which||e.button&&2===e.button},stop:function(e,t){t||(e.preventDefault?e.preventDefault():e.returnValue=!1),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},findElement:function(e,t){for(var r=B.element(e);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=t.toUpperCase());)r=r.parentNode;return r},observe:function(e,t,r,n){var s=y.getElement(e);if(n=n||!1,"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!s._eventCacheID){var o="eventCacheID_";s.id&&(o=s.id+"_"+o),s._eventCacheID=y.createUniqueID(o)}var i=s._eventCacheID;this.observers[i]||(this.observers[i]=[]),this.observers[i].push({element:s,name:t,observer:r,useCapture:n}),s.addEventListener?"mousewheel"===t?s.addEventListener(t,r,{useCapture:n,passive:!1}):s.addEventListener(t,r,n):s.attachEvent&&s.attachEvent("on"+t,r)},stopObservingElement:function(e){var t=y.getElement(e)._eventCacheID;this._removeElementObservers(B.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var r=e[t],n=new Array(r.element,r.name,r.observer,r.useCapture);B.stopObserving.apply(this,n)}},stopObserving:function(e,t,r,n){n=n||!1;var s=y.getElement(e),o=s._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.detachEvent)&&(t="keydown");var i=!1,a=B.observers[o];if(a)for(var l=0;!i&&l<a.length;){var u=a[l];if(u.name===t&&u.observer===r&&u.useCapture===n){a.splice(l,1),0==a.length&&delete B.observers[o],i=!0;break}l++}return i&&(s.removeEventListener?s.removeEventListener(t,r,n):s&&s.detachEvent&&s.detachEvent("on"+t,r)),i},unloadCache:function(){if(B&&B.observers){for(var e in B.observers){var t=B.observers[e];B._removeElementObservers.apply(this,[t])}B.observers=!1}},CLASS_NAME:"SuperMap.Event"};B.observe(window,"resize",B.unloadCache,!1);class j{constructor(e,t,r,n,s){if(this.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"],this.listeners={},this.object=e,this.element=null,this.eventTypes=[],this.eventHandler=null,this.fallThrough=n,this.includeXY=!1,this.extensions={},this.extensionCount={},this.clearMouseListener=null,y.extend(this,s),null!=r)for(var o=0,i=r.length;o<i;o++)this.addEventType(r[o]);null!=t&&this.attachToElement(t),this.CLASS_NAME="SuperMap.Events"}destroy(){for(var e in this.extensions)"boolean"!=typeof this.extensions[e]&&this.extensions[e].destroy();this.extensions=null,this.element&&(B.stopObservingElement(this.element),this.element.hasScrollEvent&&B.stopObserving(window,"scroll",this.clearMouseListener)),this.element=null,this.listeners=null,this.object=null,this.eventTypes=null,this.fallThrough=null,this.eventHandler=null}addEventType(e){this.listeners[e]||(this.eventTypes.push(e),this.listeners[e]=[])}attachToElement(e){var t,r;this.element?B.stopObservingElement(this.element):(this.eventHandler=(t=this.handleBrowserEvent,r=this,function(e){return t.call(r,e||window.event)}),this.clearMouseListener=s(this.clearMouseCache,this)),this.element=e;for(var n=0,o=this.BROWSER_EVENTS.length;n<o;n++){var i=this.BROWSER_EVENTS[n];this.addEventType(i),B.observe(e,i,this.eventHandler)}B.observe(e,"dragstart",B.stop)}on(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.register(t,e.scope,e[t])}register(e,t,r,n){if(e in j&&!this.extensions[e]&&(this.extensions[e]=new j[e](this)),null!=r&&-1!==y.indexOf(this.eventTypes,e)){null==t&&(t=this.object);var s=this.listeners[e];s||(s=[],this.listeners[e]=s,this.extensionCount[e]=0);var o={obj:t,func:r};n?(s.splice(this.extensionCount[e],0,o),"object"==typeof n&&n.extension&&this.extensionCount[e]++):s.push(o)}}registerPriority(e,t,r){this.register(e,t,r,!0)}un(e){for(var t in e)"scope"!==t&&e.hasOwnProperty(t)&&this.unregister(t,e.scope,e[t])}unregister(e,t,r){null==t&&(t=this.object);var n=this.listeners[e];if(null!=n)for(var s=0,o=n.length;s<o;s++)if(n[s].obj===t&&n[s].func===r){n.splice(s,1);break}}remove(e){null!=this.listeners[e]&&(this.listeners[e]=[])}triggerEvent(e,t){var r=this.listeners[e];if(r&&0!=r.length){var n;null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=e);for(var s=0,o=(r=r.slice()).length;s<o;s++){var i=r[s];if(null!=(n=i.func.apply(i.obj,[t]))&&!1===n)break}return this.fallThrough||B.stop(t,!0),n}}handleBrowserEvent(e){var t=e.type,r=this.listeners[t];if(r&&0!=r.length){var n=e.touches;if(n&&n[0]){for(var s,o=0,i=0,a=n.length,l=0;l<a;++l)o+=(s=n[l]).clientX,i+=s.clientY;e.clientX=o/a,e.clientY=i/a}this.includeXY&&(e.xy=this.getMousePosition(e)),this.triggerEvent(t,e)}}clearMouseCache(){this.element.scrolls=null,this.element.lefttop=null;var e=document.body;e&&(0==e.scrollTop&&0==e.scrollLeft||!navigator.userAgent.match(/iPhone/i))&&(this.element.offsets=null)}getMousePosition(e){if(this.includeXY?this.element.hasScrollEvent||(B.observe(window,"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),!this.element.scrolls){var t=y.getViewportElement();this.element.scrolls=[t.scrollLeft,t.scrollTop]}return this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]),this.element.offsets||(this.element.offsets=y.pagePosition(this.element)),new R(e.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],e.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])}}j.prototype.BROWSER_EVENTS=["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown","MSPointerDown","MSPointerUp","pointerdown","pointerup","MSGestureStart","MSGestureChange","MSGestureEnd","contextmenu"];class D{constructor(e,t){this.value=e||"",this.name=t||"token",this.CLASS_NAME="SuperMap.Credential"}getUrlParameters(){return this.name+"="+this.value}getValue(){return this.value}destroy(){this.value=null,this.name=null}}D.CREDENTIAL=null;class G{static generateToken(e,t){var r=this.servers[e];if(r)return L.post(r.tokenServiceUrl,JSON.stringify(t.toJSON())).then((function(e){return e.text()}))}static registerServers(e){this.servers=this.servers||{},y.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var r=e[t];this.servers[r.server]=r}}static registerToken(e,t){if(this.tokens=this.tokens||{},e&&t){var r=this._getTokenStorageKey(e);this.tokens[r]=t}}static registerKey(e,t){if(this.keys=this.keys||{},e&&!(e.length<1)&&t){e=y.isArray(e)?e:[e];for(var r=0;r<e.length;r++){var n=this._getUrlRestString(e[0])||e[0];this.keys[n]=t}}}static getServerInfo(e){return this.servers=this.servers||{},this.servers[e]}static getToken(e){if(e){this.tokens=this.tokens||{};var t=this._getTokenStorageKey(e);return this.tokens[t]}}static getKey(e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;return this.keys[t]}static loginiServer(e,t,r,n){e=y.urlPathAppend(e,"services/security/login");var s={username:t&&t.toString(),password:r&&r.toString(),rememberme:n};return s=JSON.stringify(s),L.post(e,s,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then((function(e){return e.json()}))}static logoutiServer(e){return e=y.urlPathAppend(e,"services/security/logout"),L.get(e,"",{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withoutFormatSuffix:!0}).then((function(){return!0})).catch((function(){return!1}))}static loginOnline(e,t){var r=G.SSO+"/login?service="+e;this._open(r,t)}static loginiPortal(e,t,r){e=y.urlPathAppend(e,"web/login");var n={username:t&&t.toString(),password:r&&r.toString()};return n=JSON.stringify(n),L.post(e,n,{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!1}).then((function(e){return e.json()}))}static logoutiPortal(e){return e=y.urlPathAppend(e,"services/security/logout"),L.get(e,"",{headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},withCredentials:!0,withoutFormatSuffix:!0}).then((function(){return!0})).catch((function(){return!1}))}static loginManager(e,t){var r=y.urlPathAppend(e,"/security/tokens"),n=t||{},s={username:n.userName&&n.userName.toString(),password:n.password&&n.password.toString()};s=JSON.stringify(s);var o=this;return L.post(r,s,{headers:{Accept:"*/*","Content-Type":"application/json; charset=UTF-8"}}).then((function(e){return e.text()})).then((function(e){return o.imanagerToken=e,e}))}static destroyAllCredentials(){this.keys=null,this.tokens=null,this.servers=null}static destroyToken(e){if(e){var t=this._getTokenStorageKey(e);this.tokens=this.tokens||{},this.tokens[t]&&delete this.tokens[t]}}static destroyKey(e){if(e){this.keys=this.keys||{};var t=this._getUrlRestString(e)||e;this.keys[t]&&delete this.keys[t]}}static appendCredential(e){var t=e,r=this.getToken(e),n=r?new D(r,"token"):null;return n||(n=(r=this.getKey(e))?new D(r,"key"):null),n&&(t=y.urlAppend(t,n.getUrlParameters())),t}static _open(e,t){t=null==t||t;var r=window.screen.availWidth/2-this.INNER_WINDOW_WIDTH/2,n=window.screen.availHeight/2-this.INNER_WINDOW_HEIGHT/2,s="height="+this.INNER_WINDOW_HEIGHT+", width="+this.INNER_WINDOW_WIDTH+",top="+n+", left="+r+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";t?window.open(e,"login"):window.open(e,"login",s)}static _getTokenStorageKey(e){var t=e.match(/(.*?):\/\/([^\/]+)/i);return t?t[0]:e}static _getUrlRestString(e){if(!e)return e;var t=e.match(/(http|https):\/\/(.*\/rest)/i);return t?t[0]:e}}G.INNER_WINDOW_WIDTH=600,G.INNER_WINDOW_HEIGHT=600,G.SSO="https://sso.supermap.com",G.ONLINE="https://www.supermapol.com";class q{constructor(e){this.data=null,this.keepData=!1,y.extend(this,e),this.options=e,this.CLASS_NAME="SuperMap.Format"}destroy(){}read(e){}write(e){}}class U extends q{constructor(e){super(e),this.indent=" ",this.space=" ",this.newline="\n",this.level=0,this.pretty=!1,this.nativeJSON=!(!window.JSON||"function"!=typeof JSON.parse||"function"!=typeof JSON.stringify),this.CLASS_NAME="SuperMap.Format.JSON",this.serialize={object:function(e){if(null==e)return"null";if(e.constructor===Date)return this.serialize.date.apply(this,[e]);if(e.constructor===Array)return this.serialize.array.apply(this,[e]);var t,r,n,s=["{"];this.level+=1;var o=!1;for(t in e)e.hasOwnProperty(t)&&(r=this.write.apply(this,[t,this.pretty]),n=this.write.apply(this,[e[t],this.pretty]),null!=r&&null!=n&&(o&&s.push(","),s.push(this.writeNewline(),this.writeIndent(),r,":",this.writeSpace(),n),o=!0));return this.level-=1,s.push(this.writeNewline(),this.writeIndent(),"}"),s.join("")},array:function(e){var t,r=["["];this.level+=1;for(var n=0,s=e.length;n<s;++n)null!=(t=this.write.apply(this,[e[n],this.pretty]))&&(n>0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,(function(e,r){var n=t[r];return n||(n=r.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))}))+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}}}read(e,t){var r;if(this.nativeJSON)try{r=JSON.parse(e,t)}catch(t){return{data:e}}return this.keepData&&(this.data=r),r}write(e,t){this.pretty=!!t;var r=null,n=typeof e;if(this.serialize[n])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[n].apply(this,[e])}catch(e){}return r}writeIndent(){var e=[];if(this.pretty)for(var t=0;t<this.level;++t)e.push(this.indent);return e.join("")}writeNewline(){return this.pretty?this.newline:""}writeSpace(){return this.pretty?this.space:""}}class z{constructor(e,t){let r=this;this.EVENT_TYPES=["processCompleted","processFailed"],this.events=null,this.eventListeners=null,this.url=null,this.urls=null,this.proxy=null,this.index=null,this.length=null,this.totalTimes=null,this.POLLING_TIMES=3,this.isInTheSameDomain=null,this.withCredentials=!1,y.isArray(e)?(r.urls=e,r.length=e.length,r.totalTimes=r.length,1===r.length?r.url=e[0]:(r.index=parseInt(Math.random()*r.length),r.url=e[r.index])):(r.totalTimes=1,r.url=e),y.isArray(e)&&!r.isServiceSupportPolling()&&(r.url=e[0],r.totalTimes=1),t=t||{},this.crossOrigin=t.crossOrigin,this.headers=t.headers,y.extend(this,t),r.isInTheSameDomain=y.isInTheSameDomain(r.url),r.events=new j(r,null,r.EVENT_TYPES,!0),r.eventListeners instanceof Object&&r.events.on(r.eventListeners),this.CLASS_NAME="SuperMap.CommonServiceBase"}destroy(){let e=this;y.isArray(e.urls)&&(e.urls=null,e.index=null,e.length=null,e.totalTimes=null),e.url=null,e.isInTheSameDomain=null,e.EVENT_TYPES=null,e.events&&(e.events.destroy(),e.events=null),e.eventListeners&&(e.eventListeners=null)}request(e){let t=e.scope.format;if("string"==typeof e.success&&(e.scope.format=e.success,t=e.success,e.success=null,e.failure=null),t&&!this.supportDataFormat(t))throw new Error(`${this.CLASS_NAME} is not surport ${t} format!`);let r=this;return e.url=e.url||r.url,this._returnContent(e)&&!e.url.includes("returnContent=true")&&(e.url=y.urlAppend(e.url,"returnContent=true")),e.proxy=e.proxy||r.proxy,e.withCredentials=null!=e.withCredentials?e.withCredentials:r.withCredentials,e.crossOrigin=null!=e.crossOrigin?e.crossOrigin:r.crossOrigin,e.headers=e.headers||r.headers,e.isInTheSameDomain=r.isInTheSameDomain,e.withoutFormatSuffix=e.scope.withoutFormatSuffix||!1,e.url=G.appendCredential(e.url),r.calculatePollingTimes(),e.scope=r,r.totalTimes>0?(r.totalTimes--,r.ajaxPolling(e)):r._commit(e)}ajaxPolling(e){let t=this,r=e.url,n=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],r=r.replace(n,n.exec(t.url)[0]),e.url=r,e.isInTheSameDomain=y.isInTheSameDomain(r),t._commit(e)}calculatePollingTimes(){let e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.times<e.totalTimes&&(e.totalTimes=e.times):e.totalTimes>e.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}isServiceSupportPolling(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}transformResult(e,t){return{result:e=y.transformResult(e),options:t}}transformErrorResult(e,t){return{error:(e=y.transformResult(e)).error||e,options:t}}serviceProcessCompleted(e,t){e=this.transformResult(e).result,this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){let r=(e=this.transformErrorResult(e).error).error||e;this.events.triggerEvent("processFailed",{error:r,options:t})}_returnContent(e){return e.scope.format!==x&&!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[b,S]}_commit(e){if("POST"===e.method||"PUT"===e.method||"PATCH"===e.method)if(e.params&&(e.url=y.urlAppend(e.url,y.getParameterString(e.params||{}))),"object"!=typeof e.data||e.data instanceof FormData)e.params=e.data;else try{e.params=y.toJSON(e.data)}catch(e){console.log("不是json对象")}return L.commit(e.method,e.url,e.params,{headers:e.headers,withoutFormatSuffix:e.withoutFormatSuffix,withCredentials:e.withCredentials,crossOrigin:e.crossOrigin,timeout:e.async?0:null,proxy:e.proxy}).then((function(e){return e.text?e.text():e.json?e.json():e})).then((function(t){let r=t;return"string"==typeof t&&(r=(new U).read(t)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&e.scope.format===x&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r})).catch((function(e){return{error:e}})).then((t=>{let r={object:this};if(t.error){const o="processFailed";if(this.events&&this.events.listeners[o]&&this.events.listeners[o].length){var n=e.failure&&(e.scope?s(e.failure,e.scope):e.failure);n?n(t,e):this.serviceProcessFailed(t,e)}else r={...r,...this.transformErrorResult(t,e)},r.type=o,e.failure&&e.failure(r)}else{const n="processCompleted";if(this.events&&this.events.listeners[n]&&this.events.listeners[n].length){var o=e.success&&(e.scope?s(e.success,e.scope):e.success);o?o(t,e):this.serviceProcessCompleted(t,e)}else t.succeed=null==t.succeed||t.succeed,r={...r,...this.transformResult(t,e)},r.type=n,e.success&&e.success(r)}return r}))}}class Q{constructor(e,t,r){this.CLASS_NAME="SuperMap.Feature",this.layer=e,this.id=y.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=t,this.data=null!=r?r:{}}destroy(){this.id=null,this.lonlat=null,this.data=null}}const J="Unknown",H="Insert",W="Update",V="Delete";class $ extends Q{constructor(e,t,r){super(null,null,t),this.fid=null,this.geometry=e||null,this.attributes={},t&&(this.attributes=y.extend(this.attributes,t)),this.bounds=null,this.state=null,this.style=r||null,this.url=null,this.lonlat=null,this.CLASS_NAME="SuperMap.Feature.Vector",$.style={default:{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},select:{fillColor:"blue",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},temporary:{fillColor:"#66cccc",fillOpacity:.2,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"default",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},delete:{display:"none"}}}destroy(){this.layer&&(this.layer.removeFeatures(this),this.layer=null),this.geometry=null,super.destroy()}clone(){return new $(this.geometry?this.geometry.clone():null,this.attributes,this.style)}toState(e){if(e===W)switch(this.state){case J:case V:this.state=e}else if(e===H)this.state===J||(this.state=e);else if(e===V)switch(this.state){case H:case V:break;case J:case W:this.state=e}else e===J&&(this.state=e)}}class Y{constructor(e,t){this.w=e?parseFloat(e):0,this.h=e?parseFloat(t):0,this.CLASS_NAME="SuperMap.Size"}toString(){return"w="+this.w+",h="+this.h}clone(){return new Y(this.w,this.h)}equals(e){var t=!1;return null!=e&&(t=this.w===e.w&&this.h===e.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(e.w)&&isNaN(e.h)),t}destroy(){this.w=null,this.h=null}}class K{constructor(e,t){y.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?y.toFloat(e):0,this.lat=t?y.toFloat(t):0,this.CLASS_NAME="SuperMap.LonLat"}toString(){return"lon="+this.lon+",lat="+this.lat}toShortString(){return this.lon+","+this.lat}clone(){return new K(this.lon,this.lat)}add(e,t){if(null==e||null==t)throw new TypeError("LonLat.add cannot receive null values");return new K(this.lon+y.toFloat(e),this.lat+y.toFloat(t))}equals(e){var t=!1;return null!=e&&(t=this.lon===e.lon&&this.lat===e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t}wrapDateLine(e){var t=this.clone();if(e){for(;t.lon<e.left;)t.lon+=e.getWidth();for(;t.lon>e.right;)t.lon-=e.getWidth()}return t}destroy(){this.lon=null,this.lat=null}static fromString(e){var t=e.split(",");return new K(t[0],t[1])}static fromArray(e){var t=y.isArray(e),r=t&&e[0],n=t&&e[1];return new K(r,n)}}class X{constructor(e,t,r,n){y.isArray(e)&&(n=e[3],r=e[2],t=e[1],e=e[0]),this.left=null!=e?y.toFloat(e):this.left,this.bottom=null!=t?y.toFloat(t):this.bottom,this.right=null!=r?y.toFloat(r):this.right,this.top=null!=n?y.toFloat(n):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new X(this.left,this.bottom,this.right,this.top)}equals(e){var t=!1;return null!=e&&(t=this.left===e.left&&this.right===e.right&&this.top===e.top&&this.bottom===e.bottom),t}toString(){return[this.left,this.bottom,this.right,this.top].join(",")}toArray(e){return!0===e?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]}toBBOX(e,t){null==e&&(e=6);var r=Math.pow(10,e),n=Math.round(this.left*r)/r,s=Math.round(this.bottom*r)/r,o=Math.round(this.right*r)/r,i=Math.round(this.top*r)/r;return!0===t?s+","+n+","+i+","+o:n+","+s+","+o+","+i}getWidth(){return this.right-this.left}getHeight(){return this.top-this.bottom}getSize(){return new Y(this.getWidth(),this.getHeight())}getCenterPixel(){return new R((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new K((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat}scale(e,t){var r,n;e=e||1,null==t&&(t=this.getCenterLonLat()),"SuperMap.LonLat"===t.CLASS_NAME?(r=t.lon,n=t.lat):(r=t.x,n=t.y);var s=(this.left-r)*e+r,o=(this.bottom-n)*e+n,i=(this.right-r)*e+r,a=(this.top-n)*e+n;return new X(s,o,i,a)}add(e,t){if(null==e||null==t)throw new TypeError("Bounds.add cannot receive null values");return new X(this.left+e,this.bottom+t,this.right+e,this.top+t)}extend(e){var t=null;if(e){switch(e.CLASS_NAME){case"SuperMap.LonLat":t=new X(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new X(e.x,e.y,e.x,e.y);break;case"SuperMap.Bounds":t=e}t&&(this.centerLonLat=null,(null==this.left||t.left<this.left)&&(this.left=t.left),(null==this.bottom||t.bottom<this.bottom)&&(this.bottom=t.bottom),(null==this.right||t.right>this.right)&&(this.right=t.right),(null==this.top||t.top>this.top)&&(this.top=t.top))}}containsLonLat(e,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var r=this.contains(e.lon,e.lat,t.inclusive),n=t.worldBounds;if(n&&!r){var s=n.getWidth(),o=(n.left+n.right)/2,i=Math.round((e.lon-o)/s);r=this.containsLonLat({lon:e.lon-i*s,lat:e.lat},{inclusive:t.inclusive})}return r}containsPixel(e,t){return this.contains(e.x,e.y,t)}contains(e,t,r){return null==r&&(r=!0),null!=e&&null!=t&&(r?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&e<this.right&&t>this.bottom&&t<this.top)}intersectsBounds(e,t){if("boolean"==typeof t&&(t={inclusive:t}),(t=t||{}).worldBounds){var r=this.wrapDateLine(t.worldBounds);e=e.wrapDateLine(t.worldBounds)}else r=this;null==t.inclusive&&(t.inclusive=!0);var n=!1,s=r.left===e.right||r.right===e.left||r.top===e.bottom||r.bottom===e.top;if(t.inclusive||!s){var o=e.bottom>=r.bottom&&e.bottom<=r.top||r.bottom>=e.bottom&&r.bottom<=e.top,i=e.top>=r.bottom&&e.top<=r.top||r.top>e.bottom&&r.top<e.top,a=e.left>=r.left&&e.left<=r.right||r.left>=e.left&&r.left<=e.right,l=e.right>=r.left&&e.right<=r.right||r.right>=e.left&&r.right<=e.right;n=(o||i)&&(a||l)}if(t.worldBounds&&!n){var u=t.worldBounds,h=u.getWidth(),c=!u.containsBounds(r),p=!u.containsBounds(e);c&&!p?(e=e.add(-h,0),n=r.intersectsBounds(e,{inclusive:t.inclusive})):p&&!c&&(r=r.add(-h,0),n=e.intersectsBounds(r,{inclusive:t.inclusive}))}return n}containsBounds(e,t,r){null==t&&(t=!1),null==r&&(r=!0);var n=this.contains(e.left,e.bottom,r),s=this.contains(e.right,e.bottom,r),o=this.contains(e.left,e.top,r),i=this.contains(e.right,e.top,r);return t?n||s||o||i:n&&s&&o&&i}determineQuadrant(e){var t="",r=this.getCenterLonLat();return(t+=e.lat<r.lat?"b":"t")+(e.lon<r.lon?"l":"r")}wrapDateLine(e,t){var r=(t=t||{}).leftTolerance||0,n=t.rightTolerance||0,s=this.clone();if(e){for(var o=e.getWidth();s.left<e.left&&s.right-n<=e.left;)s=s.add(o,0);for(;s.left+r>=e.right&&s.right>e.right;)s=s.add(-o,0);var i=s.left+r;i<e.right&&i>e.left&&s.right-n>e.right&&(s=s.add(-o,0))}return s}toServerJSONObject(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}destroy(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}static fromString(e,t){var r=e.split(",");return X.fromArray(r,t)}static fromArray(e,t){return!0===t?new X(e[1],e[0],e[3],e[2]):new X(e[0],e[1],e[2],e[3])}static fromSize(e){return new X(0,e.h,e.w,0)}static oppositeQuadrant(e){var t="";return(t+="t"===e.charAt(0)?"b":"t")+("l"===e.charAt(1)?"r":"l")}}class Z extends o{constructor(e){super(),this.components=[],this.componentTypes=null,null!=e&&this.addComponents(e),this.CLASS_NAME="SuperMap.Geometry.Collection",this.geometryType="Collection"}destroy(){this.components.length=0,this.components=null,super.destroy()}clone(){for(var e=new Z,t=0,r=this.components.length;t<r;t++)e.addComponent(this.components[t].clone());return y.applyDefaults(e,this),e}getComponentsString(){for(var e=[],t=0,r=this.components.length;t<r;t++)e.push(this.components[t].toShortString());return e.join(",")}calculateBounds(){this.bounds=null;var e=new X,t=this.components;if(t)for(var r=0,n=t.length;r<n;r++)e.extend(t[r].getBounds());null!=e.left&&null!=e.bottom&&null!=e.right&&null!=e.top&&this.setBounds(e)}addComponents(e){y.isArray(e)||(e=[e]);for(var t=0,r=e.length;t<r;t++)this.addComponent(e[t])}addComponent(e,t){var r=!1;if(e&&(null==this.componentTypes||y.indexOf(this.componentTypes,e.CLASS_NAME)>-1)){if(null!=t&&t<this.components.length){var n=this.components.slice(0,t),s=this.components.slice(t,this.components.length);n.push(e),this.components=n.concat(s)}else this.components.push(e);e.parent=this,this.clearBounds(),r=!0}return r}removeComponents(e){var t=!1;y.isArray(e)||(e=[e]);for(var r=e.length-1;r>=0;--r)t=this.removeComponent(e[r])||t;return t}removeComponent(e){return y.removeItem(this.components,e),this.clearBounds(),!0}getArea(){for(var e=0,t=0,r=this.components.length;t<r;t++)e+=this.components[t].getArea();return e}equals(e){var t=!0;if(e&&e.CLASS_NAME&&this.CLASS_NAME===e.CLASS_NAME)if(y.isArray(e.components)&&e.components.length===this.components.length){for(var r=0,n=this.components.length;r<n;++r)if(!this.components[r].equals(e.components[r])){t=!1;break}}else t=!1;else t=!1;return t}getVertices(e){for(var t=[],r=0,n=this.components.length;r<n;++r)Array.prototype.push.apply(t,this.components[r].getVertices(e));return t}}class ee extends o{constructor(e,t,r,n){super(e,t,r,n),this.x=parseFloat(e),this.y=parseFloat(t),this.tag=n||0==n?parseFloat(n):null,this.type=r||"Point",this.CLASS_NAME="SuperMap.Geometry.Point",this.geometryType="Point"}clone(e){return null==e&&(e=new ee(this.x,this.y)),y.applyDefaults(e,this),e}calculateBounds(){this.bounds=new X(this.x,this.y,this.x,this.y)}equals(e){var t=!1;return null!=e&&(t=this.x===e.x&&this.y===e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}move(e,t){this.x=this.x+e,this.y=this.y+t,this.clearBounds()}toShortString(){return this.x+", "+this.y}destroy(){this.x=null,this.y=null,this.tag=null,super.destroy()}getVertices(){return[this]}}class te extends Z{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.MultiPoint",this.geometryType="MultiPoint"}addPoint(e,t){this.addComponent(e,t)}removePoint(e){this.removeComponent(e)}}class re extends te{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point","SuperMap.PointWithMeasure"],this.CLASS_NAME="SuperMap.Geometry.Curve",this.geometryType="Curve"}}class ne extends re{constructor(e){super(e),this.CLASS_NAME="SuperMap.Geometry.LineString",this.geometryType="LineString"}removeComponent(e){var t=this.components&&this.components.length>2;return t&&super.removeComponent.apply(this,arguments),t}getSortedSegments(){for(var e,t,r=this.components.length-1,n=new Array(r),s=0;s<r;++s)e=this.components[s],t=this.components[s+1],e.x<t.x?n[s]={x1:e.x,y1:e.y,x2:t.x,y2:t.y}:n[s]={x1:t.x,y1:t.y,x2:e.x,y2:e.y};return n.sort((function(e,t){return e.x1-t.x1}))}getVertices(e){return!0===e?[this.components[0],this.components[this.components.length-1]]:!1===e?this.components.slice(1,this.components.length-1):this.components.slice()}static calculateCircle(e){if(e.length<3)return e;var t={},r=e[0],n=e[1],s=e[2],o=0,i=0,a=!0,l=0,u=0,h=0,c=[],p=(s.y-r.y)/(s.x-r.x),d=s.y-p*s.x;if(s.x!=r.x&&s.y!=r.y&&n.y==p*n.x+d||s.x==r.x&&n.x==r.x||s.y==r.y&&n.y==r.y||s.x==r.x&&s.y==r.y||s.x==n.x&&s.y==n.y||r.x==n.x&&r.y==n.y)c.push(r),c.push(n),c.push(s);else{var f=(n.x*n.x+n.y*n.y-(r.x*r.x+r.y*r.y))*(2*(s.y-r.y))-(s.x*s.x+s.y*s.y-(r.x*r.x+r.y*r.y))*(2*(n.y-r.y)),m=2*(n.x-r.x)*(s.x*s.x+s.y*s.y-(r.x*r.x+r.y*r.y))-2*(s.x-r.x)*(n.x*n.x+n.y*n.y-(r.x*r.x+r.y*r.y)),g=4*((n.x-r.x)*(s.y-r.y)-(s.x-r.x)*(n.y-r.y));t.x=f/g,t.y=m/g;var y=(2*(o=Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)))*o-((r.x-s.x)*(r.x-s.x)+(r.y-s.y)*(r.y-s.y)))/(2*o*o);y=(y=y>=1?1:y)<=-1?-1:y,h=180*Math.acos(y)/Math.PI,i=(h=s.x==r.x?t.x>r.x&&n.x>r.x||t.x<r.x&&n.x<r.x?360-h:h:t.y>p*t.x+d&&n.y>p*n.x+d||t.y<p*t.x+d&&n.y<p*n.x+d?360-h:h)/72,s.y!=r.y?s.x==r.x?s.y>r.y?n.x<r.x&&(a=!1):n.x>r.x&&(a=!1):s.x<r.x?n.y<p*n.x+d&&(a=!1):n.y>p*n.x+d&&(a=!1):s.x>r.x?n.y>r.y&&(a=!1):n.y<r.y&&(a=!1);var v=(r.y-t.y)/(r.x-t.x),b=v>=0?180*Math.atan(v)/Math.PI:Math.abs(180*Math.atan(v)/Math.PI)+90,S=Math.abs(t.y);r.y==S&&S==s.y&&r.x<s.x&&(b+=180);var x=r.y-t.y;c.push(r);for(var w=1;w<72;w++){l=i*w,u=b,a?x>=0?v>=0?u+=l:u=180-(u-90)+l:u=v>0?u-180+l:90-u+l:x>=0?v>=0?u-=l:u=180-(u-90)-l:u=v>=0?u-180-l:90-u-l,u=u*Math.PI/180;var _=t.x+o*Math.cos(u),C=t.y+o*Math.sin(u);c.push(new ee(_,C))}c.push(s)}return c}static createLineEPS(e){var t=[],r=e.length;if(r<2)return e;for(var n=0;n<r;)if("LTypeArc"==e[n].type){var s=ne.createLineArc(t,n,r,e);t=s[0],n=s[1]}else t.push(e[n]),n++;return t}static createLineArc(e,t,r,n){if(0==t){let s=ne.addPointEPS(n,t,r,"LTypeArc");Array.prototype.push.apply(e,s[0]),t=s[1]+1}else if(t==r-1){var s=[n[t-1],n[t]],o=ne.calculateCircle(s);Array.prototype.push.apply(e,o),t++}else{let s=ne.addPointEPS(n,t,r,"LTypeArc");e.pop(),Array.prototype.push.apply(e,s[0]),t=s[1]+1}return[e,t]}static addPointEPS(e,t,r,n){var s,o=[],i=t+1;return 0==t?Array.prototype.push.apply(o,[e[t],e[t+1]]):t==r-1?Array.prototype.push.apply(o,[e[t-1],e[t]]):Array.prototype.push.apply(o,[e[t-1],e[t],e[t+1]]),"LTypeCurve"==n?s=ne.calculatePointsFBZN(o):"LTypeArc"==n&&(s=ne.calculateCircle(o)),[s,i]}}class se extends Z{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LineString"],this.CLASS_NAME="SuperMap.Geometry.MultiLineString",this.geometryType="MultiLineString"}}class oe extends ne{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.LinearRing",this.geometryType="LinearRing"}addComponent(e,t){var r=!1,n=this.components.pop();null==t&&e.equals(n)||(r=super.addComponent.apply(this,arguments));var s=this.components[0];return super.addComponent.apply(this,[s]),r}removeComponent(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),super.removeComponent.apply(this,arguments);var r=this.components[0];super.addComponent.apply(this,[r])}return t}getArea(){var e=0;if(this.components&&this.components.length>2){for(var t=0,r=0,n=this.components.length;r<n-1;r++){var s=this.components[r],o=this.components[r+1];t+=(s.x+o.x)*(o.y-s.y)}e=-t/2}return e}getVertices(e){return!0===e?[]:this.components.slice(0,this.components.length-1)}}class ie extends Z{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.LinearRing"],this.CLASS_NAME="SuperMap.Geometry.Polygon",this.geometryType="Polygon"}getArea(){var e=0;if(this.components&&this.components.length>0){e+=Math.abs(this.components[0].getArea());for(var t=1,r=this.components.length;t<r;t++)e-=Math.abs(this.components[t].getArea())}return e}}class ae extends Z{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Polygon"],this.CLASS_NAME="SuperMap.Geometry.MultiPolygon",this.geometryType="MultiPolygon"}}class le{constructor(e,t,r){this.red=e||0==e?e:255,this.green=t||0,this.blue=r||0,this.CLASS_NAME="SuperMap.ServerColor"}destroy(){var e=this;e.red=null,e.green=null,e.blue=null}static fromJson(e){if(e){var t=new le,r=255;null!==e.red&&(r=Number(e.red)),t.red=r;var n=0;null!==e.green&&(n=Number(e.green)),t.green=n;var s=0;return null!==e.blue&&(s=Number(e.blue)),t.blue=s,t}}}class ue{constructor(e){this.fillBackColor=new le(255,255,255),this.fillBackOpaque=!1,this.fillForeColor=new le(255,0,0),this.fillGradientMode=null,this.fillGradientAngle=0,this.fillGradientOffsetRatioX=0,this.fillGradientOffsetRatioY=0,this.fillOpaqueRate=100,this.fillSymbolID=0,this.lineColor=new le(0,0,0),this.lineSymbolID=0,this.lineWidth=1,this.markerAngle=0,this.markerSize=1,this.markerSymbolID=-1,e&&y.extend(this,e),this.CLASS_NAME="SuperMap.ServerStyle"}destroy(){var e=this;e.fillBackColor&&(e.fillBackColor.destroy(),e.fillBackColor=null),e.fillBackOpaque=null,e.fillForeColor&&(e.fillForeColor.destroy(),e.fillForeColor=null),e.fillGradientMode=null,e.fillGradientAngle=null,e.fillGradientOffsetRatioX=null,e.fillGradientOffsetRatioY=null,e.fillOpaqueRate=null,e.fillSymbolID=null,e.lineColor&&(e.lineColor.destroy(),e.lineColor=null),e.lineSymbolID=null,e.lineWidth=null,e.markerAngle=null,e.markerSize=null,e.markerSymbolID=null}toServerJSONObject(){var e={};return y.copyAttributes(e,this)}static fromJson(e){if(e)return new ue({fillBackColor:le.fromJson(e.fillBackColor),fillBackOpaque:e.fillBackOpaque,fillForeColor:le.fromJson(e.fillForeColor),fillGradientMode:e.fillGradientMode,fillGradientAngle:e.fillGradientAngle,fillGradientOffsetRatioX:e.fillGradientOffsetRatioX,fillGradientOffsetRatioY:e.fillGradientOffsetRatioY,fillOpaqueRate:e.fillOpaqueRate,fillSymbolID:e.fillSymbolID,lineColor:le.fromJson(e.lineColor),lineSymbolID:e.lineSymbolID,lineWidth:e.lineWidth,markerAngle:e.markerAngle,markerSize:e.markerSize,markerSymbolID:e.markerSymbolID})}}class he extends ee{constructor(e){super(e),this.measure=null,e&&y.extend(this,e),this.CLASS_NAME="SuperMap.PointWithMeasure"}equals(e){var t=!1;if(null!=e){var r=this.x===e.x&&this.y===e.y&&this.measure===e.measure,n=isNaN(this.x)&&isNaN(this.y)&&isNaN(this.measure),s=isNaN(e.x)&&isNaN(e.y)&&isNaN(e.measure);t=r||n&&s}return t}toJson(){var e="{";return null!=this.measure&&null!=this.measure&&(e+='"measure":'+this.measure+","),e+='"x":'+this.x+",",(e+='"y":'+this.y)+"}"}destroy(){var e=this;e.measure=null,e.x=null,e.y=null}static fromJson(e){if(e)return new he({x:e.x,y:e.y,measure:e.measure})}}class ce extends Z{constructor(e,t){super(e,t),this.id=null,this.center=null,this.style=null,this.length=null,this.maxM=null,this.minM=null,this.parts=null,this.points=null,this.type=null,this.componentTypes=["SuperMap.Geometry.LinearRing","SuperMap.Geometry.LineString"],t&&y.extend(this,t),this.CLASS_NAME="SuperMap.Route",this.geometryType="LINEM"}toJson(){var e="{";if(null!=this.id&&null!=this.id&&(e+='"id":'+this.id+","),null!=this.center&&null!=this.center&&(e+='"center":'+this.center+","),null!=this.style&&null!=this.style&&(e+='"style":'+this.style+","),null!=this.length&&null!=this.length&&(e+='"length":'+this.length+","),null!=this.maxM&&null!=this.maxM&&(e+='"maxM":'+this.maxM+","),null!=this.minM&&null!=this.minM&&(e+='"minM":'+this.minM+","),null!=this.type&&null!=this.type&&(e+='"type":"'+this.type+'",'),null!=this.parts&&null!=this.parts){e+='"parts":['+this.parts[0];for(var t=1;t<this.parts.length;t++)e+=","+this.parts[t];e+="],"}if(null!=this.components&&this.components.length>0){e+='"points":[';for(var r=0,n=this.components.length;r<n;r++)for(var s=0,o=this.components[r].components.length;s<o;s++)e+=this.components[r].components[s].toJson()+",";e=e.replace(/,$/g,""),e+="]"}return(e=e.replace(/,$/g,""))+"}"}destroy(){var e=this;e.id=null,e.center=null,e.style=null,e.length=null,e.maxM=null,e.minM=null,e.type=null,e.parts=null,e.components.length=0,e.components=null,e.componentTypes=null}static fromJson(e){if(e){var t=e.parts||[],r=e.points||[],n=t.length,s=[];if(!(n>0))return null;for(var o=0,i=0,a=[];o<n;o++){for(var l=0;l<t[o];l++)a.push(he.fromJson(r[i+l]));i+=t[o],a[0].equals(a[t[o]-1])?s.push(new oe(a)):s.push(new ne(a)),a=[]}return new ce(s,{id:e.id,center:e.center,style:e.style,length:e.length,maxM:e.maxM,minM:e.minM,type:e.type,parts:e.parts})}}}class pe{constructor(e){this.id=0,this.style=null,this.parts=null,this.points=null,this.type=null,this.prjCoordSys=null,e&&y.extend(this,e),this.CLASS_NAME="SuperMap.ServerGeometry"}destroy(){var e=this;e.id=null,e.style=null,e.parts=null,e.partTopo=null,e.points=null,e.type=null,e.prjCoordSys=null}toGeometry(){var e=this;switch(e.type.toUpperCase()){case _:return e.toGeoPoint();case w:return e.toGeoLine();case"LINEM":return e.toGeoLinem();case C:return e.toGeoRegion();case"POINTEPS":return e.toGeoPoint();case"LINEEPS":return e.toGeoLineEPS();case"REGIONEPS":return e.toGeoRegionEPS();case"GEOCOMPOUND":return e.transformGeoCompound()}}toGeoPoint(){var e=this.parts||[],t=this.points||[],r=e.length;if(r>0){if(1===r)return new ee(t[0].x,t[0].y);var n=[];for(let e=0;e<r;e++)n.push(new ee(t[e].x,t[e].y));return new te(n)}return null}toGeoLine(){var e=this.parts||[],t=this.points||[],r=e.length;if(r>0){if(1===r){let r=[];for(let n=0;n<e[0];n++)r.push(new ee(t[n].x,t[n].y));return r[0].equals(r[e[0]-1])?new oe(r):new ne(r)}{let n=[];for(let s=0;s<r;s++){let r=[];for(let n=0;n<e[s];n++)r.push(new ee(t[n].x,t[n].y));n.push(new ne(r)),t.splice(0,e[s])}return new se(n)}}return null}toGeoLineEPS(){var e,t,r,n,s,o=this.parts||[],i=this.points||[],a=o.length;if(a>0){if(1===a){for(e=0,r=[];e<o[0];e++)r.push(new ee(i[e].x,i[e].y,i[e].type));return r[0].equals(r[o[0]-1])?(s=ne.createLineEPS(r),new oe(s)):(s=ne.createLineEPS(r),new ne(s))}for(e=0,n=[];e<a;e++){for(t=0,r=[];t<o[e];t++)r.push(new ee(i[t].x,i[t].y));s=ne.createLineEPS(r),n.push(new ne(s)),i.splice(0,o[e])}return new se(n)}return null}toGeoLinem(){return ce.fromJson(this)}toGeoRegion(){var e=this,t=e.parts||[],r=e.partTopo||[],n=e.points||[],s=t.length;if(s<=0)return null;var o=[],i=[];if(1==s){for(let e=0;e<n.length;e++)i.push(new ee(n[e].x,n[e].y));return o.push(new ie([new oe(i)])),new ae(o)}var a=[],l=[],u=[],h=[],c=[];for(let e=0,o=0;e<s;e++){for(let r=0;r<t[e];r++)i.push(new ee(n[o+r].x,n[o+r].y));o+=t[e];var p=new ie([new oe(i)]);i=[],u.push(p),0===r.length&&h.push(p.getBounds()),c.push(1),l.push(p.getArea())}if(0===r.length){pe.bubbleSort(l,u,r,h);var d=[];for(let e=1;e<u.length;e++)for(let t=e-1;t>=0;t--)if(d[e]=-1,h[t].containsBounds(h[e])){c[e]=-1*c[t],c[e]<0&&(d[e]=t);break}for(let e=0;e<u.length;e++)c[e]>0?o.push(u[e]):(o[d[e]].components=o[d[e]].components.concat(u[e].components),o.push(""))}else{o=new Array;for(let e=0;e<u.length;e++)if(r[e]&&-1==r[e]?a=a.concat(u[e].components):(a.length>0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(a),a=[]),o.push(u[e])),e==s-1){var f=o.length;if(f)o[f-1].components=o[f-1].components.concat(a);else for(let e=0,t=a.length;e<t;e++)o.push(new ie(a))}}return new ae(o)}toGeoRegionEPS(){var e=this,t=e.parts||[],r=e.partTopo||[],n=e.points||[],s=t.length;if(s<=0)return null;var o,i=[],a=[];if(1==s){for(var l=0;l<n.length;l++)a.push(new ee(n[l].x,n[l].y));return o=ne.createLineEPS(a),i.push(new ie([new oe(o)])),new ae(i)}var u=[],h=[],c=[],p=[],d=[];for(let e=0,i=0;e<s;e++){for(let r=0;r<t[e];r++)a.push(new ee(n[i+r].x,n[i+r].y));i+=t[e],o=ne.createLineEPS(a);var f=new ie([new oe(o)]);a=[],c.push(f),0===r.length&&p.push(f.getBounds()),d.push(1),h.push(f.getArea())}if(0===r.length){pe.bubbleSort(h,c,r,p);var m=[];for(let e=1;e<c.length;e++)for(let t=e-1;t>=0;t--)if(m[e]=-1,p[t].containsBounds(p[e])){d[e]=-1*d[t],d[e]<0&&(m[e]=t);break}for(let e=0;e<c.length;e++)d[e]>0?i.push(c[e]):(i[m[e]].components=i[m[e]].components.concat(c[e].components),i.push(""))}else{i=new Array;for(let e=0;e<c.length;e++)if(r[e]&&-1==r[e]?u=u.concat(c[e].components):(u.length>0&&i.length>0&&(i[i.length-1].components=i[i.length-1].components.concat(u),u=[]),i.push(c[e])),e==s-1){var g=i.length;if(g)i[g-1].components=i[g-1].components.concat(u);else for(let e=0,t=u.length;e<t;e++)i.push(new ie(u))}}return new ae(i)}transformGeoCompound(){const e=this.geoParts||[],t=e.length;if(t<=0)return null;const r=[];for(let n=0;n<t;n++){const t=e[n];r.push(new pe(t).toGeometry())}return new Z(r)}static fromJson(e){if(e)return new pe({id:e.id,style:ue.fromJson(e.style),parts:e.parts,partTopo:e.partTopo,points:e.points,center:e.center,length:e.length,maxM:e.maxM,minM:e.minM,type:e.type})}static fromGeometry(e){if(e){var t=0,r=[],n=[],s=null,o=e.components,i=e.CLASS_NAME,a={epsgCode:e.SRID};if(isNaN(e.id)||(t=e.id),"SuperMap.Geometry.LinearRing"!=i&&"SuperMap.Geometry.LineString"!=i&&(e instanceof te||e instanceof se)){let e=o.length;for(let t=0;t<e;t++){const e=o[t].getVertices();let s=e.length;r.push(s);for(let t=0;t<s;t++)n.push(new ee(e[t].x,e[t].y))}s="SuperMap.Geometry.MultiPoint"==i?_:w}else if(e instanceof ae){let e=o.length;for(let t=0;t<e;t++){let e=o[t].components,s=e.length;for(let t=0;t<s;t++){const s=e[t].getVertices(),o=s.length+1;r.push(o);for(let e=0;e<o-1;e++)n.push(new ee(s[e].x,s[e].y));n.push(new ee(s[0].x,s[0].y))}}s=C}else if(e instanceof ie){let e=o.length;for(let t=0;t<e;t++){const e=o[t].getVertices();let s=e.length+1;r.push(s);for(let t=0;t<s-1;t++)n.push(new ee(e[t].x,e[t].y));n.push(new ee(e[0].x,e[0].y))}s=C}else{const t=e.getVertices();let o=t.length;for(let e=0;e<o;e++)n.push(new ee(t[e].x,t[e].y));e instanceof oe&&(n.push(new ee(t[0].x,t[0].y)),o++),r.push(o),s=e instanceof ee?_:w}return new pe({id:t,style:null,parts:r,points:n,type:s,prjCoordSys:a})}}static IsClockWise(e){var t=e.length;if(t<3)return 0;var r=e[0].y*(e[t-1].x-e[1].x);e.push(e[0]);for(var n=1;n<t;n++)r+=e[n].y*(e[n-1].x-e[n+1].x);return.5*r}static bubbleSort(e,t,r,n){for(var s=0;s<e.length;s++)for(var o=0;o<e.length;o++)if(e[s]>e[o]){var i=e[o];e[o]=e[s],e[s]=i;var a=t[o];if(t[o]=t[s],t[s]=a,r&&r.length>0){var l=r[o];r[o]=r[s],r[s]=l}if(n&&n.length>0){var u=n[o];n[o]=n[s],n[s]=u}}}}class de extends U{constructor(e){super(e),this.ignoreExtraDims=!0,this.CLASS_NAME="SuperMap.Format.GeoJSON",this.parseCoords={point:function(e){if(!1===this.ignoreExtraDims&&2!=e.length)throw"Only 2D points are supported: "+e;return new ee(e[0],e[1])},multipoint:function(e){for(var t=[],r=null,n=0,s=e.length;n<s;++n){try{r=this.parseCoords.point.apply(this,[e[n]])}catch(e){throw e}t.push(r)}return new te(t)},linestring:function(e){for(var t=[],r=null,n=0,s=e.length;n<s;++n){try{r=this.parseCoords.point.apply(this,[e[n]])}catch(e){throw e}t.push(r)}return new ne(t)},multilinestring:function(e){for(var t=[],r=null,n=0,s=e.length;n<s;++n){try{r=this.parseCoords.linestring.apply(this,[e[n]])}catch(e){throw e}t.push(r)}return new se(t)},polygon:function(e){for(var t,r,n=[],s=0,o=e.length;s<o;++s){try{r=this.parseCoords.linestring.apply(this,[e[s]])}catch(e){throw e}t=new oe(r.components),n.push(t)}return new ie(n)},multipolygon:function(e){for(var t=[],r=null,n=0,s=e.length;n<s;++n){try{r=this.parseCoords.polygon.apply(this,[e[n]])}catch(e){throw e}t.push(r)}return new ae(t)},box:function(e){if(2!=e.length)throw"GeoJSON box coordinates must have 2 elements";return new ie([new oe([new ee(e[0][0],e[0][1]),new ee(e[1][0],e[0][1]),new ee(e[1][0],e[1][1]),new ee(e[0][0],e[1][1]),new ee(e[0][0],e[0][1])])])}},this.extract={feature:function(e){var t=this.extract.geometry.apply(this,[e.geometry]),r={type:"Feature",properties:this.createAttributes(e),geometry:t};return e.geometry&&"TEXT"===e.geometry.type&&(r.properties.texts=e.geometry.texts,r.properties.textStyle=e.geometry.textStyle),e.fid&&(r.id=e.fid),e.ID&&(r.id=e.ID),r},geometry:function(e){if(null==e)return null;!e.parts&&e.points&&(e.parts=[e.points.length]);var t,r=e.hasOwnProperty("geometryType")?e:new pe(e).toGeometry()||e,n=r.geometryType||r.type;return"LinearRing"===n&&(n="LineString"),"LINEM"===n&&(n="MultiLineString"),t=this.extract[n.toLowerCase()].apply(this,[r]),"Collection"===(n="TEXT"===n?"Point":n)?{type:"GeometryCollection",geometries:t}:{type:n,coordinates:t}},point:function(e){var t=[e.x,e.y];for(var r in e)"x"===r||"y"===r||null===e[r]||isNaN(e[r])||t.push(e[r]);return t},text:function(e){return[e.points[0].x,e.points[0].y]},multipoint:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.point.apply(this,[e.components[r]]));return t},linestring:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.point.apply(this,[e.components[r]]));return t},multilinestring:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.linestring.apply(this,[e.components[r]]));return t},polygon:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.linestring.apply(this,[e.components[r]]));return t},multipolygon:function(e){for(var t=[],r=0,n=e.components.length;r<n;++r)t.push(this.extract.polygon.apply(this,[e.components[r]]));return t},collection:function(e){for(var t=e.components.length,r=new Array(t),n=0;n<t;++n)r[n]=this.extract.geometry.apply(this,[e.components[n]]);return r}}}read(e,t,r){t=t||"FeatureCollection";var n,s=null;if(n="string"==typeof e?super.read(e,r):e)if("string"!=typeof n.type);else if(this.isValidType(n,t))switch(t){case"Geometry":try{s=this.parseGeometry(n)}catch(e){}break;case"Feature":try{(s=this.parseFeature(n)).type="Feature"}catch(e){}break;case"FeatureCollection":switch(s=[],n.type){case"Feature":try{s.push(this.parseFeature(n))}catch(e){s=null}break;case"FeatureCollection":for(var o=0,i=n.features.length;o<i;++o)try{s.push(this.parseFeature(n.features[o]))}catch(e){s=null}break;default:try{var a=this.parseGeometry(n);s.push(new $(a))}catch(e){s=null}}}return s}write(e,t){return super.write(this.toGeoJSON(e),t)}fromGeoJSON(e,t,r){let n=this.read(e,t,r);return y.isArray(n)?n.map((e=>this._toiSevrerFeature(e))):this._toiSevrerFeature(n)}toGeoJSON(e){var t={type:null};if(y.isArray(e)){t.type="FeatureCollection";var r=e.length;t.features=new Array(r);for(var n=0;n<r;++n){var s=e[n];if(o(s)){let e={};e.geometry=s,t.features[n]=this.extract.feature.apply(this,[e])}else t.features[n]=this.extract.feature.apply(this,[s])}}else if(o(e)){let r={};r.geometry=e,t=this.extract.feature.apply(this,[r])}else t=this.extract.feature.apply(this,[e]);function o(e){return e.hasOwnProperty("parts")&&e.hasOwnProperty("points")||e.hasOwnProperty("geoParts")}return t}isValidType(e,t){var r=!1;switch(t){case"Geometry":-1==y.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],e.type)||(r=!0);break;case"FeatureCollection":r=!0;break;default:e.type==t&&(r=!0)}return r}parseFeature(e){var t,r,n,s;n=e.properties?e.properties:{},s=e.geometry&&e.geometry.bbox||e.bbox;try{r=this.parseGeometry(e.geometry)}catch(e){throw e}return t=new $(r,n),s&&(t.bounds=X.fromArray(s)),e.id&&(t.geometry.id=e.id,t.fid=e.id),t}parseGeometry(e){if(null==e)return null;var t;if("GeometryCollection"==e.type){if(!y.isArray(e.geometries))throw"GeometryCollection must have geometries array: "+e;for(var r=e.geometries.length,n=new Array(r),s=0;s<r;++s)n[s]=this.parseGeometry.apply(this,[e.geometries[s]]);t=new Z(n)}else{if(!y.isArray(e.coordinates))throw"Geometry must have coordinates array: "+e;if(!this.parseCoords[e.type.toLowerCase()])throw"Unsupported geometry type: "+e.type;try{t=this.parseCoords[e.type.toLowerCase()].apply(this,[e.coordinates])}catch(e){throw e}}return t}createCRSObject(e){var t=e.layer.projection.toString(),r={};if(t.match(/epsg:/i)){var n=parseInt(t.substring(t.indexOf(":")+1));r=4326==n?{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+n}}}return r}_toiSevrerFeature(e){const t=e.attributes,r=[],n=[];for(var s in t)r.push(s),n.push(t[s]);const o={fieldNames:r,fieldValues:n,geometry:pe.fromGeometry(e.geometry)};return o.geometry.id=e.fid,o}createAttributes(e){if(!e)return null;var t={};!function(e,t){if(e.hasOwnProperty("fieldNames")&&e.hasOwnProperty("fieldValues")){var r=e.fieldNames,n=e.fieldValues;for(var s in r)t[r[s]]=n[s]}}(e,t);var r=["fieldNames","fieldValues","geometry","stringID","ID"];for(var n in e)r.indexOf(n)>-1||(t[n]=e[n]);return t}}class fe extends z{constructor(e,t){super(e,t),this.returnContent=!1,this.format=b,this.returnFeatureWithFieldCaption=!1,t&&y.extend(this,t),this.CLASS_NAME="SuperMap.QueryService",this.url&&(t&&t.format&&(this.format=t.format.toUpperCase()),this.url=y.urlPathAppend(this.url,"queryResults"))}destroy(){super.destroy(),this.returnContent=null,this.format=null}processAsync(e,t){if(e instanceof P){var r,n=this,s=null;return n.returnContent=e.returnContent,r=n.getJsonParameters(e),n.returnContent||(s=e.returnCustomResult)&&(n.url=y.urlAppend(n.url,"returnCustomResult="+s)),n.returnFeatureWithFieldCaption=e.returnFeatureWithFieldCaption,n.request({method:"POST",data:r,scope:n,success:t,failure:t})}}transformResult(e,t){e=y.transformResult(e);var r=new de;if(e&&e.recordsets)for(var n=0,s=e.recordsets,o=s.length;n<o;n++)s[n].features&&(!0===this.returnFeatureWithFieldCaption&&s[n].features.map((e=>(e.fieldNames=s[n].fieldCaptions,e))),this.format===b&&(s[n].features=r.toGeoJSON(s[n].features)));return{result:e,options:t}}dataFormat(){return[b,S,x]}getQueryParameters(e){return new P({customParams:e.customParams,expectCount:e.expectCount,networkType:e.networkType,queryOption:e.queryOption,queryParams:e.queryParams,startRecord:e.startRecord,prjCoordSys:e.prjCoordSys,holdTime:e.holdTime})}}class me extends fe{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof O){var t,r="";return t=this.getQueryParameters(e),r+="'queryMode':'SqlQuery','queryParameters':","{"+(r+=y.toJSON(t))+"}"}}}class ge extends P{constructor(e){super(e=e||{}),this.returnContent=!0,this.bounds=null,y.extend(this,e),this.CLASS_NAME="SuperMap.QueryByBoundsParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.bounds&&(e.bounds=null)}}class ye extends fe{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){if(!(e instanceof ge))return null;var t,r="",n=e.bounds;return t=this.getQueryParameters(e),r+="'queryMode':'BoundsQuery','queryParameters':",r+=y.toJSON(t),"{"+(r+=",'bounds': {'rightTop':{'y':"+n.top+",'x':"+n.right+"},'leftBottom':{'y':"+n.bottom+",'x':"+n.left+"}}")+"}"}}class ve extends P{constructor(e){super(e=e||{}),this.geometry=null,this.isNearest=null,this.returnContent=!0,y.extend(this,e),this.CLASS_NAME="SuperMap.QueryByDistanceParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.distance=null,e.isNearest=null,e.geometry&&(e.geometry.destroy(),e.geometry=null)}}class be extends fe{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByDistanceService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof ve){var t="",r=this.getQueryParameters(e),n=pe.fromGeometry(e.geometry);return t+=e.isNearest?"'queryMode':'FindNearest','queryParameters':":"'queryMode':'DistanceQuery','queryParameters':",t+=y.toJSON(r),"{"+(t+=",'geometry':"+y.toJSON(n)+",'distance':"+e.distance)+"}"}}}class Se extends fe{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof M){var t,r="",n=e.geometry,s=pe.fromGeometry(n);return t=this.getQueryParameters(e),r+="'queryMode':'SpatialQuery','queryParameters':","{"+(r+=y.toJSON(t)+",'geometry':"+y.toJSON(s)+",'spatialQueryMode':"+y.toJSON(e.spatialQueryMode))+"}"}}}class xe{constructor(e,t){this.options=t||{},this.url=e}queryByBounds(e,t,r){var n=this;return new ye(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}queryByDistance(e,t,r){var n=this;return new be(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:r}).processAsync(e,t)}queryBySQL(e,t,r){var n=this;return new me(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:r}).processAsync(e,t)}queryByGeometry(e,t,r){var n=this;return new Se(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:r}).processAsync(e,t)}_processFormat(e){return e||b}}class we{constructor(e){this.datasetNames=null,this.targetEpsgCode=null,this.targetPrj=null,this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.returnFeaturesOnly=!1,this.maxFeatures=null,this.hasGeometry=!0,this.aggregations=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesParametersBase"}destroy(){var e=this;e.datasetNames=null,e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.hasGeometry=null,e.maxFeatures=null,e.targetEpsgCode=null,e.targetPrj=null,e.aggregation&&(e.aggregation=null)}}class _e extends we{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesBySQLParameters"}destroy(){super.destroy();var e=this;e.getFeatureMode=null,e.queryParameter&&(e.queryParameter.destroy(),e.queryParameter=null)}static toJsonParameters(e){var t={datasetNames:e.datasetNames,getFeatureMode:"SQL",queryParameter:e.queryParameter};return e.maxFeatures&&!isNaN(e.maxFeatures)&&(t.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(t.hasGeometry=e.hasGeometry),e.aggregations&&(t.aggregations=e.aggregations),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),y.toJSON(t)}}class Ce extends z{constructor(e,t){super(e,t),t=t||{},this.returnContent=!0,this.returnFeaturesOnly=!1,this.fromIndex=0,this.toIndex=19,this.hasGeometry=!0,this.maxFeatures=null,this.format=b,y.extend(this,t),this.url=y.urlPathAppend(this.url,"featureResults"),this.CLASS_NAME="SuperMap.GetFeaturesServiceBase"}destroy(){super.destroy();var e=this;e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.maxFeatures=null,e.format=null,e.hasGeometry=null}processAsync(e,t){if(e){var r,n=this,s=!0;return n.returnContent=e.returnContent,n.returnFeaturesOnly=e.returnFeaturesOnly,n.fromIndex=e.fromIndex,n.toIndex=e.toIndex,n.maxFeatures=e.maxFeatures,n.hasGeometry=e.hasGeometry,n.returnContent&&(s=!1),null!=n.fromIndex&&null!=n.toIndex&&!isNaN(n.fromIndex)&&!isNaN(n.toIndex)&&n.fromIndex>=0&&n.toIndex>=0&&!s&&(n.url=y.urlAppend(n.url,`fromIndex=${n.fromIndex}&toIndex=${n.toIndex}`)),n.returnContent&&(e.returnCountOnly&&(n.url=y.urlAppend(n.url,"returnCountOnly="+e.returnCountOnly)),e.returnDatasetInfoOnly&&(n.url=y.urlAppend(n.url,"returnDatasetInfoOnly="+e.returnDatasetInfoOnly)),e.returnFeaturesOnly&&(n.url=y.urlAppend(n.url,"returnFeaturesOnly="+e.returnFeaturesOnly))),r=n.getJsonParameters(e),n.request({method:"POST",data:r,scope:n,success:t,failure:t})}}transformResult(e,t){e=y.transformResult(e);var r=new de;return this.format===b&&e.features&&(e.features=r.toGeoJSON(e.features)),this.returnFeaturesOnly&&Array.isArray(e)&&(e={succeed:e.succeed,features:r.toGeoJSON(e)}),{result:e,options:t}}dataFormat(){return[b,S,x]}}class Ae extends Ce{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return _e.toJsonParameters(e)}}class Ee extends we{constructor(e){super(e),this.getFeatureMode=Ee.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=A,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsParameters"}destroy(){super.destroy();var e=this;if(e.bounds&&(e.bounds.destroy(),e.bounds=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,n;return r={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},n={datasetNames:e.datasetNames,getFeatureMode:Ee.getFeatureMode.BOUNDS,bounds:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new N).name=e.datasetNames,t.fields=e.fields,n.queryParameter=t),e.attributeFilter&&(n.attributeFilter=e.attributeFilter,n.getFeatureMode=Ee.getFeatureMode.BOUNDS_ATTRIBUTEFILTER),e.maxFeatures&&!isNaN(e.maxFeatures)&&(n.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(n.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(n.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(n.targetPrj=e.targetPrj),e.aggregations&&(n.aggregations=e.aggregations),y.toJSON(n)}}Ee.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class Pe extends we{constructor(e){super(e),this.getFeatureMode="ID",this.IDs=null,this.fields=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByIDsParameters"}destroy(){super.destroy();var e=this;if(e.IDs=null,e.getFeatureMode=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}}static toJsonParameters(e){var t,r;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&((r=new N).name=e.datasetNames,r.fields=e.fields,t.queryParameter=r),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),"boolean"==typeof e.hasGeometry&&(t.hasGeometry=e.hasGeometry),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),y.toJSON(t)}}class Oe extends Ce{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return Pe.toJsonParameters(e)}}class Me extends Ce{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return Ee.toJsonParameters(e)}}class Ne extends we{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBufferParameters"}destroy(){super.destroy();var e=this;if(e.bufferDistance=null,e.attributeFilter=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.geometry&&(e.geometry.destroy(),e.geometry=null)}static toJsonParameters(e){var t,r,n;return n=pe.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:n},e.fields&&((t=new N).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="BUFFER_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(r.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(r.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(r.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(r.targetPrj=e.targetPrj),y.toJSON(r)}}class Te extends Ce{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){return Ne.toJsonParameters(e)}}class Ie extends we{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=A,this.orderBy=null,y.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryParameters"}destroy(){super.destroy();var e=this;if(e.geometry&&(e.geometry.destroy(),e.geometry=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null,e.orderBy=null}static toJsonParameters(e){var t,r,n;return r=pe.fromGeometry(e.geometry),n={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:r,spatialQueryMode:e.spatialQueryMode},(e.fields||e.orderBy)&&((t=new N).name=e.datasetNames,e.fields&&(t.fields=e.fields),e.orderBy&&(t.orderBy=e.orderBy),n.queryParameter=t),e.attributeFilter&&(n.attributeFilter=e.attributeFilter,n.getFeatureMode="SPATIAL_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(n.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(n.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(n.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(n.targetPrj=e.targetPrj),e.aggregations&&(n.aggregations=e.aggregations),y.toJSON(n)}}class ke extends Ce{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return Ie.toJsonParameters(e)}}class Fe{constructor(e){this.dataSourceName=null,this.dataSetName=null,this.featureId=null,y.extend(this,e),this.CLASS_NAME="SuperMap.AttachmentsParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.featureId=null}}class Le extends Fe{constructor(e){super(e),this.file=null,this.IDs=null,this.editType="add",y.extend(this,e),this.CLASS_NAME="SuperMap.EditAttachmentsParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.featureId=null,e.file=null,e.IDs=null,e.editType=null}}class Re extends z{constructor(e,t){super(e,t),t&&y.extend(this,t),this.CLASS_NAME="SuperMap.FeatureAttachmentsService"}destroy(){super.destroy()}processAsync(e,t){if(e instanceof Le){y.extend(this,e);var r=this,n=e.editType;if(r.featureId=e.featureId,r.IDs=e.IDs,n===E){if(!r.IDs||Array.isArray(r.IDs)&&0===r.IDs.length)return;r.method="DELETE";var s=[];for(let e=0;e<r.IDs.length;e++){var o=y.urlPathAppend(r.url,`/features/${r.featureId}/attachments/${r.IDs[e]}`),i=r.request({url:o,method:r.method,data:null,scope:r,success:null,failure:null});s.push(i)}return Promise.all(s).then((e=>(t&&t(e),e)))}{if(!e.file||!(e.file instanceof File||e.file instanceof Blob))return;const n=new FormData;return n.append("file",e.file),r.method="POST",r.url=y.urlPathAppend(r.url,`/features/${r.featureId}/attachments`),r.request({method:r.method,data:n,scope:r,success:t,failure:t})}}}getAttachments(e,t){if(e instanceof Fe){y.extend(this,e);var r=this;return r.method="GET",r.featureId=e.featureId,r.url=y.urlPathAppend(r.url,`/features/${r.featureId}/attachments`),r.request({method:r.method,data:null,scope:r,success:t,failure:t})}}}class Be{constructor(e){this.dataSourceName=null,this.dataSetName=null,this.features=null,this.editType="add",this.IDs=null,this.returnContent=!1,this.isUseBatch=!1,y.extend(this,e),this.CLASS_NAME="SuperMap.EditFeaturesParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.features=null,e.editType=null,e.IDs=null,e.returnContent=null}static toJsonParameters(e){var t,r,n;if(e.editType===E){if(null===e.IDs)return;n={ids:e.IDs}}else if(n=[],e.features){r=e.features.length;for(var s=0;s<r;s++)(t=e.features[s]).geometry=pe.fromGeometry(t.geometry),n.push(t)}return y.toJSON(n)}}class je extends z{constructor(e,t){super(e,t),this.returnContent=!1,this.isUseBatch=!1,t&&y.extend(this,t),this.url=y.urlPathAppend(this.url,"features"),this.CLASS_NAME="SuperMap.EditFeaturesService"}destroy(){super.destroy();var e=this;e.returnContent=null,e.isUseBatch=null,e.fromIndex=null,e.toIndex=null}processAsync(e,t){if(e instanceof Be){var r=this,n="POST",s="",o=e.editType,i=null;if(r.returnContent=e.returnContent,r.isUseBatch=e.isUseBatch,i=Be.toJsonParameters(e),o===E){i=s=y.toJSON(e.IDs);var a=y.urlAppend(r.url,y.getParameterString({ids:s}));L.urlIsLong(a)?(r.url=y.urlAppend(r.url,y.getParameterString({_method:"DELETE"})),n="POST"):(r.url=a,n="DELETE")}else"update"===o?n="PUT":(r.isUseBatch&&(r.url=y.urlAppend(r.url,`isUseBatch=${r.isUseBatch}`),r.returnContent=!1),r.returnContent&&(r.url=y.urlAppend(r.url,"returnContent=true"),n="POST"));return r.request({method:n,data:i,scope:r,success:t,failure:t})}}getMetaData(e,t){var r=this,n=e.featureId;return r.url=y.urlPathAppend(r.url,n+"/metadata"),r.request({method:"GET",data:null,scope:r,success:t,failure:t})}}const De={id:Oe,sql:Ae,bounds:Me,buffer:Te,geometry:ke};class Ge{constructor(e,t){this.url=e,this.options=t||{}}getFeaturesByIDs(e,t,r){var n=this;return new Oe(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:r}).processAsync(e,t)}getFeaturesByBounds(e,t,r){var n=this;return new Me(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}getFeaturesByBuffer(e,t,r){var n=this;return new Te(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}getFeaturesBySQL(e,t,r){var n=this;return new Ae(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}getFeaturesByGeometry(e,t,r){var n=this;return new ke(n.url,{proxy:n.options.proxy,withCredentials:n.options.withCredentials,crossOrigin:n.options.crossOrigin,headers:n.options.headers,format:n._processFormat(r)}).processAsync(e,t)}editFeatures(e,t){if(e&&e.dataSourceName&&e.dataSetName){var r=this,n=r.url,s=e.dataSourceName,o=e.dataSetName;return n=y.urlPathAppend(n,"datasources/"+s+"/datasets/"+o),new je(n,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}}getMetadata(e,t){var r=this,n=r.url,s=e.dataSourceName,o=e.dataSetName;return n=y.urlPathAppend(n,"datasources/"+s+"/datasets/"+o),new je(n,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).getMetaData(e,t)}getFeatureAttachments(e,t){if(e&&e.dataSourceName&&e.dataSetName&&null!=!e.featureId){var r=this,n=r.url,s=e.dataSourceName,o=e.dataSetName;return n=y.urlPathAppend(n,"datasources/"+s+"/datasets/"+o),new Re(n,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).getAttachments(e,t)}}editFeatureAttachments(e,t){if(e&&e.dataSourceName&&e.dataSetName&&null!=!e.featureId&&e.editType){var r=this,n=r.url,s=e.dataSourceName,o=e.dataSetName;return n=y.urlPathAppend(n,"datasources/"+s+"/datasets/"+o),new Re(n,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(e,t)}}getFeaturesCount(e,t){var r=this,n={...e,returnCountOnly:!0,returnContent:!0,returnFeaturesOnly:!1};let s=Object.keys(De).find((e=>n.CLASS_NAME.toLowerCase().includes(e)));return new De[s](r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(n,t)}getFeaturesDatasetInfo(e,t){var r=this,n={...e,returnDatasetInfoOnly:!0,returnContent:!0,returnFeaturesOnly:!1};let s=Object.keys(De).find((e=>n.CLASS_NAME.toLowerCase().includes(e)));return new De[s](r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers}).processAsync(n,t)}_processFormat(e){return e||b}}class qe{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Util"}clone(e){var t=this.BUILTIN_OBJECT;if("object"==typeof e&&null!==e){var r=e;if(e instanceof Array){r=[];for(var n=0,s=e.length;n<s;n++)r[n]=this.clone(e[n])}else if(!t[Object.prototype.toString.call(e)])for(var o in r={},e)e.hasOwnProperty(o)&&(r[o]=this.clone(e[o]));return r}return e}mergeItem(e,t,r,n){var s=this.BUILTIN_OBJECT;t.hasOwnProperty(r)&&("object"!=typeof e[r]||s[Object.prototype.toString.call(e[r])]?!n&&r in e||(e[r]=t[r]):this.merge(e[r],t[r],n))}merge(e,t,r){for(var n in t)this.mergeItem(e,t,n,r);return e}getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}getPixelContext(){return this._pixelCtx||(this._canvas=document.createElement("canvas"),this._width=this._canvas.width,this._height=this._canvas.height,this._pixelCtx=this._canvas.getContext("2d")),this._pixelCtx}adjustCanvasSize(e,t){var r,n=this._canvas,s=this._pixelCtx,o=this._width,i=this._height,a=this._offsetX,l=this._offsetY,u=100;e+a>o&&(o=e+a+u,n.width=o,r=!0),t+l>i&&(i=t+l+u,n.height=i,r=!0),e<-a&&(o+=a=Math.ceil(-e/u)*u,n.width=o,r=!0),t<-l&&(i+=l=Math.ceil(-t/u)*u,n.height=i,r=!0),r&&s.translate(a,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}inherits(e,t){var r=e.prototype;function n(){}for(var s in n.prototype=t.prototype,e.prototype=new n,r)e.prototype[s]=r[s];e.constructor=e}}class Ue{constructor(){this.util=new qe,this._ctx=null,this.palette=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],this._palette=this.palette,this.highlightColor="rgba(0,0,255,1)",this._highlightColor=this.highlightColor,this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"},this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Color"}customPalette(e){this.palette=e}resetPalette(){this.palette=this._palette}getColor(e,t){return e|=0,(t=t||this.palette)[e%t.length]}customHighlight(e){this.highlightColor=e}resetHighlight(){this.highlightColor=this._highlightColor}getHighlightColor(){return this.highlightColor}getRadialGradient(e,t,r,n,s,o,i){var a=this.util;this._ctx||(this._ctx=a.getContext());for(var l=this._ctx.createRadialGradient(e,t,r,n,s,o),u=0,h=i.length;u<h;u++)l.addColorStop(i[u][0],i[u][1]);return l.__nonRecursion=!0,l}getLinearGradient(e,t,r,n,s){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var i=this._ctx.createLinearGradient(e,t,r,n),a=0,l=s.length;a<l;a++)i.addColorStop(s[a][0],s[a][1]);return i.__nonRecursion=!0,i}getStepColors(e,t,r){e=this.toRGBA(e),t=this.toRGBA(t),e=this.getData(e);for(var n=[],s=((t=this.getData(t))[0]-e[0])/r,o=(t[1]-e[1])/r,i=(t[2]-e[2])/r,a=(t[3]-e[3])/r,l=0,u=e[0],h=e[1],c=e[2],p=e[3];l<r;l++)n[l]=this.toColor([this.adjust(Math.floor(u),[0,255]),this.adjust(Math.floor(h),[0,255]),this.adjust(Math.floor(c),[0,255]),p.toFixed(4)-0],"rgba"),u+=s,h+=o,c+=i,p+=a;return u=t[0],h=t[1],c=t[2],p=t[3],n[l]=this.toColor([u,h,c,p],"rgba"),n}getGradientColors(e,t){var r=[],n=e.length;if(void 0===t&&(t=20),1===n)r=this.getStepColors(e[0],e[0],t);else if(n>1)for(var s=0,o=n-1;s<o;s++){var i=this.getStepColors(e[s],e[s+1],t);s<o-1&&i.pop(),r=r.concat(i)}return r}toColor(e,t){if(t=t||"rgb",e&&(3===e.length||4===e.length)){if(e=this.map(e,(function(e){return e>1?Math.ceil(e):e})),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var r=this.map(e.slice(1,3),(function(e){return e+"%"}));e[1]=r[0],e[2]=r[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}toArray(e){(e=this.trim(e)).indexOf("rgba")<0&&(e=this.toRGBA(e));var t=[],r=0;return e.replace(/[\d.]+/g,(function(e){r<3?e|=0:e=+e,t[r++]=e})),t}convert(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),n=r[3];return void 0===n&&(n=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):t.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,t)}toRGBA(e){return this.convert(e,"rgba")}toRGB(e){return this.convert(e,"rgb")}toHex(e){return this.convert(e,"hex")}toHSVA(e){return this.convert(e,"hsva")}toHSV(e){return this.convert(e,"hsv")}toHSBA(e){return this.convert(e,"hsba")}toHSB(e){return this.convert(e,"hsb")}toHSLA(e){return this.convert(e,"hsla")}toHSL(e){return this.convert(e,"hsl")}toName(e){for(var t in this._nameColors)if(this.toHex(this._nameColors[t])===this.toHex(e))return t;return null}trim(e){return String(e).replace(/\s+/g,"")}normalize(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=(e=this.trim(e)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){var t=(3840&(e=parseInt(e.slice(1),16)))<<8,r=(240&e)<<4,n=15&e;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return e}lift(e,t){if(!this.isCalculableColor(e))return e;var r=t>0?1:-1;void 0===t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var n=this.getData(e),s=0;s<3;s++)n[s]=1===r?n[s]*(1-t)|0:(255-n[s])*t+n[s]|0;return"rgb("+n.join(",")+")"}reverse(e){if(!this.isCalculableColor(e))return e;var t=this.getData(this.toRGBA(e));return t=this.map(t,(function(e){return 255-e})),this.toColor(t,"rgb")}mix(e,t,r){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,s=this.getData(this.toRGBA(e)),o=this.getData(this.toRGBA(t)),i=s[3]-o[3],a=((n*i==-1?n:(n+i)/(1+n*i))+1)/2,l=1-a,u=[],h=0;h<3;h++)u[h]=s[h]*a+o[h]*l;var c=s[3]*r+o[3]*(1-r);return c=Math.max(0,Math.min(1,c)),1===s[3]&&1===o[3]?this.toColor(u,"rgb"):(u[3]=c,this.toColor(u,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(e){var t,r,n=(e=this.normalize(e)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var s,o=[];if(n[2])s=[(t=n[2].replace("#","").split(""))[0]+t[1],t[2]+t[3],t[4]+t[5]],o=this.map(s,(function(e){return Ue.prototype.adjust.call(this,parseInt(e,16),[0,255])}));else if(n[4]){var i=n[4].split(",");r=i[3],s=i.slice(0,3),o=this.map(s,(function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),Ue.prototype.adjust.call(this,e,[0,255])})),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}else if(n[5]||n[6]){var a=(n[5]||n[6]).split(","),l=parseInt(a[0],0)/360,u=a[1],h=a[2];r=a[3],(o=this.map([u,h],(function(e){return Ue.prototype.adjust.call(this,parseFloat(e)/100,[0,1])}))).unshift(l),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}return o}alpha(e,t){if(!this.isCalculableColor(e))return e;null===t&&(t=1);var r=this.getData(this.toRGBA(e));return r[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(r,"rgba")}map(e,t){if("function"!=typeof t)throw new TypeError;for(var r=e?e.length:0,n=0;n<r;n++)e[n]=t(e[n]);return e}adjust(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e}isCalculableColor(e){return e instanceof Array||"string"==typeof e}_HSV_2_RGB(e){var t,r,n,s=e[0],o=e[1],i=e[2];if(0===o)t=255*i,r=255*i,n=255*i;else{var a=6*s;6===a&&(a=0);var l=0|a,u=i*(1-o),h=i*(1-o*(a-l)),c=i*(1-o*(1-(a-l))),p=0,d=0,f=0;0===l?(p=i,d=c,f=u):1===l?(p=h,d=i,f=u):2===l?(p=u,d=i,f=c):3===l?(p=u,d=h,f=i):4===l?(p=c,d=u,f=i):(p=i,d=u,f=h),t=255*p,r=255*d,n=255*f}return[t,r,n]}_HSL_2_RGB(e){var t,r,n,s=e[0],o=e[1],i=e[2];if(0===o)t=255*i,r=255*i,n=255*i;else{var a,l=2*i-(a=i<.5?i*(1+o):i+o-o*i);t=255*this._HUE_2_RGB(l,a,s+1/3),r=255*this._HUE_2_RGB(l,a,s),n=255*this._HUE_2_RGB(l,a,s-1/3)}return[t,r,n]}_HUE_2_RGB(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}_RGB_2_HSB(e){var t,r,n=e[0]/255,s=e[1]/255,o=e[2]/255,i=Math.min(n,s,o),a=Math.max(n,s,o),l=a-i,u=a;if(0===l)t=0,r=0;else{r=l/a;var h=((a-n)/6+l/2)/l,c=((a-s)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?t=p-c:s===a?t=1/3+h-p:o===a&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,u*=100]}_RGB_2_HSL(e){var t,r,n=e[0]/255,s=e[1]/255,o=e[2]/255,i=Math.min(n,s,o),a=Math.max(n,s,o),l=a-i,u=(a+i)/2;if(0===l)t=0,r=0;else{r=u<.5?l/(a+i):l/(2-a-i);var h=((a-n)/6+l/2)/l,c=((a-s)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?t=p-c:s===a?t=1/3+h-p:o===a&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,u*=100]}}var ze=new Ue;class Qe{static createCanvas(e,t){var r=document.createElement("canvas");return r.height=e,r.width=t,r.getContext("2d")}static getLinearGradient(e,t,r,n,s){this._ctx||(this._ctx=this.getContext());for(var o=this._ctx.createLinearGradient(e,t,r,n),i=s.length,a=1/(i-1),l=0,u=0;u<i;u++)o.addColorStop(l,s[u]),l+=a;return o.__nonRecursion=!0,o}static getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}static getStepColors(e,t,r){e=ze.toRGBA(e),t=ze.toRGBA(t),e=ze.getData(e);for(var n=[],s=((t=ze.getData(t))[0]-e[0])/r,o=(t[1]-e[1])/r,i=(t[2]-e[2])/r,a=(t[3]-e[3])/r,l=0,u=e[0],h=e[1],c=e[2],p=e[3];l<r;l++)n[l]=ze.toColor([ze.adjust(Math.floor(u),[0,255]),ze.adjust(Math.floor(h),[0,255]),ze.adjust(Math.floor(c),[0,255]),p.toFixed(4)-0],"hex"),u+=s,h+=o,c+=i,p+=a;return u=t[0],h=t[1],c=t[2],p=t[3],n[l]=ze.toColor([u,h,c,p],"hex"),n}static getGradientColors(e,t,r){var n,s,o,i=[],a=e.length;if(void 0!==t){if(a>=t)if("RANGE"===r)for(s=0;s<t;s++)i.push(e[s]);else for(s=0;s<t;s++){let t=Math.floor(s/2);if(s%2==0)i.push(e[t]);else{let r=e.length-1-t;i.push(e[r])}}else{for(n=Math.ceil(t/(a-1)),s=0,o=a-1;s<o;s++){var l=this.getStepColors(e[s],e[s+1],n);s<o-1&&l.pop(),i=i.concat(l)}for(var u=i.length-t,h=0;h<u;h++)i.splice(2,1)}return i}}static getColorWithOpacity(e,t){return ze.alpha(e,t)}}!function(){if("toISOString"in Date.prototype);}()}(),n}()}));
|