WokerTask/public/admin/assets/@amap.8a62addd.js

2 lines
5.6 KiB
JavaScript

var m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function y(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function L(l){var g=l.default;if(typeof g=="function"){var f=function(){return g.apply(this,arguments)};f.prototype=g.prototype}else f={};return Object.defineProperty(f,"__esModule",{value:!0}),Object.keys(l).forEach(function(M){var w=Object.getOwnPropertyDescriptor(l,M);Object.defineProperty(f,M,w.get?w:{enumerable:!0,get:function(){return l[M]}})}),f}var b={exports:{}};(function(l,g){(function(f,M){l.exports=M()})(m,function(){function f(e){var d=[];return e.AMapUI&&d.push(M(e.AMapUI)),e.Loca&&d.push(w(e.Loca)),Promise.all(d)}function M(e){return new Promise(function(d,o){var a=[];if(e.plugins)for(var i=0;i<e.plugins.length;i+=1)u.AMapUI.plugins.indexOf(e.plugins[i])==-1&&a.push(e.plugins[i]);if(p.AMapUI===n.failed)o("\u524D\u6B21\u8BF7\u6C42 AMapUI \u5931\u8D25");else if(p.AMapUI===n.notload){p.AMapUI=n.loading,u.AMapUI.version=e.version||u.AMapUI.version,i=u.AMapUI.version;var s=document.body||document.head,r=document.createElement("script");r.type="text/javascript",r.src="https://webapi.amap.com/ui/"+i+"/main.js",r.onerror=function(t){p.AMapUI=n.failed,o("\u8BF7\u6C42 AMapUI \u5931\u8D25")},r.onload=function(){if(p.AMapUI=n.loaded,a.length)window.AMapUI.loadUI(a,function(){for(var t=0,A=a.length;t<A;t++){var v=a[t].split("/").slice(-1)[0];window.AMapUI[v]=arguments[t]}for(d();c.AMapUI.length;)c.AMapUI.splice(0,1)[0]()});else for(d();c.AMapUI.length;)c.AMapUI.splice(0,1)[0]()},s.appendChild(r)}else p.AMapUI===n.loaded?e.version&&e.version!==u.AMapUI.version?o("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C AMapUI \u6DF7\u7528"):a.length?window.AMapUI.loadUI(a,function(){for(var t=0,A=a.length;t<A;t++){var v=a[t].split("/").slice(-1)[0];window.AMapUI[v]=arguments[t]}d()}):d():e.version&&e.version!==u.AMapUI.version?o("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C AMapUI \u6DF7\u7528"):c.AMapUI.push(function(t){t?o(t):a.length?window.AMapUI.loadUI(a,function(){for(var A=0,v=a.length;A<v;A++){var U=a[A].split("/").slice(-1)[0];window.AMapUI[U]=arguments[A]}d()}):d()})})}function w(e){return new Promise(function(d,o){if(p.Loca===n.failed)o("\u524D\u6B21\u8BF7\u6C42 Loca \u5931\u8D25");else if(p.Loca===n.notload){p.Loca=n.loading,u.Loca.version=e.version||u.Loca.version;var a=u.Loca.version,i=u.AMap.version.startsWith("2"),s=a.startsWith("2");if(i&&!s||!i&&s)o("JSAPI \u4E0E Loca \u7248\u672C\u4E0D\u5BF9\u5E94\uFF01\uFF01");else{i=u.key,s=document.body||document.head;var r=document.createElement("script");r.type="text/javascript",r.src="https://webapi.amap.com/loca?v="+a+"&key="+i,r.onerror=function(t){p.Loca=n.failed,o("\u8BF7\u6C42 AMapUI \u5931\u8D25")},r.onload=function(){for(p.Loca=n.loaded,d();c.Loca.length;)c.Loca.splice(0,1)[0]()},s.appendChild(r)}}else p.Loca===n.loaded?e.version&&e.version!==u.Loca.version?o("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C Loca \u6DF7\u7528"):d():e.version&&e.version!==u.Loca.version?o("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C Loca \u6DF7\u7528"):c.Loca.push(function(t){t?o(t):o()})})}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var n;(function(e){e.notload="notload",e.loading="loading",e.loaded="loaded",e.failed="failed"})(n||(n={}));var u={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},p={AMap:n.notload,AMapUI:n.notload,Loca:n.notload},c={AMap:[],AMapUI:[],Loca:[]},I=[],h=function(e){typeof e=="function"&&(p.AMap===n.loaded?e(window.AMap):I.push(e))};return{load:function(e){return new Promise(function(d,o){if(p.AMap==n.failed)o("");else if(p.AMap==n.notload){var a=e.key,i=e.version,s=e.plugins;a?(window.AMap&&location.host!=="lbs.amap.com"&&o("\u7981\u6B62\u591A\u79CDAPI\u52A0\u8F7D\u65B9\u5F0F\u6DF7\u7528"),u.key=a,u.AMap.version=i||u.AMap.version,u.AMap.plugins=s||u.AMap.plugins,p.AMap=n.loading,i=document.body||document.head,window.___onAPILoaded=function(t){if(delete window.___onAPILoaded,t)p.AMap=n.failed,o(t);else for(p.AMap=n.loaded,f(e).then(function(){d(window.AMap)}).catch(o);I.length;)I.splice(0,1)[0]()},s=document.createElement("script"),s.type="text/javascript",s.src="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+u.AMap.version+"&key="+a+"&plugin="+u.AMap.plugins.join(","),s.onerror=function(t){p.AMap=n.failed,o(t)},i.appendChild(s)):o("\u8BF7\u586B\u5199key")}else if(p.AMap==n.loaded)if(e.key&&e.key!==u.key)o("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");else if(e.version&&e.version!==u.AMap.version)o("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");else{if(a=[],e.plugins)for(i=0;i<e.plugins.length;i+=1)u.AMap.plugins.indexOf(e.plugins[i])==-1&&a.push(e.plugins[i]);a.length?window.AMap.plugin(a,function(){f(e).then(function(){d(window.AMap)}).catch(o)}):f(e).then(function(){d(window.AMap)}).catch(o)}else if(e.key&&e.key!==u.key)o("\u591A\u4E2A\u4E0D\u4E00\u81F4\u7684 key");else if(e.version&&e.version!==u.AMap.version)o("\u4E0D\u5141\u8BB8\u591A\u4E2A\u7248\u672C JSAPI \u6DF7\u7528");else{var r=[];if(e.plugins)for(i=0;i<e.plugins.length;i+=1)u.AMap.plugins.indexOf(e.plugins[i])==-1&&r.push(e.plugins[i]);h(function(){r.length?window.AMap.plugin(r,function(){f(e).then(function(){d(window.AMap)}).catch(o)}):f(e).then(function(){d(window.AMap)}).catch(o)})}})},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,u={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},p={AMap:n.notload,AMapUI:n.notload,Loca:n.notload},c={AMap:[],AMapUI:[],Loca:[]}}}})})(b);const P=b.exports;export{P as A,L as a,m as c,y as g};