zhihao-ui 1.2.49 → 1.2.51

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.
@@ -652,7 +652,7 @@ void main(void) {
652
652
  samplePos = clamp(samplePos, vec2(0.5), sampleSize - vec2(0.5));
653
653
  samplePos.y = sampleSize.y - samplePos.y; // invert y axis so that images appear upright
654
654
  return texture2D(texture, (samplePos + textureOffset) / textureSize);
655
- }`;const $=`u_texture${g}`;let V="1.";"fill-color"in t&&(V=e.getFillColorExpression()),e.setFillColorExpression(`${V} * sampleFillPattern(${$}, ${y}, ${L}, ${k}, pxOrigin, pxPos)`)}}function parseLiteralStyle(t,e){const n=newCompilationContext(),r={...newCompilationContext(),inFragmentShader:!0,variables:n.variables},i=new ShaderBuilder,g={};if("icon-src"in t?parseIconProperties(t,i,g,n,r):"shape-points"in t?parseShapeProperties(t,i,g,n,r):"circle-radius"in t&&parseCircleProperties(t,i,g,n,r),parseStrokeProperties(t,i,g,n,r),parseFillProperties(t,i,g,n,r),t.filter){const L=expressionToGlsl(r,t.filter,BooleanType);i.setFragmentDiscardExpression(`!${L}`)}for(const L in r.variables){const $=r.variables[L],V=uniformNameForVariable($.name);let z=getGlslTypeFromType($.type);$.type===ColorType&&(z="vec4"),i.addUniform(`${z} ${V}`),g[V]=()=>{const j=e[$.name];return typeof j=="number"?j:typeof j=="boolean"?j?1:0:$.type===ColorType?asArray(j||"#eee"):typeof j=="string"?getStringNumberEquivalent(j):j}}for(const L in r.properties){const $=r.properties[L];n.properties[L]||(n.properties[L]=$);let V=getGlslTypeFromType($.type),z=`a_prop_${$.name}`;$.type===ColorType&&(V="vec4",z=`unpackColor(${z})`,i.addVertexShaderFunction(UNPACK_COLOR_FN)),i.addVarying(`v_prop_${$.name}`,V,z)}for(const L in n.properties){const $=n.properties[L];i.addAttribute(`${getGlslTypeFromType($.type)} a_prop_${$.name}`)}for(const L in n.functions)i.addVertexShaderFunction(n.functions[L]);for(const L in r.functions)i.addFragmentShaderFunction(r.functions[L]);const y={};for(const L in n.properties){const $=n.properties[L],V=z=>{const j=z.get($.name);return $.type===ColorType?packColor([...asArray(j||"#eee")]):typeof j=="string"?getStringNumberEquivalent(j):typeof j=="boolean"?j?1:0:j};y[`prop_${$.name}`]={size:getGlslSizeFromType($.type),callback:V}}function k(L,$,V,z){const j=n[L],oe=r[L];if(!j&&!oe)return;const re=getGlslTypeFromType(V),ie=getGlslSizeFromType(V);i.addAttribute(`${re} a_${$}`),oe&&i.addVarying(`v_${$}`,re,`a_${$}`),y[$]={size:ie,callback:z}}return k("geometryType",GEOMETRY_TYPE_PROPERTY_NAME,StringType,L=>getStringNumberEquivalent(computeGeometryType(L.getGeometry()))),k("featureId",FEATURE_ID_PROPERTY_NAME,StringType|NumberType,L=>{const $=L.getId()??null;return typeof $=="string"?getStringNumberEquivalent($):$}),{builder:i,attributes:y,uniforms:g}}class WebGLPointsLayer extends Layer{constructor(e){const n=Object.assign({},e);super(n),this.styleVariables_=e.variables||{},this.parseResult_=parseLiteralStyle(e.style,this.styleVariables_),this.hitDetectionDisabled_=!!e.disableHitDetection}createRenderer(){const e=Object.keys(this.parseResult_.attributes).map(n=>({name:n,...this.parseResult_.attributes[n]}));return new WebGLPointsLayerRenderer(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:e})}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}}var CAR_COLOR=(t=>(t[t.BLUE=1]="BLUE",t[t.YELLOW=2]="YELLOW",t[t.Y_GREEN=3]="Y_GREEN",t))(CAR_COLOR||{}),DEVICE_TYPE=(t=>(t[t.HOST=1]="HOST",t[t.TALK=2]="TALK",t[t.STORAGE=3]="STORAGE",t[t.INTERNET=4]="INTERNET",t[t.CAMERA=5]="CAMERA",t[t.LOAD=6]="LOAD",t))(DEVICE_TYPE||{}),LENGTH_UNIT=(t=>(t[t.M=1]="M",t[t.KM=2]="KM",t[t.NM=3]="NM",t))(LENGTH_UNIT||{}),SWITCH_BTN=(t=>(t.Camera="camera",t.Mobile="mobile",t.WaterGauge="waterGauge",t))(SWITCH_BTN||{}),SHIP_SAIL_STATUS=(t=>(t[t.发动机使用中=0]="发动机使用中",t[t.锚泊=1]="锚泊",t[t.未操作=2]="未操作",t[t.操纵能力受限=3]="操纵能力受限",t[t.吃水受限=4]="吃水受限",t[t.系泊=5]="系泊",t[t.搁浅=6]="搁浅",t[t.从事捕捞=7]="从事捕捞",t[t.航行中=8]="航行中",t[t.留作将来修正导航状态=9]="留作将来修正导航状态",t[t.高速船留用=10]="高速船留用",t[t.机动船尾推作业=11]="机动船尾推作业",t[t.机动船顶推或侧推作业=12]="机动船顶推或侧推作业",t[t.飞翼船留用=13]="飞翼船留用",t[t.现行的=14]="现行的",t[t.未定义=15]="未定义",t))(SHIP_SAIL_STATUS||{});class ShipMapData{constructor(e,n,r,i,g,y,k,L,$,V,z,j,oe,re,ie,ae,le,de,pe,ue,he,_e,Ce,xe){qn(this,"id");qn(this,"mmsi");qn(this,"fill");qn(this,"shipType");qn(this,"name");qn(this,"length");qn(this,"breadth");qn(this,"lon");qn(this,"lat");qn(this,"createdAt");qn(this,"speed");qn(this,"from");qn(this,"sailStatus");qn(this,"hdg");qn(this,"cog");qn(this,"posType");qn(this,"type");qn(this,"angle");qn(this,"leftIconColor");qn(this,"existDevice");qn(this,"existMobile");qn(this,"existWaterGauge");qn(this,"selected");qn(this,"blinkColors");this.id=e,this.mmsi=n,this.fill=r,this.shipType=i,this.name=g,this.length=y,this.breadth=k,this.lon=L,this.lat=$,this.createdAt=V,this.speed=z,this.from=j,this.sailStatus=oe,this.hdg=re,this.cog=ie,this.posType=ae,this.type=le,this.angle=de,this.leftIconColor=pe,this.existDevice=ue,this.existMobile=he,this.existWaterGauge=_e,this.selected=Ce,this.blinkColors=xe}}const formatLength=function(t,e){const r=getLength(t);let i="";switch(e){case LENGTH_UNIT.M:i=Math.round(r*100)/100+" m";break;case LENGTH_UNIT.KM:i=Math.round(r/1e3*100)/100+" km";break;case LENGTH_UNIT.NM:i=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return i},convertSixHundredThousandToLatLng=function(t,e){const n=Number(e)/6e5;return[Number(t)/6e5,n]},formatArea=(t,e)=>{const r=getArea(t);let i;switch(e){case LENGTH_UNIT.KM:r>1e4?i=Math.round(r/1e6*100)/100+" km<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break;case LENGTH_UNIT.NM:const g=Math.pow(1.852,2);r>1e4?i=Math.round(r/1e6/g*100)/100+" nm<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break}return i},convertShipMapData=t=>{const e=n=>new ShipMapData(n.id,n.id,n.fill||"#04C900","70",(n.cnname||n.enname||n.name||n.id)+`${n.existName?n.existName:""}`,n.len||n.length,n.wid||n.breadth,n.lon,n.lat,new Date().getTime(),n.spd,n.from,n.status,Number(n.hdg),n.cog,Number(n.postype),"other",n.cog,n.leftIconColor,n.existDevice,n.existMobile,n.existWaterGauge,n.selected,n.blinkColors);return Array.isArray(t)?t.map(n=>e(n)):e(t)},formatUtils={formatLength,convertSixHundredThousandToLatLng,formatArea},_hoisted_1$a={key:0,class:"measure-panel"},_hoisted_2$6={class:"d-flex justify-content-between align-content-start w-100"},_hoisted_3$5={class:"measure-history-list"},_hoisted_4$2={class:"left-panel"},_hoisted_5$2={class:"text index"},_hoisted_6$2={class:"text"},_hoisted_7$2=["onClick"],_sfc_main$c=vue.defineComponent({__name:"measure",props:vue.mergeModels({viewMode:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:vue.mergeModels(["close"],["update:visible"]),setup(t,{expose:e,emit:n}){const r=vue.inject("mapInstance"),i=n,g=vue.useModel(t,"visible"),y=vue.ref("3"),k=vue.ref([]),L=vue.ref(!1),$=new VectorSource;let V,z,j,oe,re;const ie=new VectorLayer({source:$,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),ae=function(Ve){if(Ve.dragging)return;let Ue="点击选择起点";V&&(Ue="单击继续,双击结束"),z&&(z.innerHTML=Ue,j.setPosition(Ve.coordinate),z.classList.remove("hidden"))},le=()=>{var Ve,Ue;r!=null&&r.value&&((Ve=r==null?void 0:r.value)==null||Ve.on("pointermove",ae),(Ue=r==null?void 0:r.value)==null||Ue.getViewport().addEventListener("mouseout",function(){var kt;(kt=z==null?void 0:z.classList)==null||kt.add("hidden")}),L.value=!0)};let de;const pe=new Style({fill:new Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Stroke({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new CircleStyle({radius:5,stroke:new Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new Fill({color:"rgba(255, 255, 255, 0.2)"})})});function ue(){var Ve,Ue;if(r!=null&&r.value){if(k.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(kt=>{var Dt;(Dt=kt==null?void 0:kt.parentNode)==null||Dt.removeChild(kt)}),$.clear(),de){const kt=r.value.getInteractions().getArray().find(Dt=>getUid(Dt)===getUid(de));kt&&((Ve=r.value)==null||Ve.removeInteraction(kt))}(Ue=r.value)==null||Ue.removeLayer(ie),z!=null&&z.parentNode&&z.parentNode.removeChild(z),oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe)}}function he(){var Ue,kt;ue(),(Ue=r==null?void 0:r.value)==null||Ue.addLayer(ie),de=new Draw({source:$,type:"LineString",style:function(){return pe},condition:function(Dt){return Dt.originalEvent.target.tagName!=="DIV"}}),(kt=r==null?void 0:r.value)==null||kt.addInteraction(de),Ce(),_e();let Ve;de.on("drawstart",function(Dt){var Fe;V=Dt.feature,V.set("randomId",Oe());let $e;Ve=(Fe=V.getGeometry())==null?void 0:Fe.on("change",function(ze){const qe=ze.target;let Ne=formatUtils.formatLength(qe,Number(y.value));$e=qe.getLastCoordinate(),oe&&Ne&&(oe.innerHTML=Ne),re.setPosition($e)})}),de.on("drawend",function(){var Dt;if(oe&&(oe.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),oe!=null&&oe.innerHTML){const $e=(V==null?void 0:V.get("randomId"))||Oe();k.value.push({id:$e,value:oe==null?void 0:oe.innerHTML}),oe.innerHTML=`${oe.innerHTML}<div class="ol-tooltip-delete-button" data-id="${$e}"><i class="map-iconfont icon-delete"></i></div>`}(Dt=document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button"))==null||Dt.addEventListener("click",$e=>{var ze;$e.preventDefault(),$e.stopPropagation();const Fe=(ze=$e.target)==null?void 0:ze.getAttribute("data-id");Fe&&xe(Fe)}),re.setOffset([0,-7]),V=null,oe=null,Ce(),Ve&&unByKey(Ve)})}function _e(){var Ve;z!=null&&z.parentNode&&z.parentNode.removeChild(z),z=document.createElement("div"),z.className="ol-tooltip hidden",j=new Overlay({element:z,offset:[15,0],positioning:"center-left"}),(Ve=r==null?void 0:r.value)==null||Ve.addOverlay(j)}function Ce(){var Ve;oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe),oe=document.createElement("div"),oe.className="ol-tooltip ol-tooltip-measure",re=new Overlay({element:oe,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(Ve=r==null?void 0:r.value)==null||Ve.addOverlay(re)}const xe=Ve=>{var kt,Dt;const Ue=k.value.findIndex($e=>$e.id===Ve);if(Ue!==-1){k.value.splice(Ue,1);const $e=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");$e[Ue]&&((Dt=(kt=$e[Ue])==null?void 0:kt.parentNode)==null||Dt.removeChild($e[Ue]));const Fe=$.getFeatures();Fe[Ue]&&$.removeFeature(Fe[Ue])}},Ie=()=>{i("close")},Oe=()=>Math.random().toString(36).substring(2,9);return vue.watch(()=>g,()=>{g.value&&!L.value&&(le(),he())},{deep:!0,immediate:!0}),e({addInteraction:he,removeInteraction:ue}),(Ve,Ue)=>g.value&&Ve.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.createElementVNode("div",{class:"header"},[Ue[1]||(Ue[1]=vue.createElementVNode("div",{class:"title"},"测量",-1)),vue.createElementVNode("i",{onClick:Ie,class:"map-iconfont icon-close"})]),vue.createElementVNode("div",_hoisted_2$6,[Ue[2]||(Ue[2]=vue.createElementVNode("div",{class:"tips"},"在地图上点击多个点测量距离,距离单位",-1)),vue.createVNode(vue.unref(ElSelect),{class:"select-length-unit",modelValue:y.value,"onUpdate:modelValue":Ue[0]||(Ue[0]=kt=>y.value=kt)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{label:"m",value:"1"}),vue.createVNode(vue.unref(ElOption),{label:"km",value:"2"}),vue.createVNode(vue.unref(ElOption),{label:"nm",value:"3"})]),_:1},8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$5,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.value,(kt,Dt)=>(vue.openBlock(),vue.createElementBlock("div",{class:"measure-history-item",key:kt.id},[vue.createElementVNode("div",_hoisted_4$2,[Ue[3]||(Ue[3]=vue.createElementVNode("i",{class:"map-iconfont icon-line"},null,-1)),vue.createElementVNode("span",_hoisted_5$2,"线段"+vue.toDisplayString(Dt+1),1),vue.createElementVNode("span",_hoisted_6$2,vue.toDisplayString(kt.value),1)]),vue.createElementVNode("div",{class:"delete-button",onClick:$e=>xe(kt.id)},Ue[4]||(Ue[4]=[vue.createElementVNode("i",{class:"map-iconfont icon-delete"},null,-1)]),8,_hoisted_7$2)]))),128))])])):vue.createCommentVNode("",!0)}}),Measure=_export_sfc(_sfc_main$c,[["__scopeId","data-v-f04be643"]]),mapInstance$8=vue.ref(),renderMarkerSetInstance=t=>mapInstance$8.value=t,markerPosition=vue.ref(""),marker=vue.ref(),createIconStyle=t=>new Style({image:new Icon({src:CDN_URL+"map/poi-marker-default.png",anchor:[.5,1]}),text:new Text({text:t,offsetY:-90,font:"12px",fill:new Fill({color:"#000"}),stroke:new Stroke({color:"#fff",width:2}),backgroundFill:new Fill({color:"#fff"}),backgroundStroke:new Stroke({color:"#000",width:1}),padding:[2,2,2,2]})}),renderMarker=(t,e=!0,n=!0)=>{var V;if(!mapInstance$8.value||!t||t.split(",").length!==2)return;const[r,i]=t.split(",").map(Number);marker.value=new Feature({geometry:new Point(fromLonLat([r,i]))});const g=n?`${r}, ${i}`:"";(V=marker.value)==null||V.setStyle(createIconStyle(g));const y=new VectorSource({features:[marker.value]}),k=new VectorLayer({source:y}),L=mapInstance$8.value.getView();if(mapInstance$8.value.addLayer(k),e){const z=new Translate({layers:[k]});z.on("translating",function(j){var ie;const oe=j.features.item(0).getGeometry().getCoordinates(),re=toLonLat(oe);markerPosition.value=`${re[0].toFixed(6)}, ${re[1].toFixed(6)}`,(ie=marker.value)==null||ie.setStyle(createIconStyle(markerPosition.value))}),mapInstance$8.value.addInteraction(z)}const $=new Point([r,i]);L.setCenter(transform($.getCoordinates(),projection.data,projection.mercator)),L.setZoom(mapZoom.findShip)},setMarkerPosition=t=>{var i,g;if(!mapInstance$8.value)return;const e=mapInstance$8.value.getView(),n=t.split(",").map(Number);(g=(i=marker.value)==null?void 0:i.getGeometry())==null||g.setCoordinates(fromLonLat([n[0],n[1]]));const r=new Point([n[0],n[1]]);e.setCenter(transform(r.getCoordinates(),projection.data,projection.mercator)),e.setZoom(mapZoom.markerPosition)},CDN_URL="https://static.zhihaoscm.cn/",tiandituKey="a6e8f78974f2581f2ca00485b40c948f",zhongkeKey="15c81cc0a191a232e0a0ca1a51c3ca81",baseMap={tiandituTile:`https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituTileMark:`https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTile:`https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTileMark:`https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,greenTile:`${CDN_URL}/map/tile/{z}/{x}/{y}.png`},mapZoom={default:6,min:3,max:18,findShipMin:10,findShip:13,findTruck:14,shipGreenDotMax:11,truckDefault:14,truckStatistics:8,shipModelMin:13,shipModelMax:18,markerPosition:14},renderShipsLimit=200,mapDefaultCenter=[114.84,30.52],projection={data:"EPSG:4326",mercator:"EPSG:3857"},LOG_DATE_FORMAT="YYYY-MM-DD HH:mm:ss",DEFAULT_VALUE="--";vue.ref();const shipsLayer=vue.ref(),largeAmountShipsLayer=vue.ref(),selectShipsLayer=vue.ref(),allShips=vue.ref([]),selectSingleShipData=vue.ref();vue.ref();const trucksLayer=vue.ref(),shipTrackLineFeatures=vue.ref([]),trackLineVectorSource=vue.ref(),shipTrackVectorLayer=vue.ref();vue.ref(),vue.ref();const shipLabels=vue.ref([]),trackLabels=vue.ref([]),showTrackLayer=vue.ref(!1),allTracks=vue.ref([]),currentTrackId=vue.ref(""),showTrackAnimatMarker=vue.ref(!1),hiddenOrther=vue.ref(!1),showMeasure=vue.ref(!1),getShowMeasure=()=>showMeasure.value;function getIconFont(unicode=""){return unicode.indexOf("&amp;")!==-1&&(unicode=unicode.replace("&amp;","&")),unicode.indexOf("&amp")!==-1&&(unicode=unicode.replace("&amp","&")),eval('("'+unicode.replace("&#x","\\u").replace(";","")+'")')}const multiplyPixelRatio=t=>{const e=window.devicePixelRatio||1;return t.map(n=>n.map(r=>r*e))},adjustBounds=(t,e)=>e.length===2?[t[0]-e[0],t[1]-e[1],t[2]+e[0],t[3]+e[1]]:[t[0]+e[0],t[1]+e[1],t[2]+e[2],t[3]+e[3]],isOverlapping=(t,e)=>t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1],getIconStyle=t=>new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:"#fff"}),offsetY:-14}),zIndex:100}),getRotation=(t,e,n)=>{function r(z){return 180*(z%(2*Math.PI))/Math.PI}function i(z){return z%360*Math.PI/180}function g(z){if(!z)throw new Error("Coordinate is required");if(!Array.isArray(z)){if(z.type==="Feature"&&z.geometry!==null&&z.geometry.type==="Point")return z.geometry.coordinates;if(z.type==="Point")return z.coordinates}if(Array.isArray(z)&&z.length>=2&&!Array.isArray(z[0])&&!Array.isArray(z[1]))return z;throw new Error("Coordinate must be GeoJSON Point or an Array of numbers")}function y(z,j,oe={}){if(oe.final)return function(_e,Ce){return(y(Ce,_e)+180)%360}(z,j);const re=g(z),ie=g(j),ae=i(re[0]),le=i(ie[0]),de=i(re[1]),pe=i(ie[1]),ue=Math.sin(le-ae)*Math.cos(pe),he=Math.cos(de)*Math.sin(pe)-Math.sin(de)*Math.cos(pe)*Math.cos(le-ae);return r(Math.atan2(ue,he))}function k(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function L(z,j={},oe={}){return z||console.log("Coordinates are required"),Array.isArray(z)||console.log("Coordinates must be an Array"),z.length<2&&console.log("Coordinates must be at least 2 numbers long"),(!k(z[0])||!k(z[1]))&&console.log("Coordinates must contain numbers"),$({type:"Point",coordinates:z},j,oe)}function $(z,j={},oe={}){const re={type:"Feature"};return oe.id!==void 0&&(re.id=oe.id),oe.bbox&&(re.bbox=oe.bbox),re.properties=j||{},re.geometry=z,re}const V=y(L(t),L(e),n);return V<0?360+V:V},triangleModel=multiplyPixelRatio([[0,-8],[5,8],[-5,8]]),shipShapeModel=multiplyPixelRatio([[0,-4.545],[-.56,-3.909],[-1,-2.727],[-1,3.636],[-.8,4.545],[.8,4.545],[1,3.636],[1,-2.727],[.56,-3.909],[0,-4.545]]),shipDirectPath={left:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},right:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},front:{0:[[0,0],[0,-8]],1:[[0,0],[0,-16]],2:[[0,0],[0,-24]]}},setBlankStyle=()=>new Style({image:new CircleStyle({radius:0})}),isMapMoving=vue.ref(!1),mapInstance$7=vue.ref(),renderShipStyleSetInstance=t=>{mapInstance$7.value=t,t.on("movestart",()=>{isMapMoving.value=!0}),t.on("moveend",()=>{isMapMoving.value=!1,t.render()})},speedCondition=[[1,10],[10,20],[20,1/0]],drawShipModelByZoom={14:[200,30],15:[115,15],16:[55,8],17:[25,5],18:[1,1]},setShipStyle=(t,e=!1)=>new Style({renderer:(n,r)=>{n=n;const i=r.context,g=r.feature.get("data");if(!g)return;r.feature.get("index")===0&&(shipLabels.value=[]);try{const k=drawShipBody(i,g,n,e);k&&(drawHeading(i,g,k,e),g.selected=t,!isMapMoving.value&&t&&setTimeout(()=>{drawSelectBounds(i,k)},1)),drawShipLabel(i,g,n)}catch{return!1}}}),drawShipBody=(t,e,n,r)=>{if(!mapInstance$7.value)return;const i=Math.round(Number(mapInstance$7.value.getView().getZoom()));if(!i)return;let g=[];const[y,k]=drawShipModelByZoom[i]||[0,0],[L,$]=n;if(i<=mapZoom.shipModelMax&&i>mapZoom.shipModelMin&&e.length>=y&&e.breadth>=k)g=rotateShapeModel(drawCurrentShipShapeModel(e,i),e.angle).map(z=>{const[j,oe]=z;return[L+j,$+oe]});else{const V=rotateShapeModel(triangleModel,e.angle);n.length===2&&(g=V.map(z=>{const[j,oe]=z;return[L+j,$+oe]}))}if(!(g.length>2))return!1;if(e!=null&&e.length){const V=g.length===3?30:e.length*.4;t.beginPath(),t.arc(n[0],n[1],V,0,2*Math.PI),t.fillStyle="rgba(255, 255, 255, 0.001)",t.fill()}t.save(),t.beginPath(),t.moveTo(g[0][0],g[0][1]);for(let V=1;V<g.length;V++)t.lineTo(g[V][0],g[V][1]);return t.closePath(),t.strokeStyle=r?"#ff0000":"#000",t.lineWidth=r?2:1,t.stroke(),t.fillStyle=e.fill,t.fill(),t.restore(),g},drawHeading=(t,e,n,r)=>{const[i,g]=n[0],y=getShipDirectPath(e);if(y){const k=y.map(function(L){const[$,V]=L;return[$+i,V+g]});if(t.save(),t.beginPath(),e.angle>0){t.translate(i,g);const L=e.angle*Math.PI/180;t.rotate(L),t.translate(-i,-g)}t.moveTo(i,g);for(let L=1;L<k.length;L++){const[$,V]=k[L];t.lineTo($,V)}t.strokeStyle=r?"#ff0000":"#000",t.lineWidth=r?2:1,t.stroke(),t.restore()}},drawSelectBounds=(t,e)=>{let[n,r,i,g]=getPixelFromCoordinate(e);const y=window.devicePixelRatio||1,k=4;n-=k,r-=k,i+=k,g+=k,t.save(),t.strokeStyle="#ff0000",t.lineWidth=4*y;const L=8*y;t.beginPath(),t.moveTo(n+L,g),t.lineTo(n,g),t.lineTo(n,g-L),t.moveTo(n,r+L),t.lineTo(n,r),t.lineTo(n+L,r),t.moveTo(i-L,r),t.lineTo(i,r),t.lineTo(i,r+L),t.moveTo(i,g-L),t.lineTo(i,g),t.lineTo(i-L,g),t.stroke(),t.restore()},drawShipLabel=(t,e,n)=>{if(!e.selected&&shipLabels.value.find(z=>z.name===e.name))return;const[r,i]=n,g=r,y=i,k=e.name;let L;e.leftIconColor&&(L={color:e.leftIconColor,icon:"&#xe599;"});const $=getShipCustomIcon(e),V={id:e.id,center:[g,y],text:k,fill:e.fill,color:"#fff",textColor:"#000",bgColor:"#fff",leftIcon:L,rightIcons:$,selected:e.selected,blinkColors:e.blinkColors,type:"ShipName"};drawLabel(t,V,shipLabels.value,mapInstance$7.value)},drawCurrentShipShapeModel=(t,e)=>{let n=0;e<=14?n=.058:e===15?n=.12:e===16?n=.22:e===17?n=.435:e===18&&(n=.857);const r=t.length/4*n,i=t.breadth*n;let g=cloneDeep(shipShapeModel);return g=g.map(([y,k])=>[y*i,k*r]),g},getShipDirectPath=t=>{const{speed:e,hdg:n,cog:r}=t;let i="",g=null;if(e&&e>1&&(n!==null&&n!=511&&r!==null?r-n>=3?i="left":r-n<=-3?i="right":i="front":i="front",i&&e))for(let y=0;y<speedCondition.length;y++){const k=speedCondition[y];if(e>=k[0]&&e<k[1]){g=shipDirectPath[i][y];break}}return g},getShipCustomIcon=t=>{const e=[];return t.existDevice&&e.push("&#xe687;"),t.existMobile&&e.push("&#xe688;"),t.existWaterGauge&&e.push("&#xe686;"),e||[]};class FeatureFormat{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Feature,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let r=n.dataProjection?get$1(n.dataProjection):this.readProjection(e);n.extent&&r&&r.getUnits()==="tile-pixels"&&(r=get$1(r),r.setWorldExtent(n.extent)),n={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return abstract()}readFeature(e,n){return abstract()}readFeatures(e,n){return abstract()}readGeometry(e,n){return abstract()}readProjection(e){return abstract()}writeFeature(e,n){return abstract()}writeFeatures(e,n){return abstract()}writeGeometry(e,n){return abstract()}}function transformGeometryWithOptions(t,e,n){const r=n?get$1(n.featureProjection):null,i=n?get$1(n.dataProjection):null;let g=t;if(r&&i&&!equivalent(r,i)){e&&(g=t.clone());const y=e?r:i,k=e?i:r;y.getUnits()==="tile-pixels"?g.transform(y,k):g.applyTransform(getTransform(y,k))}if(e&&n&&n.decimals!==void 0){const y=Math.pow(10,n.decimals),k=function(L){for(let $=0,V=L.length;$<V;++$)L[$]=Math.round(L[$]*y)/y;return L};g===t&&(g=t.clone()),g.applyTransform(k)}return g}const GeometryConstructor={Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon};function orientFlatCoordinates(t,e,n){return Array.isArray(e[0])?(linearRingssAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRingsArray(t,0,e,n)),t):(linearRingsAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRings(t,0,e,n)),t)}function createRenderFeature(t,e){var g;const n=t.geometry;if(!n)return[];if(Array.isArray(n))return n.map(y=>createRenderFeature({...t,geometry:y})).flat();const r=n.type==="MultiPolygon"?"Polygon":n.type;if(r==="GeometryCollection"||r==="Circle")throw new Error("Unsupported geometry type: "+r);const i=n.layout.length;return transformGeometryWithOptions(new RenderFeature(r,r==="Polygon"?orientFlatCoordinates(n.flatCoordinates,n.ends,i):n.flatCoordinates,(g=n.ends)==null?void 0:g.flat(),i,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function createGeometry(t,e){if(!t)return null;if(Array.isArray(t)){const r=t.map(i=>createGeometry(i,e));return new GeometryCollection(r)}const n=GeometryConstructor[t.type];return transformGeometryWithOptions(new n(t.flatCoordinates,t.layout,t.ends),!1,e)}class JSONFeature extends FeatureFormat{constructor(){super()}getType(){return"json"}readFeature(e,n){return this.readFeatureFromObject(getObject(e),this.getReadOptions(e,n))}readFeatures(e,n){return this.readFeaturesFromObject(getObject(e),this.getReadOptions(e,n))}readFeatureFromObject(e,n){return abstract()}readFeaturesFromObject(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromObject(getObject(e),this.getReadOptions(e,n))}readGeometryFromObject(e,n){return abstract()}readProjection(e){return this.readProjectionFromObject(getObject(e))}readProjectionFromObject(e){return abstract()}writeFeature(e,n){return JSON.stringify(this.writeFeatureObject(e,n))}writeFeatureObject(e,n){return abstract()}writeFeatures(e,n){return JSON.stringify(this.writeFeaturesObject(e,n))}writeFeaturesObject(e,n){return abstract()}writeGeometry(e,n){return JSON.stringify(this.writeGeometryObject(e,n))}writeGeometryObject(e,n){return abstract()}}function getObject(t){if(typeof t=="string"){const e=JSON.parse(t);return e||null}return t!==null?t:null}class GeoJSON extends JSONFeature{constructor(e){e=e||{},super(),this.dataProjection=get$1(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=get$1(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,n){let r=null;e.type==="Feature"?r=e:r={type:"Feature",geometry:e,properties:null};const i=readGeometryInternal(r.geometry);if(this.featureClass===RenderFeature)return createRenderFeature({geometry:i,id:r.id,properties:r.properties},n);const g=new Feature;return this.geometryName_?g.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&g.setGeometryName(r.geometry_name),g.setGeometry(createGeometry(i,n)),"id"in r&&g.setId(r.id),r.properties&&g.setProperties(r.properties,!0),g}readFeaturesFromObject(e,n){const r=e;let i=null;if(r.type==="FeatureCollection"){const g=e;i=[];const y=g.features;for(let k=0,L=y.length;k<L;++k){const $=this.readFeatureFromObject(y[k],n);$&&i.push($)}}else i=[this.readFeatureFromObject(e,n)];return i.flat()}readGeometryFromObject(e,n){return readGeometry(e,n)}readProjectionFromObject(e){const n=e.crs;let r;if(n)if(n.type=="name")r=get$1(n.properties.name);else if(n.type==="EPSG")r=get$1("EPSG:"+n.properties.code);else throw new Error("Unknown SRS type");else r=this.dataProjection;return r}writeFeatureObject(e,n){n=this.adaptOptions(n);const r={type:"Feature",geometry:null,properties:null},i=e.getId();if(i!==void 0&&(r.id=i),!e.hasProperties())return r;const g=e.getProperties(),y=e.getGeometry();return y&&(r.geometry=writeGeometry(y,n),delete g[e.getGeometryName()]),isEmpty$1(g)||(r.properties=g),r}writeFeaturesObject(e,n){n=this.adaptOptions(n);const r=[];for(let i=0,g=e.length;i<g;++i)r.push(this.writeFeatureObject(e[i],n));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,n){return writeGeometry(e,this.adaptOptions(n))}}function readGeometryInternal(t,e){if(!t)return null;let n;switch(t.type){case"Point":{n=readPointGeometry(t);break}case"LineString":{n=readLineStringGeometry(t);break}case"Polygon":{n=readPolygonGeometry(t);break}case"MultiPoint":{n=readMultiPointGeometry(t);break}case"MultiLineString":{n=readMultiLineStringGeometry(t);break}case"MultiPolygon":{n=readMultiPolygonGeometry(t);break}case"GeometryCollection":{n=readGeometryCollectionGeometry(t);break}default:throw new Error("Unsupported GeoJSON type: "+t.type)}return n}function readGeometry(t,e){const n=readGeometryInternal(t);return createGeometry(n,e)}function readGeometryCollectionGeometry(t,e){return t.geometries.map(function(r){return readGeometryInternal(r)})}function readPointGeometry(t){const e=t.coordinates;return{type:"Point",flatCoordinates:e,layout:getLayoutForStride(e.length)}}function readLineStringGeometry(t){var r;const e=t.coordinates,n=e.flat();return{type:"LineString",flatCoordinates:n,ends:[n.length],layout:getLayoutForStride(((r=e[0])==null?void 0:r.length)||2)}}function readMultiLineStringGeometry(t){var g,y;const e=t.coordinates,n=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length)||2,r=[],i=deflateCoordinatesArray(r,0,e,n);return{type:"MultiLineString",flatCoordinates:r,ends:i,layout:getLayoutForStride(n)}}function readMultiPointGeometry(t){var n;const e=t.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:getLayoutForStride(((n=e[0])==null?void 0:n.length)||2)}}function readMultiPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y[0].length)||2,i=deflateMultiCoordinatesArray(n,0,e,r);return{type:"MultiPolygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function readPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=(y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length,i=deflateCoordinatesArray(n,0,e,r);return{type:"Polygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function writeGeometry(t,e){t=transformGeometryWithOptions(t,!0,e);const n=t.getType();let r;switch(n){case"Point":{r=writePointGeometry(t);break}case"LineString":{r=writeLineStringGeometry(t);break}case"Polygon":{r=writePolygonGeometry(t,e);break}case"MultiPoint":{r=writeMultiPointGeometry(t);break}case"MultiLineString":{r=writeMultiLineStringGeometry(t);break}case"MultiPolygon":{r=writeMultiPolygonGeometry(t,e);break}case"GeometryCollection":{r=writeGeometryCollectionGeometry(t,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+n)}return r}function writeGeometryCollectionGeometry(t,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(r){return writeGeometry(r,e)})}}function writeLineStringGeometry(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}function writeMultiLineStringGeometry(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}function writeMultiPointGeometry(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}function writeMultiPolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}function writePointGeometry(t,e){return{type:"Point",coordinates:t.getCoordinates()}}function writePolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(n)}}class TextFeature extends FeatureFormat{constructor(){super()}getType(){return"text"}readFeature(e,n){return this.readFeatureFromText(getText(e),this.adaptOptions(n))}readFeatureFromText(e,n){return abstract()}readFeatures(e,n){return this.readFeaturesFromText(getText(e),this.adaptOptions(n))}readFeaturesFromText(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromText(getText(e),this.adaptOptions(n))}readGeometryFromText(e,n){return abstract()}readProjection(e){return this.readProjectionFromText(getText(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,n){return this.writeFeatureText(e,this.adaptOptions(n))}writeFeatureText(e,n){return abstract()}writeFeatures(e,n){return this.writeFeaturesText(e,this.adaptOptions(n))}writeFeaturesText(e,n){return abstract()}writeGeometry(e,n){return this.writeGeometryText(e,this.adaptOptions(n))}writeGeometryText(e,n){return abstract()}}function getText(t){return typeof t=="string"?t:""}function flipXY(t,e,n,r,i,g){i!==void 0?(i=i,g=g!==void 0?g:0):(i=[],g=0);let y=e;for(;y<n;){const k=t[y++];i[g++]=t[y++],i[g++]=k;for(let L=2;L<r;++L)i[g++]=t[y++]}return i.length=g,i}class Polyline extends TextFeature{constructor(e){super(),e=e||{},this.dataProjection=get$1("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY"}readFeatureFromText(e,n){const r=this.readGeometryFromText(e,n);return new Feature(r)}readFeaturesFromText(e,n){return[this.readFeatureFromText(e,n)]}readGeometryFromText(e,n){const r=getStrideForLayout(this.geometryLayout_),i=decodeDeltas(e,r,this.factor_);flipXY(i,0,i.length,r,i);const g=inflateCoordinates(i,0,i.length,r),y=new LineString(g,this.geometryLayout_);return transformGeometryWithOptions(y,!1,this.adaptOptions(n))}writeFeatureText(e,n){const r=e.getGeometry();if(r)return this.writeGeometryText(r,n);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(e,n){return this.writeFeatureText(e[0],n)}writeGeometryText(e,n){e=transformGeometryWithOptions(e,!0,this.adaptOptions(n));const r=e.getFlatCoordinates(),i=e.getStride();return flipXY(r,0,r.length,i,r),encodeDeltas(r,i,this.factor_)}}function encodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;for(let g=0,y=t.length;g<y;)for(r=0;r<e;++r,++g){const k=t[g],L=k-i[r];i[r]=k,t[g]=L}return encodeFloats(t,n)}function decodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;const g=decodeFloats(t,n);for(let y=0,k=g.length;y<k;)for(r=0;r<e;++r,++y)i[r]+=g[y],g[y]=i[r];return g}function encodeFloats(t,e){e=e||1e5;for(let n=0,r=t.length;n<r;++n)t[n]=Math.round(t[n]*e);return encodeSignedIntegers(t)}function decodeFloats(t,e){e=e||1e5;const n=decodeSignedIntegers(t);for(let r=0,i=n.length;r<i;++r)n[r]/=e;return n}function encodeSignedIntegers(t){for(let e=0,n=t.length;e<n;++e){const r=t[e];t[e]=r<0?~(r<<1):r<<1}return encodeUnsignedIntegers(t)}function decodeSignedIntegers(t){const e=decodeUnsignedIntegers(t);for(let n=0,r=e.length;n<r;++n){const i=e[n];e[n]=i&1?~(i>>1):i>>1}return e}function encodeUnsignedIntegers(t){let e="";for(let n=0,r=t.length;n<r;++n)e+=encodeUnsignedInteger(t[n]);return e}function decodeUnsignedIntegers(t){const e=[];let n=0,r=0;for(let i=0,g=t.length;i<g;++i){const y=t.charCodeAt(i)-63;n|=(y&31)<<r,y<32?(e.push(n),n=0,r=0):r+=5}return e}function encodeUnsignedInteger(t){let e,n="";for(;t>=32;)e=(32|t&31)+63,n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e),n}const mapInstance$6=vue.ref(),renderShipSetInstance=t=>mapInstance$6.value=t;let shipsMarkerList=[],shipsVectorSource,largeAmountShipsSource;const selectedShipData=vue.ref(null),selectedShips=vue.ref([]);let selectShipsVectorSource;const renderShips=t=>{var i,g,y,k;if(!mapInstance$6.value||showTrackLayer.value)return;const e=t.reduce((L,$)=>(L.some(V=>V.id===$.id)||L.push($),L),[]),n=Math.round(Number(mapInstance$6.value.getView().getZoom()));if(selectedShipData.value&&vue.nextTick(()=>{selectSingleShipMarker(selectedShipData.value)}).then(L=>{}),!n||n<mapZoom.shipGreenDotMax)return;const r=[...e,...selectedShips.value].reduce((L,$)=>(L.some(V=>V.id===$.id)||L.push($),L),[]);if(allShips.value.forEach(L=>{var $;!r.some(V=>V.id===L.id)&&(($=L.blinkColors)!=null&&$.length)&&checkBlinkLabelExist(mapInstance$6.value,shipLabels.value,L.id)}),allShips.value=r,!hiddenOrther.value)return n>=mapZoom.shipGreenDotMax&&n<mapZoom.shipModelMin?((i=shipsLayer.value)==null||i.setVisible(!1),(g=largeAmountShipsLayer.value)==null||g.setVisible(!0),renderLargeAmountShips(allShips.value)):((y=largeAmountShipsLayer.value)==null||y.setVisible(!1),(k=shipsLayer.value)==null||k.setVisible(!0),renderShipsMarker(allShips.value))},renderLargeAmountShips=t=>{if(!mapInstance$6.value)return;const e=t.map(n=>({type:"Feature",geometry:{type:"Point",coordinates:[n.lon,n.lat]},properties:n}));return largeAmountShipsSource==null||largeAmountShipsSource.clear(),largeAmountShipsSource=new VectorSource({features:new GeoJSON().readFeatures({type:"FeatureCollection",features:e},{featureProjection:projection.mercator})}),largeAmountShipsLayer.value=new WebGLPointsLayer({source:largeAmountShipsSource,style:{"shape-points":3,"shape-radius":9,"shape-fill-color":["case",["==",["get","fill"],"#D9001C"],"#D9001C",["==",["get","fill"],"#04C900"],"#04C900","#04C900"],"shape-rotate-with-view":!1,"shape-rotation":["+",["get","cog"],180],"shape-scale":[.8,1.2],"shape-stroke-color":"#000000","shape-stroke-width":.5}}),mapInstance$6.value.addLayer(largeAmountShipsLayer.value),largeAmountShipsLayer.value},renderShipsMarker=t=>{var n;if(!mapInstance$6.value)return;deleteAllShipMarkers();let e=convertShipMapData(t);if(e=customFilterShips(e),!!(e!=null&&e.length))return e.forEach((r,i)=>{const g=[r.lon,r.lat],y=new Feature({geometry:new Point(fromLonLat(g))}),k=1;y.set("clickGeometry",new Circle(fromLonLat(g),k)),y.set("data",r),y.set("index",i),y.setStyle(setShipStyle(!1)),shipsMarkerList.push({ship:r,lonlat:g,feature:y})}),shipsVectorSource=new VectorSource({features:shipsMarkerList.map(r=>r.feature)}),shipsLayer.value=new VectorLayer({source:shipsVectorSource,zIndex:100}),(n=mapInstance$6.value)==null||n.addLayer(shipsLayer.value),shipsLayer.value},onShipsMarkerHover=()=>{var r;let t=null,e=0;const n=100;(r=mapInstance$6.value)==null||r.on("pointermove",function(i){var L,$,V,z;const g=Date.now();if(g-e<n)return;e=g;const y=(L=mapInstance$6.value)==null?void 0:L.forEachFeatureAtPixel(i.pixel,j=>j),k=($=mapInstance$6.value)==null?void 0:$.getTargetElement();if(k&&(k.style.cursor=y?"pointer":""),t!==y){if(t){const j=t.get("data");if(!(j!=null&&j.mmsi))return;t.setStyle(setShipStyle(((V=selectedShipData.value)==null?void 0:V.id)===j.id,!1))}if(y){const j=y.get("data");if(!(j!=null&&j.mmsi))return;t=y,y.setStyle(setShipStyle(((z=selectedShipData.value)==null?void 0:z.id)===j.id,!0))}else t=null}})},customFilterShips=t=>{let e=cloneDeep(t);return e=e.filter(n=>{var i;const r=getFilterItem(n).every(({btnShow:g,value:y})=>g?!!y:!0);return(switchBtnShow.value.camera||switchBtnShow.value.mobile||switchBtnShow.value.waterGauge)&&((i=selectedShipData.value)==null?void 0:i.id)===n.id&&clearSelectFeature(),r}),e},getFilterItem=t=>[{btnShow:switchBtnShow.value.camera,value:t==null?void 0:t.existDevice},{btnShow:switchBtnShow.value.mobile,value:t==null?void 0:t.existMobile},{btnShow:switchBtnShow.value.waterGauge,value:t==null?void 0:t.existWaterGauge}],deleteAllShipMarkers=()=>{shipsMarkerList.forEach(t=>{t.feature&&(shipsVectorSource==null||shipsVectorSource.removeFeature(t.feature))}),clearAllInterval(),shipsMarkerList=[]},selectSingleShipMarker=t=>{var g;if(!mapInstance$6.value)return;const e=cloneDeep(selectSingleShipData.value);selectSingleShipData.value=convertShipMapData(t);const n=[selectSingleShipData.value.lon,selectSingleShipData.value.lat],r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",selectSingleShipData.value),r.setStyle(setShipStyle(!0)),shipsMarkerList.push({ship:selectSingleShipData.value,lonlat:n,feature:r}),selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsVectorSource=new VectorSource({features:[r]}),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),shipsVectorSource&&setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!0);const i=(g=shipsLayer.value)==null?void 0:g.getSource();return i&&(e&&setVisibleFeatureById(i,e.id,!0),setVisibleFeatureById(i,selectSingleShipData.value.id,!1)),mapInstance$6.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!0),selectShipsLayer.value},setVisibleFeatureById=(t,e,n)=>{t&&t.forEachFeature(r=>{const i=r.get("data");i&&i.id===e&&r.setStyle(n?setShipStyle(!1,i.id):setBlankStyle())})},findShip=(t,e,n=!0)=>{var i,g,y,k,L;if(!t||!mapInstance$6.value)return;const r=(y=(g=(i=shipsLayer.value)==null?void 0:i.getSource())==null?void 0:g.getFeatures())==null?void 0:y.find($=>{var V;return((V=$.get("data"))==null?void 0:V.id)===t});if(r)selectedShipData.value=r.get("data");else if(e&&e.lon&&e.lat)selectedShipData.value=e;else{console.error("找不到船舶");return}if(selectedShips.value.some($=>{var V;return $.id===((V=selectedShipData.value)==null?void 0:V.id)})||selectedShips.value.push(selectedShipData.value),n&&((k=selectedShipData.value)!=null&&k.lon)&&((L=selectedShipData.value)!=null&&L.lat)){const $=mapInstance$6.value.getView(),V=new Point([selectedShipData.value.lon,selectedShipData.value.lat]);$.setCenter(transform(V.getCoordinates(),projection.data,projection.mercator));const z=$.getZoom(),j=z<mapZoom.findShipMin?mapZoom.findShip:z;$.setZoom(j)}return setTimeout(()=>{e&&selectSingleShipMarker(e)},50),r},clearSelectFeature=()=>{var t;if(selectedShipData.value&&shipsVectorSource&&selectSingleShipData.value){setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!1);const e=(t=shipsLayer.value)==null?void 0:t.getSource();e&&setVisibleFeatureById(e,selectSingleShipData.value.id,!0)}selectedShipData.value=null,selectedShips.value=[],mapInstance$6.value&&(selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),mapInstance$6.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!1))},hiddenAllShips=()=>{var t,e;(t=shipsLayer.value)==null||t.setVisible(!1),(e=largeAmountShipsLayer.value)==null||e.setVisible(!1),clearAllInterval()},switchBtnShow=vue.ref({[SWITCH_BTN.Camera]:!1,[SWITCH_BTN.Mobile]:!1,[SWITCH_BTN.WaterGauge]:!1}),switchFilterItem=(t,e)=>{switchBtnShow.value[t]=e,renderShips(allShips.value)},rerenderShip=()=>{renderShips(allShips.value)},clearShipData=(t=!0)=>{shipsVectorSource==null||shipsVectorSource.clear(),shipsMarkerList=[],t&&(selectShipsVectorSource==null||selectShipsVectorSource.clear())},labelAlpha=.8,pixelRatio=window.devicePixelRatio||1,labelFont=`500 ${12*pixelRatio}px Arial`,labelOutSize=2*pixelRatio,labelHeight=10*pixelRatio,fillRectRadius=(t,e,n,r,i,g,y=4)=>{t.beginPath(),t.moveTo(e+y,n),t.arcTo(e+r,n,e+r,n+y,y),t.arcTo(e+r,n+i,e+r-y,n+i,y),t.arcTo(e,n+i,e,n+i-y,y),t.arcTo(e,n,e+y,n,y),t.closePath(),t.fillStyle=g,t.fill()},getPixelFromCoordinate=t=>{if(!t||t.length===0)throw new Error("Points array is empty or invalid.");let e=1/0,n=1/0,r=-1/0,i=-1/0;for(const[g,y]of t)g<e&&(e=g),y<n&&(n=y),g>r&&(r=g),y>i&&(i=y);return[e,n,r,i]},calculatePolygonCentroid=t=>{if(!Array.isArray(t)||t.length<3)throw new Error("A polygon must have at least 3 coordinates.");let e=0,n=0,r=0;const i=t.length;for(let k=0;k<i-1;k++){const[L,$]=t[k],[V,z]=t[k+1],j=L*z-V*$;r+=j,e+=(L+V)*j,n+=($+z)*j}if(r*=.5,r===0)throw new Error("多边形面积为零");const g=e/(6*r),y=n/(6*r);return[g,y]},rotateShapeModel=(t,e)=>{const[n,r]=calculatePolygonCentroid(t),i=e*Math.PI/180,g=Math.cos(i),y=Math.sin(i);return t.map(([k,L])=>{const $=k-n,V=L-r,z=$*g-V*y+n,j=$*y+V*g+r;return[z,j]})},getTopLeftPoint=t=>[t[0],t[3]],getBottomLeftPoint=t=>[t[2],t[3]],getBottomRightPoint=t=>[t[2],t[1]],getTopRighttPoint=t=>[t[0],t[1]];function calculateBounds(t,e,n,r,i){let g,y,k,L;const $=t[0],V=t[1];switch(e){case 0:g=$+i,y=g+n,L=V-i,k=L-r;break;case 1:g=$+i,y=g+n,L=V+r/2,k=L-r;break;case 2:g=$+i,y=g+n,L=V+i+r,k=L-r;break;case 3:g=$-n/2,y=g+n,L=V+i+r,k=L-r;break;case 4:y=$,g=y-n,L=V+i+r,k=L-r;break;case 5:y=$-i,g=y-n,L=V+r/2,k=L-r;break;case 6:y=$,g=y-n,L=V-i,k=L-r;break;case 7:g=$-n/2,y=g+n,L=V-i,k=L-r}if(!(!g||!k||!y||!L))return[Math.min(g,y),Math.min(k,L),Math.max(g,y),Math.max(k,L)+1]}function calculateAnchorPoint(t,e,n=70,r=20,i=20){const g=[0,0];switch(e){case 0:g[0]=t[0]+i,g[1]=t[1]-i-r/2;break;case 1:g[0]=t[0]+i,g[1]=t[1];break;case 2:g[0]=t[0]+i,g[1]=t[1]+i+r/2;break;case 3:g[0]=t[0],g[1]=t[1]+i+r/4;break;case 4:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]+i+r/4;break;case 5:g[0]=t[0]-i,g[1]=t[1];break;case 6:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]-i-r/4;break;case 7:g[0]=t[0],g[1]=t[1]-i-r/4}return g}function drawLabelBody(t,e,n){if(!t)return;const{font:r,labelOutSize:i=2,labelHeight:g,center:y,text:k,id:L,leftIcon:$,shipColor:V,lineLength:z=20,selected:j}=n;t.save(),r&&(t.font=r);let oe=t.measureText(k).width+4*i;($||V)&&(oe+=g+6*i),t.restore();let re,ie=20,ae=-1,le=g+3*i;if(z)for(let de=0;de<8;de++){re=calculateBounds(y,de,oe,le,z);let pe=!1;for(let ue=0;ue<e.length;++ue){let he=e[ue].bounds,_e=[he[0]-ie,he[1]-ie,he[2]+ie,he[3]+ie];if(re&&isOverlapping(re,_e)){pe=!0;break}}if(!pe){ae=de;break}}else ae=0,re=calculateBounds(y,ae,oe,le,z);if(j&&ae===-1&&(ae=0),re&&ae>-1){let de=getBottomLeftPoint(re),pe=getTopRighttPoint(re);return{center:y,x:calculateAnchorPoint(y,ae,oe,le,z),l:pe,r:de,bounds:re,position:ae,name:k,id:L}}else return null}const drawText=(t,e)=>{if(!t)return;const{center:n,text:r,textColor:i,leftIcon:g,rightIcons:y,font:k}=e;t.save(),t.setTransform(1,0,0,1,0,0);let[L,$]=n;if(g){t.font=`${18*pixelRatio}px map-iconfont`;let V=getIconFont(g.icon);t.fillStyle=g.color,t.fillText(V,L+labelOutSize-3*pixelRatio,$+2.6*pixelRatio),L+=23*pixelRatio}if(y!=null&&y.length){t.font=`${12*pixelRatio}px map-iconfont`,t.fillStyle="#3370ff";const V=t.measureText(r).width+6*pixelRatio;y.forEach((z,j)=>{const oe=getIconFont(z),re=20*pixelRatio*j;t.fillText(oe,L+V+re,$)})}t.font=k||labelFont,t.fillStyle=i,t.fillText(r,L+2,$),t.restore()},drawPolygon=(t,e)=>{let{points:n,strokeColor:r,fillColor:i,shouldClosePath:g,translation:y,rotation:k,rotationCenter:L,scale:$,globalAlpha:V}=e;if(V||(V=1),n&&t){t.save(),t.beginPath(),k&&k!==0&&L==null&&t.rotate(k),y&&t.translate(y[0],y[1]),k&&(L!=null&&L.length)&&t.rotate(k),$&&t.scale($,$),t.moveTo(n[0][0],n[0][1]);for(let z=1;z<n.length;z++)t.lineTo(n[z][0],n[z][1]);g&&t.closePath(),r&&(t.strokeStyle=r,t.stroke()),i&&g&&(V&&(t.globalAlpha=V),t.fillStyle=i,t.fill()),t.restore()}},intervalIds={},drawLabel=(t,e,n,r)=>{var oe,re,ie,ae,le,de,pe;let{center:i,id:g,text:y,color:k,textColor:L,bgColor:$,leftIcon:V,rightIcons:z,type:j}=e;if(i&&y){const ue={font:labelFont,labelOutSize,labelHeight,center:i,text:y,id:g,leftIcon:V,selected:e.selected};(oe=e.blinkColors)!=null&&oe.length&&e.fill&&($=e.fill,L=getForegroundColor(e.fill));const he=drawLabelBody(t,n,ue);if(he){const{x:_e,bounds:Ce,l:xe}=he,Ie=[getTopLeftPoint(Ce),getBottomLeftPoint(Ce),getBottomRightPoint(Ce),getTopRighttPoint(Ce)];n.find($e=>$e.name===y)||n.push(he),drawPolygon(t,{points:[i,_e],strokeColor:k,fillColor:"#000",shouldClosePath:!0,translation:void 0,rotation:void 0,rotationCenter:void 0,scale:void 0,globalAlpha:labelAlpha}),z!=null&&z.length&&z.forEach(()=>{Ie[1][0]+=pixelRatio*18,Ie[2][0]+=pixelRatio*18});const Ve={points:Ie,strokeColor:k,fillColor:$,shouldClosePath:!0},[Ue,kt]=xe,Dt={center:[Ue,kt+labelOutSize+labelHeight+1],text:y,textColor:L,leftIcon:V,rightIcons:z,blinkColors:e.blinkColors};if(drawPolygon(t,Ve),drawText(t,Dt),e!=null&&e.blinkColors&&e.blinkColors.length>0){let $e=Date.now(),Fe=0;const ze=e.blinkColors;!!!((ae=(ie=(re=selectShipsLayer.value)==null?void 0:re.getSource())==null?void 0:ie.getFeatures())!=null&&ae.find(Ne=>{var Et;return((Et=Ne.get("data"))==null?void 0:Et.id)===e.id})||(pe=(de=(le=shipsLayer.value)==null?void 0:le.getSource())==null?void 0:de.getFeatures())!=null&&pe.find(Ne=>{var Et;return((Et=Ne.get("data"))==null?void 0:Et.id)===e.id}))||hiddenOrther.value?(clearInterval(intervalIds[e.id]),deleteLabelFromArray(n,e.id)):(intervalIds[e.id]&&clearInterval(intervalIds[e.id]),intervalIds[e.id]=window.setInterval(()=>{const Ne=Date.now();Ne-$e>=500&&(Fe=(Fe+1)%ze.length,$e=Ne,Ve.fillColor=ze[Fe],drawPolygon(t,Ve),Dt.textColor=getForegroundColor(Ve.fillColor),drawText(t,Dt)),checkBlinkLabelExist(r,n,e.id)},500))}else shipLabels.value.find(Fe=>Fe.name===y)&&(clearInterval(intervalIds[e.id]),drawPolygon(t,Ve),drawText(t,Dt))}}return null},checkBlinkLabelExist=(t,e,n)=>{var y,k,L,$,V,z,j;const r=shipsMarkerList==null?void 0:shipsMarkerList.some(oe=>{var re,ie,ae;return((re=oe.ship)==null?void 0:re.id)===n&&((ae=(ie=oe.ship)==null?void 0:ie.blinkColors)==null?void 0:ae.length)>0}),i=[...((k=(y=shipsLayer.value)==null?void 0:y.getSource())==null?void 0:k.getFeatures())||[],...(($=(L=selectShipsLayer.value)==null?void 0:L.getSource())==null?void 0:$.getFeatures())||[]].some(oe=>{const re=oe.get("data");if((re==null?void 0:re.id)===n){const ie=t==null?void 0:t.getView().calculateExtent();if(!ie)return!1;const ae=fromLonLat([re.lon,re.lat]);return ae[0]>=ie[0]&&ae[0]<=ie[2]&&ae[1]>=ie[1]&&ae[1]<=ie[3]}return!1}),g=(z=(V=trackLineVectorSource.value)==null?void 0:V.getFeatures())==null?void 0:z.some(oe=>{const re=oe.get("data");return(re==null?void 0:re.id)===n});(!((j=shipsLayer.value)!=null&&j.getVisible())||!g&&(!i||!r))&&(clearInterval(intervalIds[n]),deleteLabelFromArray(t,e,n))},clearAllInterval=()=>{Object.keys(intervalIds).forEach(t=>{clearInterval(t)})},deleteLabelFromArray=(t,e,n)=>{var i,g,y,k,L,$,V,z;const r=e.findIndex(j=>j.id===n);if(r!==-1){e.splice(r,1);const j=(g=(i=shipsLayer.value)==null?void 0:i.getSource())==null?void 0:g.getFeatures().find(re=>{var ie;return((ie=re.get("data"))==null?void 0:ie.id)===n});j&&((k=(y=shipsLayer.value)==null?void 0:y.getSource())==null||k.removeFeature(j));const oe=($=(L=selectShipsLayer.value)==null?void 0:L.getSource())==null?void 0:$.getFeatures().find(re=>{var ie;return((ie=re.get("data"))==null?void 0:ie.id)===n});oe&&((z=(V=selectShipsLayer.value)==null?void 0:V.getSource())==null||z.removeFeature(oe)),t&&t.render()}},PI=Math.PI,a=6378245,ee=.006693421622965943;function transformLat(t,e){let n=-100+2*t+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(e*PI)+40*Math.sin(e/3*PI))*2/3,n+=(160*Math.sin(e/12*PI)+320*Math.sin(e*PI/30))*2/3,n}function transformLng(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(t*PI)+40*Math.sin(t/3*PI))*2/3,n+=(150*Math.sin(t/12*PI)+300*Math.sin(t/30*PI))*2/3,n}function outOfChina(t,e){return!(t>73.66&&t<135.05&&e>3.86&&e<53.55)}function gcj02ToWgs84(t){const[e,n]=t.split(",").map(Number);if(outOfChina(e,n))return`${e.toFixed(6)}, ${n.toFixed(6)}`;{let r=transformLat(e-105,n-35),i=transformLng(e-105,n-35);const g=n/180*PI;let y=Math.sin(g);y=1-ee*y*y;const k=Math.sqrt(y);r=r*180/(a*(1-ee)/(y*k)*PI),i=i*180/(a/k*Math.cos(g)*PI);const L=n+r,$=e+i;return`${(e*2-$).toFixed(6)}, ${(n*2-L).toFixed(6)}`}}function calculateCirclePoints(t,e){const n=fromLonLat(t),r=e*1e3,i=[n[0]-r,n[1]-r,n[0]+r,n[1]+r],g=transformExtent(i,projection.mercator,projection.data);return{leftTopPoint:{lng:g[0],lat:g[3]},rightTopPoint:{lng:g[2],lat:g[3]},rightBottomPoint:{lng:g[2],lat:g[1]},leftBottomPoint:{lng:g[0],lat:g[1]}}}const equatorialCircumference=2003750834e-2;function lonLatToMercator(t){const e=t[0]*equatorialCircumference/180;let n=Math.log(Math.tan((90+t[1])*Math.PI/360))/(Math.PI/180);return n=n*equatorialCircumference/180,[e,n]}function mercatorToLonLat(t,e="lonlat"){const n={lon:0,lat:0},r=t[0]/equatorialCircumference*180;let i=t[1]/equatorialCircumference*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),n.lon=r,n.lat=i,e==="lonlat"?n:[r,i]}function calculateBoundingBox(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;t.forEach(ie=>{const[ae,le]=ie;e=Math.min(e,le),n=Math.max(n,le),r=Math.min(r,ae),i=Math.max(i,ae)});const g=i-r,y=n-e,k=Math.max(g,y),L=(r+i)/2,$=(e+n)/2,V=k/2,z=L-V,j=L+V,oe=$-V,re=$+V;return[j,oe,z,re]}const transformUtils={gcj02ToWgs84,calculateCirclePoints,lonLatToMercator,mercatorToLonLat,calculateBoundingBox,transform},mapInstance$5=vue.ref(),renderTrackStyleSetInstance=t=>mapInstance$5.value=t,stopIcon="&#xe6e2;",stopColor="#E31818",slowIcon="&#xe703;",slowColor="#1890FF",dropletsIcon="&#xe6d2",trackList$1=vue.ref([]);let animationFeature;const renderTrackLine=(t,e,n)=>{var y,k,L;const r=t[e];if(!r)return;allTracks.value[e]=r,trackList$1.value=[];let i=r;r.length>5e3?r.filter(($,V)=>V%5===0):r.length>4e3?r.filter(($,V)=>V%4===0):r.length>2e3&&r.filter(($,V)=>V%2===0),trackList$1.value=i.map(($,V)=>{if(Number($.lon)>180||Number($.lat)>180){const[z,j]=formatUtils.convertSixHundredThousandToLatLng($.lon,$.lat);$.lon=z,$.lat=j}return $.center=[$.lon,$.lat],$.centerPoint=transformUtils.lonLatToMercator($.center),$.id=e,$.index=V,$.time=hooks($.createdAt).format("YYYY-MM-DD HH:mm:ss"),$});const g=trackList$1.value.map($=>$.centerPoint);if(g.length>=2){const $=new LineString(g),V=new Feature({geometry:$});V.setStyle(new Style({stroke:new Stroke({color:n,width:2})})),V.setId(e),V.set("type","line"),(k=(y=shipTrackVectorLayer.value)==null?void 0:y.getSource())==null||k.clear(),shipTrackLineFeatures.value=[];const z=shipTrackLineFeatures.value.findIndex(oe=>oe.getId()===e);z>=0?shipTrackLineFeatures.value[z]=V:shipTrackLineFeatures.value.push(V);const j=createAnimatedIconFeature(n,g);trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),animationFeature=j,console.log(animationFeature),shipTrackVectorLayer.value=new VectorLayer({source:trackLineVectorSource.value,zIndex:102}),renderPoint(n),(L=mapInstance$5.value)==null||L.addLayer(shipTrackVectorLayer.value)}},handlePlay=(t,e)=>{const n=allTracks.value[String(t)];playAnimation(n.map(r=>[r.lon,r.lat]),e)},removeShipTrackLineFeatureByIndex=(t,e)=>{t>=0&&t<shipTrackLineFeatures.value.length&&(shipTrackLineFeatures.value.splice(t,1),delete allTracks.value[e]),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value&&shipTrackVectorLayer.value.setSource(trackLineVectorSource.value)},createAnimatedIconFeature=(t,e)=>{const n=new Feature({geometry:new Point(fromLonLat([e[0][0],e[0][1]]))}),r=new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:t})})});return n.setStyle(r),n},geoMarkerStyle=new Style({text:new Text({font:"700 20px map-iconfont",text:getIconFont("&#xe657;"),fill:new Fill({color:"#ff0000"}),rotation:0})});let polyline,linePath,startMarker,position,geoMarker,vectorLayer;const trackAnimating=vue.ref(!1);let distance=0,lastTime=Date.now(),moveFeatureHandler=null;const moveFeature=(t,e)=>{var z,j,oe;const n=Number(50*e),r=((z=t.frameState)==null?void 0:z.time)??Date.now(),i=r-lastTime;if(distance=(distance+n*i/1e6)%2,lastTime=r,distance>=1){stopAnimation();return}const g=linePath.getCoordinateAt(distance>1?2-distance:distance),y=linePath.getCoordinateAt(distance>1?distance-.01:distance),k=linePath.getCoordinateAt(distance>1?2-distance:distance+.01),$=getRotation(transformUtils.mercatorToLonLat(y,"array"),transformUtils.mercatorToLonLat(k,"array"))*Math.PI/180;(j=geoMarkerStyle.getText())==null||j.setRotation($),position.setCoordinates(g);const V=getVectorContext(t);V.context_.save(),V.setStyle(geoMarkerStyle),V.drawGeometry(position),V.context_.restore(),(oe=mapInstance$5.value)==null||oe.render()},startAnimation=()=>{var t;trackAnimating.value=!0,showTrackAnimatMarker.value=!0,lastTime=Date.now(),distance=0,position=((t=startMarker.getGeometry())==null?void 0:t.clone())||new Point([0,0]),moveFeatureHandler&&(vectorLayer==null||vectorLayer.on("postrender",moveFeatureHandler)),geoMarker==null||geoMarker.setGeometry(void 0)},stopAnimation=()=>{var t;trackAnimating.value&&(trackAnimating.value=!1,geoMarker==null||geoMarker.setGeometry(void 0),moveFeatureHandler&&vectorLayer&&vectorLayer.un("postrender",moveFeatureHandler),vectorLayer&&((t=mapInstance$5.value)==null||t.removeLayer(vectorLayer)),vectorLayer=null,geoMarker=null)},playAnimation=(t,e)=>{var r;trackAnimating.value&&stopAnimation(),polyline=new Polyline({factor:1e6}).writeGeometry(new LineString(t)),linePath=new Polyline({factor:1e6}).readGeometry(polyline,{dataProjection:projection.data,featureProjection:projection.mercator}),startMarker=new Feature({type:"icon",geometry:new Point(linePath.getFirstCoordinate())});const n=startMarker.getGeometry();position=n?n.clone():new Point([0,0]),geoMarker=new Feature({type:"geoMarker",style:geoMarkerStyle,geometry:position}),vectorLayer=new VectorLayer({source:new VectorSource({features:[geoMarker]})}),(r=mapInstance$5.value)==null||r.addLayer(vectorLayer),moveFeatureHandler=i=>moveFeature(i,e),startAnimation()},renderPoint=t=>{if(!mapInstance$5.value)return;const e=trackList$1.value||[];if(!(e&&e.length>1))return[];const n={16:24,17:15,default:4},r=[],i=e.length;for(let k=0;k<i;k++){e[k].index=k;const L=mapInstance$5.value.getPixelFromCoordinate(e[k].centerPoint);if(L){let $=L.concat(L);$=adjustBounds($,[20,20]);const V=mapInstance$5.value.getView().getZoom();if(!V)return;if(V>15){const j=n[V]||n.default;$=adjustBounds($,[j,j])}let z=!0;if(e[k].state!=="0"){for(let j=0;j<r.length;j++)if(isOverlapping($,r[j].bounds)){z=!1;break}}z&&(e[k].bounds=$,r.push(e[k]))}}const g=getIconStyle(stopIcon),y=getIconStyle(slowIcon);r.forEach((k,L)=>{var z,j;const $=new Feature({geometry:new Point(k.centerPoint)});$.set("type","track_point"),$.set("data",k),$.setStyle([new Style({image:new CircleStyle({stroke:new Stroke({color:"rgba(0, 0, 0, 0.01)",width:20}),radius:3})}),new Style({image:new CircleStyle({fill:new Fill({color:t}),stroke:new Stroke({color:"#fff",width:2}),radius:3})})]),trackLineVectorSource.value.addFeature($);const V=new Feature({geometry:new Point(fromLonLat(k.center))});if(V.set("type","track_label"),V.set("track_label_index",L),V.setStyle(setTrackLabelStyle(k,t)),trackLineVectorSource.value.addFeature(V),typeof k=="object"&&k.hasOwnProperty("state")){const oe=new Feature({geometry:new Point(k.centerPoint)});oe.set("type","track_icon");const re=new Style({text:new Text({font:"Normal 22px map-iconfont",text:getIconFont(dropletsIcon),offsetY:-10}),zIndex:99}),ie=[];Number(k.state)===0?((z=re.getText())==null||z.setFill(new Fill({color:stopColor})),ie.push(g)):Number(k.state)===1&&((j=re.getText())==null||j.setFill(new Fill({color:slowColor})),ie.push(y)),ie.push(re),oe.setStyle(ie),trackLineVectorSource.value.addFeature(oe)}}),renderArrow(r,t),renderIconPoint()},renderArrow=(t,e)=>{const n=t.length;n||(t.push(trackList$1.value[0]),t.push(trackList$1.value[trackList$1.value.length-1]));for(let r=0;r<n-1;r++){let i;const g=t[r],y=(t[r+1].index+g.index)/2;if(y%2===0)i=trackList$1.value[y].centerPoint;else{const k=trackList$1.value[Math.floor(y)],L=trackList$1.value[Math.ceil(y)];if(k&&L){const[$,V]=k.centerPoint,[z,j]=L.centerPoint;i=[($+z)/2,(V+j)/2]}}if(i){const k=new Feature({geometry:new Point(i)});k.set("type","track_arrow"),k.setStyle(new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:e}),rotation:getRotation(t[r].center,t[r+1].center)*(Math.PI/180)})})),trackLineVectorSource.value.addFeature(k)}}},renderIconPoint=()=>{const t="&#xe69b;",e="#fcdc3f",n="#ff0000";(trackList$1.value.length<2?[trackList$1.value[0]]:[trackList$1.value[0],trackList$1.value[trackList$1.value.length-1]]).forEach(i=>{const g=new Feature({geometry:new Point(i.centerPoint)});g.set("type","track_begin"),g.set("data",i);const y=i.index===0&&trackList$1.value.length>=2?e:n;g.setStyle(new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:y})}),zIndex:101})),trackLineVectorSource.value.addFeature(g)})},setTrackLabelStyle=(t,e)=>new Style({renderer:(n,r)=>{const i=r.context,k={id:t.id||"",center:n,text:t.time,color:e,textColor:"#000",bgColor:"rgba(255,255,255,.8)",selected:!0,type:"TrackTime"};drawLabel(i,k,trackLabels.value)}}),mapInstance$4=vue.ref(),renderCustomOverlaySetInstance=t=>mapInstance$4.value=t,drawCustomContent=(t,e,n,r="top-left",i=!1,g=!0)=>{var z,j;if(!e||!mapInstance$4.value)return;g&&document.querySelectorAll(".truck-custom-content").forEach(oe=>{var re;return(re=oe.parentNode)==null?void 0:re.removeChild(oe)});const y=document.createElement("div");y.innerHTML=n;const k=new Overlay({element:y,position:e,positioning:r,stopEvent:i});if(i){let oe=!1,re=[0,0],ie=[0,0],ae=0,le=0;y.addEventListener("mousedown",function(de){var ue;oe=!0,ae=de.clientX,le=de.clientY;const pe=(ue=mapInstance$4.value)==null?void 0:ue.getCoordinateFromPixel([de.clientX-200,de.clientY-200]);pe&&(re=pe),ie=[de.clientX-y.getBoundingClientRect().left+160,de.clientY-y.getBoundingClientRect().top+84],de.preventDefault(),console.log(t,ae,le)}),document.addEventListener("mousemove",function(de){var pe;if(oe){const ue=(pe=mapInstance$4.value)==null?void 0:pe.getCoordinateFromPixel([de.clientX-ie[0],de.clientY-ie[1]]),he=ue[0]-re[0],_e=ue[1]-re[1];k.setPosition([re[0]+he,re[1]+_e])}}),document.addEventListener("mouseup",function(){oe=!1})}(z=mapInstance$4.value)==null||z.addOverlay(k);const L=y.querySelector(".close-button");L&&L.addEventListener("click",()=>{var oe,re;(oe=mapInstance$4.value)==null||oe.removeOverlay(k),(re=y.parentNode)==null||re.removeChild(y)});const $=JSON.parse(JSON.stringify(e)),V=(j=mapInstance$4.value)==null?void 0:j.getCoordinateFromPixel($);return k.setPosition(V),k},mapInstance$3=vue.ref(),renderTrackSetInstance=t=>mapInstance$3.value=t,showTracks=vue.ref([]),trackList=vue.ref([]);vue.ref(null);const trackId=vue.ref(""),cursor=vue.ref(0),renderTrack=(t,e,n,r,i="ship")=>{var V;if(console.log(i),vue.nextTick(()=>{hiddenAllShips(),clearShipData(!1)}).then(z=>{}),(e==null?void 0:e.length)<2){((V=showTracks.value)==null?void 0:V.findIndex(z=>z.id===t))<0&&showTracks.value.push({id:t,length:""});return}const g={};e.forEach(z=>{z.state?z.state=Number(z.state):delete z.state}),trackId.value=t,g[t]=e,trackList.value=e;const y=["#ff0000","#00ff00","#0079ff","#ffa500","#800080","#008080","#ffc0cb","#800000","#000080","#808000"],k=g[t].map(z=>transform([z.lon,z.lat],projection.data,projection.mercator)),L=new LineString(k),$=formatUtils.formatLength(L,r)||"--";vue.nextTick(()=>{var j,oe;const z=(j=showTracks.value)==null?void 0:j.findIndex(re=>re.id===t);z<0?showTracks.value.push({id:t,length:$}):showTracks.value[z].length=$,++cursor.value,cursor.value>y.length&&(cursor.value=0),renderTrackLine(g,t,n),vue.nextTick(()=>{resetTrackView(t)}).then(()=>{}),(oe=mapInstance$3.value)==null||oe.on("moveend",()=>{showTrackLayer.value&&(trackLabels.value=[],renderTrackLine(g,t,n))}),renderTrackPointPopup()}).then(()=>{})},renderTrackPointPopup=()=>{var e;const t=vue.ref(null);(e=mapInstance$3.value)==null||e.on("pointermove",n=>{var i,g,y,k;t.value&&((i=mapInstance$3.value)==null||i.removeOverlay(t.value));const r=(g=mapInstance$3.value)==null?void 0:g.forEachFeatureAtPixel(n.pixel,L=>L);if(r){const L=r.get("data");if(!(L!=null&&L.time))return;let $="";L!=null&&L.stayTime&&($=`
655
+ }`;const $=`u_texture${g}`;let V="1.";"fill-color"in t&&(V=e.getFillColorExpression()),e.setFillColorExpression(`${V} * sampleFillPattern(${$}, ${y}, ${L}, ${k}, pxOrigin, pxPos)`)}}function parseLiteralStyle(t,e){const n=newCompilationContext(),r={...newCompilationContext(),inFragmentShader:!0,variables:n.variables},i=new ShaderBuilder,g={};if("icon-src"in t?parseIconProperties(t,i,g,n,r):"shape-points"in t?parseShapeProperties(t,i,g,n,r):"circle-radius"in t&&parseCircleProperties(t,i,g,n,r),parseStrokeProperties(t,i,g,n,r),parseFillProperties(t,i,g,n,r),t.filter){const L=expressionToGlsl(r,t.filter,BooleanType);i.setFragmentDiscardExpression(`!${L}`)}for(const L in r.variables){const $=r.variables[L],V=uniformNameForVariable($.name);let z=getGlslTypeFromType($.type);$.type===ColorType&&(z="vec4"),i.addUniform(`${z} ${V}`),g[V]=()=>{const j=e[$.name];return typeof j=="number"?j:typeof j=="boolean"?j?1:0:$.type===ColorType?asArray(j||"#eee"):typeof j=="string"?getStringNumberEquivalent(j):j}}for(const L in r.properties){const $=r.properties[L];n.properties[L]||(n.properties[L]=$);let V=getGlslTypeFromType($.type),z=`a_prop_${$.name}`;$.type===ColorType&&(V="vec4",z=`unpackColor(${z})`,i.addVertexShaderFunction(UNPACK_COLOR_FN)),i.addVarying(`v_prop_${$.name}`,V,z)}for(const L in n.properties){const $=n.properties[L];i.addAttribute(`${getGlslTypeFromType($.type)} a_prop_${$.name}`)}for(const L in n.functions)i.addVertexShaderFunction(n.functions[L]);for(const L in r.functions)i.addFragmentShaderFunction(r.functions[L]);const y={};for(const L in n.properties){const $=n.properties[L],V=z=>{const j=z.get($.name);return $.type===ColorType?packColor([...asArray(j||"#eee")]):typeof j=="string"?getStringNumberEquivalent(j):typeof j=="boolean"?j?1:0:j};y[`prop_${$.name}`]={size:getGlslSizeFromType($.type),callback:V}}function k(L,$,V,z){const j=n[L],oe=r[L];if(!j&&!oe)return;const re=getGlslTypeFromType(V),ie=getGlslSizeFromType(V);i.addAttribute(`${re} a_${$}`),oe&&i.addVarying(`v_${$}`,re,`a_${$}`),y[$]={size:ie,callback:z}}return k("geometryType",GEOMETRY_TYPE_PROPERTY_NAME,StringType,L=>getStringNumberEquivalent(computeGeometryType(L.getGeometry()))),k("featureId",FEATURE_ID_PROPERTY_NAME,StringType|NumberType,L=>{const $=L.getId()??null;return typeof $=="string"?getStringNumberEquivalent($):$}),{builder:i,attributes:y,uniforms:g}}class WebGLPointsLayer extends Layer{constructor(e){const n=Object.assign({},e);super(n),this.styleVariables_=e.variables||{},this.parseResult_=parseLiteralStyle(e.style,this.styleVariables_),this.hitDetectionDisabled_=!!e.disableHitDetection}createRenderer(){const e=Object.keys(this.parseResult_.attributes).map(n=>({name:n,...this.parseResult_.attributes[n]}));return new WebGLPointsLayerRenderer(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:e})}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}}var CAR_COLOR=(t=>(t[t.BLUE=1]="BLUE",t[t.YELLOW=2]="YELLOW",t[t.Y_GREEN=3]="Y_GREEN",t))(CAR_COLOR||{}),DEVICE_TYPE=(t=>(t[t.HOST=1]="HOST",t[t.TALK=2]="TALK",t[t.STORAGE=3]="STORAGE",t[t.INTERNET=4]="INTERNET",t[t.CAMERA=5]="CAMERA",t[t.LOAD=6]="LOAD",t))(DEVICE_TYPE||{}),LENGTH_UNIT=(t=>(t[t.M=1]="M",t[t.KM=2]="KM",t[t.NM=3]="NM",t))(LENGTH_UNIT||{}),SWITCH_BTN=(t=>(t.Camera="camera",t.Mobile="mobile",t.WaterGauge="waterGauge",t))(SWITCH_BTN||{}),SHIP_SAIL_STATUS=(t=>(t[t.发动机使用中=0]="发动机使用中",t[t.锚泊=1]="锚泊",t[t.未操作=2]="未操作",t[t.操纵能力受限=3]="操纵能力受限",t[t.吃水受限=4]="吃水受限",t[t.系泊=5]="系泊",t[t.搁浅=6]="搁浅",t[t.从事捕捞=7]="从事捕捞",t[t.航行中=8]="航行中",t[t.留作将来修正导航状态=9]="留作将来修正导航状态",t[t.高速船留用=10]="高速船留用",t[t.机动船尾推作业=11]="机动船尾推作业",t[t.机动船顶推或侧推作业=12]="机动船顶推或侧推作业",t[t.飞翼船留用=13]="飞翼船留用",t[t.现行的=14]="现行的",t[t.未定义=15]="未定义",t))(SHIP_SAIL_STATUS||{});class ShipMapData{constructor(e,n,r,i,g,y,k,L,$,V,z,j,oe,re,ie,ae,le,de,pe,ue,he,_e,Ce,xe){qn(this,"id");qn(this,"mmsi");qn(this,"fill");qn(this,"shipType");qn(this,"name");qn(this,"length");qn(this,"breadth");qn(this,"lon");qn(this,"lat");qn(this,"createdAt");qn(this,"speed");qn(this,"from");qn(this,"sailStatus");qn(this,"hdg");qn(this,"cog");qn(this,"posType");qn(this,"type");qn(this,"angle");qn(this,"leftIconColor");qn(this,"existDevice");qn(this,"existMobile");qn(this,"existWaterGauge");qn(this,"selected");qn(this,"blinkColors");this.id=e,this.mmsi=n,this.fill=r,this.shipType=i,this.name=g,this.length=y,this.breadth=k,this.lon=L,this.lat=$,this.createdAt=V,this.speed=z,this.from=j,this.sailStatus=oe,this.hdg=re,this.cog=ie,this.posType=ae,this.type=le,this.angle=de,this.leftIconColor=pe,this.existDevice=ue,this.existMobile=he,this.existWaterGauge=_e,this.selected=Ce,this.blinkColors=xe}}const formatLength=function(t,e){const r=getLength(t);let i="";switch(e){case LENGTH_UNIT.M:i=Math.round(r*100)/100+" m";break;case LENGTH_UNIT.KM:i=Math.round(r/1e3*100)/100+" km";break;case LENGTH_UNIT.NM:i=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return i},convertSixHundredThousandToLatLng=function(t,e){const n=Number(e)/6e5;return[Number(t)/6e5,n]},formatArea=(t,e)=>{const r=getArea(t);let i;switch(e){case LENGTH_UNIT.KM:r>1e4?i=Math.round(r/1e6*100)/100+" km<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break;case LENGTH_UNIT.NM:const g=Math.pow(1.852,2);r>1e4?i=Math.round(r/1e6/g*100)/100+" nm<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break}return i},convertShipMapData=t=>{const e=n=>new ShipMapData(n.id,n.id,n.fill||"#04C900","70",(n.cnname||n.enname||n.name||n.id)+`${n.existName?n.existName:""}`,n.len||n.length,n.wid||n.breadth,n.lon,n.lat,new Date().getTime(),n.spd,n.from,n.status,Number(n.hdg),n.cog,Number(n.postype),"other",n.cog,n.leftIconColor,n.existDevice,n.existMobile,n.existWaterGauge,n.selected,n.blinkColors);return Array.isArray(t)?t.map(n=>e(n)):e(t)},formatUtils={formatLength,convertSixHundredThousandToLatLng,formatArea},mapInstance$9=vue.ref(),shipsLayer=vue.ref(),largeAmountShipsLayer=vue.ref(),selectShipsLayer=vue.ref(),allShips=vue.ref([]),selectSingleShipData=vue.ref();vue.ref();const trucksLayer=vue.ref(),shipTrackLineFeatures=vue.ref([]),trackLineVectorSource=vue.ref(),shipTrackVectorLayer=vue.ref();vue.ref(),vue.ref();const shipLabels=vue.ref([]),trackLabels=vue.ref([]),showTrackLayer=vue.ref(!1),allTracks=vue.ref([]),currentTrackId=vue.ref(""),showTrackAnimatMarker=vue.ref(!1),hiddenOrther=vue.ref(!1),showDrawLayer=vue.ref(!1),_hoisted_1$a={key:0,class:"measure-panel"},_hoisted_2$6={class:"d-flex justify-content-between align-content-start w-100"},_hoisted_3$5={class:"measure-history-list"},_hoisted_4$2={class:"left-panel"},_hoisted_5$2={class:"text index"},_hoisted_6$2={class:"text"},_hoisted_7$2=["onClick"],_sfc_main$c=vue.defineComponent({__name:"measure",props:vue.mergeModels({viewMode:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:vue.mergeModels(["close"],["update:visible"]),setup(t,{expose:e,emit:n}){const r=vue.inject("mapInstance"),i=n,g=vue.useModel(t,"visible"),y=vue.ref("3"),k=vue.ref([]),L=vue.ref(!1),$=new VectorSource;let V,z,j,oe,re;const ie=new VectorLayer({source:$,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),ae=function(Ve){if(Ve.dragging)return;let Ue="点击选择起点";V&&(Ue="单击继续,双击结束"),z&&(z.innerHTML=Ue,j.setPosition(Ve.coordinate),z.classList.remove("hidden"))},le=()=>{var Ve,Ue;r!=null&&r.value&&((Ve=r==null?void 0:r.value)==null||Ve.on("pointermove",ae),(Ue=r==null?void 0:r.value)==null||Ue.getViewport().addEventListener("mouseout",function(){var kt;(kt=z==null?void 0:z.classList)==null||kt.add("hidden")}),L.value=!0)};let de;const pe=new Style({fill:new Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Stroke({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new CircleStyle({radius:5,stroke:new Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new Fill({color:"rgba(255, 255, 255, 0.2)"})})});function ue(){var Ve,Ue;if(r!=null&&r.value){if(showDrawLayer.value=!1,k.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(kt=>{var Dt;(Dt=kt==null?void 0:kt.parentNode)==null||Dt.removeChild(kt)}),$.clear(),de){const kt=r.value.getInteractions().getArray().find(Dt=>getUid(Dt)===getUid(de));kt&&((Ve=r.value)==null||Ve.removeInteraction(kt))}(Ue=r.value)==null||Ue.removeLayer(ie),z!=null&&z.parentNode&&z.parentNode.removeChild(z),oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe)}}function he(){var Ue,kt;ue(),(Ue=r==null?void 0:r.value)==null||Ue.addLayer(ie),showDrawLayer.value=!0,de=new Draw({source:$,type:"LineString",style:function(){return pe},condition:function(Dt){return Dt.originalEvent.target.tagName!=="DIV"}}),(kt=r==null?void 0:r.value)==null||kt.addInteraction(de),Ce(),_e();let Ve;de.on("drawstart",function(Dt){var Fe;V=Dt.feature,V.set("randomId",Oe());let $e;Ve=(Fe=V.getGeometry())==null?void 0:Fe.on("change",function(ze){const qe=ze.target;let Ne=formatUtils.formatLength(qe,Number(y.value));$e=qe.getLastCoordinate(),oe&&Ne&&(oe.innerHTML=Ne),re.setPosition($e)})}),de.on("drawend",function(){var Dt;if(oe&&(oe.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),oe!=null&&oe.innerHTML){const $e=(V==null?void 0:V.get("randomId"))||Oe();k.value.push({id:$e,value:oe==null?void 0:oe.innerHTML}),oe.innerHTML=`${oe.innerHTML}<div class="ol-tooltip-delete-button" data-id="${$e}"><i class="map-iconfont icon-delete"></i></div>`}(Dt=document.querySelector(".ol-selectable:has(.ol-tooltip-delete-button):last-child .ol-tooltip-delete-button"))==null||Dt.addEventListener("click",$e=>{var ze;$e.preventDefault(),$e.stopPropagation();const Fe=(ze=$e.target)==null?void 0:ze.getAttribute("data-id");Fe&&xe(Fe)}),re.setOffset([0,-7]),V=null,oe=null,Ce(),Ve&&unByKey(Ve)})}function _e(){var Ve;z!=null&&z.parentNode&&z.parentNode.removeChild(z),z=document.createElement("div"),z.className="ol-tooltip hidden",j=new Overlay({element:z,offset:[15,0],positioning:"center-left"}),(Ve=r==null?void 0:r.value)==null||Ve.addOverlay(j)}function Ce(){var Ve;oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe),oe=document.createElement("div"),oe.className="ol-tooltip ol-tooltip-measure",re=new Overlay({element:oe,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(Ve=r==null?void 0:r.value)==null||Ve.addOverlay(re)}const xe=Ve=>{var kt,Dt;const Ue=k.value.findIndex($e=>$e.id===Ve);if(Ue!==-1){k.value.splice(Ue,1);const $e=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");$e[Ue]&&((Dt=(kt=$e[Ue])==null?void 0:kt.parentNode)==null||Dt.removeChild($e[Ue]));const Fe=$.getFeatures();Fe[Ue]&&$.removeFeature(Fe[Ue])}},Ie=()=>{i("close")},Oe=()=>Math.random().toString(36).substring(2,9);return vue.watch(()=>g,()=>{g.value&&!L.value&&(le(),he())},{deep:!0,immediate:!0}),e({addInteraction:he,removeInteraction:ue}),(Ve,Ue)=>g.value&&Ve.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.createElementVNode("div",{class:"header"},[Ue[1]||(Ue[1]=vue.createElementVNode("div",{class:"title"},"测量",-1)),vue.createElementVNode("i",{onClick:Ie,class:"map-iconfont icon-close"})]),vue.createElementVNode("div",_hoisted_2$6,[Ue[2]||(Ue[2]=vue.createElementVNode("div",{class:"tips"},"在地图上点击多个点测量距离,距离单位",-1)),vue.createVNode(vue.unref(ElSelect),{class:"select-length-unit",modelValue:y.value,"onUpdate:modelValue":Ue[0]||(Ue[0]=kt=>y.value=kt)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{label:"m",value:"1"}),vue.createVNode(vue.unref(ElOption),{label:"km",value:"2"}),vue.createVNode(vue.unref(ElOption),{label:"nm",value:"3"})]),_:1},8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$5,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.value,(kt,Dt)=>(vue.openBlock(),vue.createElementBlock("div",{class:"measure-history-item",key:kt.id},[vue.createElementVNode("div",_hoisted_4$2,[Ue[3]||(Ue[3]=vue.createElementVNode("i",{class:"map-iconfont icon-line"},null,-1)),vue.createElementVNode("span",_hoisted_5$2,"线段"+vue.toDisplayString(Dt+1),1),vue.createElementVNode("span",_hoisted_6$2,vue.toDisplayString(kt.value),1)]),vue.createElementVNode("div",{class:"delete-button",onClick:$e=>xe(kt.id)},Ue[4]||(Ue[4]=[vue.createElementVNode("i",{class:"map-iconfont icon-delete"},null,-1)]),8,_hoisted_7$2)]))),128))])])):vue.createCommentVNode("",!0)}}),Measure=_export_sfc(_sfc_main$c,[["__scopeId","data-v-3277433d"]]),mapInstance$8=vue.ref(),renderMarkerSetInstance=t=>mapInstance$8.value=t,markerPosition=vue.ref(""),marker=vue.ref(),createIconStyle=t=>new Style({image:new Icon({src:CDN_URL+"map/poi-marker-default.png",anchor:[.5,1]}),text:new Text({text:t,offsetY:-90,font:"12px",fill:new Fill({color:"#000"}),stroke:new Stroke({color:"#fff",width:2}),backgroundFill:new Fill({color:"#fff"}),backgroundStroke:new Stroke({color:"#000",width:1}),padding:[2,2,2,2]})}),renderMarker=(t,e=!0,n=!0)=>{var V;if(!mapInstance$8.value||!t||t.split(",").length!==2)return;const[r,i]=t.split(",").map(Number);marker.value=new Feature({geometry:new Point(fromLonLat([r,i]))});const g=n?`${r}, ${i}`:"";(V=marker.value)==null||V.setStyle(createIconStyle(g));const y=new VectorSource({features:[marker.value]}),k=new VectorLayer({source:y}),L=mapInstance$8.value.getView();if(mapInstance$8.value.addLayer(k),e){const z=new Translate({layers:[k]});z.on("translating",function(j){var ie;const oe=j.features.item(0).getGeometry().getCoordinates(),re=toLonLat(oe);markerPosition.value=`${re[0].toFixed(6)}, ${re[1].toFixed(6)}`,(ie=marker.value)==null||ie.setStyle(createIconStyle(markerPosition.value))}),mapInstance$8.value.addInteraction(z)}const $=new Point([r,i]);L.setCenter(transform($.getCoordinates(),projection.data,projection.mercator)),L.setZoom(mapZoom.findShip)},setMarkerPosition=t=>{var i,g;if(!mapInstance$8.value)return;const e=mapInstance$8.value.getView(),n=t.split(",").map(Number);(g=(i=marker.value)==null?void 0:i.getGeometry())==null||g.setCoordinates(fromLonLat([n[0],n[1]]));const r=new Point([n[0],n[1]]);e.setCenter(transform(r.getCoordinates(),projection.data,projection.mercator)),e.setZoom(mapZoom.markerPosition)},CDN_URL="https://static.zhihaoscm.cn/",tiandituKey="a6e8f78974f2581f2ca00485b40c948f",zhongkeKey="15c81cc0a191a232e0a0ca1a51c3ca81",baseMap={tiandituTile:`https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituTileMark:`https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTile:`https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTileMark:`https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,greenTile:`${CDN_URL}/map/tile/{z}/{x}/{y}.png`},mapZoom={default:6,min:3,max:18,findShipMin:10,findShip:13,findTruck:14,shipGreenDotMax:11,truckDefault:14,truckStatistics:8,shipModelMin:13,shipModelMax:18,markerPosition:14},renderShipsLimit=200,mapDefaultCenter=[114.84,30.52],projection={data:"EPSG:4326",mercator:"EPSG:3857"},LOG_DATE_FORMAT="YYYY-MM-DD HH:mm:ss",DEFAULT_VALUE="--";function getIconFont(unicode=""){return unicode.indexOf("&amp;")!==-1&&(unicode=unicode.replace("&amp;","&")),unicode.indexOf("&amp")!==-1&&(unicode=unicode.replace("&amp","&")),eval('("'+unicode.replace("&#x","\\u").replace(";","")+'")')}const multiplyPixelRatio=t=>{const e=window.devicePixelRatio||1;return t.map(n=>n.map(r=>r*e))},adjustBounds=(t,e)=>e.length===2?[t[0]-e[0],t[1]-e[1],t[2]+e[0],t[3]+e[1]]:[t[0]+e[0],t[1]+e[1],t[2]+e[2],t[3]+e[3]],isOverlapping=(t,e)=>t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1],getIconStyle=t=>new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:"#fff"}),offsetY:-14}),zIndex:100}),getRotation=(t,e,n)=>{function r(z){return 180*(z%(2*Math.PI))/Math.PI}function i(z){return z%360*Math.PI/180}function g(z){if(!z)throw new Error("Coordinate is required");if(!Array.isArray(z)){if(z.type==="Feature"&&z.geometry!==null&&z.geometry.type==="Point")return z.geometry.coordinates;if(z.type==="Point")return z.coordinates}if(Array.isArray(z)&&z.length>=2&&!Array.isArray(z[0])&&!Array.isArray(z[1]))return z;throw new Error("Coordinate must be GeoJSON Point or an Array of numbers")}function y(z,j,oe={}){if(oe.final)return function(_e,Ce){return(y(Ce,_e)+180)%360}(z,j);const re=g(z),ie=g(j),ae=i(re[0]),le=i(ie[0]),de=i(re[1]),pe=i(ie[1]),ue=Math.sin(le-ae)*Math.cos(pe),he=Math.cos(de)*Math.sin(pe)-Math.sin(de)*Math.cos(pe)*Math.cos(le-ae);return r(Math.atan2(ue,he))}function k(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function L(z,j={},oe={}){return z||console.log("Coordinates are required"),Array.isArray(z)||console.log("Coordinates must be an Array"),z.length<2&&console.log("Coordinates must be at least 2 numbers long"),(!k(z[0])||!k(z[1]))&&console.log("Coordinates must contain numbers"),$({type:"Point",coordinates:z},j,oe)}function $(z,j={},oe={}){const re={type:"Feature"};return oe.id!==void 0&&(re.id=oe.id),oe.bbox&&(re.bbox=oe.bbox),re.properties=j||{},re.geometry=z,re}const V=y(L(t),L(e),n);return V<0?360+V:V},triangleModel=multiplyPixelRatio([[0,-8],[5,8],[-5,8]]),shipShapeModel=multiplyPixelRatio([[0,-4.545],[-.56,-3.909],[-1,-2.727],[-1,3.636],[-.8,4.545],[.8,4.545],[1,3.636],[1,-2.727],[.56,-3.909],[0,-4.545]]),shipDirectPath={left:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},right:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},front:{0:[[0,0],[0,-8]],1:[[0,0],[0,-16]],2:[[0,0],[0,-24]]}},setBlankStyle=()=>new Style({image:new CircleStyle({radius:0})}),isMapMoving=vue.ref(!1),mapInstance$7=vue.ref(),renderShipStyleSetInstance=t=>{mapInstance$7.value=t,t.on("movestart",()=>{isMapMoving.value=!0}),t.on("moveend",()=>{isMapMoving.value=!1,t.render()})},speedCondition=[[1,10],[10,20],[20,1/0]],drawShipModelByZoom={14:[200,30],15:[115,15],16:[55,8],17:[25,5],18:[1,1]},setShipStyle=(t,e=!1)=>new Style({renderer:(n,r)=>{var k,L;n=n;const i=r.context,g=r.feature.get("data");if(!g)return;const y=r.feature.get("index");(y===0||y===void 0)&&(shipLabels.value=[]);try{const $=drawShipBody(i,g,n,e);$&&(drawHeading(i,g,$,e),g.selected=t,!isMapMoving.value&&t&&(drawSelectBounds(i,$),(L=(k=trackLineVectorSource.value)==null?void 0:k.getFeatures())!=null&&L.some(z=>{const j=z.get("data");return(j==null?void 0:j.id)===g.id})||setTimeout(()=>{drawSelectBounds(i,$)},1))),drawShipLabel(i,g,n),t&&setTimeout(()=>{drawShipLabel(i,g,n)},1)}catch{return!1}}}),drawShipBody=(t,e,n,r)=>{if(!mapInstance$7.value)return;const i=Math.round(Number(mapInstance$7.value.getView().getZoom()));if(!i)return;let g=[];const[y,k]=drawShipModelByZoom[i]||[0,0],[L,$]=n;if(i<=mapZoom.shipModelMax&&i>mapZoom.shipModelMin&&e.length>=y&&e.breadth>=k)g=rotateShapeModel(drawCurrentShipShapeModel(e,i),e.angle).map(z=>{const[j,oe]=z;return[L+j,$+oe]});else{const V=rotateShapeModel(triangleModel,e.angle);n.length===2&&(g=V.map(z=>{const[j,oe]=z;return[L+j,$+oe]}))}if(!(g.length>2))return!1;if(e!=null&&e.length){const V=g.length===3?30:e.length*.4;t.beginPath(),t.arc(n[0],n[1],V,0,2*Math.PI),t.fillStyle="rgba(255, 255, 255, 0.001)",t.fill()}t.save(),t.beginPath(),t.moveTo(g[0][0],g[0][1]);for(let V=1;V<g.length;V++)t.lineTo(g[V][0],g[V][1]);return t.closePath(),t.strokeStyle=r?"#ff0000":"#000",t.lineWidth=r?2:1,t.stroke(),t.fillStyle=e.fill,t.fill(),t.restore(),g},drawHeading=(t,e,n,r)=>{const[i,g]=n[0],y=getShipDirectPath(e);if(y){const k=y.map(function(L){const[$,V]=L;return[$+i,V+g]});if(t.save(),t.beginPath(),e.angle>0){t.translate(i,g);const L=e.angle*Math.PI/180;t.rotate(L),t.translate(-i,-g)}t.moveTo(i,g);for(let L=1;L<k.length;L++){const[$,V]=k[L];t.lineTo($,V)}t.strokeStyle=r?"#ff0000":"#000",t.lineWidth=r?2:1,t.stroke(),t.restore()}},drawSelectBounds=(t,e)=>{let[n,r,i,g]=getPixelFromCoordinate(e);const y=window.devicePixelRatio||1,k=4;n-=k,r-=k,i+=k,g+=k,t.save(),t.strokeStyle="#ff0000",t.lineWidth=4*y;const L=8*y;t.beginPath(),t.moveTo(n+L,g),t.lineTo(n,g),t.lineTo(n,g-L),t.moveTo(n,r+L),t.lineTo(n,r),t.lineTo(n+L,r),t.moveTo(i-L,r),t.lineTo(i,r),t.lineTo(i,r+L),t.moveTo(i,g-L),t.lineTo(i,g),t.lineTo(i-L,g),t.stroke(),t.restore()},drawShipLabel=(t,e,n)=>{if(!e.selected&&shipLabels.value.find(z=>z.id===e.id))return;const[r,i]=n,g=r,y=i,k=e.name;let L;e.leftIconColor&&(L={color:e.leftIconColor,icon:"&#xe599;"});const $=getShipCustomIcon(e),V={id:e.id,center:[g,y],text:k,fill:e.fill,color:"#fff",textColor:"#000",bgColor:"#fff",leftIcon:L,rightIcons:$,selected:e.selected,blinkColors:e.blinkColors,type:"ShipName"};mapInstance$7.value&&drawLabel(t,V,shipLabels.value,mapInstance$7.value)},drawCurrentShipShapeModel=(t,e)=>{let n=0;e<=14?n=.058:e===15?n=.12:e===16?n=.22:e===17?n=.435:e===18&&(n=.857);const r=t.length/4*n,i=t.breadth*n;let g=cloneDeep(shipShapeModel);return g=g.map(([y,k])=>[y*i,k*r]),g},getShipDirectPath=t=>{const{speed:e,hdg:n,cog:r}=t;let i="",g=null;if(e&&e>1&&(n!==null&&n!=511&&r!==null?r-n>=3?i="left":r-n<=-3?i="right":i="front":i="front",i&&e))for(let y=0;y<speedCondition.length;y++){const k=speedCondition[y];if(e>=k[0]&&e<k[1]){g=shipDirectPath[i][y];break}}return g},getShipCustomIcon=t=>{const e=[];return t.existDevice&&e.push("&#xe687;"),t.existMobile&&e.push("&#xe688;"),t.existWaterGauge&&e.push("&#xe686;"),e||[]};class FeatureFormat{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Feature,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let r=n.dataProjection?get$1(n.dataProjection):this.readProjection(e);n.extent&&r&&r.getUnits()==="tile-pixels"&&(r=get$1(r),r.setWorldExtent(n.extent)),n={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return abstract()}readFeature(e,n){return abstract()}readFeatures(e,n){return abstract()}readGeometry(e,n){return abstract()}readProjection(e){return abstract()}writeFeature(e,n){return abstract()}writeFeatures(e,n){return abstract()}writeGeometry(e,n){return abstract()}}function transformGeometryWithOptions(t,e,n){const r=n?get$1(n.featureProjection):null,i=n?get$1(n.dataProjection):null;let g=t;if(r&&i&&!equivalent(r,i)){e&&(g=t.clone());const y=e?r:i,k=e?i:r;y.getUnits()==="tile-pixels"?g.transform(y,k):g.applyTransform(getTransform(y,k))}if(e&&n&&n.decimals!==void 0){const y=Math.pow(10,n.decimals),k=function(L){for(let $=0,V=L.length;$<V;++$)L[$]=Math.round(L[$]*y)/y;return L};g===t&&(g=t.clone()),g.applyTransform(k)}return g}const GeometryConstructor={Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon};function orientFlatCoordinates(t,e,n){return Array.isArray(e[0])?(linearRingssAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRingsArray(t,0,e,n)),t):(linearRingsAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRings(t,0,e,n)),t)}function createRenderFeature(t,e){var g;const n=t.geometry;if(!n)return[];if(Array.isArray(n))return n.map(y=>createRenderFeature({...t,geometry:y})).flat();const r=n.type==="MultiPolygon"?"Polygon":n.type;if(r==="GeometryCollection"||r==="Circle")throw new Error("Unsupported geometry type: "+r);const i=n.layout.length;return transformGeometryWithOptions(new RenderFeature(r,r==="Polygon"?orientFlatCoordinates(n.flatCoordinates,n.ends,i):n.flatCoordinates,(g=n.ends)==null?void 0:g.flat(),i,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function createGeometry(t,e){if(!t)return null;if(Array.isArray(t)){const r=t.map(i=>createGeometry(i,e));return new GeometryCollection(r)}const n=GeometryConstructor[t.type];return transformGeometryWithOptions(new n(t.flatCoordinates,t.layout,t.ends),!1,e)}class JSONFeature extends FeatureFormat{constructor(){super()}getType(){return"json"}readFeature(e,n){return this.readFeatureFromObject(getObject(e),this.getReadOptions(e,n))}readFeatures(e,n){return this.readFeaturesFromObject(getObject(e),this.getReadOptions(e,n))}readFeatureFromObject(e,n){return abstract()}readFeaturesFromObject(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromObject(getObject(e),this.getReadOptions(e,n))}readGeometryFromObject(e,n){return abstract()}readProjection(e){return this.readProjectionFromObject(getObject(e))}readProjectionFromObject(e){return abstract()}writeFeature(e,n){return JSON.stringify(this.writeFeatureObject(e,n))}writeFeatureObject(e,n){return abstract()}writeFeatures(e,n){return JSON.stringify(this.writeFeaturesObject(e,n))}writeFeaturesObject(e,n){return abstract()}writeGeometry(e,n){return JSON.stringify(this.writeGeometryObject(e,n))}writeGeometryObject(e,n){return abstract()}}function getObject(t){if(typeof t=="string"){const e=JSON.parse(t);return e||null}return t!==null?t:null}class GeoJSON extends JSONFeature{constructor(e){e=e||{},super(),this.dataProjection=get$1(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=get$1(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,n){let r=null;e.type==="Feature"?r=e:r={type:"Feature",geometry:e,properties:null};const i=readGeometryInternal(r.geometry);if(this.featureClass===RenderFeature)return createRenderFeature({geometry:i,id:r.id,properties:r.properties},n);const g=new Feature;return this.geometryName_?g.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&g.setGeometryName(r.geometry_name),g.setGeometry(createGeometry(i,n)),"id"in r&&g.setId(r.id),r.properties&&g.setProperties(r.properties,!0),g}readFeaturesFromObject(e,n){const r=e;let i=null;if(r.type==="FeatureCollection"){const g=e;i=[];const y=g.features;for(let k=0,L=y.length;k<L;++k){const $=this.readFeatureFromObject(y[k],n);$&&i.push($)}}else i=[this.readFeatureFromObject(e,n)];return i.flat()}readGeometryFromObject(e,n){return readGeometry(e,n)}readProjectionFromObject(e){const n=e.crs;let r;if(n)if(n.type=="name")r=get$1(n.properties.name);else if(n.type==="EPSG")r=get$1("EPSG:"+n.properties.code);else throw new Error("Unknown SRS type");else r=this.dataProjection;return r}writeFeatureObject(e,n){n=this.adaptOptions(n);const r={type:"Feature",geometry:null,properties:null},i=e.getId();if(i!==void 0&&(r.id=i),!e.hasProperties())return r;const g=e.getProperties(),y=e.getGeometry();return y&&(r.geometry=writeGeometry(y,n),delete g[e.getGeometryName()]),isEmpty$1(g)||(r.properties=g),r}writeFeaturesObject(e,n){n=this.adaptOptions(n);const r=[];for(let i=0,g=e.length;i<g;++i)r.push(this.writeFeatureObject(e[i],n));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,n){return writeGeometry(e,this.adaptOptions(n))}}function readGeometryInternal(t,e){if(!t)return null;let n;switch(t.type){case"Point":{n=readPointGeometry(t);break}case"LineString":{n=readLineStringGeometry(t);break}case"Polygon":{n=readPolygonGeometry(t);break}case"MultiPoint":{n=readMultiPointGeometry(t);break}case"MultiLineString":{n=readMultiLineStringGeometry(t);break}case"MultiPolygon":{n=readMultiPolygonGeometry(t);break}case"GeometryCollection":{n=readGeometryCollectionGeometry(t);break}default:throw new Error("Unsupported GeoJSON type: "+t.type)}return n}function readGeometry(t,e){const n=readGeometryInternal(t);return createGeometry(n,e)}function readGeometryCollectionGeometry(t,e){return t.geometries.map(function(r){return readGeometryInternal(r)})}function readPointGeometry(t){const e=t.coordinates;return{type:"Point",flatCoordinates:e,layout:getLayoutForStride(e.length)}}function readLineStringGeometry(t){var r;const e=t.coordinates,n=e.flat();return{type:"LineString",flatCoordinates:n,ends:[n.length],layout:getLayoutForStride(((r=e[0])==null?void 0:r.length)||2)}}function readMultiLineStringGeometry(t){var g,y;const e=t.coordinates,n=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length)||2,r=[],i=deflateCoordinatesArray(r,0,e,n);return{type:"MultiLineString",flatCoordinates:r,ends:i,layout:getLayoutForStride(n)}}function readMultiPointGeometry(t){var n;const e=t.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:getLayoutForStride(((n=e[0])==null?void 0:n.length)||2)}}function readMultiPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y[0].length)||2,i=deflateMultiCoordinatesArray(n,0,e,r);return{type:"MultiPolygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function readPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=(y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length,i=deflateCoordinatesArray(n,0,e,r);return{type:"Polygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function writeGeometry(t,e){t=transformGeometryWithOptions(t,!0,e);const n=t.getType();let r;switch(n){case"Point":{r=writePointGeometry(t);break}case"LineString":{r=writeLineStringGeometry(t);break}case"Polygon":{r=writePolygonGeometry(t,e);break}case"MultiPoint":{r=writeMultiPointGeometry(t);break}case"MultiLineString":{r=writeMultiLineStringGeometry(t);break}case"MultiPolygon":{r=writeMultiPolygonGeometry(t,e);break}case"GeometryCollection":{r=writeGeometryCollectionGeometry(t,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+n)}return r}function writeGeometryCollectionGeometry(t,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(r){return writeGeometry(r,e)})}}function writeLineStringGeometry(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}function writeMultiLineStringGeometry(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}function writeMultiPointGeometry(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}function writeMultiPolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}function writePointGeometry(t,e){return{type:"Point",coordinates:t.getCoordinates()}}function writePolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(n)}}class TextFeature extends FeatureFormat{constructor(){super()}getType(){return"text"}readFeature(e,n){return this.readFeatureFromText(getText(e),this.adaptOptions(n))}readFeatureFromText(e,n){return abstract()}readFeatures(e,n){return this.readFeaturesFromText(getText(e),this.adaptOptions(n))}readFeaturesFromText(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromText(getText(e),this.adaptOptions(n))}readGeometryFromText(e,n){return abstract()}readProjection(e){return this.readProjectionFromText(getText(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,n){return this.writeFeatureText(e,this.adaptOptions(n))}writeFeatureText(e,n){return abstract()}writeFeatures(e,n){return this.writeFeaturesText(e,this.adaptOptions(n))}writeFeaturesText(e,n){return abstract()}writeGeometry(e,n){return this.writeGeometryText(e,this.adaptOptions(n))}writeGeometryText(e,n){return abstract()}}function getText(t){return typeof t=="string"?t:""}function flipXY(t,e,n,r,i,g){i!==void 0?(i=i,g=g!==void 0?g:0):(i=[],g=0);let y=e;for(;y<n;){const k=t[y++];i[g++]=t[y++],i[g++]=k;for(let L=2;L<r;++L)i[g++]=t[y++]}return i.length=g,i}class Polyline extends TextFeature{constructor(e){super(),e=e||{},this.dataProjection=get$1("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY"}readFeatureFromText(e,n){const r=this.readGeometryFromText(e,n);return new Feature(r)}readFeaturesFromText(e,n){return[this.readFeatureFromText(e,n)]}readGeometryFromText(e,n){const r=getStrideForLayout(this.geometryLayout_),i=decodeDeltas(e,r,this.factor_);flipXY(i,0,i.length,r,i);const g=inflateCoordinates(i,0,i.length,r),y=new LineString(g,this.geometryLayout_);return transformGeometryWithOptions(y,!1,this.adaptOptions(n))}writeFeatureText(e,n){const r=e.getGeometry();if(r)return this.writeGeometryText(r,n);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(e,n){return this.writeFeatureText(e[0],n)}writeGeometryText(e,n){e=transformGeometryWithOptions(e,!0,this.adaptOptions(n));const r=e.getFlatCoordinates(),i=e.getStride();return flipXY(r,0,r.length,i,r),encodeDeltas(r,i,this.factor_)}}function encodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;for(let g=0,y=t.length;g<y;)for(r=0;r<e;++r,++g){const k=t[g],L=k-i[r];i[r]=k,t[g]=L}return encodeFloats(t,n)}function decodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;const g=decodeFloats(t,n);for(let y=0,k=g.length;y<k;)for(r=0;r<e;++r,++y)i[r]+=g[y],g[y]=i[r];return g}function encodeFloats(t,e){e=e||1e5;for(let n=0,r=t.length;n<r;++n)t[n]=Math.round(t[n]*e);return encodeSignedIntegers(t)}function decodeFloats(t,e){e=e||1e5;const n=decodeSignedIntegers(t);for(let r=0,i=n.length;r<i;++r)n[r]/=e;return n}function encodeSignedIntegers(t){for(let e=0,n=t.length;e<n;++e){const r=t[e];t[e]=r<0?~(r<<1):r<<1}return encodeUnsignedIntegers(t)}function decodeSignedIntegers(t){const e=decodeUnsignedIntegers(t);for(let n=0,r=e.length;n<r;++n){const i=e[n];e[n]=i&1?~(i>>1):i>>1}return e}function encodeUnsignedIntegers(t){let e="";for(let n=0,r=t.length;n<r;++n)e+=encodeUnsignedInteger(t[n]);return e}function decodeUnsignedIntegers(t){const e=[];let n=0,r=0;for(let i=0,g=t.length;i<g;++i){const y=t.charCodeAt(i)-63;n|=(y&31)<<r,y<32?(e.push(n),n=0,r=0):r+=5}return e}function encodeUnsignedInteger(t){let e,n="";for(;t>=32;)e=(32|t&31)+63,n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e),n}const mapInstance$6=vue.ref(),renderShipSetInstance=t=>mapInstance$6.value=t;let shipsMarkerList=[],shipsVectorSource,largeAmountShipsSource;const selectedShipData=vue.ref(null),selectedShips=vue.ref([]);let selectShipsVectorSource,hoveredFeature=null,hoveredFeatures=[];const renderShips=t=>{var i,g,y,k;if(!mapInstance$6.value||showTrackLayer.value)return;const e=t.reduce((L,$)=>(L.some(V=>V.id===$.id)||L.push($),L),[]),n=Math.round(Number(mapInstance$6.value.getView().getZoom()));if(selectedShipData.value&&vue.nextTick(()=>{selectSingleShipMarker(selectedShipData.value)}).then(L=>{}),!n||n<mapZoom.shipGreenDotMax)return;const r=[...e,...selectedShips.value].reduce((L,$)=>(L.some(V=>V.id===$.id)||L.push($),L),[]);if(allShips.value.forEach(L=>{var $;!r.some(V=>V.id===L.id)&&(($=L.blinkColors)!=null&&$.length)&&checkBlinkLabelExist(mapInstance$6.value,shipLabels.value,L.id)}),allShips.value=r,!hiddenOrther.value)return n>=mapZoom.shipGreenDotMax&&n<mapZoom.shipModelMin?((i=shipsLayer.value)==null||i.setVisible(!1),(g=largeAmountShipsLayer.value)==null||g.setVisible(!0),renderLargeAmountShips(allShips.value)):((y=largeAmountShipsLayer.value)==null||y.setVisible(!1),(k=shipsLayer.value)==null||k.setVisible(!0),renderShipsMarker(allShips.value))},renderLargeAmountShips=t=>{if(!mapInstance$6.value)return;const e=t.map(n=>({type:"Feature",geometry:{type:"Point",coordinates:[n.lon,n.lat]},properties:n}));return largeAmountShipsSource==null||largeAmountShipsSource.clear(),largeAmountShipsSource=new VectorSource({features:new GeoJSON().readFeatures({type:"FeatureCollection",features:e},{featureProjection:projection.mercator})}),largeAmountShipsLayer.value=new WebGLPointsLayer({source:largeAmountShipsSource,style:{"shape-points":3,"shape-radius":9,"shape-fill-color":["case",["==",["get","fill"],"#D9001C"],"#D9001C",["==",["get","fill"],"#04C900"],"#04C900","#04C900"],"shape-rotate-with-view":!1,"shape-rotation":["+",["get","cog"],180],"shape-scale":[.8,1.2],"shape-stroke-color":["case",["==",["get","hover"],0],"#000000",["==",["get","hover"],1],"#FF0000","#000000"],"shape-stroke-width":.5}}),mapInstance$6.value.addLayer(largeAmountShipsLayer.value),largeAmountShipsLayer.value},renderShipsMarker=t=>{var n;if(!mapInstance$6.value)return;deleteAllShipMarkers();let e=convertShipMapData(t);if(e=customFilterShips(e),!!(e!=null&&e.length))return e.forEach((r,i)=>{const g=[r.lon,r.lat],y=new Feature({geometry:new Point(fromLonLat(g))}),k=1;y.set("clickGeometry",new Circle(fromLonLat(g),k)),y.set("data",r),y.set("index",i),y.setStyle(setShipStyle(!1)),shipsMarkerList.push({ship:r,lonlat:g,feature:y})}),shipsVectorSource=new VectorSource({features:shipsMarkerList.map(r=>r.feature)}),shipsLayer.value=new VectorLayer({source:shipsVectorSource,zIndex:100}),(n=mapInstance$6.value)==null||n.addLayer(shipsLayer.value),shipsLayer.value},onShipsMarkerHover=()=>{var n;let t=0;const e=300;(n=mapInstance$6.value)==null||n.on("pointermove",function(r){var k,L,$;if(showDrawLayer.value)return;const i=Date.now();if(i-t<e)return;t=i;const g=(k=mapInstance$6.value)==null?void 0:k.forEachFeatureAtPixel(r.pixel,V=>V),y=(L=mapInstance$6.value)==null?void 0:L.getTargetElement();if(y&&(y.style.cursor=g?"pointer":""),hoveredFeature!==g){if(hoveredFeature){hoveredFeature.set("hover",0);const V=hoveredFeature.get("data");V!=null&&V.mmsi&&hoveredFeature.setStyle(setShipStyle(!1,!1)),hoveredFeature=null}if(g){hoveredFeature=g,g.set("hover",1);const V=g.get("data");if(!(V!=null&&V.mmsi))return;hoveredFeatures.push(g),g.setStyle(setShipStyle((($=selectedShipData.value)==null?void 0:$.id)===V.id,!0))}else hoveredFeatures.forEach(V=>{var j;V.set("hover",0);const z=V.get("data");z!=null&&z.mmsi&&V.setStyle(setShipStyle(((j=selectedShipData.value)==null?void 0:j.id)===z.id,!1))}),hoveredFeatures=[]}})},customFilterShips=t=>{let e=cloneDeep(t);return e=e.filter(n=>{var i;const r=getFilterItem(n).every(({btnShow:g,value:y})=>g?!!y:!0);return(switchBtnShow.value.camera||switchBtnShow.value.mobile||switchBtnShow.value.waterGauge)&&((i=selectedShipData.value)==null?void 0:i.id)===n.id&&clearSelectFeature(),r}),e},getFilterItem=t=>[{btnShow:switchBtnShow.value.camera,value:t==null?void 0:t.existDevice},{btnShow:switchBtnShow.value.mobile,value:t==null?void 0:t.existMobile},{btnShow:switchBtnShow.value.waterGauge,value:t==null?void 0:t.existWaterGauge}],deleteAllShipMarkers=()=>{shipsMarkerList.forEach(t=>{t.feature&&(shipsVectorSource==null||shipsVectorSource.removeFeature(t.feature))}),clearAllInterval(),shipsMarkerList=[]},selectSingleShipMarker=t=>{var g;if(!mapInstance$6.value)return;const e=cloneDeep(selectSingleShipData.value);selectSingleShipData.value=convertShipMapData(t);const n=[selectSingleShipData.value.lon,selectSingleShipData.value.lat],r=new Feature({geometry:new Point(fromLonLat(n))});if(r.set("data",selectSingleShipData.value),shipsLayer.value){const y=shipsLayer.value.getSource();y&&y.forEachFeature(k=>{var L,$;((L=k.get("data"))==null?void 0:L.id)===(($=selectSingleShipData.value)==null?void 0:$.id)&&k.set("data",selectSingleShipData.value)})}r.setStyle(setShipStyle(!0)),shipsMarkerList.push({ship:selectSingleShipData.value,lonlat:n,feature:r}),selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsVectorSource=new VectorSource({features:[r]}),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource,updateWhileInteracting:!0}),shipsVectorSource&&setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!0);const i=(g=shipsLayer.value)==null?void 0:g.getSource();return i&&(e&&setVisibleFeatureById(i,e.id,!0),setVisibleFeatureById(i,selectSingleShipData.value.id,!1)),mapInstance$6.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!0),hideAllHoveredShips(),selectShipsLayer.value},hideAllHoveredShips=()=>{hoveredFeatures==null||hoveredFeatures.forEach(t=>{var n;const e=t==null?void 0:t.get("data");e&&t&&t.setStyle(setShipStyle(((n=selectedShipData.value)==null?void 0:n.id)===e.id,!1))})},setVisibleFeatureById=(t,e,n)=>{t&&t.forEachFeature(r=>{const i=r.get("data");i&&i.id===e&&r.setStyle(n?setShipStyle(!1,!1):setBlankStyle())})},findShip=(t,e,n=!0)=>{var i,g,y,k,L;if(!t||!mapInstance$6.value)return;const r=(y=(g=(i=shipsLayer.value)==null?void 0:i.getSource())==null?void 0:g.getFeatures())==null?void 0:y.find($=>{var V;return((V=$.get("data"))==null?void 0:V.id)===t});if(r)selectedShipData.value=r.get("data");else if(e&&e.lon&&e.lat)selectedShipData.value=e;else{console.error("找不到船舶");return}if(selectedShips.value.some($=>{var V;return $.id===((V=selectedShipData.value)==null?void 0:V.id)})||selectedShips.value.push(selectedShipData.value),n&&((k=selectedShipData.value)!=null&&k.lon)&&((L=selectedShipData.value)!=null&&L.lat)){const $=mapInstance$6.value.getView(),V=new Point([selectedShipData.value.lon,selectedShipData.value.lat]);$.setCenter(transform(V.getCoordinates(),projection.data,projection.mercator));const z=$.getZoom(),j=z<mapZoom.findShipMin?mapZoom.findShip:z;$.setZoom(j)}return setTimeout(()=>{e&&selectSingleShipMarker(e)},50),r},clearSelectFeature=()=>{var t;if(selectedShipData.value&&shipsVectorSource&&selectSingleShipData.value){setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!1);const e=(t=shipsLayer.value)==null?void 0:t.getSource();e&&setVisibleFeatureById(e,selectSingleShipData.value.id,!0)}selectedShipData.value=null,selectedShips.value=[],mapInstance$6.value&&(selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),mapInstance$6.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!1))},hiddenAllShips=()=>{var t,e;(t=shipsLayer.value)==null||t.setVisible(!1),(e=largeAmountShipsLayer.value)==null||e.setVisible(!1),clearAllInterval()},switchBtnShow=vue.ref({[SWITCH_BTN.Camera]:!1,[SWITCH_BTN.Mobile]:!1,[SWITCH_BTN.WaterGauge]:!1}),switchFilterItem=(t,e)=>{switchBtnShow.value[t]=e,renderShips(allShips.value)},rerenderShip=()=>{renderShips(allShips.value)},clearShipData=(t=!0)=>{shipsVectorSource==null||shipsVectorSource.clear(),shipsMarkerList=[],selectedShips.value=[],shipLabels.value=[],t&&(selectShipsVectorSource==null||selectShipsVectorSource.clear())},labelAlpha=.8,pixelRatio=window.devicePixelRatio||1,labelFont=`500 ${12*pixelRatio}px Arial`,labelOutSize=2*pixelRatio,labelHeight=10*pixelRatio,fillRectRadius=(t,e,n,r,i,g,y=4)=>{t.beginPath(),t.moveTo(e+y,n),t.arcTo(e+r,n,e+r,n+y,y),t.arcTo(e+r,n+i,e+r-y,n+i,y),t.arcTo(e,n+i,e,n+i-y,y),t.arcTo(e,n,e+y,n,y),t.closePath(),t.fillStyle=g,t.fill()},getPixelFromCoordinate=t=>{if(!t||t.length===0)throw new Error("Points array is empty or invalid.");let e=1/0,n=1/0,r=-1/0,i=-1/0;for(const[g,y]of t)g<e&&(e=g),y<n&&(n=y),g>r&&(r=g),y>i&&(i=y);return[e,n,r,i]},calculatePolygonCentroid=t=>{if(!Array.isArray(t)||t.length<3)throw new Error("A polygon must have at least 3 coordinates.");let e=0,n=0,r=0;const i=t.length;for(let k=0;k<i-1;k++){const[L,$]=t[k],[V,z]=t[k+1],j=L*z-V*$;r+=j,e+=(L+V)*j,n+=($+z)*j}if(r*=.5,r===0)throw new Error("多边形面积为零");const g=e/(6*r),y=n/(6*r);return[g,y]},rotateShapeModel=(t,e)=>{const[n,r]=calculatePolygonCentroid(t),i=e*Math.PI/180,g=Math.cos(i),y=Math.sin(i);return t.map(([k,L])=>{const $=k-n,V=L-r,z=$*g-V*y+n,j=$*y+V*g+r;return[z,j]})},getTopLeftPoint=t=>[t[0],t[3]],getBottomLeftPoint=t=>[t[2],t[3]],getBottomRightPoint=t=>[t[2],t[1]],getTopRighttPoint=t=>[t[0],t[1]];function calculateBounds(t,e,n,r,i){let g,y,k,L;const $=t[0],V=t[1];switch(e){case 0:g=$+i,y=g+n,L=V-i,k=L-r;break;case 1:g=$+i,y=g+n,L=V+r/2,k=L-r;break;case 2:g=$+i,y=g+n,L=V+i+r,k=L-r;break;case 3:g=$-n/2,y=g+n,L=V+i+r,k=L-r;break;case 4:y=$,g=y-n,L=V+i+r,k=L-r;break;case 5:y=$-i,g=y-n,L=V+r/2,k=L-r;break;case 6:y=$,g=y-n,L=V-i,k=L-r;break;case 7:g=$-n/2,y=g+n,L=V-i,k=L-r}if(!(!g||!k||!y||!L))return[Math.min(g,y),Math.min(k,L),Math.max(g,y),Math.max(k,L)+1]}function calculateAnchorPoint(t,e,n=70,r=20,i=20){const g=[0,0];switch(e){case 0:g[0]=t[0]+i,g[1]=t[1]-i-r/2;break;case 1:g[0]=t[0]+i,g[1]=t[1];break;case 2:g[0]=t[0]+i,g[1]=t[1]+i+r/2;break;case 3:g[0]=t[0],g[1]=t[1]+i+r/4;break;case 4:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]+i+r/4;break;case 5:g[0]=t[0]-i,g[1]=t[1];break;case 6:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]-i-r/4;break;case 7:g[0]=t[0],g[1]=t[1]-i-r/4}return g}function drawLabelBody(t,e,n){if(!t)return;const{font:r,labelOutSize:i=2,labelHeight:g,center:y,text:k,id:L,leftIcon:$,shipColor:V,lineLength:z=20,selected:j,blinkColors:oe}=n;t.save(),r&&(t.font=r);let re=t.measureText(k).width+4*i;($||V)&&(re+=g+6*i),t.restore();let ie,ae=20,le=-1,de=g+3*i;if(z)for(let pe=0;pe<8;pe++){ie=calculateBounds(y,pe,re,de,z);let ue=!1;for(let he=0;he<e.length;++he){let _e=e[he].bounds,Ce=[_e[0]-ae,_e[1]-ae,_e[2]+ae,_e[3]+ae];if(ie&&isOverlapping(ie,Ce)){ue=!0;break}}if(!ue){le=pe;break}}else le=0,ie=calculateBounds(y,le,re,de,z);if(((oe==null?void 0:oe.length)>1||j)&&(le=0,ie=calculateBounds(y,le,re,de,z)),ie&&le>-1){let pe=getBottomLeftPoint(ie),ue=getTopRighttPoint(ie);return{center:y,x:calculateAnchorPoint(y,le,re,de,z),l:ue,r:pe,bounds:ie,position:le,name:k,id:L}}else return null}const drawText=(t,e)=>{if(!t)return;const{center:n,text:r,textColor:i,leftIcon:g,rightIcons:y,font:k}=e;t.save(),t.setTransform(1,0,0,1,0,0);let[L,$]=n;if(g){t.font=`${18*pixelRatio}px map-iconfont`;let V=getIconFont(g.icon);t.fillStyle=g.color,t.fillText(V,L+labelOutSize-3*pixelRatio,$+2.6*pixelRatio),L+=23*pixelRatio}if(y!=null&&y.length){t.font=`${12*pixelRatio}px map-iconfont`,t.fillStyle="#3370ff";const V=t.measureText(r).width+6*pixelRatio;y.forEach((z,j)=>{const oe=getIconFont(z),re=20*pixelRatio*j;t.fillText(oe,L+V+re,$)})}t.font=k||labelFont,t.fillStyle=i,t.fillText(r,L+2,$),t.restore()},drawPolygon=(t,e)=>{let{points:n,strokeColor:r,fillColor:i,shouldClosePath:g,translation:y,rotation:k,rotationCenter:L,scale:$,globalAlpha:V}=e;if(V||(V=1),n&&t){t.save(),t.beginPath(),k&&k!==0&&L==null&&t.rotate(k),y&&t.translate(y[0],y[1]),k&&(L!=null&&L.length)&&t.rotate(k),$&&t.scale($,$),t.moveTo(n[0][0],n[0][1]);for(let z=1;z<n.length;z++)t.lineTo(n[z][0],n[z][1]);g&&t.closePath(),r&&(t.strokeStyle=r,t.stroke()),i&&g&&(V&&(t.globalAlpha=V),t.fillStyle=i,t.fill()),t.restore()}},intervalIds={},drawLabel=(t,e,n,r)=>{var re,ie,ae,le,de,pe,ue,he;let{center:i,id:g,text:y,color:k,textColor:L,bgColor:$,leftIcon:V,rightIcons:z,type:j,blinkColors:oe}=e;if(i&&y){const _e={font:labelFont,labelOutSize,labelHeight,center:i,text:y,id:g,leftIcon:V,blinkColors:oe,selected:e.selected};(re=e.blinkColors)!=null&&re.length&&e.fill&&($=e.fill,L=getForegroundColor(e.fill));const Ce=drawLabelBody(t,n,_e);if(Ce){const{x:xe,bounds:Ie,l:Oe}=Ce,Ve=[getTopLeftPoint(Ie),getBottomLeftPoint(Ie),getBottomRightPoint(Ie),getTopRighttPoint(Ie)];n.find(ze=>ze.name===y)||n.push(Ce),drawPolygon(t,{points:[i,Oe],strokeColor:k,fillColor:"#000",shouldClosePath:!0,translation:void 0,rotation:void 0,rotationCenter:void 0,scale:void 0,globalAlpha:labelAlpha}),z!=null&&z.length&&z.forEach(()=>{Ve[1][0]+=pixelRatio*18,Ve[2][0]+=pixelRatio*18});const kt={points:Ve,strokeColor:k,fillColor:$,shouldClosePath:!0},[Dt,$e]=Oe,Fe={center:[Dt,$e+labelOutSize+labelHeight+1],text:y,textColor:L,leftIcon:V,rightIcons:z,blinkColors:e.blinkColors};if(drawPolygon(t,kt),drawText(t,Fe),e!=null&&e.blinkColors&&e.blinkColors.length>0){let ze=Date.now(),qe=0;const Ne=e.blinkColors;!!!((le=(ae=(ie=selectShipsLayer.value)==null?void 0:ie.getSource())==null?void 0:ae.getFeatures())!=null&&le.find(Pt=>{var hn;return((hn=Pt.get("data"))==null?void 0:hn.id)===e.id})||(ue=(pe=(de=shipsLayer.value)==null?void 0:de.getSource())==null?void 0:pe.getFeatures())!=null&&ue.find(Pt=>{var hn;return((hn=Pt.get("data"))==null?void 0:hn.id)===e.id}))||hiddenOrther.value&&((he=selectSingleShipData.value)==null?void 0:he.id)!==e.id?deleteLabelFromArray(n,e.id):(intervalIds[e.id]&&clearInterval(intervalIds[e.id]),intervalIds[e.id]=window.setInterval(()=>{const Pt=Date.now();Pt-ze>=500&&(qe=(qe+1)%Ne.length,ze=Pt,kt.fillColor=Ne[qe],drawPolygon(t,kt),Fe.textColor=getForegroundColor(kt.fillColor),drawText(t,Fe)),checkBlinkLabelExist(r,n,e.id)},500))}else shipLabels.value.find(qe=>qe.name===y)&&(clearInterval(intervalIds[e.id]),drawPolygon(t,kt),drawText(t,Fe))}}return null},checkBlinkLabelExist=(t,e,n)=>{var y,k,L,$,V,z,j;const r=shipsMarkerList==null?void 0:shipsMarkerList.some(oe=>{var re,ie,ae;return((re=oe.ship)==null?void 0:re.id)===n&&((ae=(ie=oe.ship)==null?void 0:ie.blinkColors)==null?void 0:ae.length)>0}),i=[...((k=(y=shipsLayer.value)==null?void 0:y.getSource())==null?void 0:k.getFeatures())||[],...(($=(L=selectShipsLayer.value)==null?void 0:L.getSource())==null?void 0:$.getFeatures())||[]].some(oe=>{const re=oe.get("data");if((re==null?void 0:re.id)===n){const ie=t==null?void 0:t.getView().calculateExtent();if(!ie)return!1;const ae=fromLonLat([re.lon,re.lat]);return ae[0]>=ie[0]&&ae[0]<=ie[2]&&ae[1]>=ie[1]&&ae[1]<=ie[3]}return!1}),g=(z=(V=trackLineVectorSource.value)==null?void 0:V.getFeatures())==null?void 0:z.some(oe=>{const re=oe.get("data");return(re==null?void 0:re.id)===n});(((j=shipsLayer.value)==null?void 0:j.getVisible())===!1&&e.some(oe=>{var re;return oe.id!==((re=selectSingleShipData.value)==null?void 0:re.id)&&oe.id===n})||(!g||!i)&&(!i||!r))&&deleteLabelFromArray(t,e,n)},clearAllInterval=()=>{Object.keys(intervalIds).forEach(t=>{clearInterval(t)})},deleteLabelFromArray=(t,e,n)=>{var i,g,y,k,L,$,V,z;clearInterval(intervalIds[n]);const r=e.findIndex(j=>j.id===n);if(r!==-1){e.splice(r,1);const j=(g=(i=shipsLayer.value)==null?void 0:i.getSource())==null?void 0:g.getFeatures().find(re=>{var ie;return((ie=re.get("data"))==null?void 0:ie.id)===n});j&&((k=(y=shipsLayer.value)==null?void 0:y.getSource())==null||k.removeFeature(j));const oe=($=(L=selectShipsLayer.value)==null?void 0:L.getSource())==null?void 0:$.getFeatures().find(re=>{var ie;return((ie=re.get("data"))==null?void 0:ie.id)===n});oe&&((z=(V=selectShipsLayer.value)==null?void 0:V.getSource())==null||z.removeFeature(oe)),t&&t.render()}},deleteLabelFromArrayById=()=>{mapInstance$9.value&&selectSingleShipData.value&&deleteLabelFromArray(mapInstance$9.value,shipLabels.value,selectSingleShipData.value.id)},PI=Math.PI,a=6378245,ee=.006693421622965943;function transformLat(t,e){let n=-100+2*t+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(e*PI)+40*Math.sin(e/3*PI))*2/3,n+=(160*Math.sin(e/12*PI)+320*Math.sin(e*PI/30))*2/3,n}function transformLng(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(t*PI)+40*Math.sin(t/3*PI))*2/3,n+=(150*Math.sin(t/12*PI)+300*Math.sin(t/30*PI))*2/3,n}function outOfChina(t,e){return!(t>73.66&&t<135.05&&e>3.86&&e<53.55)}function gcj02ToWgs84(t){const[e,n]=t.split(",").map(Number);if(outOfChina(e,n))return`${e.toFixed(6)}, ${n.toFixed(6)}`;{let r=transformLat(e-105,n-35),i=transformLng(e-105,n-35);const g=n/180*PI;let y=Math.sin(g);y=1-ee*y*y;const k=Math.sqrt(y);r=r*180/(a*(1-ee)/(y*k)*PI),i=i*180/(a/k*Math.cos(g)*PI);const L=n+r,$=e+i;return`${(e*2-$).toFixed(6)}, ${(n*2-L).toFixed(6)}`}}function calculateCirclePoints(t,e){const n=fromLonLat(t),r=e*1e3,i=[n[0]-r,n[1]-r,n[0]+r,n[1]+r],g=transformExtent(i,projection.mercator,projection.data);return{leftTopPoint:{lng:g[0],lat:g[3]},rightTopPoint:{lng:g[2],lat:g[3]},rightBottomPoint:{lng:g[2],lat:g[1]},leftBottomPoint:{lng:g[0],lat:g[1]}}}const equatorialCircumference=2003750834e-2;function lonLatToMercator(t){const e=t[0]*equatorialCircumference/180;let n=Math.log(Math.tan((90+t[1])*Math.PI/360))/(Math.PI/180);return n=n*equatorialCircumference/180,[e,n]}function mercatorToLonLat(t,e="lonlat"){const n={lon:0,lat:0},r=t[0]/equatorialCircumference*180;let i=t[1]/equatorialCircumference*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),n.lon=r,n.lat=i,e==="lonlat"?n:[r,i]}function calculateBoundingBox(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;t.forEach(ie=>{const[ae,le]=ie;e=Math.min(e,le),n=Math.max(n,le),r=Math.min(r,ae),i=Math.max(i,ae)});const g=i-r,y=n-e,k=Math.max(g,y),L=(r+i)/2,$=(e+n)/2,V=k/2,z=L-V,j=L+V,oe=$-V,re=$+V;return[j,oe,z,re]}const transformUtils={gcj02ToWgs84,calculateCirclePoints,lonLatToMercator,mercatorToLonLat,calculateBoundingBox,transform},mapInstance$5=vue.ref(),renderTrackStyleSetInstance=t=>mapInstance$5.value=t,stopIcon="&#xe6e2;",stopColor="#E31818",slowIcon="&#xe703;",slowColor="#1890FF",dropletsIcon="&#xe6d2",trackList$1=vue.ref([]),renderTrackLine=(t,e,n)=>{var L,$,V;const r=t[e];if(!r)return;allTracks.value[e]=r,trackList$1.value=[];const g=Math.max(1,Math.floor(r.length/50)),y=r.filter((z,j)=>j%g===0);trackList$1.value=y.map((z,j)=>{if(Number(z.lon)>180||Number(z.lat)>180){const[oe,re]=formatUtils.convertSixHundredThousandToLatLng(z.lon,z.lat);z.lon=oe,z.lat=re}return z.center=[z.lon,z.lat],z.centerPoint=transformUtils.lonLatToMercator(z.center),z.id=e,z.index=j,z.time=hooks(z.createdAt).format("YYYY-MM-DD HH:mm:ss"),z});const k=trackList$1.value.map(z=>z.centerPoint);if(k.length>=2){const z=new LineString(k),j=new Feature({geometry:z});j.setStyle(new Style({stroke:new Stroke({color:n,width:2})})),j.setId(e),j.set("type","line"),($=(L=shipTrackVectorLayer.value)==null?void 0:L.getSource())==null||$.clear(),shipTrackLineFeatures.value=[];const oe=shipTrackLineFeatures.value.findIndex(re=>re.getId()===e);oe>=0?shipTrackLineFeatures.value[oe]=j:shipTrackLineFeatures.value.push(j),createAnimatedIconFeature(n,k),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value=new VectorLayer({source:trackLineVectorSource.value,zIndex:102,updateWhileInteracting:!0}),renderPoint(n),(V=mapInstance$5.value)==null||V.addLayer(shipTrackVectorLayer.value)}},handlePlay=(t,e)=>{const n=allTracks.value[String(t)];playAnimation(n.map(r=>[r.lon,r.lat]),e)},removeShipTrackLineFeatureByIndex=(t,e)=>{t>=0&&t<shipTrackLineFeatures.value.length&&(shipTrackLineFeatures.value.splice(t,1),delete allTracks.value[e]),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value&&shipTrackVectorLayer.value.setSource(trackLineVectorSource.value)},createAnimatedIconFeature=(t,e)=>{const n=new Feature({geometry:new Point(fromLonLat([e[0][0],e[0][1]]))}),r=new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:t})})});return n.setStyle(r),n},geoMarkerStyle=new Style({text:new Text({font:"700 20px map-iconfont",text:getIconFont("&#xe657;"),fill:new Fill({color:"#ff0000"}),rotation:0})});let polyline,linePath,startMarker,position,geoMarker,vectorLayer;const trackAnimating=vue.ref(!1);let distance=0,lastTime=Date.now(),moveFeatureHandler=null;const moveFeature=(t,e)=>{var z,j,oe;const n=Number(50*e),r=((z=t.frameState)==null?void 0:z.time)??Date.now(),i=r-lastTime;if(distance=(distance+n*i/1e6)%2,lastTime=r,distance>=1){stopAnimation();return}const g=linePath.getCoordinateAt(distance>1?2-distance:distance),y=linePath.getCoordinateAt(distance>1?distance-.01:distance),k=linePath.getCoordinateAt(distance>1?2-distance:distance+.01),$=getRotation(transformUtils.mercatorToLonLat(y,"array"),transformUtils.mercatorToLonLat(k,"array"))*Math.PI/180;(j=geoMarkerStyle.getText())==null||j.setRotation($),position.setCoordinates(g);const V=getVectorContext(t);V.context_.save(),V.setStyle(geoMarkerStyle),V.drawGeometry(position),V.context_.restore(),(oe=mapInstance$5.value)==null||oe.render()},startAnimation=()=>{var t;trackAnimating.value=!0,showTrackAnimatMarker.value=!0,lastTime=Date.now(),distance=0,position=((t=startMarker.getGeometry())==null?void 0:t.clone())||new Point([0,0]),moveFeatureHandler&&(vectorLayer==null||vectorLayer.on("postrender",moveFeatureHandler)),geoMarker==null||geoMarker.setGeometry(void 0)},stopAnimation=()=>{var t;trackAnimating.value&&(trackAnimating.value=!1,geoMarker==null||geoMarker.setGeometry(void 0),moveFeatureHandler&&vectorLayer&&vectorLayer.un("postrender",moveFeatureHandler),vectorLayer&&((t=mapInstance$5.value)==null||t.removeLayer(vectorLayer)),vectorLayer=null,geoMarker=null)},playAnimation=(t,e)=>{var r;trackAnimating.value&&stopAnimation(),polyline=new Polyline({factor:1e6}).writeGeometry(new LineString(t)),linePath=new Polyline({factor:1e6}).readGeometry(polyline,{dataProjection:projection.data,featureProjection:projection.mercator}),startMarker=new Feature({type:"icon",geometry:new Point(linePath.getFirstCoordinate())});const n=startMarker.getGeometry();position=n?n.clone():new Point([0,0]),geoMarker=new Feature({type:"geoMarker",style:geoMarkerStyle,geometry:position}),vectorLayer=new VectorLayer({source:new VectorSource({features:[geoMarker]})}),(r=mapInstance$5.value)==null||r.addLayer(vectorLayer),moveFeatureHandler=i=>moveFeature(i,e),startAnimation()},renderPoint=t=>{if(!mapInstance$5.value)return;const e=trackList$1.value||[];if(!(e&&e.length>1))return[];const n={16:24,17:15,default:4},r=[],i=e.length;for(let k=0;k<i;k++){e[k].index=k;const L=mapInstance$5.value.getPixelFromCoordinate(e[k].centerPoint);if(L){let $=L.concat(L);$=adjustBounds($,[20,20]);const V=mapInstance$5.value.getView().getZoom();if(!V)return;if(V>15){const j=n[V]||n.default;$=adjustBounds($,[j,j])}let z=!0;if(e[k].state!=="0"){for(let j=0;j<r.length;j++)if(isOverlapping($,r[j].bounds)){z=!1;break}}z&&(e[k].bounds=$,r.push(e[k]))}}const g=getIconStyle(stopIcon),y=getIconStyle(slowIcon);r.forEach((k,L)=>{var z,j;const $=new Feature({geometry:new Point(k.centerPoint)});$.set("type","track_point"),$.set("data",k),$.setStyle([new Style({image:new CircleStyle({stroke:new Stroke({color:"rgba(0, 0, 0, 0.01)",width:20}),radius:3})}),new Style({image:new CircleStyle({fill:new Fill({color:t}),stroke:new Stroke({color:"#fff",width:2}),radius:3})})]),trackLineVectorSource.value.addFeature($);const V=new Feature({geometry:new Point(fromLonLat(k.center))});if(V.set("type","track_label"),V.set("track_label_index",L),V.setStyle(setTrackLabelStyle(k,t)),trackLineVectorSource.value.addFeature(V),typeof k=="object"&&k.hasOwnProperty("state")){const oe=new Feature({geometry:new Point(k.centerPoint)});oe.set("type","track_icon");const re=new Style({text:new Text({font:"Normal 22px map-iconfont",text:getIconFont(dropletsIcon),offsetY:-10}),zIndex:99}),ie=[];Number(k.state)===0?((z=re.getText())==null||z.setFill(new Fill({color:stopColor})),ie.push(g)):Number(k.state)===1&&((j=re.getText())==null||j.setFill(new Fill({color:slowColor})),ie.push(y)),ie.push(re),oe.setStyle(ie),trackLineVectorSource.value.addFeature(oe)}}),renderArrow(r,t),renderIconPoint()},renderArrow=(t,e)=>{const n=t.length;n||(t.push(trackList$1.value[0]),t.push(trackList$1.value[trackList$1.value.length-1]));for(let r=0;r<n-1;r++){let i;const g=t[r],y=(t[r+1].index+g.index)/2;if(y%2===0)i=trackList$1.value[y].centerPoint;else{const k=trackList$1.value[Math.floor(y)],L=trackList$1.value[Math.ceil(y)];if(k&&L){const[$,V]=k.centerPoint,[z,j]=L.centerPoint;i=[($+z)/2,(V+j)/2]}}if(i){const k=new Feature({geometry:new Point(i)});k.set("type","track_arrow"),k.setStyle(new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:e}),rotation:getRotation(t[r].center,t[r+1].center)*(Math.PI/180)})})),trackLineVectorSource.value.addFeature(k)}}},renderIconPoint=()=>{const t="&#xe69b;",e="#fcdc3f",n="#ff0000";(trackList$1.value.length<2?[trackList$1.value[0]]:[trackList$1.value[0],trackList$1.value[trackList$1.value.length-1]]).forEach(i=>{const g=new Feature({geometry:new Point(i.centerPoint)});g.set("type","track_begin"),g.set("data",i);const y=i.index===0&&trackList$1.value.length>=2?e:n;g.setStyle(new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:y})}),zIndex:101})),trackLineVectorSource.value.addFeature(g)})},setTrackLabelStyle=(t,e)=>new Style({renderer:(n,r)=>{const i=r.context,k={id:t.id||"",center:n,text:t.time,color:e,textColor:"#000",bgColor:"rgba(255,255,255,.8)",selected:!0,type:"TrackTime"};drawLabel(i,k,trackLabels.value,mapInstance$5.value)}}),mapInstance$4=vue.ref(),renderCustomOverlaySetInstance=t=>mapInstance$4.value=t,drawCustomContent=(t,e,n,r="top-left",i=!1,g=!0)=>{var z,j;if(!e||!mapInstance$4.value)return;g&&document.querySelectorAll(".truck-custom-content").forEach(oe=>{var re;return(re=oe.parentNode)==null?void 0:re.removeChild(oe)});const y=document.createElement("div");y.innerHTML=n;const k=new Overlay({element:y,position:e,positioning:r,stopEvent:i});if(i){let oe=!1,re=[0,0],ie=[0,0],ae=0,le=0;y.addEventListener("mousedown",function(de){var ue;oe=!0,ae=de.clientX,le=de.clientY;const pe=(ue=mapInstance$4.value)==null?void 0:ue.getCoordinateFromPixel([de.clientX-200,de.clientY-200]);pe&&(re=pe),ie=[de.clientX-y.getBoundingClientRect().left+160,de.clientY-y.getBoundingClientRect().top+84],de.preventDefault(),console.log(t,ae,le)}),document.addEventListener("mousemove",function(de){var pe;if(oe){const ue=(pe=mapInstance$4.value)==null?void 0:pe.getCoordinateFromPixel([de.clientX-ie[0],de.clientY-ie[1]]),he=ue[0]-re[0],_e=ue[1]-re[1];k.setPosition([re[0]+he,re[1]+_e])}}),document.addEventListener("mouseup",function(){oe=!1})}(z=mapInstance$4.value)==null||z.addOverlay(k);const L=y.querySelector(".close-button");L&&L.addEventListener("click",()=>{var oe,re;(oe=mapInstance$4.value)==null||oe.removeOverlay(k),(re=y.parentNode)==null||re.removeChild(y)});const $=JSON.parse(JSON.stringify(e)),V=(j=mapInstance$4.value)==null?void 0:j.getCoordinateFromPixel($);return k.setPosition(V),k},mapInstance$3=vue.ref(),renderTrackSetInstance=t=>mapInstance$3.value=t,showTracks=vue.ref([]),trackList=vue.ref([]);vue.ref(null);const trackId=vue.ref(""),cursor=vue.ref(0),renderTrack=(t,e,n,r,i="ship")=>{var V;if(console.log(i),vue.nextTick(()=>{hiddenAllShips(),clearShipData(!1)}).then(z=>{}),(e==null?void 0:e.length)<2){((V=showTracks.value)==null?void 0:V.findIndex(z=>z.id===t))<0&&showTracks.value.push({id:t,length:""});return}const g={};e.forEach(z=>{z.state?z.state=Number(z.state):delete z.state}),trackId.value=t,g[t]=e,trackList.value=e;const y=["#ff0000","#00ff00","#0079ff","#ffa500","#800080","#008080","#ffc0cb","#800000","#000080","#808000"],k=g[t].map(z=>transform([z.lon,z.lat],projection.data,projection.mercator)),L=new LineString(k),$=formatUtils.formatLength(L,r)||"--";vue.nextTick(()=>{var j,oe;const z=(j=showTracks.value)==null?void 0:j.findIndex(re=>re.id===t);z<0?showTracks.value.push({id:t,length:$}):showTracks.value[z].length=$,++cursor.value,cursor.value>y.length&&(cursor.value=0),renderTrackLine(g,t,n),vue.nextTick(()=>{resetTrackView(t)}).then(()=>{}),(oe=mapInstance$3.value)==null||oe.on("moveend",()=>{showTrackLayer.value&&(trackLabels.value=[],renderTrackLine(g,t,n))}),i==="ship"&&renderTrackPointPopup()}).then(()=>{})},renderTrackPointPopup=()=>{var e;const t=vue.ref(null);(e=mapInstance$3.value)==null||e.on("pointermove",n=>{var i,g,y,k;t.value&&((i=mapInstance$3.value)==null||i.removeOverlay(t.value));const r=(g=mapInstance$3.value)==null?void 0:g.forEachFeatureAtPixel(n.pixel,L=>L);if(r){const L=r.get("data");if(!(L!=null&&L.time))return;let $="";L!=null&&L.stayTime&&($=`
656
656
  <div class="item w-100">
657
657
  <div class="item-label">停泊时间约</div>
658
658
  <div class="item-item">${formatMinutesToDDHHMM(Number(L.stayTime))}</div>
@@ -688,20 +688,20 @@ void main(void) {
688
688
  <div class="item-item">${L.time}</div>
689
689
  </div>
690
690
  ${$??$}
691
- </div>`,z=(y=mapInstance$3.value)==null?void 0:y.getPixelFromCoordinate(n.coordinate);if(z){const j=drawCustomContent(L.time,z,V,"top-left");j&&(t.value=j)}}else t.value&&((k=mapInstance$3.value)==null||k.removeOverlay(t.value))})},removeAllTrackLayer=()=>{var t;showTracks.value=[],(t=trackLineVectorSource.value)==null||t.clear()},playTrack=(t,e)=>{handlePlay(String(t),e)},resetTrackView=t=>{var i;const e=mapInstance$3.value.getView(),n=t?shipTrackLineFeatures.value.find(g=>g.getId()===t):shipTrackLineFeatures.value[0];if(!n)return;const r=(i=n==null?void 0:n.getGeometry())==null?void 0:i.getExtent();if(r!=null&&r.length)try{const g=buffer(r,Math.max(r[2]-r[0],r[3]-r[1])*.02);e.fit(g)}catch(g){console.log(g)}},formatMinutesToDDHHMM=t=>{const e=hooks.duration(t,"minutes"),n=Math.floor(e.asDays()),r=e.hours(),i=e.minutes();let g=`${String(i).padStart(2,"0")}分`;return r!==0&&(g=`${String(r).padStart(2,"0")}时${g}`),n!==0&&(g=`${String(n).padStart(2,"0")}天${g}`),g},_hoisted_1$9={key:0,class:"more-tool-panel"},_hoisted_2$5={class:"switch-buttons"},_hoisted_3$4={class:"tool-components"},_sfc_main$b=vue.defineComponent({__name:"toolPanel",props:{vehicleMode:{},viewMode:{},disableGreenDot:{type:Boolean},showTrackLayer:{type:Boolean},mapTileMode:{}},emits:["switchGreenDot","switchMapTile"],setup(t,{emit:e}){var oe,re;const n=vue.inject("mapInstance"),r=t,i=e,g=vue.ref(((re=(oe=n==null?void 0:n.value)==null?void 0:oe.getView())==null?void 0:re.getZoom())||mapZoom.default),y=vue.ref(!1),k=vue.ref(null),L=vue.ref(!0),$=()=>{r.disableGreenDot||g.value>=mapZoom.shipGreenDotMax||(L.value=!L.value,i("switchGreenDot",L.value))},V=()=>{i("switchMapTile",r.mapTileMode===BaseMapType.vector?BaseMapType.satellite:BaseMapType.vector)},z=()=>{var ie,ae;y.value?(showMeasure.value=!1,(ie=k.value)==null||ie.removeInteraction()):(showMeasure.value=!0,(ae=k.value)==null||ae.addInteraction()),y.value=!y.value},j=()=>{var ie;(ie=k.value)==null||ie.removeInteraction(),y.value=!1};return vue.onMounted(()=>{vue.nextTick(()=>{var ie;(ie=n==null?void 0:n.value)==null||ie.on("moveend",()=>{var le,de;const ae=(de=(le=n==null?void 0:n.value)==null?void 0:le.getView())==null?void 0:de.getZoom();ae&&(g.value=ae)})})}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:vue.normalizeClass(`tool-panel ${ie.viewMode}`)},[ie.viewMode==="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$5,[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[5]||(ae[5]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[6]||(ae[6]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[0]||(ae[0]=le=>V())},ae[7]||(ae[7]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"图层",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="truck"?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[1]||(ae[1]=le=>V())},ae[8]||(ae[8]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)):vue.createCommentVNode("",!0),ie.showTrackLayer?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:4},[vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[2]||(ae[2]=le=>vue.unref(playTrack)(vue.unref(currentTrackId),1))},ae[9]||(ae[9]=[vue.createElementVNode("i",{class:"map-iconfont icon-play"},null,-1),vue.createElementVNode("div",{class:"button-text"},"播放轨迹",-1)])),vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[3]||(ae[3]=le=>vue.unref(resetTrackView)())},ae[10]||(ae[10]=[vue.createElementVNode("i",{class:"map-iconfont icon-center"},null,-1),vue.createElementVNode("div",{class:"button-text"},"轨迹居中",-1)]))],64)):vue.createCommentVNode("",!0),vue.renderSlot(ie.$slots,"toolPanel",{},void 0,!0)])])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[11]||(ae[11]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[12]||(ae[12]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",{active:ie.mapTileMode===vue.unref(BaseMapType).satellite}]),onClick:V},ae[13]||(ae[13]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)],64))],2),vue.createElementVNode("div",_hoisted_3$4,[y.value?(vue.openBlock(),vue.createBlock(Measure,{key:0,ref_key:"measureRef",ref:k,visible:y.value,"onUpdate:visible":ae[4]||(ae[4]=le=>y.value=le),onClose:j,"view-mode":ie.viewMode},null,8,["visible","view-mode"])):vue.createCommentVNode("",!0)])],64))}}),ToolPanel=_export_sfc(_sfc_main$b,[["__scopeId","data-v-6b24cf3c"]]),UNITS_PROP="units",LEADING_DIGITS=[1,2,5],DEFAULT_DPI=25.4/.28;let ScaleLine$1=class extends Control{constructor(e){e=e||{};const n=document.createElement("div");n.style.pointerEvents="none",super({element:n,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+CLASS_UNSELECTABLE,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(UNITS_PROP,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(UNITS_PROP)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(UNITS_PROP,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=e.center,r=e.projection,i=this.getUnits(),g=i=="degrees"?"degrees":"m";let y=getPointResolution(r,e.resolution,n,g);const k=this.minWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI,L=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI:void 0;let $=k*y,V="";if(i=="degrees"){const pe=METERS_PER_UNIT$1.degrees;$*=pe,$<pe/60?(V="″",y*=3600):$<pe?(V="′",y*=60):V="°"}else if(i=="imperial")$<.9144?(V="in",y/=.0254):$<1609.344?(V="ft",y/=.3048):(V="mi",y/=1609.344);else if(i=="nautical")y/=1852,V="NM";else if(i=="metric")$<1e-6?(V="nm",y*=1e9):$<.001?(V="μm",y*=1e6):$<1?(V="mm",y*=1e3):$<1e3?V="m":(V="km",y/=1e3);else if(i=="us")$<.9144?(V="in",y*=39.37):$<1609.344?(V="ft",y/=.30480061):(V="mi",y/=1609.3472);else throw new Error("Invalid units");let z=3*Math.floor(Math.log(k*y)/Math.log(10)),j,oe,re,ie,ae,le;for(;;){re=Math.floor(z/3);const pe=Math.pow(10,re);if(j=LEADING_DIGITS[(z%3+3)%3]*pe,oe=Math.round(j/y),isNaN(oe)){this.element.style.display="none",this.renderedVisible_=!1;return}if(L!==void 0&&oe>=L){j=ie,oe=ae,re=le;break}else if(oe>=k)break;ie=j,ae=oe,le=re,++z}const de=this.scaleBar_?this.createScaleBar(oe,j,V):j.toFixed(re<0?-re:0)+" "+V;this.renderedHTML_!=de&&(this.innerElement_.innerHTML=de,this.renderedHTML_=de),this.renderedWidth_!=oe&&(this.innerElement_.style.width=oe+"px",this.renderedWidth_=oe),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,n,r){const i=this.getScaleForResolution(),g=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),y=this.scaleBarSteps_,k=e/y,L=[this.createMarker("absolute")];for(let V=0;V<y;++V){const z=V%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";L.push(`<div><div class="ol-scale-singlebar ${z}" style="width: ${k}px;"></div>`+this.createMarker("relative")+(V%2===0||y===2?this.createStepText(V,e,!1,n,r):"")+"</div>")}return L.push(this.createStepText(y,e,!0,n,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+g+"</div>":"")+L.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,n,r,i,g){const k=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+g),L=e===0?-3:n/this.scaleBarSteps_*-1,$=e===0?0:n/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${L}px;text-align: ${e===0?"left":"center"};min-width: ${$}px;left: ${r?n+"px":"unset"};">`+k+"</div>"}getScaleForResolution(){const e=getPointResolution(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),n=this.dpi_||DEFAULT_DPI,r=1e3/25.4;return e*r*n}render(e){const n=e.frameState;n?this.viewState_=n.viewState:this.viewState_=null,this.updateElement_()}};const _hoisted_1$8={id:"scale-line-container"},_sfc_main$a=vue.defineComponent({__name:"scaleLine",setup(t,{expose:e}){const n=vue.inject("mapInstance");return e({setScaleLine:i=>{var k;i||(i="metric");const g=new ScaleLine$1({units:i}),y=document.getElementById("scale-line-container");y&&(g.setTarget(y),(k=n==null?void 0:n.value)==null||k.addControl(g))}}),(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8))}}),ScaleLine=_export_sfc(_sfc_main$a,[["__scopeId","data-v-d666f80d"]]),_hoisted_1$7={class:"zoom"},_sfc_main$9=vue.defineComponent({__name:"zoomControl",props:{map:{type:Object}},setup(t){const e=vue.inject("mapInstance"),n=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g+1)},r=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g-1)};return(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createElementVNode("div",{onClick:n,class:"button big-button"},"+"),vue.createElementVNode("div",{onClick:r,class:"button small-button"},"-")]))}}),ZoomControl=_export_sfc(_sfc_main$9,[["__scopeId","data-v-ee822625"]]),_hoisted_1$6={class:"copyright"},_hoisted_2$4=["src","width"],_sfc_main$8=vue.defineComponent({__name:"copyright",props:{type:{default:COPY_RIGHT_TYPE.HORIZONTAL},mapTile:{default:BaseMapType.satellite}},setup(t){vue.useCssVars(g=>({"0d38823b":i.value}));const e=t,n=vue.computed(()=>e.type===COPY_RIGHT_TYPE.HORIZONTAL?`map/tdt-copyright-h${e.mapTile===BaseMapType.satellite?"-w":""}.svg`:`map/tdt-copyright-v${e.mapTile===BaseMapType.satellite?"-w":""}.svg`),r=vue.computed(()=>e.type===COPY_RIGHT_TYPE.HORIZONTAL?"400px":"168px"),i=vue.computed(()=>e.type===COPY_RIGHT_TYPE.HORIZONTAL?"auto auto 0 5px":"0 auto auto 5px");return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("img",{src:vue.unref(CDN_URL)+n.value,width:r.value,class:"logo",alt:""},null,8,_hoisted_2$4)]))}}),Copyright=_export_sfc(_sfc_main$8,[["__scopeId","data-v-15a296ba"]]),TileEventType={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},tmpTileCoord=[0,0,0],DECIMALS=5;class TileGrid{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,assert(isSorted(this.resolutions_,(i,g)=>g-i),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let i=0,g=this.resolutions_.length-1;i<g;++i)if(!n)n=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,assert(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const r=e.extent;r!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=getTopLeft(r)),assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,assert(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:DEFAULT_TILE_SIZE,assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=r!==void 0?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((i,g)=>{const y=new TileRange(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(r){const k=this.getTileRangeForExtentAndZ(r,g);y.minX=Math.max(k.minX,y.minX),y.maxX=Math.min(k.maxX,y.maxX),y.minY=Math.max(k.minY,y.minY),y.maxY=Math.min(k.maxY,y.maxY)}return y}):r&&this.calculateTileRanges_(r)}forEachTileCoord(e,n,r){const i=this.getTileRangeForExtentAndZ(e,n);for(let g=i.minX,y=i.maxX;g<=y;++g)for(let k=i.minY,L=i.maxY;k<=L;++k)r([n,g,k])}forEachTileCoordParentTileRange(e,n,r,i){let g,y,k,L=null,$=e[0]-1;for(this.zoomFactor_===2?(y=e[1],k=e[2]):L=this.getTileCoordExtent(e,i);$>=this.minZoom;){if(y!==void 0&&k!==void 0?(y=Math.floor(y/2),k=Math.floor(k/2),g=createOrUpdate(y,y,k,k,r)):g=this.getTileRangeForExtentAndZ(L,$,r),n($,g))return!0;--$}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const g=e[1]*2,y=e[2]*2;return createOrUpdate(g,g+1,y,y+1,n)}const i=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,e[0]+1,n)}return null}getTileRangeForTileCoordAndZ(e,n,r){if(n>this.maxZoom||n<this.minZoom)return null;const i=e[0],g=e[1],y=e[2];if(n===i)return createOrUpdate(g,y,g,y,r);if(this.zoomFactor_){const L=Math.pow(this.zoomFactor_,n-i),$=Math.floor(g*L),V=Math.floor(y*L);if(n<i)return createOrUpdate($,$,V,V,r);const z=Math.floor(L*(g+1))-1,j=Math.floor(L*(y+1))-1;return createOrUpdate($,z,V,j,r)}const k=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(k,n,r)}getTileRangeForExtentAndZ(e,n,r){this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,tmpTileCoord);const i=tmpTileCoord[1],g=tmpTileCoord[2];this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,tmpTileCoord);const y=tmpTileCoord[1],k=tmpTileCoord[2];return createOrUpdate(i,y,g,k,r)}getTileCoordCenter(e){const n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=toSize(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*i[0]*r,n[1]-(e[2]+.5)*i[1]*r]}getTileCoordExtent(e,n){const r=this.getOrigin(e[0]),i=this.getResolution(e[0]),g=toSize(this.getTileSize(e[0]),this.tmpSize_),y=r[0]+e[1]*g[0]*i,k=r[1]-(e[2]+1)*g[1]*i,L=y+g[0]*i,$=k+g[1]*i;return createOrUpdate$2(y,k,L,$,n)}getTileCoordForCoordAndResolution(e,n,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,r)}getTileCoordForXYAndResolution_(e,n,r,i,g){const y=this.getZForResolution(r),k=r/this.getResolution(y),L=this.getOrigin(y),$=toSize(this.getTileSize(y),this.tmpSize_);let V=k*(e-L[0])/r/$[0],z=k*(L[1]-n)/r/$[1];return i?(V=ceil(V,DECIMALS)-1,z=ceil(z,DECIMALS)-1):(V=floor(V,DECIMALS),z=floor(z,DECIMALS)),createOrUpdate$1(y,V,z,g)}getTileCoordForXYAndZ_(e,n,r,i,g){const y=this.getOrigin(r),k=this.getResolution(r),L=toSize(this.getTileSize(r),this.tmpSize_);let $=(e-y[0])/k/L[0],V=(y[1]-n)/k/L[1];return i?($=ceil($,DECIMALS)-1,V=ceil(V,DECIMALS)-1):($=floor($,DECIMALS),V=floor(V,DECIMALS)),createOrUpdate$1(r,$,V,g)}getTileCoordForCoordAndZ(e,n,r){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,r)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,n){const r=linearFindNearest(this.resolutions_,e,n||0);return clamp(r,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,n){return intersectsLinearRing(n,0,n.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const n=this.resolutions_.length,r=new Array(n);for(let i=this.minZoom;i<n;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r}}function getForProjection(t){let e=t.getDefaultTileGrid();return e||(e=createForProjection(t),t.setDefaultTileGrid(e)),e}function wrapX(t,e,n){const r=e[0],i=t.getTileCoordCenter(e),g=extentFromProjection(n);if(!containsCoordinate(g,i)){const y=getWidth(g),k=Math.ceil((g[0]-i[0])/y);return i[0]+=y*k,t.getTileCoordForCoordAndZ(i,r)}return e}function createForExtent(t,e,n,r){r=r!==void 0?r:"top-left";const i=resolutionsFromExtent(t,e,n);return new TileGrid({extent:t,origin:getCorner(t,r),resolutions:i,tileSize:n})}function createXYZ(t){const e=t||{},n=e.extent||get$1("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:resolutionsFromExtent(n,e.maxZoom,e.tileSize,e.maxResolution)};return new TileGrid(r)}function resolutionsFromExtent(t,e,n,r){e=e!==void 0?e:DEFAULT_MAX_ZOOM,n=toSize(n!==void 0?n:DEFAULT_TILE_SIZE);const i=getHeight(t),g=getWidth(t);r=r>0?r:Math.max(g/n[0],i/n[1]);const y=e+1,k=new Array(y);for(let L=0;L<y;++L)k[L]=r/Math.pow(2,L);return k}function createForProjection(t,e,n,r){const i=extentFromProjection(t);return createForExtent(i,e,n,r)}function extentFromProjection(t){t=get$1(t);let e=t.getExtent();if(!e){const n=180*METERS_PER_UNIT$1.degrees/t.getMetersPerUnit();e=createOrUpdate$2(-n,-n,n,n)}return e}class TileSource extends Source{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const n=[256,256];this.tileGrid&&toSize(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),n),this.tmpSize=[0,0],this.key_=e.key||getUid(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const n=e?this.getTileGridForProjection(e):this.tileGrid;return n?n.getResolutions():null}getTile(e,n,r,i,g){return abstract()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:getForProjection(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,n,r){const i=this.getTileGridForProjection(r),g=this.getTilePixelRatio(n),y=toSize(i.getTileSize(e),this.tmpSize);return g==1?y:scale$1(y,g,this.tmpSize)}getTileCoordForTileUrlFunction(e,n){const r=n!==void 0?n:this.getProjection(),i=n!==void 0?this.getTileGridForProjection(r):this.tileGrid||this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(e=wrapX(i,e,r)),withinExtentAndZ(e,i)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class TileSourceEvent extends BaseEvent{constructor(e,n){super(e),this.tile=n}}const zRegEx=/\{z\}/g,xRegEx=/\{x\}/g,yRegEx=/\{y\}/g,dashYRegEx=/\{-y\}/g;function renderXYZTemplate(t,e,n,r,i){return t.replace(zRegEx,e.toString()).replace(xRegEx,n.toString()).replace(yRegEx,r.toString()).replace(dashYRegEx,function(){if(i===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(i-r).toString()})}function expandUrl(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const r=n[1].charCodeAt(0),i=n[2].charCodeAt(0);let g;for(g=r;g<=i;++g)e.push(t.replace(n[0],String.fromCharCode(g)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)e.push(t.replace(n[0],i.toString()));return e}return e.push(t),e}function createFromTemplate(t,e){return function(n,r,i){if(!n)return;let g;const y=n[0];if(e){const k=e.getFullTileRange(y);k&&(g=k.getHeight()-1)}return renderXYZTemplate(t,y,n[1],n[2],g)}}function createFromTemplates(t,e){const n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=createFromTemplate(t[i],e);return createFromTileUrlFunctions(r)}function createFromTileUrlFunctions(t){return t.length===1?t[0]:function(e,n,r){if(!e)return;const i=hash(e),g=modulo(i,t.length);return t[g](e,n,r)}}class UrlTile extends TileSource{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===UrlTile.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const n=e.target,r=getUid(n),i=n.getState();let g;i==TileState.LOADING?(this.tileLoadingKeys_[r]=!0,g=TileEventType.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],g=i==TileState.ERROR?TileEventType.TILELOADERROR:i==TileState.LOADED?TileEventType.TILELOADEND:void 0),g!=null&&this.dispatchEvent(new TileSourceEvent(g,n))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,n){this.tileUrlFunction=e,typeof n<"u"?this.setKey(n):this.changed()}setUrl(e){const n=expandUrl(e);this.urls=n,this.setUrls(n)}setUrls(e){this.urls=e;const n=e.join(`
691
+ </div>`,z=(y=mapInstance$3.value)==null?void 0:y.getPixelFromCoordinate(n.coordinate);if(z){const j=drawCustomContent(L.time,z,V,"top-left");j&&(t.value=j)}}else t.value&&((k=mapInstance$3.value)==null||k.removeOverlay(t.value))})},removeAllTrackLayer=()=>{var t;showTracks.value=[],(t=trackLineVectorSource.value)==null||t.clear()},playTrack=(t,e)=>{handlePlay(String(t),e)},resetTrackView=t=>{var i;const e=mapInstance$3.value.getView(),n=t?shipTrackLineFeatures.value.find(g=>g.getId()===t):shipTrackLineFeatures.value[0];if(!n)return;const r=(i=n==null?void 0:n.getGeometry())==null?void 0:i.getExtent();if(r!=null&&r.length)try{const g=buffer(r,Math.max(r[2]-r[0],r[3]-r[1])*.02);e.fit(g)}catch(g){console.log(g)}},formatMinutesToDDHHMM=t=>{const e=hooks.duration(t,"minutes"),n=Math.floor(e.asDays()),r=e.hours(),i=e.minutes();let g=`${String(i).padStart(2,"0")}分`;return r!==0&&(g=`${String(r).padStart(2,"0")}时${g}`),n!==0&&(g=`${String(n).padStart(2,"0")}天${g}`),g},_hoisted_1$9={key:0,class:"more-tool-panel"},_hoisted_2$5={class:"switch-buttons"},_hoisted_3$4={class:"tool-components"},_sfc_main$b=vue.defineComponent({__name:"toolPanel",props:{vehicleMode:{},viewMode:{},disableGreenDot:{type:Boolean},showTrackLayer:{type:Boolean},mapTileMode:{}},emits:["switchGreenDot","switchMapTile"],setup(t,{emit:e}){var oe,re;const n=vue.inject("mapInstance"),r=t,i=e,g=vue.ref(((re=(oe=n==null?void 0:n.value)==null?void 0:oe.getView())==null?void 0:re.getZoom())||mapZoom.default),y=vue.ref(!1),k=vue.ref(null),L=vue.ref(!0),$=()=>{r.disableGreenDot||g.value>=mapZoom.shipGreenDotMax||(L.value=!L.value,i("switchGreenDot",L.value))},V=()=>{i("switchMapTile",r.mapTileMode===BaseMapType.vector?BaseMapType.satellite:BaseMapType.vector)},z=()=>{var ie,ae;y.value?(ie=k.value)==null||ie.removeInteraction():(ae=k.value)==null||ae.addInteraction(),y.value=!y.value},j=()=>{var ie;(ie=k.value)==null||ie.removeInteraction(),y.value=!1};return vue.onMounted(()=>{vue.nextTick(()=>{var ie;(ie=n==null?void 0:n.value)==null||ie.on("moveend",()=>{var le,de;const ae=(de=(le=n==null?void 0:n.value)==null?void 0:le.getView())==null?void 0:de.getZoom();ae&&(g.value=ae)})})}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:vue.normalizeClass(`tool-panel ${ie.viewMode}`)},[ie.viewMode==="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$5,[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[5]||(ae[5]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[6]||(ae[6]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[0]||(ae[0]=le=>V())},ae[7]||(ae[7]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"图层",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="truck"?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[1]||(ae[1]=le=>V())},ae[8]||(ae[8]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)):vue.createCommentVNode("",!0),ie.showTrackLayer?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:4},[vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[2]||(ae[2]=le=>vue.unref(playTrack)(vue.unref(currentTrackId),1))},ae[9]||(ae[9]=[vue.createElementVNode("i",{class:"map-iconfont icon-play"},null,-1),vue.createElementVNode("div",{class:"button-text"},"播放轨迹",-1)])),vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[3]||(ae[3]=le=>vue.unref(resetTrackView)())},ae[10]||(ae[10]=[vue.createElementVNode("i",{class:"map-iconfont icon-center"},null,-1),vue.createElementVNode("div",{class:"button-text"},"轨迹居中",-1)]))],64)):vue.createCommentVNode("",!0),vue.renderSlot(ie.$slots,"toolPanel",{},void 0,!0)])])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[11]||(ae[11]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[12]||(ae[12]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",{active:ie.mapTileMode===vue.unref(BaseMapType).satellite}]),onClick:V},ae[13]||(ae[13]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)],64))],2),vue.createElementVNode("div",_hoisted_3$4,[y.value?(vue.openBlock(),vue.createBlock(Measure,{key:0,ref_key:"measureRef",ref:k,visible:y.value,"onUpdate:visible":ae[4]||(ae[4]=le=>y.value=le),onClose:j,"view-mode":ie.viewMode},null,8,["visible","view-mode"])):vue.createCommentVNode("",!0)])],64))}}),ToolPanel=_export_sfc(_sfc_main$b,[["__scopeId","data-v-79266143"]]),UNITS_PROP="units",LEADING_DIGITS=[1,2,5],DEFAULT_DPI=25.4/.28;let ScaleLine$1=class extends Control{constructor(e){e=e||{};const n=document.createElement("div");n.style.pointerEvents="none",super({element:n,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+CLASS_UNSELECTABLE,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(UNITS_PROP,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(UNITS_PROP)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(UNITS_PROP,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=e.center,r=e.projection,i=this.getUnits(),g=i=="degrees"?"degrees":"m";let y=getPointResolution(r,e.resolution,n,g);const k=this.minWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI,L=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI:void 0;let $=k*y,V="";if(i=="degrees"){const pe=METERS_PER_UNIT$1.degrees;$*=pe,$<pe/60?(V="″",y*=3600):$<pe?(V="′",y*=60):V="°"}else if(i=="imperial")$<.9144?(V="in",y/=.0254):$<1609.344?(V="ft",y/=.3048):(V="mi",y/=1609.344);else if(i=="nautical")y/=1852,V="NM";else if(i=="metric")$<1e-6?(V="nm",y*=1e9):$<.001?(V="μm",y*=1e6):$<1?(V="mm",y*=1e3):$<1e3?V="m":(V="km",y/=1e3);else if(i=="us")$<.9144?(V="in",y*=39.37):$<1609.344?(V="ft",y/=.30480061):(V="mi",y/=1609.3472);else throw new Error("Invalid units");let z=3*Math.floor(Math.log(k*y)/Math.log(10)),j,oe,re,ie,ae,le;for(;;){re=Math.floor(z/3);const pe=Math.pow(10,re);if(j=LEADING_DIGITS[(z%3+3)%3]*pe,oe=Math.round(j/y),isNaN(oe)){this.element.style.display="none",this.renderedVisible_=!1;return}if(L!==void 0&&oe>=L){j=ie,oe=ae,re=le;break}else if(oe>=k)break;ie=j,ae=oe,le=re,++z}const de=this.scaleBar_?this.createScaleBar(oe,j,V):j.toFixed(re<0?-re:0)+" "+V;this.renderedHTML_!=de&&(this.innerElement_.innerHTML=de,this.renderedHTML_=de),this.renderedWidth_!=oe&&(this.innerElement_.style.width=oe+"px",this.renderedWidth_=oe),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,n,r){const i=this.getScaleForResolution(),g=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),y=this.scaleBarSteps_,k=e/y,L=[this.createMarker("absolute")];for(let V=0;V<y;++V){const z=V%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";L.push(`<div><div class="ol-scale-singlebar ${z}" style="width: ${k}px;"></div>`+this.createMarker("relative")+(V%2===0||y===2?this.createStepText(V,e,!1,n,r):"")+"</div>")}return L.push(this.createStepText(y,e,!0,n,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+g+"</div>":"")+L.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,n,r,i,g){const k=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+g),L=e===0?-3:n/this.scaleBarSteps_*-1,$=e===0?0:n/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${L}px;text-align: ${e===0?"left":"center"};min-width: ${$}px;left: ${r?n+"px":"unset"};">`+k+"</div>"}getScaleForResolution(){const e=getPointResolution(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),n=this.dpi_||DEFAULT_DPI,r=1e3/25.4;return e*r*n}render(e){const n=e.frameState;n?this.viewState_=n.viewState:this.viewState_=null,this.updateElement_()}};const _hoisted_1$8={id:"scale-line-container"},_sfc_main$a=vue.defineComponent({__name:"scaleLine",setup(t,{expose:e}){const n=vue.inject("mapInstance");return e({setScaleLine:i=>{var k;i||(i="metric");const g=new ScaleLine$1({units:i}),y=document.getElementById("scale-line-container");y&&(g.setTarget(y),(k=n==null?void 0:n.value)==null||k.addControl(g))}}),(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8))}}),ScaleLine=_export_sfc(_sfc_main$a,[["__scopeId","data-v-d666f80d"]]),_hoisted_1$7={class:"zoom"},_sfc_main$9=vue.defineComponent({__name:"zoomControl",props:{map:{type:Object}},setup(t){const e=vue.inject("mapInstance"),n=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g+1)},r=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g-1)};return(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createElementVNode("div",{onClick:n,class:"button big-button"},"+"),vue.createElementVNode("div",{onClick:r,class:"button small-button"},"-")]))}}),ZoomControl=_export_sfc(_sfc_main$9,[["__scopeId","data-v-ee822625"]]),_hoisted_1$6={class:"copyright"},_hoisted_2$4=["src","width"],_sfc_main$8=vue.defineComponent({__name:"copyright",props:{type:{default:COPY_RIGHT_TYPE.HORIZONTAL},mapTile:{default:BaseMapType.satellite}},setup(t){vue.useCssVars(g=>({"0d38823b":i.value}));const e=t,n=vue.computed(()=>e.type===COPY_RIGHT_TYPE.HORIZONTAL?`map/tdt-copyright-h${e.mapTile===BaseMapType.satellite?"-w":""}.svg`:`map/tdt-copyright-v${e.mapTile===BaseMapType.satellite?"-w":""}.svg`),r=vue.computed(()=>e.type===COPY_RIGHT_TYPE.HORIZONTAL?"400px":"168px"),i=vue.computed(()=>e.type===COPY_RIGHT_TYPE.HORIZONTAL?"auto auto 0 5px":"0 auto auto 5px");return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("img",{src:vue.unref(CDN_URL)+n.value,width:r.value,class:"logo",alt:""},null,8,_hoisted_2$4)]))}}),Copyright=_export_sfc(_sfc_main$8,[["__scopeId","data-v-15a296ba"]]),TileEventType={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},tmpTileCoord=[0,0,0],DECIMALS=5;class TileGrid{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,assert(isSorted(this.resolutions_,(i,g)=>g-i),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let i=0,g=this.resolutions_.length-1;i<g;++i)if(!n)n=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,assert(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const r=e.extent;r!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=getTopLeft(r)),assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,assert(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:DEFAULT_TILE_SIZE,assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=r!==void 0?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((i,g)=>{const y=new TileRange(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(r){const k=this.getTileRangeForExtentAndZ(r,g);y.minX=Math.max(k.minX,y.minX),y.maxX=Math.min(k.maxX,y.maxX),y.minY=Math.max(k.minY,y.minY),y.maxY=Math.min(k.maxY,y.maxY)}return y}):r&&this.calculateTileRanges_(r)}forEachTileCoord(e,n,r){const i=this.getTileRangeForExtentAndZ(e,n);for(let g=i.minX,y=i.maxX;g<=y;++g)for(let k=i.minY,L=i.maxY;k<=L;++k)r([n,g,k])}forEachTileCoordParentTileRange(e,n,r,i){let g,y,k,L=null,$=e[0]-1;for(this.zoomFactor_===2?(y=e[1],k=e[2]):L=this.getTileCoordExtent(e,i);$>=this.minZoom;){if(y!==void 0&&k!==void 0?(y=Math.floor(y/2),k=Math.floor(k/2),g=createOrUpdate(y,y,k,k,r)):g=this.getTileRangeForExtentAndZ(L,$,r),n($,g))return!0;--$}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const g=e[1]*2,y=e[2]*2;return createOrUpdate(g,g+1,y,y+1,n)}const i=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,e[0]+1,n)}return null}getTileRangeForTileCoordAndZ(e,n,r){if(n>this.maxZoom||n<this.minZoom)return null;const i=e[0],g=e[1],y=e[2];if(n===i)return createOrUpdate(g,y,g,y,r);if(this.zoomFactor_){const L=Math.pow(this.zoomFactor_,n-i),$=Math.floor(g*L),V=Math.floor(y*L);if(n<i)return createOrUpdate($,$,V,V,r);const z=Math.floor(L*(g+1))-1,j=Math.floor(L*(y+1))-1;return createOrUpdate($,z,V,j,r)}const k=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(k,n,r)}getTileRangeForExtentAndZ(e,n,r){this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,tmpTileCoord);const i=tmpTileCoord[1],g=tmpTileCoord[2];this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,tmpTileCoord);const y=tmpTileCoord[1],k=tmpTileCoord[2];return createOrUpdate(i,y,g,k,r)}getTileCoordCenter(e){const n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=toSize(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*i[0]*r,n[1]-(e[2]+.5)*i[1]*r]}getTileCoordExtent(e,n){const r=this.getOrigin(e[0]),i=this.getResolution(e[0]),g=toSize(this.getTileSize(e[0]),this.tmpSize_),y=r[0]+e[1]*g[0]*i,k=r[1]-(e[2]+1)*g[1]*i,L=y+g[0]*i,$=k+g[1]*i;return createOrUpdate$2(y,k,L,$,n)}getTileCoordForCoordAndResolution(e,n,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,r)}getTileCoordForXYAndResolution_(e,n,r,i,g){const y=this.getZForResolution(r),k=r/this.getResolution(y),L=this.getOrigin(y),$=toSize(this.getTileSize(y),this.tmpSize_);let V=k*(e-L[0])/r/$[0],z=k*(L[1]-n)/r/$[1];return i?(V=ceil(V,DECIMALS)-1,z=ceil(z,DECIMALS)-1):(V=floor(V,DECIMALS),z=floor(z,DECIMALS)),createOrUpdate$1(y,V,z,g)}getTileCoordForXYAndZ_(e,n,r,i,g){const y=this.getOrigin(r),k=this.getResolution(r),L=toSize(this.getTileSize(r),this.tmpSize_);let $=(e-y[0])/k/L[0],V=(y[1]-n)/k/L[1];return i?($=ceil($,DECIMALS)-1,V=ceil(V,DECIMALS)-1):($=floor($,DECIMALS),V=floor(V,DECIMALS)),createOrUpdate$1(r,$,V,g)}getTileCoordForCoordAndZ(e,n,r){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,r)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,n){const r=linearFindNearest(this.resolutions_,e,n||0);return clamp(r,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,n){return intersectsLinearRing(n,0,n.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const n=this.resolutions_.length,r=new Array(n);for(let i=this.minZoom;i<n;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r}}function getForProjection(t){let e=t.getDefaultTileGrid();return e||(e=createForProjection(t),t.setDefaultTileGrid(e)),e}function wrapX(t,e,n){const r=e[0],i=t.getTileCoordCenter(e),g=extentFromProjection(n);if(!containsCoordinate(g,i)){const y=getWidth(g),k=Math.ceil((g[0]-i[0])/y);return i[0]+=y*k,t.getTileCoordForCoordAndZ(i,r)}return e}function createForExtent(t,e,n,r){r=r!==void 0?r:"top-left";const i=resolutionsFromExtent(t,e,n);return new TileGrid({extent:t,origin:getCorner(t,r),resolutions:i,tileSize:n})}function createXYZ(t){const e=t||{},n=e.extent||get$1("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:resolutionsFromExtent(n,e.maxZoom,e.tileSize,e.maxResolution)};return new TileGrid(r)}function resolutionsFromExtent(t,e,n,r){e=e!==void 0?e:DEFAULT_MAX_ZOOM,n=toSize(n!==void 0?n:DEFAULT_TILE_SIZE);const i=getHeight(t),g=getWidth(t);r=r>0?r:Math.max(g/n[0],i/n[1]);const y=e+1,k=new Array(y);for(let L=0;L<y;++L)k[L]=r/Math.pow(2,L);return k}function createForProjection(t,e,n,r){const i=extentFromProjection(t);return createForExtent(i,e,n,r)}function extentFromProjection(t){t=get$1(t);let e=t.getExtent();if(!e){const n=180*METERS_PER_UNIT$1.degrees/t.getMetersPerUnit();e=createOrUpdate$2(-n,-n,n,n)}return e}class TileSource extends Source{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const n=[256,256];this.tileGrid&&toSize(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),n),this.tmpSize=[0,0],this.key_=e.key||getUid(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const n=e?this.getTileGridForProjection(e):this.tileGrid;return n?n.getResolutions():null}getTile(e,n,r,i,g){return abstract()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:getForProjection(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,n,r){const i=this.getTileGridForProjection(r),g=this.getTilePixelRatio(n),y=toSize(i.getTileSize(e),this.tmpSize);return g==1?y:scale$1(y,g,this.tmpSize)}getTileCoordForTileUrlFunction(e,n){const r=n!==void 0?n:this.getProjection(),i=n!==void 0?this.getTileGridForProjection(r):this.tileGrid||this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(e=wrapX(i,e,r)),withinExtentAndZ(e,i)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class TileSourceEvent extends BaseEvent{constructor(e,n){super(e),this.tile=n}}const zRegEx=/\{z\}/g,xRegEx=/\{x\}/g,yRegEx=/\{y\}/g,dashYRegEx=/\{-y\}/g;function renderXYZTemplate(t,e,n,r,i){return t.replace(zRegEx,e.toString()).replace(xRegEx,n.toString()).replace(yRegEx,r.toString()).replace(dashYRegEx,function(){if(i===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(i-r).toString()})}function expandUrl(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const r=n[1].charCodeAt(0),i=n[2].charCodeAt(0);let g;for(g=r;g<=i;++g)e.push(t.replace(n[0],String.fromCharCode(g)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)e.push(t.replace(n[0],i.toString()));return e}return e.push(t),e}function createFromTemplate(t,e){return function(n,r,i){if(!n)return;let g;const y=n[0];if(e){const k=e.getFullTileRange(y);k&&(g=k.getHeight()-1)}return renderXYZTemplate(t,y,n[1],n[2],g)}}function createFromTemplates(t,e){const n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=createFromTemplate(t[i],e);return createFromTileUrlFunctions(r)}function createFromTileUrlFunctions(t){return t.length===1?t[0]:function(e,n,r){if(!e)return;const i=hash(e),g=modulo(i,t.length);return t[g](e,n,r)}}class UrlTile extends TileSource{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===UrlTile.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const n=e.target,r=getUid(n),i=n.getState();let g;i==TileState.LOADING?(this.tileLoadingKeys_[r]=!0,g=TileEventType.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],g=i==TileState.ERROR?TileEventType.TILELOADERROR:i==TileState.LOADED?TileEventType.TILELOADEND:void 0),g!=null&&this.dispatchEvent(new TileSourceEvent(g,n))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,n){this.tileUrlFunction=e,typeof n<"u"?this.setKey(n):this.changed()}setUrl(e){const n=expandUrl(e);this.urls=n,this.setUrls(n)}setUrls(e){this.urls=e;const n=e.join(`
692
692
  `);this.generateTileUrlFunction_?this.setTileUrlFunction(createFromTemplates(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,r){}}class TileImage extends UrlTile{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:defaultTileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ImageTile,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!equivalent(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||equivalent(n,e)))return this.tileGrid;const r=getUid(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=getForProjection(e)),this.tileGridForProjection[r]}createTile_(e,n,r,i,g,y){const k=[e,n,r],L=this.getTileCoordForTileUrlFunction(k,g),$=L?this.tileUrlFunction(L,i,g):void 0,V=new this.tileClass(k,$!==void 0?TileState.IDLE:TileState.EMPTY,$!==void 0?$:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return V.key=y,V.addEventListener(EventType.CHANGE,this.handleTileChange.bind(this)),V}getTile(e,n,r,i,g){const y=this.getProjection();if(!y||!g||equivalent(y,g))return this.getTileInternal(e,n,r,i,y||g);const k=[e,n,r],L=this.getKey(),$=this.getTileGridForProjection(y),V=this.getTileGridForProjection(g),z=this.getTileCoordForTileUrlFunction(k,g),j=new ReprojTile(y,$,g,V,k,z,this.getTilePixelRatio(i),this.getGutter(),(oe,re,ie,ae)=>this.getTileInternal(oe,re,ie,ae,y),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return j.key=L,j}getTileInternal(e,n,r,i,g){const y=this.getKey();return this.createTile_(e,n,r,i,g,y)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const r=get$1(e);if(r){const i=getUid(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=n)}}}function defaultTileLoadFunction(t,e){t.getImage().src=e}class XYZ extends TileImage{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",r=e.tileGrid!==void 0?e.tileGrid:createXYZ({extent:extentFromProjection(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const dotImage=new Image;dotImage.src=`${CDN_URL}/map/truck-dot.svg`,dotImage.crossOrigin="anonymous";const dotActiveImage=new Image;dotActiveImage.src=`${CDN_URL}/map/truck-dot-active.svg`,dotActiveImage.crossOrigin="anonymous";const cameraImage=new Image;cameraImage.src=`${CDN_URL}/map/map-camera.svg`,cameraImage.crossOrigin="anonymous";const loadImage=new Image;loadImage.src=`${CDN_URL}/map/map-load.svg`,loadImage.crossOrigin="anonymous";const setTruckStyle=(t,e,n,r)=>new Style({renderer:(i,g)=>{const y=g.context;y.save();let k=1;y.scale(k,k);let[L,$]=i;L=Number(L)/k-20,$=Number($)/k;const V=L-70,z=$-68;let j=180;const oe=56,re="#FFFFFF";let ie=176;const ae=52;let le="#164AFF",de="#FFFFFF";n===CAR_COLOR.YELLOW?(ie=176,le="#FFC81E",de="rgba(0,0,0,0.88)"):n===CAR_COLOR.Y_GREEN&&(j=200,ie=196,le="#8FED7C",de="rgba(0,0,0,0.88)"),r!=null&&r.length&&(j+=r.length*56),fillRectRadius(y,V,z,j,oe,re),fillRectRadius(y,V+2,z+2,ie,ae,le),n===CAR_COLOR.Y_GREEN&&fillRectRadius(y,V+2,z+2,68,ae,"#FFC81E"),y.save(),y.restore(),y.fillStyle=de,y.font="bold 28px Arial",y.textAlign="left",y.textBaseline="middle";const pe=`${e.slice(0,2)+" · "+e.slice(2)}`;if(y.fillText(pe,V+12,z+32),y.save(),y.restore(),r!=null&&r.length){const he=y.measureText(pe).width+12;let _e=0;r.forEach(Ce=>{Ce===DEVICE_TYPE.CAMERA&&(y.drawImage(cameraImage,L-54+he+_e*56,$-64,50,50),++_e),Ce===DEVICE_TYPE.LOAD&&(y.drawImage(loadImage,L-54+he+_e*56,$-64,50,50),++_e)})}const ue=dotImage;y.drawImage(ue,L+j/2-90,$,50/k,50/k),y.restore()}}),mapInstance$2=vue.ref(),renderDashboardSetInstance=t=>mapInstance$2.value=t;vue.ref([]);let truckMarkerList=[],trucksVectorSource;const renderTrucksMarker=t=>{if(deleteAllTruckMarkers(),!!mapInstance$2.value)return t.forEach(e=>{const n=formatUtils.convertSixHundredThousandToLatLng(e.lon,e.lat),r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",e),r.setStyle(setTruckStyle(!1,e.vno,e.vclColor??0,e.icons??[])),truckMarkerList.push({name:e.vno,lonlat:n,feature:r})}),trucksVectorSource=new VectorSource({features:truckMarkerList.map(e=>e.feature)}),trucksLayer.value=new VectorLayer({source:trucksVectorSource}),mapInstance$2.value.addLayer(trucksLayer.value),trucksLayer.value},deleteAllTruckMarkers=()=>{truckMarkerList.forEach(t=>{t.feature&&(trucksVectorSource==null||trucksVectorSource.removeFeature(t.feature))}),truckMarkerList=[]},mapInstance$1=vue.ref(),renderTruckSetInstance=t=>mapInstance$1.value=t,vehicle=vue.ref(null),focusShipData=vue.ref(),currentTruckOverlay=vue.ref(null),findTruck=async(t,e)=>{if(!mapInstance$1.value||(focusShipData.value=t,!(t!=null&&t.lon&&(t!=null&&t.lat))))return;const n=Math.abs(Number(t.lon))>180?formatUtils.convertSixHundredThousandToLatLng(t.lon,t.lat):[t.lon,t.lat],r=mapInstance$1.value.getPixelFromCoordinate(transform(n,projection.data,projection.mercator));currentTruckOverlay.value=t?drawTruckIcon(t.vno,r,(t==null?void 0:t.drc)??"",e)??null:null;const i=mapInstance$1.value.getView(),g=new Point(n);i.setCenter(transform(g.getCoordinates(),projection.data,projection.mercator))},clearAllTruck=()=>{vehicle.value.clearAllShip()},drawTruckIcon=(t,e,n,r)=>{let i=`<div id="${t}" class="ol-custom-content truck-custom-content" style="width: 80px; height: 80px; transform: rotate(${n}deg);">
693
693
  <img src="${CDN_URL}map/car-icon.gif" width="100%" height="100%" />
694
- </div>`;return r&&(i+=r),drawCustomContent(t,e,i,"center-center")},removeTruckIcon=()=>{var e;const t=(e=currentTruckOverlay.value)==null?void 0:e.getElement();t&&(t.innerHTML="")},zoomTruckIcon=()=>{var g;if(!mapInstance$1.value)return;const t=mapInstance$1.value.getView().getZoom(),e=120,n=60;function r(y){return y<14?n:y>=14&&y<=18?Math.round((y-14)*(e-n)/4+n):e}const i=r(t);(g=document.querySelectorAll(".truck-custom-content"))==null||g.forEach(y=>{y.style.width=`${i}px`,y.style.height=`${i}px`})},mapInstance=vue.ref(),drawPolygonSetInstance=t=>mapInstance.value=t;let layerState="drawn",drawnState="undrawn";const source=new VectorSource;let sketch,helpTooltipElement,helpTooltip,measureTooltipElement,measureTooltip,circleStyle,drawVector,draw;const drawPolygonStyle={drawend:new Style({stroke:new Stroke({color:"#fbcc33",width:2})}),drawing:new Style({stroke:new Stroke({color:"rgba(255, 255, 255, 1)",width:1.5,lineDash:[10,10]}),fill:new Fill({color:"rgba(255, 255, 255, 0.25)"})})};function createMeasureTooltip(){var t;measureTooltipElement!=null&&measureTooltipElement.parentNode&&measureTooltipElement.parentNode.removeChild(measureTooltipElement),measureTooltipElement=document.createElement("div"),measureTooltipElement.className="ol-tooltip ol-tooltip-draw-polygon",measureTooltip=new Overlay({element:measureTooltipElement,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(t=mapInstance.value)==null||t.addOverlay(measureTooltip)}function createHelpTooltip(){var t;helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),helpTooltipElement=document.createElement("div"),helpTooltipElement.className="ol-tooltip ol-help-tooltip hidden",helpTooltip=new Overlay({element:helpTooltipElement,offset:[15,0],positioning:"center-left"}),(t=mapInstance.value)==null||t.addOverlay(helpTooltip)}let squareLimitError=!1,lineLimitError=!1;const validateSquareLimit=t=>{let n=1/0,r=-1/0,i=1/0,g=-1/0;t==null||t.forEach(L=>{const $=transform(L,projection.mercator,projection.data),V=$[0],z=$[1];n=Math.min(n,z),r=Math.max(r,z),i=Math.min(i,V),g=Math.max(g,V)});const y=(r-n)*111,k=(g-i)*111;squareLimitError=y>150||k>150};let storeFeature,callbackFunction=null;const addInteraction=t=>{var n,r;t&&(callbackFunction=t),drawVector||init(),drawnState="undrawn",layerState="drawn",(n=mapInstance.value)==null||n.addLayer(drawVector),draw=new Draw({type:"Polygon",source,trace:!0,style:[drawPolygonStyle.drawing,circleStyle]}),(r=mapInstance.value)==null||r.addInteraction(draw),createMeasureTooltip(),createHelpTooltip();let e;draw.on("drawstart",function(i){var g;layerState="drawn",sketch=i.feature,e=(g=sketch.getGeometry())==null?void 0:g.on("change",function(y){const k=y.target,L=formatUtils.formatArea(k,LENGTH_UNIT.NM),V=k.getCoordinates()[0],z=new LineString([V[V.length-2],V[V.length-1]]),j=formatUtils.formatLength(z,LENGTH_UNIT.NM);if(lineLimitError=Number(getLength(z)/1e3)>150,validateSquareLimit(V),measureTooltipElement&&L&&(measureTooltipElement.innerHTML=`
694
+ </div>`;return r&&(i+=r),drawCustomContent(t,e,i,"center-center")},removeTruckIcon=()=>{var e;const t=(e=currentTruckOverlay.value)==null?void 0:e.getElement();t&&(t.innerHTML="")},zoomTruckIcon=()=>{var g;if(!mapInstance$1.value)return;const t=mapInstance$1.value.getView().getZoom(),e=120,n=60;function r(y){return y<14?n:y>=14&&y<=18?Math.round((y-14)*(e-n)/4+n):e}const i=r(t);(g=document.querySelectorAll(".truck-custom-content"))==null||g.forEach(y=>{y.style.width=`${i}px`,y.style.height=`${i}px`})},mapInstance=vue.ref(),drawPolygonSetInstance=t=>mapInstance.value=t;let layerState="drawn",drawnState="undrawn";const source=new VectorSource;let sketch,helpTooltipElement,helpTooltip,measureTooltipElement,measureTooltip,circleStyle,drawVector,draw;const drawPolygonStyle={drawend:new Style({stroke:new Stroke({color:"#fbcc33",width:2})}),drawing:new Style({stroke:new Stroke({color:"rgba(255, 255, 255, 1)",width:1.5,lineDash:[10,10]}),fill:new Fill({color:"rgba(255, 255, 255, 0.25)"})})};function createMeasureTooltip(){var t;measureTooltipElement!=null&&measureTooltipElement.parentNode&&measureTooltipElement.parentNode.removeChild(measureTooltipElement),measureTooltipElement=document.createElement("div"),measureTooltipElement.className="ol-tooltip ol-tooltip-draw-polygon",measureTooltip=new Overlay({element:measureTooltipElement,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(t=mapInstance.value)==null||t.addOverlay(measureTooltip)}function createHelpTooltip(){var t;helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),helpTooltipElement=document.createElement("div"),helpTooltipElement.className="ol-tooltip ol-help-tooltip hidden",helpTooltip=new Overlay({element:helpTooltipElement,offset:[15,0],positioning:"center-left"}),(t=mapInstance.value)==null||t.addOverlay(helpTooltip)}let squareLimitError=!1,lineLimitError=!1;const validateSquareLimit=t=>{let n=1/0,r=-1/0,i=1/0,g=-1/0;t==null||t.forEach(L=>{const $=transform(L,projection.mercator,projection.data),V=$[0],z=$[1];n=Math.min(n,z),r=Math.max(r,z),i=Math.min(i,V),g=Math.max(g,V)});const y=(r-n)*111,k=(g-i)*111;squareLimitError=y>150||k>150};let storeFeature,callbackFunction=null;const addInteraction=t=>{var n,r;showDrawLayer.value=!0,t&&(callbackFunction=t),drawVector||init(),drawnState="undrawn",layerState="drawn",drawVector&&((n=mapInstance.value)==null||n.addLayer(drawVector)),draw=new Draw({type:"Polygon",source,trace:!0,style:[drawPolygonStyle.drawing,circleStyle]}),storeFeature||((r=mapInstance.value)==null||r.addInteraction(draw),createHelpTooltip()),createMeasureTooltip();let e;draw.on("drawstart",function(i){var g;layerState="drawn",sketch=i.feature,e=(g=sketch.getGeometry())==null?void 0:g.on("change",function(y){const k=y.target,L=formatUtils.formatArea(k,LENGTH_UNIT.NM),V=k.getCoordinates()[0],z=new LineString([V[V.length-2],V[V.length-1]]),j=formatUtils.formatLength(z,LENGTH_UNIT.NM);if(lineLimitError=Number(getLength(z)/1e3)>150,validateSquareLimit(V),measureTooltipElement&&L&&(measureTooltipElement.innerHTML=`
695
695
  <span class="text">面积:${L}${lineLimitError||squareLimitError?'<span class="error pl-12">超出可以绘画的距离</span>':""}</span>
696
696
  `),helpTooltipElement&&L){let oe="";parseFloat(L)>0&&(oe=`
697
697
  <div class="text ${squareLimitError?"error":""}">面积:${L}${squareLimitError?'<span class="error pl-12">超出可以绘画的距离</span>':""}</div>`),helpTooltipElement.innerHTML=`${oe}
698
698
  <span class="text ${lineLimitError?"error":""}">线段${V.length-2}:${j}${lineLimitError?'<span class="error pl-4">超出可以绘画的距离</span>':""}</span>
699
699
  <div><span class="text">单击继续,双击结束</span></div>
700
- `}}),drawnState="drawing"}),draw.on("drawend",function(i){if(i.feature.getGeometry()){storeFeature=i.feature;const g=endFn(i.feature);g!=null&&g.length&&callbackFunction&&callbackFunction(g)}if(sketch=null,measureTooltipElement=null,createMeasureTooltip(),e&&unByKey(e),drawnState="drawend",draw&&mapInstance.value){const g=mapInstance.value.getInteractions().getArray().find(y=>getUid(y)===getUid(draw));g&&mapInstance.value.removeInteraction(g),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement)}})},removeInteraction=()=>{var t,e,n;if(mapInstance.value){if(document.querySelectorAll(".ol-tooltip.ol-tooltip-draw-polygon").forEach(r=>{var i;(i=r==null?void 0:r.parentNode)==null||i.removeChild(r)}),source.clear(),(t=mapInstance.value)==null||t.removeLayer(drawVector),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),((e=mapInstance.value)==null?void 0:e.getTargetElement()).style.cursor="",document.querySelector("#map").style.cursor="",draw){const r=mapInstance.value.getInteractions().getArray().find(i=>getUid(i)===getUid(draw));r&&((n=mapInstance.value)==null||n.removeInteraction(r))}drawnState="undrawn",layerState="destroyed"}},endFn=t=>{var e,n,r;if(t.getGeometry()){const i=[],y=t.getGeometry().getCoordinates();(e=y[0])==null||e.forEach(L=>{i.push(transform(L,projection.mercator,projection.data))});const k=y[0][y[0].length-2];if(k&&measureTooltip.setPosition(k),measureTooltip.setOffset([10,0]),measureTooltipElement&&(measureTooltipElement.innerHTML+='<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'),(n=document.querySelector(".delete-icon"))==null||n.addEventListener("click",()=>{reset()}),!lineLimitError&&!squareLimitError)return i;draw&&((r=mapInstance.value)==null||r.removeInteraction(draw)),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement)}},initFeature=t=>{var e,n;if(t&&(callbackFunction=t),layerState="drawn",storeFeature){const r=storeFeature.getGeometry();if(!r)return;const i=formatUtils.formatArea(r,LENGTH_UNIT.NM);measureTooltipElement&&(measureTooltipElement.innerHTML=`
700
+ `}}),drawnState="drawing"}),draw.on("drawend",function(i){if(i.feature.getGeometry()){storeFeature=i.feature;const g=endFn(i.feature);g!=null&&g.length&&callbackFunction&&callbackFunction(g)}if(sketch=null,measureTooltipElement=null,createMeasureTooltip(),e&&unByKey(e),drawnState="drawend",draw&&mapInstance.value){const g=mapInstance.value.getInteractions().getArray().find(y=>getUid(y)===getUid(draw));g&&mapInstance.value.removeInteraction(g),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement)}})},removeInteraction=()=>{var t,e,n;if(mapInstance.value){if(showDrawLayer.value=!1,document.querySelectorAll(".ol-tooltip.ol-tooltip-draw-polygon").forEach(r=>{var i;(i=r==null?void 0:r.parentNode)==null||i.removeChild(r)}),source.clear(),drawVector&&((t=mapInstance.value)==null||t.removeLayer(drawVector)),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),((e=mapInstance.value)==null?void 0:e.getTargetElement()).style.cursor="",document.querySelector("#map").style.cursor="",draw){const r=mapInstance.value.getInteractions().getArray().find(i=>getUid(i)===getUid(draw));r&&((n=mapInstance.value)==null||n.removeInteraction(r))}drawnState="undrawn",layerState="destroyed"}},endFn=t=>{var e,n,r;if(t.getGeometry()){const i=[],y=t.getGeometry().getCoordinates();(e=y[0])==null||e.forEach(L=>{i.push(transform(L,projection.mercator,projection.data))});const k=y[0][y[0].length-2];if(k&&measureTooltip.setPosition(k),measureTooltip.setOffset([10,0]),measureTooltipElement&&(measureTooltipElement.innerHTML+='<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'),(n=document.querySelector(".delete-icon"))==null||n.addEventListener("click",()=>{reset()}),!lineLimitError&&!squareLimitError)return i;draw&&((r=mapInstance.value)==null||r.removeInteraction(draw)),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement)}},initFeature=t=>{var e,n;if(t&&(callbackFunction=t),layerState="drawn",storeFeature){const r=storeFeature.getGeometry();if(!r)return;const i=formatUtils.formatArea(r,LENGTH_UNIT.NM);measureTooltipElement&&(measureTooltipElement.innerHTML=`
701
701
  <span class="text">面积:${i}${lineLimitError||squareLimitError?'<span class="error pl-12">超出可以绘画的距离</span>':""}</span>
702
- `),(e=drawVector.getSource())==null||e.addFeature(storeFeature);const g=endFn(storeFeature);g!=null&&g.length&&callbackFunction&&callbackFunction(g);const y=getCenter(storeFeature.getGeometry().getExtent());(n=mapInstance.value)==null||n.getView().setCenter(y)}},pointerMoveHandler=function(t){var n;if(t.dragging)return;let e="点击选择起点";sketch&&(e="单击继续,双击结束"),helpTooltipElement&&(helpTooltipElement.innerHTML=e,helpTooltip.setPosition(t.coordinate),helpTooltipElement.classList.remove("hidden")),layerState==="drawn"&&(((n=mapInstance.value)==null?void 0:n.getTargetElement()).style.cursor="crosshair")},init=()=>{mapInstance.value&&(circleStyle=new Style({image:new CircleStyle({radius:5,fill:new Fill({color:"rgb(51,112,255, 1)"})}),geometry:function(t){const e=t.getGeometry().getCoordinates();return new MultiPoint(e)}}),drawVector=new VectorLayer({source,style:drawPolygonStyle.drawend}),mapInstance.value.on("pointermove",pointerMoveHandler),mapInstance.value.getViewport().addEventListener("mouseout",function(){var t;(t=helpTooltipElement==null?void 0:helpTooltipElement.classList)==null||t.add("hidden")}),mapInstance.value.on(["dblclick"],function(t){drawnState!=="undrawn"&&(t.stopPropagation(),t.preventDefault())}))},reset=()=>{removeInteraction(),addInteraction(),storeFeature=null},drawPolygonTool={addInteraction,removeInteraction,initFeature,reset},setPointStyle=(t,e,n)=>{const r=new Image;r.crossOrigin="anonymous";const i=new Image;i.crossOrigin="anonymous";const{color:g,url:y,activeUrl:k,activeColor:L,imgWidth:$,imgHeight:V}=n;return(k||y)&&(t?i.src=CDN_URL+(k||y):r.src=CDN_URL+(y||k)),new Style({renderer:(z,j)=>{const oe=j.context;oe.save();const re=window.devicePixelRatio||1;let[ie,ae]=z;if(ie=Number(ie),ae=Number(ae),e){oe.font=`${12*re}px Arial`;const le=oe.measureText(e).width,de=ie-le/2-(re<=1?8:re),pe=ae+6*re,ue=le+4,he=16*re,_e=t&&L||g;fillRectRadius(oe,de,pe+(re<=1?6:13*re),ue,he,_e),oe.save(),oe.restore(),oe.fillStyle=t?"#FFFFFF":"#000000",oe.textAlign="center",oe.textBaseline="middle",oe.fillText(e,de+(le+4)/2,pe+(re<=1?16:22*re)),oe.save(),oe.restore()}if(y||k){const le=t?i:r;oe.drawImage(le,ie-($||le.width)/2,ae-(V||le.height)/2,30*re,30*re)}oe.restore()}})};class PointMarkerClass{constructor(e,n){qn(this,"mapInstance");qn(this,"pointMarkerList",[]);qn(this,"pointsVectorSource");qn(this,"highlightPoint");qn(this,"pointLayer");qn(this,"options");qn(this,"resetPointsView",e=>{var g;if(!this.mapInstance||e.length===0)return;const n=(g=this.mapInstance)==null?void 0:g.getView();if(!n)return;const i=e.map(y=>transform(y,projection.data,projection.mercator)).reduce((y,k)=>[Math.min(y[0],k[0]),Math.min(y[1],k[1]),Math.max(y[2],k[0]),Math.max(y[3],k[1])],[1/0,1/0,-1/0,-1/0]);try{const y=buffer(i,Math.max(i[2]-i[0],i[3]-i[1])*.02);n.fit(y)}catch(y){console.error("Failed to zoom to points:",y)}});this.mapInstance=e,this.options=n}renderPointMarker(e){if(!this.mapInstance)return;let n={};e.forEach(r=>{var g;const i=[r.lon,r.lat];if(((g=this.highlightPoint)==null?void 0:g.id)===r.id)n={id:r.id,name:r.name,lonlat:[Number(r.lon),Number(r.lat)],pointType:r.pointType};else{const y=this.getFeature(r,i);this.pointMarkerList.push({id:r.id,name:r.name,lonlat:[Number(r.lon),Number(r.lat)],feature:y,pointType:r.pointType})}}),n&&n.lonlat&&(n.feature=this.getFeature(n,n.lonlat),this.pointMarkerList.push(n)),this.pointsVectorSource=new VectorSource({features:[...this.pointMarkerList.map(r=>r.feature)]}),this.pointLayer=new VectorLayer({source:this.pointsVectorSource}),this.mapInstance.addLayer(this.pointLayer)}deleteAllPointMarkers(e){this.pointMarkerList.forEach(n=>{var r;n.feature&&e!==n.id&&((r=this.pointsVectorSource)==null||r.removeFeature(n.feature))})}cancelHighlightTruckMarker(){if(!this.highlightPoint)return;const{id:e,name:n}=this.highlightPoint;this.highlightPoint=void 0,this.pointMarkerList.find(r=>{r.id===e&&r.feature.setStyle(setPointStyle(!1,n,this.options))})}highlightPointMarker(e){if(!this.mapInstance)return;const{id:n,name:r,fullName:i,lon:g,lat:y,pointType:k}=e,L=[Number(g),Number(y)];this.highlightPoint={id:n,name:r,fullName:i,lonlat:L,pointType:k},this.setPointCenter(L)}getFeature(e,n){var i;const r=new Feature({geometry:new Point(fromLonLat(n))});return r.set("data",e),r.setStyle(setPointStyle(((i=this.highlightPoint)==null?void 0:i.id)===e.id,e.name,this.options)),r}setPointCenter(e,n={customZoom:mapZoom.findShip,type:1}){if(!this.mapInstance)return;const{customZoom:r=mapZoom.findShip,type:i=1}=n,g=this.mapInstance.getView(),y=g.getZoom();(i===1||y>r&&i===2||y<r&&i===3)&&g.setZoom(r);const k=new Point(e);g.setCenter(transform(k.getCoordinates(),projection.data,projection.mercator))}}const _sfc_main$7=vue.defineComponent({__name:"Map",props:{zoom:{},center:{},vehicleMode:{},viewMode:{},mmsi:{},shipData:{},logoType:{},showToolPanel:{type:Boolean}},emits:["zoomChanged","extentChanged"],setup(t,{expose:e,emit:n}){const r=vue.ref();vue.provide("mapInstance",r);const i=vue.ref(null),g=vue.ref(null),y=vue.ref(null),k=n,L=t,$=vue.ref(L.zoom||mapZoom.default),V=vue.ref(!1),z=vue.ref(!0),j=vue.ref(!0),oe=vue.ref(!0),re={tiandituTile:new TileLayer({source:new XYZ({url:baseMap.tiandituTile})}),tiandituTileMark:new TileLayer({source:new XYZ({url:baseMap.tiandituTileMark})}),tiandituImgTile:new TileLayer({source:new XYZ({url:baseMap.tiandituImgTile}),visible:!1}),tiandituImgTileMark:new TileLayer({source:new XYZ({url:baseMap.tiandituImgTileMark}),visible:!1}),greenMark:new TileLayer({source:new XYZ({url:baseMap.greenTile})})},ie=()=>{var Ie,Oe;const xe={projection:projection.mercator,zoom:L.zoom||(L.vehicleMode==="ship"?mapZoom.default:mapZoom.truckDefault),minZoom:mapZoom.min,maxZoom:mapZoom.max,center:transformUtils.lonLatToMercator(L.center||mapDefaultCenter),constrainResolution:!0,enableRotation:!1,multiWorld:!0};r.value=new Map$2({target:"map",layers:[re.tiandituTile,re.tiandituTileMark,re.tiandituImgTile,re.tiandituImgTileMark,re.greenMark],view:new View(xe)}),ae(),L.showToolPanel===void 0?oe.value=!0:oe.value=L.showToolPanel,(Ie=g.value)==null||Ie.setScaleLine(L.vehicleMode==="ship"?"nautical":"metric"),(Oe=r.value)==null||Oe.on("moveend",ue),le(xe.zoom<mapZoom.shipGreenDotMax),pe(L.vehicleMode==="ship"||L.viewMode==="findShip"?BaseMapType.satellite:BaseMapType.vector),L.viewMode==="findShip"&&L.mmsi&&L.shipData&&vue.nextTick(()=>{findShip(String(L.mmsi),L.shipData)}),onShipsMarkerHover()};vue.onMounted(()=>{ie()});const ae=()=>{r.value&&(renderCustomOverlaySetInstance(r.value),renderTruckSetInstance(r.value),drawPolygonSetInstance(r.value),renderShipStyleSetInstance(r.value),renderTrackStyleSetInstance(r.value),renderDashboardSetInstance(r.value),renderMarkerSetInstance(r.value),renderShipSetInstance(r.value),renderTrackSetInstance(r.value))},le=xe=>{var Ie;L.vehicleMode!=="ship"&&(xe=!1),(Ie=r.value)==null||Ie.getLayers().forEach(Oe=>{getUid(Oe)===getUid(re.greenMark)&&(Oe.setVisible(xe),z.value=xe)})},de=vue.ref(BaseMapType.satellite),pe=xe=>{var Ie;de.value=xe,(Ie=r.value)==null||Ie.getLayers().forEach(Oe=>{(getUid(Oe)===getUid(re.tiandituTile)||getUid(Oe)===getUid(re.tiandituTileMark)||getUid(Oe)===getUid(re.tiandituImgTile)||getUid(Oe)===getUid(re.tiandituImgTileMark))&&Oe.setVisible(!1),(xe===BaseMapType.vector&&(getUid(Oe)===getUid(re.tiandituTile)||getUid(Oe)===getUid(re.tiandituTileMark))||xe===BaseMapType.satellite&&(getUid(Oe)===getUid(re.tiandituImgTile)||getUid(Oe)===getUid(re.tiandituImgTileMark)))&&Oe.setVisible(!0)})},ue=()=>{const xe=r.value.getView(),Ie=xe.getZoom();Ie&&he(Ie);const Oe=xe.calculateExtent(r.value.getSize());Oe&&Ie&&_e(Oe,Ie)},he=xe=>{var Ve,Ue,kt,Dt,$e;$.value=xe,le(xe<mapZoom.shipGreenDotMax);const Ie=(Ve=r.value)==null?void 0:Ve.getLayers(),Oe=L.vehicleMode==="ship"?Ie==null?void 0:Ie.getArray().find(Fe=>getUid(Fe)===getUid(re.greenMark)):void 0;showTrackLayer.value?(j.value=!1,Oe==null||Oe.setVisible(!1),(Ue=shipsLayer.value)==null||Ue.setVisible(!1),(kt=largeAmountShipsLayer.value)==null||kt.setVisible(!1)):!V.value&&z.value&&xe<=mapZoom.shipGreenDotMax?(j.value=!0,Oe==null||Oe.setVisible(!0),(Dt=shipsLayer.value)==null||Dt.setVisible(!1),($e=largeAmountShipsLayer.value)==null||$e.setVisible(!1)):(j.value=!1,Oe==null||Oe.setVisible(!1)),k("zoomChanged",xe)},_e=(xe,Ie)=>{const Oe=transform([xe[0],xe[1]],projection.mercator,projection.data),Ve=transform([xe[2],xe[3]],projection.mercator,projection.data);k("extentChanged",{extent:[Oe,Ve],zoom:Ie})};return e({mapInstance:r,initMap:ie,pointRender:(xe,Ie)=>new PointMarkerClass(xe,Ie),renderTrucksMarker,renderShip:renderShips,renderTrack:(xe,Ie,Oe)=>{var Ve,Ue;currentTrackId.value=xe,showTrackLayer.value=!0,V.value=!0,hiddenAllShips(),(Ue=(Ve=largeAmountShipsLayer.value)==null?void 0:Ve.getSource())==null||Ue.clear(),renderTrack(xe,L.vehicleMode==="ship"?Ie.reverse():Ie,Oe,LENGTH_UNIT.NM)},findTruck,removeTruckIcon,clearAllTruck,closeTrack:()=>{var xe,Ie;showTrackLayer.value=!1,(xe=shipTrackVectorLayer.value)==null||xe.setVisible(!1),(Ie=selectShipsLayer.value)==null||Ie.setVisible(!0),V.value=!1,le($.value<mapZoom.shipGreenDotMax),allTracks.value=[],stopAnimation()},closeTruckTrack:()=>{var xe,Ie;showTrackLayer.value=!1,(xe=shipTrackVectorLayer.value)==null||xe.setVisible(!1),(Ie=selectShipsLayer.value)==null||Ie.setVisible(!0),stopAnimation()},resetTrackView,playTrack,clearSelectFeature,findShip,focusShip:(xe,Ie,Oe=!0)=>{var Ve,Ue;hiddenOrther.value=Oe,(Ve=shipsLayer.value)==null||Ve.setVisible(!Oe),(Ue=largeAmountShipsLayer.value)==null||Ue.setVisible(!1),findShip(xe,Ie)},clearShipData,showTracks,removeAllTrackLayer,switchFilterItem,rerenderShip,switchGreenDot:()=>le(!1),zoomTruckIcon,renderTruckTrack:(xe,Ie,Oe)=>{showTrackLayer.value=!0,renderTrack(xe,Ie,Oe,LENGTH_UNIT.KM,"truck")},drawCustomContent,removerLayer:removeShipTrackLineFeatureByIndex,renderMarker,setMarkerPosition:xe=>{V.value=!0,setMarkerPosition(xe)},getZoomAndCenter:()=>{var Ue;const xe=(Ue=r.value)==null?void 0:Ue.getView();if(!xe)return null;const Ie=Math.round(Number(xe.getZoom())),{lon:Oe,lat:Ve}=transformUtils.mercatorToLonLat(xe.getCenter());return{zoom:Ie,center:[Oe,Ve]}},setCenter:xe=>{var Ve;const Ie=(Ve=r.value)==null?void 0:Ve.getView();if(!Ie)return null;const Oe=new Point(xe);Ie.setCenter(transform(Oe.getCoordinates(),projection.data,projection.mercator))},drawPolygonTool,setMapInstance:ae,store:{getShowMeasure:getShowMeasure()},config:{mapZoom,projection},utils:{transform:transformUtils,format:formatUtils}}),(xe,Ie)=>(vue.openBlock(),vue.createElementBlock("div",{class:"map-page map-container",ref_key:"pageRef",ref:i},[Ie[0]||(Ie[0]=vue.createElementVNode("div",{id:"map",class:"map"},null,-1)),oe.value?(vue.openBlock(),vue.createBlock(ToolPanel,{key:0,"vehicle-mode":xe.vehicleMode,"view-mode":xe.viewMode,"disable-green-dot":V.value,"show-track-layer":vue.unref(showTrackLayer),"map-tile-mode":de.value,onSwitchGreenDot:le,onSwitchMapTile:pe},{toolPanel:vue.withCtx(()=>[vue.renderSlot(xe.$slots,"toolPanel",{},void 0,!0)]),_:3},8,["vehicle-mode","view-mode","disable-green-dot","show-track-layer","map-tile-mode"])):vue.createCommentVNode("",!0),xe.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createVNode(ScaleLine,{ref_key:"scaleLineControl",ref:g},null,512),vue.createVNode(ZoomControl,{ref_key:"zoomControl",ref:y},null,512)],64)):vue.createCommentVNode("",!0),vue.createVNode(Copyright,{type:xe.logoType,"map-tile":de.value},null,8,["type","map-tile"])],512))}}),Map$1=_export_sfc(_sfc_main$7,[["__scopeId","data-v-b6c57705"]]),ZhMap=withInstall$1(Map$1);var zhCn={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
702
+ `),drawVector&&((e=drawVector.getSource())==null||e.addFeature(storeFeature));const g=endFn(storeFeature);g!=null&&g.length&&callbackFunction&&callbackFunction(g);const y=getCenter(storeFeature.getGeometry().getExtent());(n=mapInstance.value)==null||n.getView().setCenter(y)}},pointerMoveHandler=function(t){var n;if(t.dragging)return;let e="点击选择起点";sketch&&(e="单击继续,双击结束"),helpTooltipElement&&(helpTooltipElement.innerHTML=e,helpTooltip.setPosition(t.coordinate),helpTooltipElement.classList.remove("hidden")),layerState==="drawn"&&(((n=mapInstance.value)==null?void 0:n.getTargetElement()).style.cursor="crosshair")},init=()=>{mapInstance.value&&(circleStyle=new Style({image:new CircleStyle({radius:5,fill:new Fill({color:"rgb(51,112,255, 1)"})}),geometry:function(t){const e=t.getGeometry().getCoordinates();return new MultiPoint(e)}}),drawVector=new VectorLayer({source,style:drawPolygonStyle.drawend}),mapInstance.value.on("pointermove",pointerMoveHandler),mapInstance.value.getViewport().addEventListener("mouseout",function(){var t;(t=helpTooltipElement==null?void 0:helpTooltipElement.classList)==null||t.add("hidden")}),mapInstance.value.on(["dblclick"],function(t){drawnState!=="undrawn"&&(t.stopPropagation(),t.preventDefault())}))},destroy=()=>{storeFeature=null,drawVector=null,removeInteraction()},reset=()=>{destroy(),addInteraction()},drawPolygonTool={addInteraction,removeInteraction,initFeature,reset,destroy},setPointStyle=(t,e,n)=>{const r=new Image;r.crossOrigin="anonymous";const i=new Image;i.crossOrigin="anonymous";const{color:g,url:y,activeUrl:k,activeColor:L,imgWidth:$,imgHeight:V}=n;return(k||y)&&(t?i.src=CDN_URL+(k||y):r.src=CDN_URL+(y||k)),new Style({renderer:(z,j)=>{const oe=j.context;oe.save();const re=window.devicePixelRatio||1;let[ie,ae]=z;if(ie=Number(ie),ae=Number(ae),e){oe.font=`${12*re}px Arial`;const le=oe.measureText(e).width,de=ie-le/2-(re<=1?10:-3),pe=ae+(re<=1?0:10)+6*re,ue=le+4,he=16*re,_e=t&&L||g;fillRectRadius(oe,de,pe+(re<=1?6:13*re),ue,he,_e),oe.save(),oe.restore(),oe.fillStyle=t?"#FFFFFF":"#000000",oe.textAlign="center",oe.textBaseline="middle",oe.fillText(e,de+(le+4)/2,pe+(re<=1?15:22*re)),oe.save(),oe.restore()}if(y||k){const le=t?i:r;oe.drawImage(le,ie-($||le.width)/2,ae-(V||le.height)/2,30*re,30*re)}oe.restore()}})};class PointMarkerClass{constructor(e,n){qn(this,"mapInstance");qn(this,"pointMarkerList",[]);qn(this,"pointsVectorSource");qn(this,"highlightPoint");qn(this,"pointLayer");qn(this,"options");qn(this,"resetPointsView",(e,n=.02)=>{var y;if(!this.mapInstance||e.length===0)return;const r=(y=this.mapInstance)==null?void 0:y.getView();if(!r)return;const g=e.map(k=>transform(k,projection.data,projection.mercator)).reduce((k,L)=>[Math.min(k[0],L[0]),Math.min(k[1],L[1]),Math.max(k[2],L[0]),Math.max(k[3],L[1])],[1/0,1/0,-1/0,-1/0]);try{const k=buffer(g,Math.max(g[2]-g[0],g[3]-g[1])*n);r.fit(k)}catch(k){console.error("Failed to zoom to points:",k)}});this.mapInstance=e,this.options=n}renderPointMarker(e){if(this.deleteAllPointMarkers(),!this.mapInstance)return;let n={};e.forEach(r=>{var g;const i=[r.lon,r.lat];if(((g=this.highlightPoint)==null?void 0:g.id)===r.id)n={id:r.id,name:r.name,lonlat:[Number(r.lon),Number(r.lat)],pointType:r.pointType};else{const y=this.getFeature(r,i);this.pointMarkerList.push({id:r.id,name:r.name,lonlat:[Number(r.lon),Number(r.lat)],feature:y,pointType:r.pointType})}}),n&&n.lonlat&&(n.feature=this.getFeature(n,n.lonlat),this.pointMarkerList.push(n)),this.pointsVectorSource=new VectorSource({features:[...this.pointMarkerList.map(r=>r.feature)]}),this.pointLayer=new VectorLayer({source:this.pointsVectorSource}),this.mapInstance.addLayer(this.pointLayer)}deleteAllPointMarkers(e){this.pointMarkerList.forEach(n=>{var r;n.feature&&e!==n.id&&((r=this.pointsVectorSource)==null||r.removeFeature(n.feature))})}cancelHighlightTruckMarker(){if(!this.highlightPoint)return;const{id:e,name:n}=this.highlightPoint;this.highlightPoint=void 0,this.pointMarkerList.find(r=>{r.id===e&&r.feature.setStyle(setPointStyle(!1,n,this.options))})}highlightPointMarker(e){if(!this.mapInstance)return;const{id:n,name:r,fullName:i,lon:g,lat:y,pointType:k}=e,L=[Number(g),Number(y)];this.highlightPoint={id:n,name:r,fullName:i,lonlat:L,pointType:k},this.setPointCenter(L)}getFeature(e,n){var i;const r=new Feature({geometry:new Point(fromLonLat(n))});return r.set("data",e),r.setStyle(setPointStyle(((i=this.highlightPoint)==null?void 0:i.id)===e.id,e.name,this.options)),r}setPointCenter(e,n={customZoom:mapZoom.findShip,type:1}){if(!this.mapInstance)return;const{customZoom:r=mapZoom.findShip,type:i=1}=n,g=this.mapInstance.getView(),y=g.getZoom();(i===1||y>r&&i===2||y<r&&i===3)&&g.setZoom(r);const k=new Point(e);g.setCenter(transform(k.getCoordinates(),projection.data,projection.mercator))}}const _sfc_main$7=vue.defineComponent({__name:"Map",props:{zoom:{},center:{},vehicleMode:{},viewMode:{},mmsi:{},shipData:{},logoType:{},showToolPanel:{type:Boolean}},emits:["zoomChanged","extentChanged"],setup(t,{expose:e,emit:n}){const r=vue.ref();vue.provide("mapInstance",r);const i=vue.ref(null),g=vue.ref(null),y=vue.ref(null),k=n,L=t,$=vue.ref(L.zoom||mapZoom.default),V=vue.ref(!1),z=vue.ref(!0),j=vue.ref(!0),oe=vue.ref(!0),re={tiandituTile:new TileLayer({source:new XYZ({url:baseMap.tiandituTile})}),tiandituTileMark:new TileLayer({source:new XYZ({url:baseMap.tiandituTileMark})}),tiandituImgTile:new TileLayer({source:new XYZ({url:baseMap.tiandituImgTile}),visible:!1}),tiandituImgTileMark:new TileLayer({source:new XYZ({url:baseMap.tiandituImgTileMark}),visible:!1}),greenMark:new TileLayer({source:new XYZ({url:baseMap.greenTile})})},ie=()=>{var Ie,Oe;const xe={projection:projection.mercator,zoom:L.zoom||(L.vehicleMode==="ship"?mapZoom.default:mapZoom.truckDefault),minZoom:mapZoom.min,maxZoom:mapZoom.max,center:transformUtils.lonLatToMercator(L.center||mapDefaultCenter),constrainResolution:!0,enableRotation:!1,multiWorld:!0};r.value=new Map$2({target:"map",layers:[re.tiandituTile,re.tiandituTileMark,re.tiandituImgTile,re.tiandituImgTileMark,re.greenMark],view:new View(xe)}),ae(),L.showToolPanel===void 0?oe.value=!0:oe.value=L.showToolPanel,(Ie=g.value)==null||Ie.setScaleLine(L.vehicleMode==="ship"?"nautical":"metric"),(Oe=r.value)==null||Oe.on("moveend",ue),le(xe.zoom<mapZoom.shipGreenDotMax),pe(L.vehicleMode==="ship"||L.viewMode==="findShip"?BaseMapType.satellite:BaseMapType.vector),L.viewMode==="findShip"&&L.mmsi&&L.shipData&&vue.nextTick(()=>{findShip(String(L.mmsi),L.shipData)}),onShipsMarkerHover()};vue.onMounted(()=>{ie()});const ae=()=>{r.value&&(renderCustomOverlaySetInstance(r.value),renderTruckSetInstance(r.value),drawPolygonSetInstance(r.value),renderShipStyleSetInstance(r.value),renderTrackStyleSetInstance(r.value),renderDashboardSetInstance(r.value),renderMarkerSetInstance(r.value),renderShipSetInstance(r.value),renderTrackSetInstance(r.value))},le=xe=>{var Ie;L.vehicleMode!=="ship"&&(xe=!1),(Ie=r.value)==null||Ie.getLayers().forEach(Oe=>{getUid(Oe)===getUid(re.greenMark)&&(Oe.setVisible(xe),z.value=xe)})},de=vue.ref(BaseMapType.satellite),pe=xe=>{var Ie;de.value=xe,(Ie=r.value)==null||Ie.getLayers().forEach(Oe=>{(getUid(Oe)===getUid(re.tiandituTile)||getUid(Oe)===getUid(re.tiandituTileMark)||getUid(Oe)===getUid(re.tiandituImgTile)||getUid(Oe)===getUid(re.tiandituImgTileMark))&&Oe.setVisible(!1),(xe===BaseMapType.vector&&(getUid(Oe)===getUid(re.tiandituTile)||getUid(Oe)===getUid(re.tiandituTileMark))||xe===BaseMapType.satellite&&(getUid(Oe)===getUid(re.tiandituImgTile)||getUid(Oe)===getUid(re.tiandituImgTileMark)))&&Oe.setVisible(!0)})},ue=()=>{const xe=r.value.getView(),Ie=xe.getZoom();Ie&&he(Ie);const Oe=xe.calculateExtent(r.value.getSize());Oe&&Ie&&_e(Oe,Ie)},he=xe=>{var Ve,Ue,kt,Dt,$e;$.value=xe,le(xe<mapZoom.shipGreenDotMax);const Ie=(Ve=r.value)==null?void 0:Ve.getLayers(),Oe=L.vehicleMode==="ship"?Ie==null?void 0:Ie.getArray().find(Fe=>getUid(Fe)===getUid(re.greenMark)):void 0;showTrackLayer.value?(j.value=!1,Oe==null||Oe.setVisible(!1),(Ue=shipsLayer.value)==null||Ue.setVisible(!1),(kt=largeAmountShipsLayer.value)==null||kt.setVisible(!1)):!V.value&&z.value&&xe<=mapZoom.shipGreenDotMax?(j.value=!0,Oe==null||Oe.setVisible(!0),(Dt=shipsLayer.value)==null||Dt.setVisible(!1),($e=largeAmountShipsLayer.value)==null||$e.setVisible(!1)):(j.value=!1,Oe==null||Oe.setVisible(!1)),k("zoomChanged",xe)},_e=(xe,Ie)=>{const Oe=transform([xe[0],xe[1]],projection.mercator,projection.data),Ve=transform([xe[2],xe[3]],projection.mercator,projection.data);k("extentChanged",{extent:[Oe,Ve],zoom:Ie})};return e({mapInstance:r,initMap:ie,pointRender:(xe,Ie)=>new PointMarkerClass(xe,Ie),renderTrucksMarker,renderShip:renderShips,renderTrack:(xe,Ie,Oe)=>{var Ve,Ue;showDrawLayer.value=!0,currentTrackId.value=xe,showTrackLayer.value=!0,V.value=!0,hiddenAllShips(),(Ue=(Ve=largeAmountShipsLayer.value)==null?void 0:Ve.getSource())==null||Ue.clear(),renderTrack(xe,L.vehicleMode==="ship"?Ie.reverse():Ie,Oe,LENGTH_UNIT.NM)},findTruck,removeTruckIcon,clearAllTruck,closeTrack:(xe=!1)=>{var Ie,Oe,Ve;showDrawLayer.value=!1,showTrackLayer.value=!1,(Ie=shipTrackVectorLayer.value)==null||Ie.setVisible(!1),(Oe=selectShipsLayer.value)==null||Oe.setVisible(!0),V.value=!1,le($.value<mapZoom.shipGreenDotMax),xe&&(allTracks.value=[],(Ve=trackLineVectorSource.value)==null||Ve.clear()),stopAnimation()},closeTruckTrack:()=>{var xe,Ie;showTrackLayer.value=!1,(xe=shipTrackVectorLayer.value)==null||xe.setVisible(!1),(Ie=selectShipsLayer.value)==null||Ie.setVisible(!0),stopAnimation()},resetTrackView,playTrack,clearSelectFeature,findShip,focusShip:(xe,Ie,Oe=!0)=>{var Ve,Ue;hiddenOrther.value=Oe,(Ve=shipsLayer.value)==null||Ve.setVisible(!Oe),Oe||rerenderShip(),(Ue=largeAmountShipsLayer.value)==null||Ue.setVisible(!1),findShip(xe,Ie)},clearShipData,showTracks,removeAllTrackLayer,switchFilterItem,rerenderShip,switchGreenDot:()=>le(!1),zoomTruckIcon,renderTruckTrack:(xe,Ie,Oe)=>{showTrackLayer.value=!0,renderTrack(xe,Ie,Oe,LENGTH_UNIT.KM,"truck")},drawCustomContent,removerLayer:removeShipTrackLineFeatureByIndex,renderMarker,setMarkerPosition:xe=>{V.value=!0,setMarkerPosition(xe)},getZoomAndCenter:()=>{var Ue;const xe=(Ue=r.value)==null?void 0:Ue.getView();if(!xe)return null;const Ie=Math.round(Number(xe.getZoom())),{lon:Oe,lat:Ve}=transformUtils.mercatorToLonLat(xe.getCenter());return{zoom:Ie,center:[Oe,Ve]}},setCenter:xe=>{var Ve;const Ie=(Ve=r.value)==null?void 0:Ve.getView();if(!Ie)return null;const Oe=new Point(xe);Ie.setCenter(transform(Oe.getCoordinates(),projection.data,projection.mercator))},deleteLabelFromArray:deleteLabelFromArrayById,drawPolygonTool,setMapInstance:ae,store:{showDrawLayer:()=>showDrawLayer.value},config:{mapZoom,projection},utils:{transform:transformUtils,format:formatUtils}}),(xe,Ie)=>(vue.openBlock(),vue.createElementBlock("div",{class:"map-page map-container",ref_key:"pageRef",ref:i},[Ie[0]||(Ie[0]=vue.createElementVNode("div",{id:"map",class:"map"},null,-1)),oe.value?(vue.openBlock(),vue.createBlock(ToolPanel,{key:0,"vehicle-mode":xe.vehicleMode,"view-mode":xe.viewMode,"disable-green-dot":V.value,"show-track-layer":vue.unref(showTrackLayer),"map-tile-mode":de.value,onSwitchGreenDot:le,onSwitchMapTile:pe},{toolPanel:vue.withCtx(()=>[vue.renderSlot(xe.$slots,"toolPanel",{},void 0,!0)]),_:3},8,["vehicle-mode","view-mode","disable-green-dot","show-track-layer","map-tile-mode"])):vue.createCommentVNode("",!0),xe.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createVNode(ScaleLine,{ref_key:"scaleLineControl",ref:g},null,512),vue.createVNode(ZoomControl,{ref_key:"zoomControl",ref:y},null,512)],64)):vue.createCommentVNode("",!0),vue.createVNode(Copyright,{type:xe.logoType,"map-tile":de.value},null,8,["type","map-tile"])],512))}}),Map$1=_export_sfc(_sfc_main$7,[["__scopeId","data-v-6751c660"]]),ZhMap=withInstall$1(Map$1);var zhCn={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
703
703
  * Sortable 1.15.6
704
704
  * @author RubaXa <trash@rubaxa.org>
705
705
  * @author owenm <owen23355@gmail.com>
706
706
  * @license MIT
707
- */function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _objectSpread2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(r){_defineProperty(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _typeof(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(e){return typeof e}:_typeof=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(t)}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _extends(){return _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,g;for(g=0;g<r.length;g++)i=r[g],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function _objectWithoutProperties(t,e){if(t==null)return{};var n=_objectWithoutPropertiesLoose(t,e),r,i;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);for(i=0;i<g.length;i++)r=g[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var version="1.15.6";function userAgent(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var IE11OrLess=userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Edge=userAgent(/Edge/i),FireFox=userAgent(/firefox/i),Safari=userAgent(/safari/i)&&!userAgent(/chrome/i)&&!userAgent(/android/i),IOS=userAgent(/iP(ad|od|hone)/i),ChromeForAndroid=userAgent(/chrome/i)&&userAgent(/android/i),captureMode={capture:!1,passive:!1};function on(t,e,n){t.addEventListener(e,n,!IE11OrLess&&captureMode)}function off(t,e,n){t.removeEventListener(e,n,!IE11OrLess&&captureMode)}function matches(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function getParentOrHost(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function closest(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&matches(t,e):matches(t,e))||r&&t===n)return t;if(t===n)break}while(t=getParentOrHost(t))}return null}var R_SPACE=/\s+/g;function toggleClass(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(R_SPACE," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(R_SPACE," ")}}function css(t,e,n){var r=t&&t.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=n+(typeof n=="string"?"":"px")}}function matrix(t,e){var n="";if(typeof t=="string")n=t;else do{var r=css(t,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function find(t,e,n){if(t){var r=t.getElementsByTagName(e),i=0,g=r.length;if(n)for(;i<g;i++)n(r[i],i);return r}return[]}function getWindowScrollingElement(){var t=document.scrollingElement;return t||document.documentElement}function getRect(t,e,n,r,i){if(!(!t.getBoundingClientRect&&t!==window)){var g,y,k,L,$,V,z;if(t!==window&&t.parentNode&&t!==getWindowScrollingElement()?(g=t.getBoundingClientRect(),y=g.top,k=g.left,L=g.bottom,$=g.right,V=g.height,z=g.width):(y=0,k=0,L=window.innerHeight,$=window.innerWidth,V=window.innerHeight,z=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!IE11OrLess))do if(i&&i.getBoundingClientRect&&(css(i,"transform")!=="none"||n&&css(i,"position")!=="static")){var j=i.getBoundingClientRect();y-=j.top+parseInt(css(i,"border-top-width")),k-=j.left+parseInt(css(i,"border-left-width")),L=y+g.height,$=k+g.width;break}while(i=i.parentNode);if(r&&t!==window){var oe=matrix(i||t),re=oe&&oe.a,ie=oe&&oe.d;oe&&(y/=ie,k/=re,z/=re,V/=ie,L=y+V,$=k+z)}return{top:y,left:k,bottom:L,right:$,width:z,height:V}}}function isScrolledPast(t,e,n){for(var r=getParentAutoScrollElement(t,!0),i=getRect(t)[e];r;){var g=getRect(r)[n],y=void 0;if(y=i>=g,!y)return r;if(r===getWindowScrollingElement())break;r=getParentAutoScrollElement(r,!1)}return!1}function getChild(t,e,n,r){for(var i=0,g=0,y=t.children;g<y.length;){if(y[g].style.display!=="none"&&y[g]!==Sortable.ghost&&(r||y[g]!==Sortable.dragged)&&closest(y[g],n.draggable,t,!1)){if(i===e)return y[g];i++}g++}return null}function lastChild(t,e){for(var n=t.lastElementChild;n&&(n===Sortable.ghost||css(n,"display")==="none"||e&&!matches(n,e));)n=n.previousElementSibling;return n||null}function index(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==Sortable.clone&&(!e||matches(t,e))&&n++;return n}function getRelativeScrollOffset(t){var e=0,n=0,r=getWindowScrollingElement();if(t)do{var i=matrix(t),g=i.a,y=i.d;e+=t.scrollLeft*g,n+=t.scrollTop*y}while(t!==r&&(t=t.parentNode));return[e,n]}function indexOfObject(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t[n][r])return Number(n)}return-1}function getParentAutoScrollElement(t,e){if(!t||!t.getBoundingClientRect)return getWindowScrollingElement();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=css(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return getWindowScrollingElement();if(r||e)return n;r=!0}}while(n=n.parentNode);return getWindowScrollingElement()}function extend(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function isRectEqual(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var _throttleTimeout;function throttle(t,e){return function(){if(!_throttleTimeout){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),_throttleTimeout=setTimeout(function(){_throttleTimeout=void 0},e)}}}function cancelThrottle(){clearTimeout(_throttleTimeout),_throttleTimeout=void 0}function scrollBy(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function clone(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function getChildContainingRectFromElement(t,e,n){var r={};return Array.from(t.children).forEach(function(i){var g,y,k,L;if(!(!closest(i,e.draggable,t,!1)||i.animated||i===n)){var $=getRect(i);r.left=Math.min((g=r.left)!==null&&g!==void 0?g:1/0,$.left),r.top=Math.min((y=r.top)!==null&&y!==void 0?y:1/0,$.top),r.right=Math.max((k=r.right)!==null&&k!==void 0?k:-1/0,$.right),r.bottom=Math.max((L=r.bottom)!==null&&L!==void 0?L:-1/0,$.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var expando="Sortable"+new Date().getTime();function AnimationStateManager(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(css(i,"display")==="none"||i===Sortable.ghost)){t.push({target:i,rect:getRect(i)});var g=_objectSpread2({},t[t.length-1].rect);if(i.thisAnimationDuration){var y=matrix(i,!0);y&&(g.top-=y.f,g.left-=y.e)}i.fromRect=g}})}},addAnimationState:function(r){t.push(r)},removeAnimationState:function(r){t.splice(indexOfObject(t,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var g=!1,y=0;t.forEach(function(k){var L=0,$=k.target,V=$.fromRect,z=getRect($),j=$.prevFromRect,oe=$.prevToRect,re=k.rect,ie=matrix($,!0);ie&&(z.top-=ie.f,z.left-=ie.e),$.toRect=z,$.thisAnimationDuration&&isRectEqual(j,z)&&!isRectEqual(V,z)&&(re.top-z.top)/(re.left-z.left)===(V.top-z.top)/(V.left-z.left)&&(L=calculateRealTime(re,j,oe,i.options)),isRectEqual(z,V)||($.prevFromRect=V,$.prevToRect=z,L||(L=i.options.animation),i.animate($,re,z,L)),L&&(g=!0,y=Math.max(y,L),clearTimeout($.animationResetTimer),$.animationResetTimer=setTimeout(function(){$.animationTime=0,$.prevFromRect=null,$.fromRect=null,$.prevToRect=null,$.thisAnimationDuration=null},L),$.thisAnimationDuration=L)}),clearTimeout(e),g?e=setTimeout(function(){typeof r=="function"&&r()},y):typeof r=="function"&&r(),t=[]},animate:function(r,i,g,y){if(y){css(r,"transition",""),css(r,"transform","");var k=matrix(this.el),L=k&&k.a,$=k&&k.d,V=(i.left-g.left)/(L||1),z=(i.top-g.top)/($||1);r.animatingX=!!V,r.animatingY=!!z,css(r,"transform","translate3d("+V+"px,"+z+"px,0)"),this.forRepaintDummy=repaint(r),css(r,"transition","transform "+y+"ms"+(this.options.easing?" "+this.options.easing:"")),css(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){css(r,"transition",""),css(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},y)}}}}function repaint(t){return t.offsetWidth}function calculateRealTime(t,e,n,r){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*r.animation}var plugins=[],defaults={initializeByDefault:!0},PluginManager={mount:function t(e){for(var n in defaults)defaults.hasOwnProperty(n)&&!(n in e)&&(e[n]=defaults[n]);plugins.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),plugins.push(e)},pluginEvent:function t(e,n,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var g=e+"Global";plugins.forEach(function(y){n[y.pluginName]&&(n[y.pluginName][g]&&n[y.pluginName][g](_objectSpread2({sortable:n},r)),n.options[y.pluginName]&&n[y.pluginName][e]&&n[y.pluginName][e](_objectSpread2({sortable:n},r)))})},initializePlugins:function t(e,n,r,i){plugins.forEach(function(k){var L=k.pluginName;if(!(!e.options[L]&&!k.initializeByDefault)){var $=new k(e,n,e.options);$.sortable=e,$.options=e.options,e[L]=$,_extends(r,$.defaults)}});for(var g in e.options)if(e.options.hasOwnProperty(g)){var y=this.modifyOption(e,g,e.options[g]);typeof y<"u"&&(e.options[g]=y)}},getEventProperties:function t(e,n){var r={};return plugins.forEach(function(i){typeof i.eventProperties=="function"&&_extends(r,i.eventProperties.call(n[i.pluginName],e))}),r},modifyOption:function t(e,n,r){var i;return plugins.forEach(function(g){e[g.pluginName]&&g.optionListeners&&typeof g.optionListeners[n]=="function"&&(i=g.optionListeners[n].call(e[g.pluginName],r))}),i}};function dispatchEvent(t){var e=t.sortable,n=t.rootEl,r=t.name,i=t.targetEl,g=t.cloneEl,y=t.toEl,k=t.fromEl,L=t.oldIndex,$=t.newIndex,V=t.oldDraggableIndex,z=t.newDraggableIndex,j=t.originalEvent,oe=t.putSortable,re=t.extraEventProperties;if(e=e||n&&n[expando],!!e){var ie,ae=e.options,le="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!IE11OrLess&&!Edge?ie=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(ie=document.createEvent("Event"),ie.initEvent(r,!0,!0)),ie.to=y||n,ie.from=k||n,ie.item=i||n,ie.clone=g,ie.oldIndex=L,ie.newIndex=$,ie.oldDraggableIndex=V,ie.newDraggableIndex=z,ie.originalEvent=j,ie.pullMode=oe?oe.lastPutMode:void 0;var de=_objectSpread2(_objectSpread2({},re),PluginManager.getEventProperties(r,e));for(var pe in de)ie[pe]=de[pe];n&&n.dispatchEvent(ie),ae[le]&&ae[le].call(e,ie)}}var _excluded=["evt"],pluginEvent=function t(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,g=_objectWithoutProperties(r,_excluded);PluginManager.pluginEvent.bind(Sortable)(e,n,_objectSpread2({dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,dragStarted:moved,putSortable,activeSortable:Sortable.active,originalEvent:i,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex,hideGhostForTarget:_hideGhostForTarget,unhideGhostForTarget:_unhideGhostForTarget,cloneNowHidden:function(){cloneHidden=!0},cloneNowShown:function(){cloneHidden=!1},dispatchSortableEvent:function(k){_dispatchEvent({sortable:n,name:k,originalEvent:i})}},g))};function _dispatchEvent(t){dispatchEvent(_objectSpread2({putSortable,cloneEl,targetEl:dragEl,rootEl,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex},t))}var dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,oldIndex,newIndex,oldDraggableIndex,newDraggableIndex,activeGroup,putSortable,awaitingDragStarted=!1,ignoreNextClick=!1,sortables=[],tapEvt,touchEvt,lastDx,lastDy,tapDistanceLeft,tapDistanceTop,moved,lastTarget,lastDirection,pastFirstInvertThresh=!1,isCircumstantialInvert=!1,targetMoveDistance,ghostRelativeParent,ghostRelativeParentInitialScroll=[],_silent=!1,savedInputChecked=[],documentExists=typeof document<"u",PositionGhostAbsolutely=IOS,CSSFloatProperty=Edge||IE11OrLess?"cssFloat":"float",supportDraggable=documentExists&&!ChromeForAndroid&&!IOS&&"draggable"in document.createElement("div"),supportCssPointerEvents=function(){if(documentExists){if(IE11OrLess)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),_detectDirection=function t(e,n){var r=css(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),g=getChild(e,0,n),y=getChild(e,1,n),k=g&&css(g),L=y&&css(y),$=k&&parseInt(k.marginLeft)+parseInt(k.marginRight)+getRect(g).width,V=L&&parseInt(L.marginLeft)+parseInt(L.marginRight)+getRect(y).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(g&&k.float&&k.float!=="none"){var z=k.float==="left"?"left":"right";return y&&(L.clear==="both"||L.clear===z)?"vertical":"horizontal"}return g&&(k.display==="block"||k.display==="flex"||k.display==="table"||k.display==="grid"||$>=i&&r[CSSFloatProperty]==="none"||y&&r[CSSFloatProperty]==="none"&&$+V>i)?"vertical":"horizontal"},_dragElInRowColumn=function t(e,n,r){var i=r?e.left:e.top,g=r?e.right:e.bottom,y=r?e.width:e.height,k=r?n.left:n.top,L=r?n.right:n.bottom,$=r?n.width:n.height;return i===k||g===L||i+y/2===k+$/2},_detectNearestEmptySortable=function t(e,n){var r;return sortables.some(function(i){var g=i[expando].options.emptyInsertThreshold;if(!(!g||lastChild(i))){var y=getRect(i),k=e>=y.left-g&&e<=y.right+g,L=n>=y.top-g&&n<=y.bottom+g;if(k&&L)return r=i}}),r},_prepareGroup=function t(e){function n(g,y){return function(k,L,$,V){var z=k.options.group.name&&L.options.group.name&&k.options.group.name===L.options.group.name;if(g==null&&(y||z))return!0;if(g==null||g===!1)return!1;if(y&&g==="clone")return g;if(typeof g=="function")return n(g(k,L,$,V),y)(k,L,$,V);var j=(y?k:L).options.group.name;return g===!0||typeof g=="string"&&g===j||g.join&&g.indexOf(j)>-1}}var r={},i=e.group;(!i||_typeof(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=n(i.pull,!0),r.checkPut=n(i.put),r.revertClone=i.revertClone,e.group=r},_hideGhostForTarget=function t(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","none")},_unhideGhostForTarget=function t(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","")};documentExists&&!ChromeForAndroid&&document.addEventListener("click",function(t){if(ignoreNextClick)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ignoreNextClick=!1,!1},!0);var nearestEmptyInsertDetectEvent=function t(e){if(dragEl){e=e.touches?e.touches[0]:e;var n=_detectNearestEmptySortable(e.clientX,e.clientY);if(n){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[expando]._onDragOver(r)}}},_checkOutsideTargetEl=function t(e){dragEl&&dragEl.parentNode[expando]._isOutsideThisEl(e.target)};function Sortable(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=_extends({},e),t[expando]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return _detectDirection(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(y,k){y.setData("Text",k.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Sortable.supportPointer!==!1&&"PointerEvent"in window&&(!Safari||IOS),emptyInsertThreshold:5};PluginManager.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);_prepareGroup(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:supportDraggable,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?on(t,"pointerdown",this._onTapStart):(on(t,"mousedown",this._onTapStart),on(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(on(t,"dragover",this),on(t,"dragenter",this)),sortables.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),_extends(this,AnimationStateManager())}Sortable.prototype={constructor:Sortable,_isOutsideThisEl:function t(e){!this.el.contains(e)&&e!==this.el&&(lastTarget=null)},_getDirection:function t(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,dragEl):this.options.direction},_onTapStart:function t(e){if(e.cancelable){var n=this,r=this.el,i=this.options,g=i.preventOnFilter,y=e.type,k=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,L=(k||e).target,$=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||L,V=i.filter;if(_saveInputCheckedState(r),!dragEl&&!(/mousedown|pointerdown/.test(y)&&e.button!==0||i.disabled)&&!$.isContentEditable&&!(!this.nativeDraggable&&Safari&&L&&L.tagName.toUpperCase()==="SELECT")&&(L=closest(L,i.draggable,r,!1),!(L&&L.animated)&&lastDownEl!==L)){if(oldIndex=index(L),oldDraggableIndex=index(L,i.draggable),typeof V=="function"){if(V.call(this,e,L,this)){_dispatchEvent({sortable:n,rootEl:$,name:"filter",targetEl:L,toEl:r,fromEl:r}),pluginEvent("filter",n,{evt:e}),g&&e.preventDefault();return}}else if(V&&(V=V.split(",").some(function(z){if(z=closest($,z.trim(),r,!1),z)return _dispatchEvent({sortable:n,rootEl:z,name:"filter",targetEl:L,fromEl:r,toEl:r}),pluginEvent("filter",n,{evt:e}),!0}),V)){g&&e.preventDefault();return}i.handle&&!closest($,i.handle,r,!1)||this._prepareDragStart(e,k,L)}}},_prepareDragStart:function t(e,n,r){var i=this,g=i.el,y=i.options,k=g.ownerDocument,L;if(r&&!dragEl&&r.parentNode===g){var $=getRect(r);if(rootEl=g,dragEl=r,parentEl=dragEl.parentNode,nextEl=dragEl.nextSibling,lastDownEl=r,activeGroup=y.group,Sortable.dragged=dragEl,tapEvt={target:dragEl,clientX:(n||e).clientX,clientY:(n||e).clientY},tapDistanceLeft=tapEvt.clientX-$.left,tapDistanceTop=tapEvt.clientY-$.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,dragEl.style["will-change"]="all",L=function(){if(pluginEvent("delayEnded",i,{evt:e}),Sortable.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!FireFox&&i.nativeDraggable&&(dragEl.draggable=!0),i._triggerDragStart(e,n),_dispatchEvent({sortable:i,name:"choose",originalEvent:e}),toggleClass(dragEl,y.chosenClass,!0)},y.ignore.split(",").forEach(function(V){find(dragEl,V.trim(),_disableDraggable)}),on(k,"dragover",nearestEmptyInsertDetectEvent),on(k,"mousemove",nearestEmptyInsertDetectEvent),on(k,"touchmove",nearestEmptyInsertDetectEvent),y.supportPointer?(on(k,"pointerup",i._onDrop),!this.nativeDraggable&&on(k,"pointercancel",i._onDrop)):(on(k,"mouseup",i._onDrop),on(k,"touchend",i._onDrop),on(k,"touchcancel",i._onDrop)),FireFox&&this.nativeDraggable&&(this.options.touchStartThreshold=4,dragEl.draggable=!0),pluginEvent("delayStart",this,{evt:e}),y.delay&&(!y.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Edge||IE11OrLess))){if(Sortable.eventCanceled){this._onDrop();return}y.supportPointer?(on(k,"pointerup",i._disableDelayedDrag),on(k,"pointercancel",i._disableDelayedDrag)):(on(k,"mouseup",i._disableDelayedDrag),on(k,"touchend",i._disableDelayedDrag),on(k,"touchcancel",i._disableDelayedDrag)),on(k,"mousemove",i._delayedDragTouchMoveHandler),on(k,"touchmove",i._delayedDragTouchMoveHandler),y.supportPointer&&on(k,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(L,y.delay)}else L()}},_delayedDragTouchMoveHandler:function t(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function t(){dragEl&&_disableDraggable(dragEl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function t(){var e=this.el.ownerDocument;off(e,"mouseup",this._disableDelayedDrag),off(e,"touchend",this._disableDelayedDrag),off(e,"touchcancel",this._disableDelayedDrag),off(e,"pointerup",this._disableDelayedDrag),off(e,"pointercancel",this._disableDelayedDrag),off(e,"mousemove",this._delayedDragTouchMoveHandler),off(e,"touchmove",this._delayedDragTouchMoveHandler),off(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function t(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?on(document,"pointermove",this._onTouchMove):n?on(document,"touchmove",this._onTouchMove):on(document,"mousemove",this._onTouchMove):(on(dragEl,"dragend",this),on(rootEl,"dragstart",this._onDragStart));try{document.selection?_nextTick(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function t(e,n){if(awaitingDragStarted=!1,rootEl&&dragEl){pluginEvent("dragStarted",this,{evt:n}),this.nativeDraggable&&on(document,"dragover",_checkOutsideTargetEl);var r=this.options;!e&&toggleClass(dragEl,r.dragClass,!1),toggleClass(dragEl,r.ghostClass,!0),Sortable.active=this,e&&this._appendGhost(),_dispatchEvent({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function t(){if(touchEvt){this._lastX=touchEvt.clientX,this._lastY=touchEvt.clientY,_hideGhostForTarget();for(var e=document.elementFromPoint(touchEvt.clientX,touchEvt.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(touchEvt.clientX,touchEvt.clientY),e!==n);)n=e;if(dragEl.parentNode[expando]._isOutsideThisEl(e),n)do{if(n[expando]){var r=void 0;if(r=n[expando]._onDragOver({clientX:touchEvt.clientX,clientY:touchEvt.clientY,target:e,rootEl:n}),r&&!this.options.dragoverBubble)break}e=n}while(n=getParentOrHost(n));_unhideGhostForTarget()}},_onTouchMove:function t(e){if(tapEvt){var n=this.options,r=n.fallbackTolerance,i=n.fallbackOffset,g=e.touches?e.touches[0]:e,y=ghostEl&&matrix(ghostEl,!0),k=ghostEl&&y&&y.a,L=ghostEl&&y&&y.d,$=PositionGhostAbsolutely&&ghostRelativeParent&&getRelativeScrollOffset(ghostRelativeParent),V=(g.clientX-tapEvt.clientX+i.x)/(k||1)+($?$[0]-ghostRelativeParentInitialScroll[0]:0)/(k||1),z=(g.clientY-tapEvt.clientY+i.y)/(L||1)+($?$[1]-ghostRelativeParentInitialScroll[1]:0)/(L||1);if(!Sortable.active&&!awaitingDragStarted){if(r&&Math.max(Math.abs(g.clientX-this._lastX),Math.abs(g.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(ghostEl){y?(y.e+=V-(lastDx||0),y.f+=z-(lastDy||0)):y={a:1,b:0,c:0,d:1,e:V,f:z};var j="matrix(".concat(y.a,",").concat(y.b,",").concat(y.c,",").concat(y.d,",").concat(y.e,",").concat(y.f,")");css(ghostEl,"webkitTransform",j),css(ghostEl,"mozTransform",j),css(ghostEl,"msTransform",j),css(ghostEl,"transform",j),lastDx=V,lastDy=z,touchEvt=g}e.cancelable&&e.preventDefault()}},_appendGhost:function t(){if(!ghostEl){var e=this.options.fallbackOnBody?document.body:rootEl,n=getRect(dragEl,!0,PositionGhostAbsolutely,!0,e),r=this.options;if(PositionGhostAbsolutely){for(ghostRelativeParent=e;css(ghostRelativeParent,"position")==="static"&&css(ghostRelativeParent,"transform")==="none"&&ghostRelativeParent!==document;)ghostRelativeParent=ghostRelativeParent.parentNode;ghostRelativeParent!==document.body&&ghostRelativeParent!==document.documentElement?(ghostRelativeParent===document&&(ghostRelativeParent=getWindowScrollingElement()),n.top+=ghostRelativeParent.scrollTop,n.left+=ghostRelativeParent.scrollLeft):ghostRelativeParent=getWindowScrollingElement(),ghostRelativeParentInitialScroll=getRelativeScrollOffset(ghostRelativeParent)}ghostEl=dragEl.cloneNode(!0),toggleClass(ghostEl,r.ghostClass,!1),toggleClass(ghostEl,r.fallbackClass,!0),toggleClass(ghostEl,r.dragClass,!0),css(ghostEl,"transition",""),css(ghostEl,"transform",""),css(ghostEl,"box-sizing","border-box"),css(ghostEl,"margin",0),css(ghostEl,"top",n.top),css(ghostEl,"left",n.left),css(ghostEl,"width",n.width),css(ghostEl,"height",n.height),css(ghostEl,"opacity","0.8"),css(ghostEl,"position",PositionGhostAbsolutely?"absolute":"fixed"),css(ghostEl,"zIndex","100000"),css(ghostEl,"pointerEvents","none"),Sortable.ghost=ghostEl,e.appendChild(ghostEl),css(ghostEl,"transform-origin",tapDistanceLeft/parseInt(ghostEl.style.width)*100+"% "+tapDistanceTop/parseInt(ghostEl.style.height)*100+"%")}},_onDragStart:function t(e,n){var r=this,i=e.dataTransfer,g=r.options;if(pluginEvent("dragStart",this,{evt:e}),Sortable.eventCanceled){this._onDrop();return}pluginEvent("setupClone",this),Sortable.eventCanceled||(cloneEl=clone(dragEl),cloneEl.removeAttribute("id"),cloneEl.draggable=!1,cloneEl.style["will-change"]="",this._hideClone(),toggleClass(cloneEl,this.options.chosenClass,!1),Sortable.clone=cloneEl),r.cloneId=_nextTick(function(){pluginEvent("clone",r),!Sortable.eventCanceled&&(r.options.removeCloneOnHide||rootEl.insertBefore(cloneEl,dragEl),r._hideClone(),_dispatchEvent({sortable:r,name:"clone"}))}),!n&&toggleClass(dragEl,g.dragClass,!0),n?(ignoreNextClick=!0,r._loopId=setInterval(r._emulateDragOver,50)):(off(document,"mouseup",r._onDrop),off(document,"touchend",r._onDrop),off(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",g.setData&&g.setData.call(r,i,dragEl)),on(document,"drop",r),css(dragEl,"transform","translateZ(0)")),awaitingDragStarted=!0,r._dragStartId=_nextTick(r._dragStarted.bind(r,n,e)),on(document,"selectstart",r),moved=!0,window.getSelection().removeAllRanges(),Safari&&css(document.body,"user-select","none")},_onDragOver:function t(e){var n=this.el,r=e.target,i,g,y,k=this.options,L=k.group,$=Sortable.active,V=activeGroup===L,z=k.sort,j=putSortable||$,oe,re=this,ie=!1;if(_silent)return;function ae(qe,Ne){pluginEvent(qe,re,_objectSpread2({evt:e,isOwner:V,axis:oe?"vertical":"horizontal",revert:y,dragRect:i,targetRect:g,canSort:z,fromSortable:j,target:r,completed:de,onMove:function(Pt,hn){return _onMove(rootEl,n,dragEl,i,Pt,getRect(Pt),e,hn)},changed:pe},Ne))}function le(){ae("dragOverAnimationCapture"),re.captureAnimationState(),re!==j&&j.captureAnimationState()}function de(qe){return ae("dragOverCompleted",{insertion:qe}),qe&&(V?$._hideClone():$._showClone(re),re!==j&&(toggleClass(dragEl,putSortable?putSortable.options.ghostClass:$.options.ghostClass,!1),toggleClass(dragEl,k.ghostClass,!0)),putSortable!==re&&re!==Sortable.active?putSortable=re:re===Sortable.active&&putSortable&&(putSortable=null),j===re&&(re._ignoreWhileAnimating=r),re.animateAll(function(){ae("dragOverAnimationComplete"),re._ignoreWhileAnimating=null}),re!==j&&(j.animateAll(),j._ignoreWhileAnimating=null)),(r===dragEl&&!dragEl.animated||r===n&&!r.animated)&&(lastTarget=null),!k.dragoverBubble&&!e.rootEl&&r!==document&&(dragEl.parentNode[expando]._isOutsideThisEl(e.target),!qe&&nearestEmptyInsertDetectEvent(e)),!k.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),ie=!0}function pe(){newIndex=index(dragEl),newDraggableIndex=index(dragEl,k.draggable),_dispatchEvent({sortable:re,name:"change",toEl:n,newIndex,newDraggableIndex,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=closest(r,k.draggable,n,!0),ae("dragOver"),Sortable.eventCanceled)return ie;if(dragEl.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||re._ignoreWhileAnimating===r)return de(!1);if(ignoreNextClick=!1,$&&!k.disabled&&(V?z||(y=parentEl!==rootEl):putSortable===this||(this.lastPutMode=activeGroup.checkPull(this,$,dragEl,e))&&L.checkPut(this,$,dragEl,e))){if(oe=this._getDirection(e,r)==="vertical",i=getRect(dragEl),ae("dragOverValid"),Sortable.eventCanceled)return ie;if(y)return parentEl=rootEl,le(),this._hideClone(),ae("revert"),Sortable.eventCanceled||(nextEl?rootEl.insertBefore(dragEl,nextEl):rootEl.appendChild(dragEl)),de(!0);var ue=lastChild(n,k.draggable);if(!ue||_ghostIsLast(e,oe,this)&&!ue.animated){if(ue===dragEl)return de(!1);if(ue&&n===e.target&&(r=ue),r&&(g=getRect(r)),_onMove(rootEl,n,dragEl,i,r,g,e,!!r)!==!1)return le(),ue&&ue.nextSibling?n.insertBefore(dragEl,ue.nextSibling):n.appendChild(dragEl),parentEl=n,pe(),de(!0)}else if(ue&&_ghostIsFirst(e,oe,this)){var he=getChild(n,0,k,!0);if(he===dragEl)return de(!1);if(r=he,g=getRect(r),_onMove(rootEl,n,dragEl,i,r,g,e,!1)!==!1)return le(),n.insertBefore(dragEl,he),parentEl=n,pe(),de(!0)}else if(r.parentNode===n){g=getRect(r);var _e=0,Ce,xe=dragEl.parentNode!==n,Ie=!_dragElInRowColumn(dragEl.animated&&dragEl.toRect||i,r.animated&&r.toRect||g,oe),Oe=oe?"top":"left",Ve=isScrolledPast(r,"top","top")||isScrolledPast(dragEl,"top","top"),Ue=Ve?Ve.scrollTop:void 0;lastTarget!==r&&(Ce=g[Oe],pastFirstInvertThresh=!1,isCircumstantialInvert=!Ie&&k.invertSwap||xe),_e=_getSwapDirection(e,r,g,oe,Ie?1:k.swapThreshold,k.invertedSwapThreshold==null?k.swapThreshold:k.invertedSwapThreshold,isCircumstantialInvert,lastTarget===r);var kt;if(_e!==0){var Dt=index(dragEl);do Dt-=_e,kt=parentEl.children[Dt];while(kt&&(css(kt,"display")==="none"||kt===ghostEl))}if(_e===0||kt===r)return de(!1);lastTarget=r,lastDirection=_e;var $e=r.nextElementSibling,Fe=!1;Fe=_e===1;var ze=_onMove(rootEl,n,dragEl,i,r,g,e,Fe);if(ze!==!1)return(ze===1||ze===-1)&&(Fe=ze===1),_silent=!0,setTimeout(_unsilent,30),le(),Fe&&!$e?n.appendChild(dragEl):r.parentNode.insertBefore(dragEl,Fe?$e:r),Ve&&scrollBy(Ve,0,Ue-Ve.scrollTop),parentEl=dragEl.parentNode,Ce!==void 0&&!isCircumstantialInvert&&(targetMoveDistance=Math.abs(Ce-getRect(r)[Oe])),pe(),de(!0)}if(n.contains(dragEl))return de(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function t(){off(document,"mousemove",this._onTouchMove),off(document,"touchmove",this._onTouchMove),off(document,"pointermove",this._onTouchMove),off(document,"dragover",nearestEmptyInsertDetectEvent),off(document,"mousemove",nearestEmptyInsertDetectEvent),off(document,"touchmove",nearestEmptyInsertDetectEvent)},_offUpEvents:function t(){var e=this.el.ownerDocument;off(e,"mouseup",this._onDrop),off(e,"touchend",this._onDrop),off(e,"pointerup",this._onDrop),off(e,"pointercancel",this._onDrop),off(e,"touchcancel",this._onDrop),off(document,"selectstart",this)},_onDrop:function t(e){var n=this.el,r=this.options;if(newIndex=index(dragEl),newDraggableIndex=index(dragEl,r.draggable),pluginEvent("drop",this,{evt:e}),parentEl=dragEl&&dragEl.parentNode,newIndex=index(dragEl),newDraggableIndex=index(dragEl,r.draggable),Sortable.eventCanceled){this._nulling();return}awaitingDragStarted=!1,isCircumstantialInvert=!1,pastFirstInvertThresh=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),_cancelNextTick(this.cloneId),_cancelNextTick(this._dragStartId),this.nativeDraggable&&(off(document,"drop",this),off(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Safari&&css(document.body,"user-select",""),css(dragEl,"transform",""),e&&(moved&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),ghostEl&&ghostEl.parentNode&&ghostEl.parentNode.removeChild(ghostEl),(rootEl===parentEl||putSortable&&putSortable.lastPutMode!=="clone")&&cloneEl&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),dragEl&&(this.nativeDraggable&&off(dragEl,"dragend",this),_disableDraggable(dragEl),dragEl.style["will-change"]="",moved&&!awaitingDragStarted&&toggleClass(dragEl,putSortable?putSortable.options.ghostClass:this.options.ghostClass,!1),toggleClass(dragEl,this.options.chosenClass,!1),_dispatchEvent({sortable:this,name:"unchoose",toEl:parentEl,newIndex:null,newDraggableIndex:null,originalEvent:e}),rootEl!==parentEl?(newIndex>=0&&(_dispatchEvent({rootEl:parentEl,name:"add",toEl:parentEl,fromEl:rootEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"remove",toEl:parentEl,originalEvent:e}),_dispatchEvent({rootEl:parentEl,name:"sort",toEl:parentEl,fromEl:rootEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:e})),putSortable&&putSortable.save()):newIndex!==oldIndex&&newIndex>=0&&(_dispatchEvent({sortable:this,name:"update",toEl:parentEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:e})),Sortable.active&&((newIndex==null||newIndex===-1)&&(newIndex=oldIndex,newDraggableIndex=oldDraggableIndex),_dispatchEvent({sortable:this,name:"end",toEl:parentEl,originalEvent:e}),this.save()))),this._nulling()},_nulling:function t(){pluginEvent("nulling",this),rootEl=dragEl=parentEl=ghostEl=nextEl=cloneEl=lastDownEl=cloneHidden=tapEvt=touchEvt=moved=newIndex=newDraggableIndex=oldIndex=oldDraggableIndex=lastTarget=lastDirection=putSortable=activeGroup=Sortable.dragged=Sortable.ghost=Sortable.clone=Sortable.active=null,savedInputChecked.forEach(function(e){e.checked=!0}),savedInputChecked.length=lastDx=lastDy=0},handleEvent:function t(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":dragEl&&(this._onDragOver(e),_globalDragOver(e));break;case"selectstart":e.preventDefault();break}},toArray:function t(){for(var e=[],n,r=this.el.children,i=0,g=r.length,y=this.options;i<g;i++)n=r[i],closest(n,y.draggable,this.el,!1)&&e.push(n.getAttribute(y.dataIdAttr)||_generateId(n));return e},sort:function t(e,n){var r={},i=this.el;this.toArray().forEach(function(g,y){var k=i.children[y];closest(k,this.options.draggable,i,!1)&&(r[g]=k)},this),n&&this.captureAnimationState(),e.forEach(function(g){r[g]&&(i.removeChild(r[g]),i.appendChild(r[g]))}),n&&this.animateAll()},save:function t(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function t(e,n){return closest(e,n||this.options.draggable,this.el,!1)},option:function t(e,n){var r=this.options;if(n===void 0)return r[e];var i=PluginManager.modifyOption(this,e,n);typeof i<"u"?r[e]=i:r[e]=n,e==="group"&&_prepareGroup(r)},destroy:function t(){pluginEvent("destroy",this);var e=this.el;e[expando]=null,off(e,"mousedown",this._onTapStart),off(e,"touchstart",this._onTapStart),off(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(off(e,"dragover",this),off(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),sortables.splice(sortables.indexOf(this.el),1),this.el=e=null},_hideClone:function t(){if(!cloneHidden){if(pluginEvent("hideClone",this),Sortable.eventCanceled)return;css(cloneEl,"display","none"),this.options.removeCloneOnHide&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),cloneHidden=!0}},_showClone:function t(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(cloneHidden){if(pluginEvent("showClone",this),Sortable.eventCanceled)return;dragEl.parentNode==rootEl&&!this.options.group.revertClone?rootEl.insertBefore(cloneEl,dragEl):nextEl?rootEl.insertBefore(cloneEl,nextEl):rootEl.appendChild(cloneEl),this.options.group.revertClone&&this.animate(dragEl,cloneEl),css(cloneEl,"display",""),cloneHidden=!1}}};function _globalDragOver(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function _onMove(t,e,n,r,i,g,y,k){var L,$=t[expando],V=$.options.onMove,z;return window.CustomEvent&&!IE11OrLess&&!Edge?L=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(L=document.createEvent("Event"),L.initEvent("move",!0,!0)),L.to=e,L.from=t,L.dragged=n,L.draggedRect=r,L.related=i||e,L.relatedRect=g||getRect(e),L.willInsertAfter=k,L.originalEvent=y,t.dispatchEvent(L),V&&(z=V.call($,L,y)),z}function _disableDraggable(t){t.draggable=!1}function _unsilent(){_silent=!1}function _ghostIsFirst(t,e,n){var r=getRect(getChild(n.el,0,n.options,!0)),i=getChildContainingRectFromElement(n.el,n.options,ghostEl),g=10;return e?t.clientX<i.left-g||t.clientY<r.top&&t.clientX<r.right:t.clientY<i.top-g||t.clientY<r.bottom&&t.clientX<r.left}function _ghostIsLast(t,e,n){var r=getRect(lastChild(n.el,n.options.draggable)),i=getChildContainingRectFromElement(n.el,n.options,ghostEl),g=10;return e?t.clientX>i.right+g||t.clientY>r.bottom&&t.clientX>r.left:t.clientY>i.bottom+g||t.clientX>r.right&&t.clientY>r.top}function _getSwapDirection(t,e,n,r,i,g,y,k){var L=r?t.clientY:t.clientX,$=r?n.height:n.width,V=r?n.top:n.left,z=r?n.bottom:n.right,j=!1;if(!y){if(k&&targetMoveDistance<$*i){if(!pastFirstInvertThresh&&(lastDirection===1?L>V+$*g/2:L<z-$*g/2)&&(pastFirstInvertThresh=!0),pastFirstInvertThresh)j=!0;else if(lastDirection===1?L<V+targetMoveDistance:L>z-targetMoveDistance)return-lastDirection}else if(L>V+$*(1-i)/2&&L<z-$*(1-i)/2)return _getInsertDirection(e)}return j=j||y,j&&(L<V+$*g/2||L>z-$*g/2)?L>V+$/2?1:-1:0}function _getInsertDirection(t){return index(dragEl)<index(t)?1:-1}function _generateId(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function _saveInputCheckedState(t){savedInputChecked.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&savedInputChecked.push(r)}}function _nextTick(t){return setTimeout(t,0)}function _cancelNextTick(t){return clearTimeout(t)}documentExists&&on(document,"touchmove",function(t){(Sortable.active||awaitingDragStarted)&&t.cancelable&&t.preventDefault()}),Sortable.utils={on,off,css,find,is:function t(e,n){return!!closest(e,n,e,!1)},extend,throttle,closest,toggleClass,clone,index,nextTick:_nextTick,cancelNextTick:_cancelNextTick,detectDirection:_detectDirection,getChild,expando},Sortable.get=function(t){return t[expando]},Sortable.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Sortable.utils=_objectSpread2(_objectSpread2({},Sortable.utils),r.utils)),PluginManager.mount(r)})},Sortable.create=function(t,e){return new Sortable(t,e)},Sortable.version=version;var autoScrolls=[],scrollEl,scrollRootEl,scrolling=!1,lastAutoScrollX,lastAutoScrollY,touchEvt$1,pointerElemChangedInterval;function AutoScrollPlugin(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var r=n.originalEvent;this.sortable.nativeDraggable?on(document,"dragover",this._handleAutoScroll):this.options.supportPointer?on(document,"pointermove",this._handleFallbackAutoScroll):r.touches?on(document,"touchmove",this._handleFallbackAutoScroll):on(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?off(document,"dragover",this._handleAutoScroll):(off(document,"pointermove",this._handleFallbackAutoScroll),off(document,"touchmove",this._handleFallbackAutoScroll),off(document,"mousemove",this._handleFallbackAutoScroll)),clearPointerElemChangedInterval(),clearAutoScrolls(),cancelThrottle()},nulling:function(){touchEvt$1=scrollRootEl=scrollEl=scrolling=pointerElemChangedInterval=lastAutoScrollX=lastAutoScrollY=null,autoScrolls.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,r){var i=this,g=(n.touches?n.touches[0]:n).clientX,y=(n.touches?n.touches[0]:n).clientY,k=document.elementFromPoint(g,y);if(touchEvt$1=n,r||this.options.forceAutoScrollFallback||Edge||IE11OrLess||Safari){autoScroll(n,this.options,k,r);var L=getParentAutoScrollElement(k,!0);scrolling&&(!pointerElemChangedInterval||g!==lastAutoScrollX||y!==lastAutoScrollY)&&(pointerElemChangedInterval&&clearPointerElemChangedInterval(),pointerElemChangedInterval=setInterval(function(){var $=getParentAutoScrollElement(document.elementFromPoint(g,y),!0);$!==L&&(L=$,clearAutoScrolls()),autoScroll(n,i.options,$,r)},10),lastAutoScrollX=g,lastAutoScrollY=y)}else{if(!this.options.bubbleScroll||getParentAutoScrollElement(k,!0)===getWindowScrollingElement()){clearAutoScrolls();return}autoScroll(n,this.options,getParentAutoScrollElement(k,!1),!1)}}},_extends(t,{pluginName:"scroll",initializeByDefault:!0})}function clearAutoScrolls(){autoScrolls.forEach(function(t){clearInterval(t.pid)}),autoScrolls=[]}function clearPointerElemChangedInterval(){clearInterval(pointerElemChangedInterval)}var autoScroll=throttle(function(t,e,n,r){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,y=e.scrollSensitivity,k=e.scrollSpeed,L=getWindowScrollingElement(),$=!1,V;scrollRootEl!==n&&(scrollRootEl=n,clearAutoScrolls(),scrollEl=e.scroll,V=e.scrollFn,scrollEl===!0&&(scrollEl=getParentAutoScrollElement(n,!0)));var z=0,j=scrollEl;do{var oe=j,re=getRect(oe),ie=re.top,ae=re.bottom,le=re.left,de=re.right,pe=re.width,ue=re.height,he=void 0,_e=void 0,Ce=oe.scrollWidth,xe=oe.scrollHeight,Ie=css(oe),Oe=oe.scrollLeft,Ve=oe.scrollTop;oe===L?(he=pe<Ce&&(Ie.overflowX==="auto"||Ie.overflowX==="scroll"||Ie.overflowX==="visible"),_e=ue<xe&&(Ie.overflowY==="auto"||Ie.overflowY==="scroll"||Ie.overflowY==="visible")):(he=pe<Ce&&(Ie.overflowX==="auto"||Ie.overflowX==="scroll"),_e=ue<xe&&(Ie.overflowY==="auto"||Ie.overflowY==="scroll"));var Ue=he&&(Math.abs(de-i)<=y&&Oe+pe<Ce)-(Math.abs(le-i)<=y&&!!Oe),kt=_e&&(Math.abs(ae-g)<=y&&Ve+ue<xe)-(Math.abs(ie-g)<=y&&!!Ve);if(!autoScrolls[z])for(var Dt=0;Dt<=z;Dt++)autoScrolls[Dt]||(autoScrolls[Dt]={});(autoScrolls[z].vx!=Ue||autoScrolls[z].vy!=kt||autoScrolls[z].el!==oe)&&(autoScrolls[z].el=oe,autoScrolls[z].vx=Ue,autoScrolls[z].vy=kt,clearInterval(autoScrolls[z].pid),(Ue!=0||kt!=0)&&($=!0,autoScrolls[z].pid=setInterval((function(){r&&this.layer===0&&Sortable.active._onTouchMove(touchEvt$1);var $e=autoScrolls[this.layer].vy?autoScrolls[this.layer].vy*k:0,Fe=autoScrolls[this.layer].vx?autoScrolls[this.layer].vx*k:0;typeof V=="function"&&V.call(Sortable.dragged.parentNode[expando],Fe,$e,t,touchEvt$1,autoScrolls[this.layer].el)!=="continue"||scrollBy(autoScrolls[this.layer].el,Fe,$e)}).bind({layer:z}),24))),z++}while(e.bubbleScroll&&j!==L&&(j=getParentAutoScrollElement(j,!1)));scrolling=$}},30),drop=function t(e){var n=e.originalEvent,r=e.putSortable,i=e.dragEl,g=e.activeSortable,y=e.dispatchSortableEvent,k=e.hideGhostForTarget,L=e.unhideGhostForTarget;if(n){var $=r||g;k();var V=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,z=document.elementFromPoint(V.clientX,V.clientY);L(),$&&!$.el.contains(z)&&(y("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function Revert(){}Revert.prototype={startIndex:null,dragStart:function t(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function t(e){var n=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=getChild(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),r&&r.animateAll()},drop},_extends(Revert,{pluginName:"revertOnSpill"});function Remove(){}Remove.prototype={onSpill:function t(e){var n=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop},_extends(Remove,{pluginName:"removeOnSpill"}),Sortable.mount(new AutoScrollPlugin),Sortable.mount(Remove,Revert);const useTable=(t,e={},n=!0,r,i,g=y=>y)=>{const y=vue.reactive({tableData:[],pageable:{page:1,size:10,total:0},searchParam:{},searchInitParam:{},totalParam:{},loading:!1}),k=vue.computed({get:()=>({page:y.pageable.page,size:y.pageable.size}),set:ie=>{console.log("我是分页更新之后的值",ie)}}),L=async()=>{if(y.loading=!0,!t){y.loading=!1;return}try{const ie=localStorage.getItem("MytaskGotoListPageQuery");if(ie){e={},y.totalParam={};const le=JSON.parse(ie);e={...e,...le},y.searchParam={...le}}Object.assign(y.totalParam,e,n?k.value:{});for(const le in y.searchParam)y.searchParam[le]===""&&delete y.searchParam[le];let ae=await t(g({...y.searchInitParam,...y.totalParam}));if(r&&(ae=await r(ae)),y.tableData=n?ae.list:ae,n){const{currentPage:le,pageSize:de,total:pe}=ae;V({page:le,size:de,total:pe})}}catch(ie){i&&i(ie)}finally{y.loading=!1}},$=()=>{y.totalParam={},y.searchInitParam={},e={};const ie={};for(const ae in y.searchParam)(y.searchParam[ae]||y.searchParam[ae]===!1||y.searchParam[ae]===0)&&(ie[ae]=y.searchParam[ae]);Object.assign(y.totalParam,ie,n?k.value:{})},V=ie=>{Object.assign(y.pageable,ie)},z=()=>{y.pageable.page=1,$(),L().then()},j=()=>{y.pageable.page=1,y.searchParam={...y.searchInitParam},$(),L().then()},oe=ie=>{y.pageable.page=1,y.pageable.size=ie,L().then()},re=ie=>{y.pageable.page=ie,L().then()};return{...vue.toRefs(y),getTableList:L,search:z,reset:j,handleSizeChange:oe,handleCurrentChange:re,updatedTotalParam:$}},useSelection=(t="id",e)=>{const n=vue.ref(!1),r=vue.ref([]),i=vue.computed(()=>{const y=[];return r.value.forEach(k=>y.push(get$5(k,t))),y});return{isSelected:n,selectedList:r,selectedListIds:i,selectionChange:y=>{y.length?n.value=!0:n.value=!1,r.value=y,e&&e(y)}}},_hoisted_1$5={class:"search-form-item"},_sfc_main$6=vue.defineComponent({name:"SearchFormItem",__name:"SearchFormItem",props:{column:{},searchParam:{}},emits:["search"],setup(t,{emit:e}){vue.useCssVars(ae=>({"011911cb":z.value}));const n=t,r=e,i=vue.computed(()=>n.searchParam),g=vue.computed(()=>{var ae,le,de;return{label:((ae=n.column.fieldNames)==null?void 0:ae.label)??"label",value:((le=n.column.fieldNames)==null?void 0:le.value)??"value",children:((de=n.column.fieldNames)==null?void 0:de.children)??"children"}}),y=vue.inject("enumMap",vue.ref(new Map)),k=vue.computed(()=>{var le;let ae=y.value.get(n.column.prop);return ae?(((le=n.column.search)==null?void 0:le.el)==="select-v2"&&n.column.fieldNames&&(ae=ae.map(de=>({...de,label:de[g.value.label],value:de[g.value.value]}))),ae):[]}),L=vue.computed(()=>{var ae,le;return((le=(ae=n.column.search)==null?void 0:ae.props)==null?void 0:le.options)??k.value??[]}),$=vue.computed(()=>{var he,_e;const ae=g.value.label,le=g.value.value,de=g.value.children,pe=(he=n.column.search)==null?void 0:he.el;let ue=((_e=n.column.search)==null?void 0:_e.props)??{};return pe==="tree-select"&&(ue={...ue,props:{...ue.props,label:ae,children:de},nodeKey:le}),pe==="cascader"&&(ue={...ue,props:{...ue.props,label:ae,value:le,children:de}}),ue}),V=vue.computed(()=>{var de,pe,ue,he,_e,Ce,xe;const ae=n.column.search;return["datetimerange","daterange","monthrange"].includes((de=ae==null?void 0:ae.props)==null?void 0:de.type)||(pe=ae==null?void 0:ae.props)!=null&&pe.isRange?{rangeSeparator:((ue=ae==null?void 0:ae.props)==null?void 0:ue.rangeSeparator)??"-",startPlaceholder:((he=ae==null?void 0:ae.props)==null?void 0:he.startPlaceholder)??"开始时间",endPlaceholder:((_e=ae==null?void 0:ae.props)==null?void 0:_e.endPlaceholder)??"结束时间"}:{placeholder:((Ce=ae==null?void 0:ae.props)==null?void 0:Ce.placeholder)??((xe=ae==null?void 0:ae.el)!=null&&xe.includes("input")?"请输入":"请选择")}}),z=vue.computed(()=>{var ue,he;const ae=n.column.search,le=i.value[(ae==null?void 0:ae.key)??handleProp(n.column.prop)],de=ae==null?void 0:ae.el,pe=(ue=ae==null?void 0:ae.props)==null?void 0:ue.placeholder;if(ae!=null&&ae.width)if(isFunction$2(ae==null?void 0:ae.width)){if(ae==null?void 0:ae.width(le))return(ae==null?void 0:ae.width(le))+"px"}else return(ae==null?void 0:ae.width)+"px";if(le&&le.length!==0&&["select","select-v2","tree-select","cascader"].includes(de||"")){if(isArray$2(le)){let xe=L.value;const Ie=[];if(le.forEach(Oe=>{const Ve=xe.find(kt=>kt[g.value.value]===Oe);Ie.push(Ve?Ve[g.value.label]:Oe);const Ue=Ve[g.value.children]??L.value;xe=Ve?Ue:[]}),(he=ae==null?void 0:ae.props)!=null&&he.multiple){const Ue=getWidthByText(Ie[0])+42;return le.length>1?Ue+26+getWidthByText("+ "+(le.length-1))+"px":Ue+"px"}return getWidthByText(Ie.join(" / "))+"px"}let _e=L.value.find(xe=>xe[g.value.value]===le);const Ce=_e?_e[g.value.label]:le;return getWidthByText(Ce)+"px"}else return pe?getWidthByText(pe)+"px":"100px"}),j=vue.computed(()=>{var ae,le,de,pe,ue;return(de=(le=(ae=n.column)==null?void 0:ae.search)==null?void 0:le.props)!=null&&de.multiple&&((ue=(pe=n.column)==null?void 0:pe.search)==null?void 0:ue.el)==="select"?{collapseTags:!0,collapseTagsTooltip:!0}:{}}),oe=vue.computed(()=>{var le;const ae=n.column.search;return((le=ae==null?void 0:ae.props)==null?void 0:le.clearable)??((ae==null?void 0:ae.defaultValue)==null||!1)}),re=ae=>{var le,de,pe,ue,he,_e,Ce,xe,Ie;if(((pe=(de=(le=n.column)==null?void 0:le.search)==null?void 0:de.props)==null?void 0:pe.type)==="daterange"){const{searchParam:Oe}=vue.toRefs(n);if(ae!=null&&ae.length){const Ve=((_e=(he=(ue=n.column)==null?void 0:ue.search)==null?void 0:he.props)==null?void 0:_e.beginTime)||"beginTime",Ue=((Ie=(xe=(Ce=n.column)==null?void 0:Ce.search)==null?void 0:xe.props)==null?void 0:Ie.endTime)||"endTime";Oe.value[Ve]=ae[0],Oe.value[Ue]=ae[1]}else delete Oe.value.beginTime,delete Oe.value.endTime}(ae==null||ae==="")&&r("search"),ae instanceof Array&&!ae.length&&r("search")},ie=()=>{var ae;["input","input-number"].includes(((ae=n.column.search)==null?void 0:ae.el)||"")&&r("search")};return(ae,le)=>{var de,pe,ue,he,_e,Ce,xe;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(((de=ae.column.search)==null?void 0:de.render)??`el-${(pe=ae.column.search)==null?void 0:pe.el}`),vue.mergeProps({...$.value,...V.value,searchParam:i.value,clearable:oe.value,...j.value},{modelValue:i.value[((ue=ae.column.search)==null?void 0:ue.key)??vue.unref(handleProp)(ae.column.prop)],"onUpdate:modelValue":le[0]||(le[0]=Ie=>{var Oe;return i.value[((Oe=ae.column.search)==null?void 0:Oe.key)??vue.unref(handleProp)(ae.column.prop)]=Ie}),modelModifiers:{trim:!0},data:((he=ae.column.search)==null?void 0:he.el)==="tree-select"?k.value:[],options:L.value,"prefix-icon":(Ce=(_e=ae.column.search)==null?void 0:_e.props)==null?void 0:Ce.prefixIcon,onChange:re,onKeyup:vue.withKeys(ie,["enter"])}),vue.createSlots({default:vue.withCtx(()=>{var Ie;return[((Ie=ae.column.search)==null?void 0:Ie.el)==="select"?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(k.value,(Oe,Ve)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent("el-option"),{key:Ve,label:Oe[g.value.label]??"",value:Oe[g.value.value]},null,8,["label","value"]))),128)):vue.renderSlot(ae.$slots,"default",{key:1},void 0,!0)]}),_:2},[((xe=ae.column.search)==null?void 0:xe.el)==="cascader"?{name:"default",fn:vue.withCtx(({data:Ie})=>[vue.createElementVNode("span",null,vue.toDisplayString(Ie[g.value.label]),1)]),key:"0"}:void 0]),1040,["modelValue","data","options","prefix-icon"]))])}}}),SearchFormItem=_export_sfc(_sfc_main$6,[["__scopeId","data-v-b68822f7"]]),_hoisted_1$4={class:"table-search"},_hoisted_2$3={key:0},_hoisted_3$3={key:0,class:"operation"},_sfc_main$5=vue.defineComponent({name:"SearchForm",__name:"SearchForm",props:{columns:{default:()=>[]},searchParam:{default:()=>({})},search:{},reset:{},isShowResetBtn:{type:Boolean,default:!0},isShowSearchBtn:{type:Boolean,default:!0}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElForm),{ref:"formRef",model:n.searchParam,class:"table-search--left",onSubmit:r[0]||(r[0]=vue.withModifiers(()=>{},["prevent"]))},{default:vue.withCtx(()=>[vue.renderSlot(n.$slots,"default",{},void 0,!0),n.columns.length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.columns,i=>{var g,y,k;return vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:i.prop},[!vue.unref(isBoolean$1)((g=i.search)==null?void 0:g.isShow)||(y=i.search)!=null&&y.isShow?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$3,[vue.createVNode(vue.unref(ElFormItem),null,vue.createSlots({default:vue.withCtx(()=>[vue.createVNode(SearchFormItem,{column:i,"search-param":n.searchParam,onSearch:n.search},null,8,["column","search-param","onSearch"])]),_:2},[(k=i.search)!=null&&k.label?{name:"label",fn:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSpace),{size:4},{default:vue.withCtx(()=>{var L,$;return[vue.createElementVNode("span",null,vue.toDisplayString(`${i.search.label}`),1),(L=i.search)!=null&&L.tooltip?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,effect:"dark",content:($=i.search)==null?void 0:$.tooltip,placement:"top"},{default:vue.withCtx(()=>r[1]||(r[1]=[vue.createElementVNode("i",{class:vue.normalizeClass("iconfont icon-yiwen")},null,-1)])),_:2},1032,["content"])):vue.createCommentVNode("",!0)]}),_:2},1024),r[2]||(r[2]=vue.createElementVNode("span",null,":",-1))]),key:"0"}:void 0]),1024)])):vue.createCommentVNode("",!0)],64)}),128)),e.isShowSearchBtn?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:0,type:"primary",class:"table-search--search-btn",onClick:n.search},{icon:vue.withCtx(()=>r[3]||(r[3]=[vue.createElementVNode("i",{class:"ztable-iconfont icon-zhihao-table-search"},null,-1)])),default:vue.withCtx(()=>[r[4]||(r[4]=vue.createTextVNode(" 搜索 "))]),_:1},8,["onClick"])):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0)]),_:3},8,["model"]),e.isShowResetBtn&&n.columns.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$3,[vue.createVNode(vue.unref(ElTooltip),{class:"box-item",effect:"light",content:"重置",placement:"top"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{class:"table-search--reset-btn",onClick:n.reset},{icon:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{size:14},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(refresh_left_default))]),_:1})]),_:1},8,["onClick"])]),_:1})])):vue.createCommentVNode("",!0)]))}}),SearchForm=_export_sfc(_sfc_main$5,[["__scopeId","data-v-78af7c4d"]]),_hoisted_1$3={class:"el-pagination__total zh-page-total"},_sfc_main$4=vue.defineComponent({name:"Pagination",__name:"tablePagination",props:{pageable:{},handleSizeChange:{type:Function},handleCurrentChange:{type:Function}},setup(t){return(e,n)=>e.pageable.total?(vue.openBlock(),vue.createBlock(vue.unref(ElPagination),{key:0,class:"zh-pagination",background:!0,"current-page":e.pageable.page,"page-size":e.pageable.size,total:e.pageable.total,layout:"slot, sizes, prev, pager, next, jumper",onSizeChange:e.handleSizeChange,onCurrentChange:e.handleCurrentChange},{default:vue.withCtx(()=>[vue.renderSlot(e.$slots,"zhPaginationLeftSlot",{pageable:e.pageable},()=>[vue.createElementVNode("div",_hoisted_1$3,"共"+vue.toDisplayString(e.pageable.total)+"条数据",1)],!0)]),_:3},8,["current-page","page-size","total","onSizeChange","onCurrentChange"])):vue.createCommentVNode("",!0)}}),TablePagination=_export_sfc(_sfc_main$4,[["__scopeId","data-v-26dd9888"]]);function _isSlot(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vue.isVNode(t)}const _sfc_main$3=vue.defineComponent({name:"TableColumn",__name:"TableColumn",props:{column:{},customColumn:{type:Boolean}},setup(t){const e=t,n=vue.ref(e.column),r=vue.useSlots(),i=vue.inject("enumMap",vue.ref(new Map)),g=(L,$)=>i.value.get(L.prop)&&L.isFilterEnum?filterEnum(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop),L.fieldNames):formatValue(handleRowAccordingToProp($.row,L.prop)),y=(L,$)=>filterEnum(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop),L.fieldNames,"tag"),k=L=>vue.createVNode(vue.Fragment,null,[L.isShow&&vue.createVNode(ElTableColumn,vue.mergeProps(L,{"class-name":L.wrap&&"table-column--wrap",showOverflowTooltip:L.showOverflowTooltip??L.prop!=="operation"}),{default:$=>{var z,j,oe;let V;if(L._children)return L._children.map(re=>k(re));if(L.render)return L.render($);if(L.prop==="operation"){if(!r[handleProp(L.prop)]){n.value.width=0;return}const re=((j=(z=r[handleProp(L.prop)]($))==null?void 0:z.at(0))==null?void 0:j.children)||[],ie=Ce=>Array.from(Ce).map(xe=>{var Ie,Oe;return((Ie=xe.type)==null?void 0:Ie.name)==="ElButton"&&xe.children!=="v-if"?xe:(Oe=xe.children)!=null&&Oe.length?ie(xe.children):null}).filter(Boolean).flat(),ae=ie(re),le=Ce=>{let xe="";return Ce.forEach(Ie=>{xe+=Ie.children.default()[0].children}),getWidthByText(xe,14)+16*(Ce.length>0?Ce.length-1:0)},de=Ce=>{n.value.hasOperationMaxWidth||(n.value.width=0,n.value.hasOperationMaxWidth=!0);const xe=n.value.width;let Ie=0;Ce>0&&(Ie=Math.round(Ce)+32),Ie>Number.parseInt((xe==null?void 0:xe.toString())||"0")&&(n.value.width=Ie,n.value.hasOperationMaxWidth=!0)};if(ae.length<=3||L.expandOperationButtons){const Ce=Math.ceil(le(ae));let xe=Ce;return e.customColumn&&(xe=ae.length?ae.length===1?Ce+30:Ce:50),de(xe),vue.createVNode("div",{class:"operation-container all-action"},[r[handleProp(L.prop)]($)])}const pe=[],ue=ae.slice(0,2),he=vue.createVNode(ElButton,{link:!0,type:"primary"},{default:()=>[vue.createTextVNode("更多")]});pe.push(...ue),pe[3]=vue.createVNode(ElDropdown,null,{default:()=>he,dropdown:()=>{let Ce;return vue.createVNode(ElDropdownMenu,null,_isSlot(Ce=ae.slice(2).map(xe=>vue.createVNode(ElDropdownItem,null,_isSlot(xe)?xe:{default:()=>[xe]})))?Ce:{default:()=>[Ce]})}});const _e=le([...ue,he]);return de(_e),vue.createVNode("div",{class:"operation-container"},[pe])}return r[handleProp(L.prop)]?r[handleProp(L.prop)]($):L.tag?vue.createVNode(ElTag,{type:y(L,$)},_isSlot(V=g(L,$))?V:{default:()=>[V]}):L.click&&g(L,$)!==DEFAULT_VALUE$1?vue.createVNode("span",{class:"el-link el-link--primary scan-link",onClick:function(){L.click($==null?void 0:$.row,$==null?void 0:$.$index)}},[L.formatter?L.formatter($.row,$.column,$.row[L.prop],$.$index):g(L,$)]):vue.createVNode("span",{class:((oe=filterEnumObj(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop)))==null?void 0:oe.state)||"text"},[L.formatter?L.formatter($.row,$.column,$.row[L.prop],$.$index):g(L,$)])},header:$=>L.headerRender?L.headerRender($):r[`${handleProp(L.prop)}Header`]?r[`${handleProp(L.prop)}Header`]($):L.label})]);return(L,$)=>(vue.openBlock(),vue.createBlock(k,vue.normalizeProps(vue.guardReactiveProps(n.value)),null,16))}}),_hoisted_1$2={class:"custom-column-dialog"},_hoisted_2$2={class:"table-body"},_hoisted_3$2={class:"name"},_hoisted_4$1={key:0,class:"ml-10"},_hoisted_5$1={class:"custom-width-label text"},_hoisted_6$1={key:0,class:"custom-width-input-box"},_hoisted_7$1={class:"custom-column-footer"},_hoisted_8$1={class:"flex-1"},_sfc_main$2=vue.defineComponent({name:"ColSetting",__name:"ColSetting",props:{originTableColumns:{default:()=>[]}},emits:["close","submit","dragSort"],setup(t,{expose:e,emit:n}){const r=vue.ref(),i=vue.ref(!1),g=t,y=vue.ref([]),k=vue.ref(new Date().getTime()),L=vue.ref(!1),$=vue.ref(),V=le=>{y.value=le,L.value=!0,vue.nextTick(()=>{re()})},z=le=>{i.value=le},j=n,oe=async()=>{j("submit",y.value),L.value=!1},re=()=>{$.value&&($.value.destroy(),k.value=new Date().getTime(),r.value.doLayout()),vue.nextTick(()=>{const le=document.querySelector(".custom-column-dialog tbody");$.value=Sortable.create(le,{handle:".move",animation:300,filter:".operation",onEnd({newIndex:de,oldIndex:pe}){if(!de&&de!==0||!pe&&pe!==0)return;let ue=cloneDeep(y.value);const he=ue[pe];if(de<pe)for(let _e=de;_e<pe;_e++)ue[_e].order=String(Number(ue[_e].order)+1);else for(let _e=pe+1;_e<=de;_e++)ue[_e].order=String(Number(ue[_e].order)-1);he.order=String(de),y.value=cloneDeep(ue)}})})},ie=()=>{const le=cloneDeep(g.originTableColumns);i.value?y.value=le:y.value=y.value.map(de=>{const pe=y.value.find(ue=>ue.prop===de.prop);return!(pe!=null&&pe.isShow)||pe.prop==="operation"?de:le.find(ue=>ue.prop===de.prop)}),re()},ae=()=>{L.value=!1};return e({openColSetting:V}),(le,de)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createVNode(_sfc_main$s,{modelValue:L.value,"onUpdate:modelValue":de[1]||(de[1]=pe=>L.value=pe),size:"middle"},{header:vue.withCtx(()=>de[2]||(de[2]=[vue.createElementVNode("div",{class:"title"},"自定义列",-1),vue.createElementVNode("div",{class:"sub-title"},"勾选需要展示的列,拖动列名进行排序",-1)])),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$1,[vue.createVNode(vue.unref(ElCheckbox),{modelValue:i.value,"onUpdate:modelValue":de[0]||(de[0]=pe=>i.value=pe),class:"checkbox",label:"全局",onChange:z},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_8$1,[vue.createVNode(ZhButton$1,{plain:"",onClick:ae},{default:vue.withCtx(()=>de[4]||(de[4]=[vue.createTextVNode("取消")])),_:1}),vue.createVNode(ZhButton$1,{plain:"",class:"w-auto",onClick:ie},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.value?"全局恢复默认":"恢复默认"),1)]),_:1}),vue.createVNode(ZhButton$1,{type:"primary",onClick:oe},{default:vue.withCtx(()=>de[5]||(de[5]=[vue.createTextVNode("保存")])),_:1})])])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$2,[(vue.openBlock(),vue.createBlock(vue.unref(ElTable),{ref_key:"tableRef",ref:r,class:"custom-colum-table",key:k.value,data:y.value,"row-class-name":pe=>pe.row.prop==="operation"?"operation":""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTableColumn),{width:"100",label:"选择"},{default:vue.withCtx(({row:pe})=>[vue.createVNode(vue.unref(ElCheckbox),{class:"custom-column-check",modelValue:pe.isShow,"onUpdate:modelValue":ue=>pe.isShow=ue,disabled:pe.readonly},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:1}),vue.createVNode(vue.unref(ElTableColumn),{prop:"label",label:"名称"},{default:vue.withCtx(({row:pe})=>[vue.createElementVNode("div",_hoisted_3$2,[vue.createTextVNode(vue.toDisplayString(pe.label)+" ",1),pe.readonly?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$1,"(必选)")):vue.createCommentVNode("",!0),pe.prop!=="operation"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:"move move-icon"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(rank_default))]),_:1})):vue.createCommentVNode("",!0)])]),_:1}),vue.createVNode(vue.unref(ElTableColumn),{prop:"width",label:"宽度",width:"180"},{default:vue.withCtx(({row:pe})=>[vue.createElementVNode("div",{class:vue.normalizeClass(`custom-width-box ${pe.readonly&&"readonly"}`)},[de[3]||(de[3]=vue.createElementVNode("span",{class:"text"},"宽度",-1)),vue.createElementVNode("span",_hoisted_5$1,vue.toDisplayString(pe.width)+" px",1),pe.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$1,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:pe.width,"onUpdate:modelValue":ue=>pe.width=ue,class:"custom-width-input",min:10,max:1e3,controls:!1},null,8,["modelValue","onUpdate:modelValue"])]))],2)]),_:1})]),_:1},8,["data","row-class-name"]))])]),_:1},8,["modelValue"])]))}}),ColSetting=_export_sfc(_sfc_main$2,[["__scopeId","data-v-fd937235"]]),_hoisted_1$1={class:"no-card table-main zh-table"},_hoisted_2$1={class:"table-title-container"},_hoisted_3$1={key:0,class:"table-title"},_hoisted_4={key:1,class:"table-header-tip"},_hoisted_5={class:"table-header-container"},_hoisted_6={key:0,class:"table-header"},_hoisted_7={class:"header-button-ri"},_hoisted_8={key:0},_hoisted_9={class:"table-body-container"},_hoisted_10={class:"text d-flex inline-input-text pointer"},_hoisted_11={key:1,class:"inline-input-box d-flex"},_hoisted_12={class:"table-empty"},_hoisted_13=["src"],_sfc_main$1=vue.defineComponent({name:"ZhTable",__name:"Table",props:{columns:{default:()=>[]},data:{},requestApi:{},requestAuto:{type:Boolean,default:!0},requestError:{type:Function,default:t=>{console.error("protable中请求数据错误",t)}},handleParam:{},dataCallback:{},selectChangeCallback:{},title:{},pagination:{type:Boolean,default:!0},initParam:{default:{}},border:{type:Boolean,default:!1},rowKey:{default:"id"},isShowSearch:{type:Boolean,default:!0},maxHeight:{},isShowSearchBtn:{type:Boolean,default:!0},isShowResetBtn:{type:Boolean,default:!0},customColumn:{type:Boolean,default:!1},onSortChange:{},offset:{},customColumnCacheKey:{},customColumnPageCacheKey:{},beforeReset:{}},emits:["search","reset","dargSort"],setup(t,{expose:e,emit:n}){var Un;const r=vue.ref(new Date().getTime()),i={mounted(xn){var On;(On=xn.querySelector("input"))==null||On.focus()}},g=vue.useSlots(),y=t,k=vue.ref(),L=["selection","radio","index","expand","sort","input"],$=vue.ref(y.isShowSearch),V=vue.ref(""),z=vue.ref({}),j=vue.ref(y.maxHeight||"1000px"),{selectionChange:oe,selectedList:re,selectedListIds:ie,isSelected:ae}=useSelection(y.rowKey,y.selectChangeCallback),{loading:le,tableData:de,pageable:pe,searchParam:ue,searchInitParam:he,getTableList:_e,search:Ce,reset:xe,handleSizeChange:Ie,handleCurrentChange:Oe}=useTable(y.requestApi,y.initParam,y.pagination,y.dataCallback,y.requestError,y.handleParam),Ve=xn=>{function On(er){return er.replace(/[A-Z]/g,ar=>"_"+ar.toLowerCase())}const Ln={ascending:"asc",descending:"desc"},{prop:_n,order:Mn}=xn,Wn=On(handleProp(_n)),Qn=Ln[Mn];ue.value={...ue.value,sortKey:Wn,sortOrder:Qn},pe.value.page=1,Ce()},Ue=()=>k.value.clearSelection(),kt=()=>k.value.clearSort(),Dt=vue.ref(!1),$e=()=>{En(),y.customColumn&&Zn(),y.requestAuto&&_e(),y.data&&(pe.value.total=y.data.length)};vue.onMounted(()=>{$e(),vue.nextTick(()=>{Dt.value=!0})}),vue.onActivated(()=>{Dt.value&&$e()}),vue.onDeactivated(()=>{}),vue.onUnmounted(()=>{});const Fe=vue.computed(()=>y.data?y.pagination?y.data.slice((pe.value.page-1)*pe.value.size,pe.value.size*pe.value.page):y.data:de.value),ze=xn=>{pe.value.total=xn};vue.watch(()=>y.initParam,_e,{deep:!0});let qe=vue.reactive(y.columns);const Ne=vue.computed(()=>hn(qe)),Et=vue.ref(new Map),Pt=async({prop:xn,enum:On})=>{if(!On||Et.value.has(xn)&&(typeof On=="function"||Et.value.get(xn)===On))return;if(typeof On!="function")return Et.value.set(xn,vue.unref(On));Et.value.set(xn,[]);const{data:Ln}=await On();Et.value.set(xn,Ln)};vue.provide("enumMap",Et);const hn=(xn,On=[])=>(xn.forEach(async Ln=>{var _n;(_n=Ln._children)!=null&&_n.length&&On.push(...hn(Ln._children)),On.push(Ln),Ln.isShow=Ln.isShow??!0,Ln.isFilterEnum=Ln.isFilterEnum??!0,await Pt(Ln)}),On.filter(Ln=>{var _n;return!((_n=Ln._children)!=null&&_n.length)})),Lt=vue.computed(()=>{var xn;return(xn=Ne.value)==null?void 0:xn.filter(On=>{var Ln,_n;return((Ln=On.search)==null?void 0:Ln.el)||((_n=On.search)==null?void 0:_n.render)}).sort((On,Ln)=>On.search.order-Ln.search.order)});(Un=Lt.value)==null||Un.forEach((xn,On)=>{var Mn,Wn,Qn;xn.search.order=((Mn=xn.search)==null?void 0:Mn.order)??On+2;const Ln=((Wn=xn.search)==null?void 0:Wn.key)??handleProp(xn.prop),_n=(Qn=xn.search)==null?void 0:Qn.defaultValue;_n!=null&&(he.value[Ln]=_n,ue.value[Ln]=_n)});const jt=n,Tn=()=>{var xn;(xn=k.value)==null||xn.clearSelection(),Ce(),jt("search")},kn=()=>{y.beforeReset&&y.beforeReset(),xe(),kt(),jt("reset")},En=()=>{const xn=document.querySelector(".el-table__body-wrapper tbody");xn&&Sortable.create(xn,{handle:".move",animation:300,onEnd({newIndex:On,oldIndex:Ln}){const[_n]=Fe.value.splice(Ln,1);Fe.value.splice(On,0,_n),jt("dargSort",{newIndex:On,oldIndex:Ln})}})},Cn=vue.ref(0),In=(xn,On)=>{const Ln=de.value.findIndex(_n=>_n.$showInput);Ln>-1&&(de.value[Ln]=cloneDeep(z.value),de.value[Ln].$showInput=!1),Cn.value=$get(xn,String(On)),xn.$showInput=!0,z.value=cloneDeep(xn)},An=async(xn,On,Ln)=>{set$2(xn,On,Cn.value),Ln&&await Ln(xn),xn.$showInput=!1,ElMessage.success("更新成功"),await _e()},Nn=async xn=>{const On=de.value.findIndex(Ln=>isEqual(pickBy$1(Ln,identity$1),pickBy$1(xn,identity$1)));On>-1&&(de.value[On]=cloneDeep(z.value),de.value[On].$showInput=!1)},Vn=useColSetting(y.customColumnCacheKey),Bn=vue.ref(null),Yn=()=>qe.map((xn,On)=>({readonly:xn.isCustomDisable||["id","operation"].includes(String(xn.prop)),order:On,index:On,width:xn.width||xn.minWidth,...xn})).sort((xn,On)=>{const Ln=Number(xn.order),_n=Number(On.order);return Ln-_n}),Xn=()=>{zn=vue.reactive(Yn()),vue.nextTick(()=>{Bn.value.openColSetting(cloneDeep(zn))})},Zn=()=>{if(!y.customColumnPageCacheKey)return;const xn=Vn.getColumnCache(y.customColumnPageCacheKey);if(xn!=null&&xn.length){const On=qe.map(Ln=>{const _n=xn.find(Mn=>Mn.prop===Ln.prop);if(_n){const Mn={...Ln,order:_n.order||Ln.order,isShow:_n.isShow!==void 0?_n.isShow:Ln.isShow,readonly:_n.readonly!==void 0?_n.readonly:Ln.readonly,prop:_n.prop||Ln.prop,index:_n.index||Ln.index};return Ln.minWidth&&(Mn.minWidth=_n.minWidth||Ln.minWidth),Ln.width&&(Mn.width=_n.width||Ln.width),Mn}return Ln});zn=vue.reactive(On),qe=vue.reactive(zn)}};let zn=vue.reactive(Yn());const jn=cloneDeep(Yn()),$n=xn=>{if(!y.customColumnPageCacheKey)return console.error("请添加自定义列缓存配置项:customColumnPageCacheKey");xn=xn.map(On=>{const Ln=jn.find(_n=>_n.prop===On.prop);return Ln&&Ln.minWidth&&(On.minWidth=On.width,delete On.width),On}),qe=vue.reactive(cloneDeep(xn)),Vn.setColumnCache(y.customColumnPageCacheKey,xn),r.value=new Date().getTime(),k.value.doLayout()};return e({element:k,tableData:Fe,radio:V,pageable:pe,searchParam:ue,searchInitParam:he,setPageTotal:ze,getTableList:_e,search:Ce,reset:xe,handleSizeChange:Ie,handleCurrentChange:Oe,clearSelection:Ue,enumMap:Et,isSelected:ae,selectedList:re,selectedListIds:ie}),(xn,On)=>{const Ln=vue.resolveDirective("loading");return vue.openBlock(),vue.createBlock(vue.unref(ElConfigProvider),{locale:vue.unref(zhCn)},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[xn.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,vue.toDisplayString(xn.title),1)):vue.createCommentVNode("",!0),vue.unref(g).headerTip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4,[vue.renderSlot(xn.$slots,"headerTip",{},void 0,!0)])):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",_hoisted_5,[vue.withDirectives(vue.createVNode(SearchForm,{search:Tn,reset:kn,columns:Lt.value,"search-param":vue.unref(ue),"is-show-reset-btn":y.isShowResetBtn,"is-show-search-btn":y.isShowSearchBtn},{default:vue.withCtx(()=>[xn.$slots.tableHeader?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6,[vue.createElementVNode("div",_hoisted_7,[vue.renderSlot(xn.$slots,"tableHeader",{selectedList:vue.unref(re),selectedListIds:vue.unref(ie),isSelected:vue.unref(ae)},void 0,!0)])])):vue.createCommentVNode("",!0)]),_:3},8,["columns","search-param","is-show-reset-btn","is-show-search-btn"]),[[vue.vShow,$.value]])]),vue.unref(g).searchBarBottom?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8,[vue.renderSlot(xn.$slots,"searchBarBottom",{},void 0,!0)])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_9,[y.customColumn?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"col-setting-button",onClick:Xn},[vue.createVNode(vue.unref(ElTooltip),{class:"box-item",effect:"dark",content:"自定义列",placement:"top"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{size:14,color:"#000000a6"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(setting_default))]),_:1})]),_:1})])):vue.createCommentVNode("",!0),vue.withDirectives((vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.mergeProps({ref_key:"tableRef",ref:k},xn.$attrs,{key:r.value,data:Fe.value,border:xn.border,"row-key":xn.rowKey,"max-height":j.value,"row-style":{height:"42px"},"tooltip-effect":"light","tooltip-options":{showArrow:!1,placement:"bottom-start",offset:y.offset?y.offset:-20}},vue.toHandlers(xn.$attrs),{onSelectionChange:vue.unref(oe),onSortChange:On[1]||(On[1]=_n=>y.onSortChange?y.onSortChange(_n):Ve(_n))}),{append:vue.withCtx(()=>[vue.renderSlot(xn.$slots,"append",{},void 0,!0)]),empty:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_12,[vue.renderSlot(xn.$slots,"empty",{},()=>[vue.createElementVNode("img",{src:`${vue.unref(CDN_URL$1)}ghy-components/empty.png`,class:"zh-empty-img",alt:"notData"},null,8,_hoisted_13),On[5]||(On[5]=vue.createElementVNode("div",null,"暂无数据",-1))],!0)])]),default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(qe).sort((_n,Mn)=>_n.order-Mn.order),_n=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:_n},[_n.type&&L.includes(_n.type)&&_n.isShow?(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:0,ref_for:!0},_n,{align:_n.align??"left","reserve-selection":_n.type=="selection"}),vue.createSlots({default:vue.withCtx(Mn=>[_n.type=="expand"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_n.render?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_n.render),vue.mergeProps({key:0,ref_for:!0},Mn),null,16)):vue.renderSlot(xn.$slots,_n.type,vue.mergeProps({key:1,ref_for:!0},Mn),void 0,!0)],64)):vue.createCommentVNode("",!0),_n.type=="sort"?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,class:"move"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(d_caret_default))]),_:1})]),_:1})):vue.createCommentVNode("",!0),_n.type=="input"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[Mn.row.$showInput?(vue.openBlock(),vue.createElementBlock("div",_hoisted_11,[vue.withDirectives(vue.createVNode(vue.unref(ElInputNumber),{modelValue:Cn.value,"onUpdate:modelValue":On[0]||(On[0]=Wn=>Cn.value=Wn),min:0,controls:!1},null,8,["modelValue"]),[[i]]),vue.createVNode(vue.unref(ElLink),{underline:!1,type:"primary",onClick:Wn=>An(Mn.row,String(_n.prop),_n.blurCallback),class:"ml-5"},{default:vue.withCtx(()=>On[3]||(On[3]=[vue.createTextVNode(" 保存 ")])),_:2},1032,["onClick"]),vue.createVNode(vue.unref(ElLink),{type:"primary",underline:!1,onClick:Wn=>Nn(Mn.row),class:"ml-5"},{default:vue.withCtx(()=>On[4]||(On[4]=[vue.createTextVNode(" 取消 ")])),_:2},1032,["onClick"])])):(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:"编辑",placement:"top"},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_10,[vue.createTextVNode(vue.toDisplayString(vue.unref($get)(Mn.row,String(_n.prop)))+" ",1),vue.createVNode(vue.unref(ElLink),{underline:!1,class:"text d-flex inline-input-text pointer",onClick:Wn=>In(Mn.row,_n.prop)},{default:vue.withCtx(()=>On[2]||(On[2]=[vue.createElementVNode("i",{class:"iconfont icon-edit"},null,-1)])),_:2},1032,["onClick"])])]),_:2},1024))],64)):vue.createCommentVNode("",!0)]),_:2},[_n.headerRender?{name:"header",fn:vue.withCtx(Mn=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_n.headerRender),vue.mergeProps({ref_for:!0},Mn),null,16))]),key:"0"}:void 0]),1040,["align","reserve-selection"])):vue.createCommentVNode("",!0),!_n.type&&_n.prop&&_n.isShow?(vue.openBlock(),vue.createBlock(_sfc_main$3,{key:1,column:_n,"custom-column":xn.customColumn},vue.createSlots({_:2},[vue.renderList(Object.keys(xn.$slots),Mn=>({name:Mn,fn:vue.withCtx(Wn=>[vue.renderSlot(xn.$slots,Mn,vue.mergeProps({ref_for:!0},Wn),void 0,!0)])}))]),1032,["column","custom-column"])):vue.createCommentVNode("",!0)],64))),128))]),_:3},16,["data","border","row-key","max-height","tooltip-options","onSelectionChange"])),[[Ln,vue.unref(le)]])]),vue.renderSlot(xn.$slots,"pagination",{},()=>[xn.pagination?(vue.openBlock(),vue.createBlock(TablePagination,{key:0,pageable:vue.unref(pe),"handle-size-change":vue.unref(Ie),"handle-current-change":vue.unref(Oe)},{zhPaginationLeftSlot:vue.withCtx(_n=>[vue.renderSlot(xn.$slots,"zhPaginationLeft",vue.normalizeProps(vue.guardReactiveProps(_n)),void 0,!0)]),_:3},8,["pageable","handle-size-change","handle-current-change"])):vue.createCommentVNode("",!0)],!0)]),y.customColumn?(vue.openBlock(),vue.createBlock(ColSetting,{key:0,ref_key:"colRef",ref:Bn,"origin-table-columns":vue.unref(jn),onSubmit:$n},null,8,["origin-table-columns"])):vue.createCommentVNode("",!0)]),_:3},8,["locale"])}}}),Table=_export_sfc(_sfc_main$1,[["__scopeId","data-v-83e26bf1"]]),ZhTable=withInstall$1(Table),_hoisted_1={key:1},_hoisted_2={key:1,class:"zh-base-item--value--file"},_hoisted_3={key:2},_sfc_main=vue.defineComponent({name:"ZhBaseItem",__name:"BaseItem",props:{label:{},labelRender:{},colon:{type:Boolean,default:!1},value:{},fileId:{},rewriteFileName:{},valueRender:{},onClick:{},labelWidth:{},infoDirection:{default:"horizontal"},defaultValue:{default:DEFAULT_VALUE$1},className:{},labelClassName:{},valueClassName:{},span:{default:1},showFileName:{type:Boolean,default:!0},fetchFileById:{}},setup(t){const e=vue.useSlots(),n=t,r=vue.inject("infoLabelWidth",void 0),i=vue.computed(()=>!!(n.onClick&&n.value)),g=vue.computed(()=>!!(!n.value&&n.fileId)),y=vue.ref(),k=vue.computed(()=>{var j;const z=(j=y.value)==null?void 0:j.name;if(!z)return"";if(n.rewriteFileName){const oe=z.substring(z.lastIndexOf("."));return n.rewriteFileName+oe}return z}),L=vue.computed(()=>{const z={},j=n.labelWidth||r;return j&&n.infoDirection==="horizontal"&&(isNaN(Number(j))?z.width=j:z.width=j+"px"),z}),$=vue.computed(()=>({...L.value})),V=vue.computed(()=>n.value===""?DEFAULT_VALUE$1:n.value??DEFAULT_VALUE$1);return vue.watchEffect(async()=>{!g.value||!n.fileId||!n.fetchFileById||(y.value=await n.fetchFileById(n.fileId))}),(z,j)=>(vue.openBlock(),vue.createBlock(vue.unref(ZhGridItem),{span:z.span,label:z.label},{default:vue.withCtx(oe=>{var re;return[vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item",[z.infoDirection,z.className]])},[vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item-label",[z.infoDirection,z.labelClassName]]),style:vue.normalizeStyle({width:z.infoDirection==="horizontal"&&oe.maxLabelWidthInCol?oe.maxLabelWidthInCol+"px":void 0,...$.value})},[z.labelRender?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(z.labelRender),{key:0})):(vue.openBlock(),vue.createElementBlock("span",_hoisted_1,vue.toDisplayString(z.label)+vue.toDisplayString(z.colon?":":""),1))],6),vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item-value",z.valueClassName])},[vue.unref(e).value?vue.renderSlot(z.$slots,"value",{key:0,content:z.value}):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[i.value?(vue.openBlock(),vue.createBlock(vue.unref(ElLink),{key:0,type:"primary",onClick:j[0]||(j[0]=vue.withModifiers(ie=>z.onClick&&z.onClick(z.value),["stop"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(z.value),1)]),_:1})):g.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2,[z.showFileName?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(vue.unref(ElIcon),{class:"iconfont"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1}),vue.createTextVNode(" "+vue.toDisplayString(k.value),1)],64)):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(ElLink),{type:"primary",href:(re=y.value)==null?void 0:re.path,target:"_blank",class:vue.normalizeClass({"ml-8":z.showFileName})},{default:vue.withCtx(()=>j[1]||(j[1]=[vue.createTextVNode(" 查看/下载 ")])),_:1},8,["href","class"])])):z.valueRender?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(z.valueRender)))])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:3},[vue.createTextVNode(vue.toDisplayString(V.value),1)],64))],64))],2)],2)]}),_:3},8,["span","label"]))}}),ZhBaseItem=withInstall$1(_sfc_main),components=[ZhBaseInfo,ZhButton,ZhDatePicker,ZhDetailHeader,ZhDetailSubTitle,ZhDialog,ZhDiyDataTable,ZhEditInfoPair,ZhFileWrapper,ZhGrid,ZhGridItem,ZhMultiGrid,ZhInfoPair,ZhInput,ZhInputNumber,ZhLoading,ZhMessageBox,ZhConfirm,ZhAlert,ZhPrompt,ZhMoneyInput,ZhPageHeadPanel,ZhToolTips,ZhMap,ZhButtonGroup,ZhTable],installer=makeInstaller(components);exports.BaseMapType=BaseMapType,exports.CDN_URL=CDN_URL,exports.COPY_RIGHT_TYPE=COPY_RIGHT_TYPE,exports.DEFAULT_VALUE=DEFAULT_VALUE,exports.DIY_DATA_TYPE=DIY_DATA_TYPE,exports.LOG_DATE_FORMAT=LOG_DATE_FORMAT,exports.SEARCH_TYPE=SEARCH_TYPE,exports.ZhAlert=ZhAlert,exports.ZhBaseInfo=ZhBaseInfo,exports.ZhBaseItem=ZhBaseItem,exports.ZhButton=ZhButton,exports.ZhButtonGroup=ZhButtonGroup,exports.ZhConfirm=ZhConfirm,exports.ZhDatePicker=ZhDatePicker,exports.ZhDetailHeader=ZhDetailHeader,exports.ZhDetailSubTitle=ZhDetailSubTitle,exports.ZhDialog=ZhDialog,exports.ZhDiyDataTable=ZhDiyDataTable,exports.ZhEditInfoPair=ZhEditInfoPair,exports.ZhFileWrapper=ZhFileWrapper,exports.ZhGrid=ZhGrid,exports.ZhGridItem=ZhGridItem,exports.ZhInfoPair=ZhInfoPair,exports.ZhInput=ZhInput,exports.ZhInputNumber=ZhInputNumber,exports.ZhLoading=ZhLoading,exports.ZhMap=ZhMap,exports.ZhMessageBox=ZhMessageBox,exports.ZhMoneyInput=ZhMoneyInput,exports.ZhMultiGrid=ZhMultiGrid,exports.ZhPageHeadPanel=ZhPageHeadPanel,exports.ZhPrompt=ZhPrompt,exports.ZhTable=ZhTable,exports.ZhToolTips=ZhToolTips,exports.baseMap=baseMap,exports.default=installer,exports.mapDefaultCenter=mapDefaultCenter,exports.mapZoom=mapZoom,exports.projection=projection,exports.renderShipsLimit=renderShipsLimit,exports.tiandituKey=tiandituKey,exports.zhongkeKey=zhongkeKey,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
707
+ */function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _objectSpread2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(r){_defineProperty(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _typeof(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(e){return typeof e}:_typeof=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(t)}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _extends(){return _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,g;for(g=0;g<r.length;g++)i=r[g],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function _objectWithoutProperties(t,e){if(t==null)return{};var n=_objectWithoutPropertiesLoose(t,e),r,i;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);for(i=0;i<g.length;i++)r=g[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var version="1.15.6";function userAgent(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var IE11OrLess=userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Edge=userAgent(/Edge/i),FireFox=userAgent(/firefox/i),Safari=userAgent(/safari/i)&&!userAgent(/chrome/i)&&!userAgent(/android/i),IOS=userAgent(/iP(ad|od|hone)/i),ChromeForAndroid=userAgent(/chrome/i)&&userAgent(/android/i),captureMode={capture:!1,passive:!1};function on(t,e,n){t.addEventListener(e,n,!IE11OrLess&&captureMode)}function off(t,e,n){t.removeEventListener(e,n,!IE11OrLess&&captureMode)}function matches(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function getParentOrHost(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function closest(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&matches(t,e):matches(t,e))||r&&t===n)return t;if(t===n)break}while(t=getParentOrHost(t))}return null}var R_SPACE=/\s+/g;function toggleClass(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(R_SPACE," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(R_SPACE," ")}}function css(t,e,n){var r=t&&t.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=n+(typeof n=="string"?"":"px")}}function matrix(t,e){var n="";if(typeof t=="string")n=t;else do{var r=css(t,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function find(t,e,n){if(t){var r=t.getElementsByTagName(e),i=0,g=r.length;if(n)for(;i<g;i++)n(r[i],i);return r}return[]}function getWindowScrollingElement(){var t=document.scrollingElement;return t||document.documentElement}function getRect(t,e,n,r,i){if(!(!t.getBoundingClientRect&&t!==window)){var g,y,k,L,$,V,z;if(t!==window&&t.parentNode&&t!==getWindowScrollingElement()?(g=t.getBoundingClientRect(),y=g.top,k=g.left,L=g.bottom,$=g.right,V=g.height,z=g.width):(y=0,k=0,L=window.innerHeight,$=window.innerWidth,V=window.innerHeight,z=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!IE11OrLess))do if(i&&i.getBoundingClientRect&&(css(i,"transform")!=="none"||n&&css(i,"position")!=="static")){var j=i.getBoundingClientRect();y-=j.top+parseInt(css(i,"border-top-width")),k-=j.left+parseInt(css(i,"border-left-width")),L=y+g.height,$=k+g.width;break}while(i=i.parentNode);if(r&&t!==window){var oe=matrix(i||t),re=oe&&oe.a,ie=oe&&oe.d;oe&&(y/=ie,k/=re,z/=re,V/=ie,L=y+V,$=k+z)}return{top:y,left:k,bottom:L,right:$,width:z,height:V}}}function isScrolledPast(t,e,n){for(var r=getParentAutoScrollElement(t,!0),i=getRect(t)[e];r;){var g=getRect(r)[n],y=void 0;if(y=i>=g,!y)return r;if(r===getWindowScrollingElement())break;r=getParentAutoScrollElement(r,!1)}return!1}function getChild(t,e,n,r){for(var i=0,g=0,y=t.children;g<y.length;){if(y[g].style.display!=="none"&&y[g]!==Sortable.ghost&&(r||y[g]!==Sortable.dragged)&&closest(y[g],n.draggable,t,!1)){if(i===e)return y[g];i++}g++}return null}function lastChild(t,e){for(var n=t.lastElementChild;n&&(n===Sortable.ghost||css(n,"display")==="none"||e&&!matches(n,e));)n=n.previousElementSibling;return n||null}function index(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==Sortable.clone&&(!e||matches(t,e))&&n++;return n}function getRelativeScrollOffset(t){var e=0,n=0,r=getWindowScrollingElement();if(t)do{var i=matrix(t),g=i.a,y=i.d;e+=t.scrollLeft*g,n+=t.scrollTop*y}while(t!==r&&(t=t.parentNode));return[e,n]}function indexOfObject(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t[n][r])return Number(n)}return-1}function getParentAutoScrollElement(t,e){if(!t||!t.getBoundingClientRect)return getWindowScrollingElement();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=css(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return getWindowScrollingElement();if(r||e)return n;r=!0}}while(n=n.parentNode);return getWindowScrollingElement()}function extend(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function isRectEqual(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var _throttleTimeout;function throttle(t,e){return function(){if(!_throttleTimeout){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),_throttleTimeout=setTimeout(function(){_throttleTimeout=void 0},e)}}}function cancelThrottle(){clearTimeout(_throttleTimeout),_throttleTimeout=void 0}function scrollBy(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function clone(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function getChildContainingRectFromElement(t,e,n){var r={};return Array.from(t.children).forEach(function(i){var g,y,k,L;if(!(!closest(i,e.draggable,t,!1)||i.animated||i===n)){var $=getRect(i);r.left=Math.min((g=r.left)!==null&&g!==void 0?g:1/0,$.left),r.top=Math.min((y=r.top)!==null&&y!==void 0?y:1/0,$.top),r.right=Math.max((k=r.right)!==null&&k!==void 0?k:-1/0,$.right),r.bottom=Math.max((L=r.bottom)!==null&&L!==void 0?L:-1/0,$.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var expando="Sortable"+new Date().getTime();function AnimationStateManager(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(css(i,"display")==="none"||i===Sortable.ghost)){t.push({target:i,rect:getRect(i)});var g=_objectSpread2({},t[t.length-1].rect);if(i.thisAnimationDuration){var y=matrix(i,!0);y&&(g.top-=y.f,g.left-=y.e)}i.fromRect=g}})}},addAnimationState:function(r){t.push(r)},removeAnimationState:function(r){t.splice(indexOfObject(t,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var g=!1,y=0;t.forEach(function(k){var L=0,$=k.target,V=$.fromRect,z=getRect($),j=$.prevFromRect,oe=$.prevToRect,re=k.rect,ie=matrix($,!0);ie&&(z.top-=ie.f,z.left-=ie.e),$.toRect=z,$.thisAnimationDuration&&isRectEqual(j,z)&&!isRectEqual(V,z)&&(re.top-z.top)/(re.left-z.left)===(V.top-z.top)/(V.left-z.left)&&(L=calculateRealTime(re,j,oe,i.options)),isRectEqual(z,V)||($.prevFromRect=V,$.prevToRect=z,L||(L=i.options.animation),i.animate($,re,z,L)),L&&(g=!0,y=Math.max(y,L),clearTimeout($.animationResetTimer),$.animationResetTimer=setTimeout(function(){$.animationTime=0,$.prevFromRect=null,$.fromRect=null,$.prevToRect=null,$.thisAnimationDuration=null},L),$.thisAnimationDuration=L)}),clearTimeout(e),g?e=setTimeout(function(){typeof r=="function"&&r()},y):typeof r=="function"&&r(),t=[]},animate:function(r,i,g,y){if(y){css(r,"transition",""),css(r,"transform","");var k=matrix(this.el),L=k&&k.a,$=k&&k.d,V=(i.left-g.left)/(L||1),z=(i.top-g.top)/($||1);r.animatingX=!!V,r.animatingY=!!z,css(r,"transform","translate3d("+V+"px,"+z+"px,0)"),this.forRepaintDummy=repaint(r),css(r,"transition","transform "+y+"ms"+(this.options.easing?" "+this.options.easing:"")),css(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){css(r,"transition",""),css(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},y)}}}}function repaint(t){return t.offsetWidth}function calculateRealTime(t,e,n,r){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*r.animation}var plugins=[],defaults={initializeByDefault:!0},PluginManager={mount:function t(e){for(var n in defaults)defaults.hasOwnProperty(n)&&!(n in e)&&(e[n]=defaults[n]);plugins.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),plugins.push(e)},pluginEvent:function t(e,n,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var g=e+"Global";plugins.forEach(function(y){n[y.pluginName]&&(n[y.pluginName][g]&&n[y.pluginName][g](_objectSpread2({sortable:n},r)),n.options[y.pluginName]&&n[y.pluginName][e]&&n[y.pluginName][e](_objectSpread2({sortable:n},r)))})},initializePlugins:function t(e,n,r,i){plugins.forEach(function(k){var L=k.pluginName;if(!(!e.options[L]&&!k.initializeByDefault)){var $=new k(e,n,e.options);$.sortable=e,$.options=e.options,e[L]=$,_extends(r,$.defaults)}});for(var g in e.options)if(e.options.hasOwnProperty(g)){var y=this.modifyOption(e,g,e.options[g]);typeof y<"u"&&(e.options[g]=y)}},getEventProperties:function t(e,n){var r={};return plugins.forEach(function(i){typeof i.eventProperties=="function"&&_extends(r,i.eventProperties.call(n[i.pluginName],e))}),r},modifyOption:function t(e,n,r){var i;return plugins.forEach(function(g){e[g.pluginName]&&g.optionListeners&&typeof g.optionListeners[n]=="function"&&(i=g.optionListeners[n].call(e[g.pluginName],r))}),i}};function dispatchEvent(t){var e=t.sortable,n=t.rootEl,r=t.name,i=t.targetEl,g=t.cloneEl,y=t.toEl,k=t.fromEl,L=t.oldIndex,$=t.newIndex,V=t.oldDraggableIndex,z=t.newDraggableIndex,j=t.originalEvent,oe=t.putSortable,re=t.extraEventProperties;if(e=e||n&&n[expando],!!e){var ie,ae=e.options,le="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!IE11OrLess&&!Edge?ie=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(ie=document.createEvent("Event"),ie.initEvent(r,!0,!0)),ie.to=y||n,ie.from=k||n,ie.item=i||n,ie.clone=g,ie.oldIndex=L,ie.newIndex=$,ie.oldDraggableIndex=V,ie.newDraggableIndex=z,ie.originalEvent=j,ie.pullMode=oe?oe.lastPutMode:void 0;var de=_objectSpread2(_objectSpread2({},re),PluginManager.getEventProperties(r,e));for(var pe in de)ie[pe]=de[pe];n&&n.dispatchEvent(ie),ae[le]&&ae[le].call(e,ie)}}var _excluded=["evt"],pluginEvent=function t(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,g=_objectWithoutProperties(r,_excluded);PluginManager.pluginEvent.bind(Sortable)(e,n,_objectSpread2({dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,dragStarted:moved,putSortable,activeSortable:Sortable.active,originalEvent:i,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex,hideGhostForTarget:_hideGhostForTarget,unhideGhostForTarget:_unhideGhostForTarget,cloneNowHidden:function(){cloneHidden=!0},cloneNowShown:function(){cloneHidden=!1},dispatchSortableEvent:function(k){_dispatchEvent({sortable:n,name:k,originalEvent:i})}},g))};function _dispatchEvent(t){dispatchEvent(_objectSpread2({putSortable,cloneEl,targetEl:dragEl,rootEl,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex},t))}var dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,oldIndex,newIndex,oldDraggableIndex,newDraggableIndex,activeGroup,putSortable,awaitingDragStarted=!1,ignoreNextClick=!1,sortables=[],tapEvt,touchEvt,lastDx,lastDy,tapDistanceLeft,tapDistanceTop,moved,lastTarget,lastDirection,pastFirstInvertThresh=!1,isCircumstantialInvert=!1,targetMoveDistance,ghostRelativeParent,ghostRelativeParentInitialScroll=[],_silent=!1,savedInputChecked=[],documentExists=typeof document<"u",PositionGhostAbsolutely=IOS,CSSFloatProperty=Edge||IE11OrLess?"cssFloat":"float",supportDraggable=documentExists&&!ChromeForAndroid&&!IOS&&"draggable"in document.createElement("div"),supportCssPointerEvents=function(){if(documentExists){if(IE11OrLess)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),_detectDirection=function t(e,n){var r=css(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),g=getChild(e,0,n),y=getChild(e,1,n),k=g&&css(g),L=y&&css(y),$=k&&parseInt(k.marginLeft)+parseInt(k.marginRight)+getRect(g).width,V=L&&parseInt(L.marginLeft)+parseInt(L.marginRight)+getRect(y).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(g&&k.float&&k.float!=="none"){var z=k.float==="left"?"left":"right";return y&&(L.clear==="both"||L.clear===z)?"vertical":"horizontal"}return g&&(k.display==="block"||k.display==="flex"||k.display==="table"||k.display==="grid"||$>=i&&r[CSSFloatProperty]==="none"||y&&r[CSSFloatProperty]==="none"&&$+V>i)?"vertical":"horizontal"},_dragElInRowColumn=function t(e,n,r){var i=r?e.left:e.top,g=r?e.right:e.bottom,y=r?e.width:e.height,k=r?n.left:n.top,L=r?n.right:n.bottom,$=r?n.width:n.height;return i===k||g===L||i+y/2===k+$/2},_detectNearestEmptySortable=function t(e,n){var r;return sortables.some(function(i){var g=i[expando].options.emptyInsertThreshold;if(!(!g||lastChild(i))){var y=getRect(i),k=e>=y.left-g&&e<=y.right+g,L=n>=y.top-g&&n<=y.bottom+g;if(k&&L)return r=i}}),r},_prepareGroup=function t(e){function n(g,y){return function(k,L,$,V){var z=k.options.group.name&&L.options.group.name&&k.options.group.name===L.options.group.name;if(g==null&&(y||z))return!0;if(g==null||g===!1)return!1;if(y&&g==="clone")return g;if(typeof g=="function")return n(g(k,L,$,V),y)(k,L,$,V);var j=(y?k:L).options.group.name;return g===!0||typeof g=="string"&&g===j||g.join&&g.indexOf(j)>-1}}var r={},i=e.group;(!i||_typeof(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=n(i.pull,!0),r.checkPut=n(i.put),r.revertClone=i.revertClone,e.group=r},_hideGhostForTarget=function t(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","none")},_unhideGhostForTarget=function t(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","")};documentExists&&!ChromeForAndroid&&document.addEventListener("click",function(t){if(ignoreNextClick)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ignoreNextClick=!1,!1},!0);var nearestEmptyInsertDetectEvent=function t(e){if(dragEl){e=e.touches?e.touches[0]:e;var n=_detectNearestEmptySortable(e.clientX,e.clientY);if(n){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[expando]._onDragOver(r)}}},_checkOutsideTargetEl=function t(e){dragEl&&dragEl.parentNode[expando]._isOutsideThisEl(e.target)};function Sortable(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=_extends({},e),t[expando]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return _detectDirection(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(y,k){y.setData("Text",k.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Sortable.supportPointer!==!1&&"PointerEvent"in window&&(!Safari||IOS),emptyInsertThreshold:5};PluginManager.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);_prepareGroup(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:supportDraggable,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?on(t,"pointerdown",this._onTapStart):(on(t,"mousedown",this._onTapStart),on(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(on(t,"dragover",this),on(t,"dragenter",this)),sortables.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),_extends(this,AnimationStateManager())}Sortable.prototype={constructor:Sortable,_isOutsideThisEl:function t(e){!this.el.contains(e)&&e!==this.el&&(lastTarget=null)},_getDirection:function t(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,dragEl):this.options.direction},_onTapStart:function t(e){if(e.cancelable){var n=this,r=this.el,i=this.options,g=i.preventOnFilter,y=e.type,k=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,L=(k||e).target,$=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||L,V=i.filter;if(_saveInputCheckedState(r),!dragEl&&!(/mousedown|pointerdown/.test(y)&&e.button!==0||i.disabled)&&!$.isContentEditable&&!(!this.nativeDraggable&&Safari&&L&&L.tagName.toUpperCase()==="SELECT")&&(L=closest(L,i.draggable,r,!1),!(L&&L.animated)&&lastDownEl!==L)){if(oldIndex=index(L),oldDraggableIndex=index(L,i.draggable),typeof V=="function"){if(V.call(this,e,L,this)){_dispatchEvent({sortable:n,rootEl:$,name:"filter",targetEl:L,toEl:r,fromEl:r}),pluginEvent("filter",n,{evt:e}),g&&e.preventDefault();return}}else if(V&&(V=V.split(",").some(function(z){if(z=closest($,z.trim(),r,!1),z)return _dispatchEvent({sortable:n,rootEl:z,name:"filter",targetEl:L,fromEl:r,toEl:r}),pluginEvent("filter",n,{evt:e}),!0}),V)){g&&e.preventDefault();return}i.handle&&!closest($,i.handle,r,!1)||this._prepareDragStart(e,k,L)}}},_prepareDragStart:function t(e,n,r){var i=this,g=i.el,y=i.options,k=g.ownerDocument,L;if(r&&!dragEl&&r.parentNode===g){var $=getRect(r);if(rootEl=g,dragEl=r,parentEl=dragEl.parentNode,nextEl=dragEl.nextSibling,lastDownEl=r,activeGroup=y.group,Sortable.dragged=dragEl,tapEvt={target:dragEl,clientX:(n||e).clientX,clientY:(n||e).clientY},tapDistanceLeft=tapEvt.clientX-$.left,tapDistanceTop=tapEvt.clientY-$.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,dragEl.style["will-change"]="all",L=function(){if(pluginEvent("delayEnded",i,{evt:e}),Sortable.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!FireFox&&i.nativeDraggable&&(dragEl.draggable=!0),i._triggerDragStart(e,n),_dispatchEvent({sortable:i,name:"choose",originalEvent:e}),toggleClass(dragEl,y.chosenClass,!0)},y.ignore.split(",").forEach(function(V){find(dragEl,V.trim(),_disableDraggable)}),on(k,"dragover",nearestEmptyInsertDetectEvent),on(k,"mousemove",nearestEmptyInsertDetectEvent),on(k,"touchmove",nearestEmptyInsertDetectEvent),y.supportPointer?(on(k,"pointerup",i._onDrop),!this.nativeDraggable&&on(k,"pointercancel",i._onDrop)):(on(k,"mouseup",i._onDrop),on(k,"touchend",i._onDrop),on(k,"touchcancel",i._onDrop)),FireFox&&this.nativeDraggable&&(this.options.touchStartThreshold=4,dragEl.draggable=!0),pluginEvent("delayStart",this,{evt:e}),y.delay&&(!y.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Edge||IE11OrLess))){if(Sortable.eventCanceled){this._onDrop();return}y.supportPointer?(on(k,"pointerup",i._disableDelayedDrag),on(k,"pointercancel",i._disableDelayedDrag)):(on(k,"mouseup",i._disableDelayedDrag),on(k,"touchend",i._disableDelayedDrag),on(k,"touchcancel",i._disableDelayedDrag)),on(k,"mousemove",i._delayedDragTouchMoveHandler),on(k,"touchmove",i._delayedDragTouchMoveHandler),y.supportPointer&&on(k,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(L,y.delay)}else L()}},_delayedDragTouchMoveHandler:function t(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function t(){dragEl&&_disableDraggable(dragEl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function t(){var e=this.el.ownerDocument;off(e,"mouseup",this._disableDelayedDrag),off(e,"touchend",this._disableDelayedDrag),off(e,"touchcancel",this._disableDelayedDrag),off(e,"pointerup",this._disableDelayedDrag),off(e,"pointercancel",this._disableDelayedDrag),off(e,"mousemove",this._delayedDragTouchMoveHandler),off(e,"touchmove",this._delayedDragTouchMoveHandler),off(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function t(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?on(document,"pointermove",this._onTouchMove):n?on(document,"touchmove",this._onTouchMove):on(document,"mousemove",this._onTouchMove):(on(dragEl,"dragend",this),on(rootEl,"dragstart",this._onDragStart));try{document.selection?_nextTick(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function t(e,n){if(awaitingDragStarted=!1,rootEl&&dragEl){pluginEvent("dragStarted",this,{evt:n}),this.nativeDraggable&&on(document,"dragover",_checkOutsideTargetEl);var r=this.options;!e&&toggleClass(dragEl,r.dragClass,!1),toggleClass(dragEl,r.ghostClass,!0),Sortable.active=this,e&&this._appendGhost(),_dispatchEvent({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function t(){if(touchEvt){this._lastX=touchEvt.clientX,this._lastY=touchEvt.clientY,_hideGhostForTarget();for(var e=document.elementFromPoint(touchEvt.clientX,touchEvt.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(touchEvt.clientX,touchEvt.clientY),e!==n);)n=e;if(dragEl.parentNode[expando]._isOutsideThisEl(e),n)do{if(n[expando]){var r=void 0;if(r=n[expando]._onDragOver({clientX:touchEvt.clientX,clientY:touchEvt.clientY,target:e,rootEl:n}),r&&!this.options.dragoverBubble)break}e=n}while(n=getParentOrHost(n));_unhideGhostForTarget()}},_onTouchMove:function t(e){if(tapEvt){var n=this.options,r=n.fallbackTolerance,i=n.fallbackOffset,g=e.touches?e.touches[0]:e,y=ghostEl&&matrix(ghostEl,!0),k=ghostEl&&y&&y.a,L=ghostEl&&y&&y.d,$=PositionGhostAbsolutely&&ghostRelativeParent&&getRelativeScrollOffset(ghostRelativeParent),V=(g.clientX-tapEvt.clientX+i.x)/(k||1)+($?$[0]-ghostRelativeParentInitialScroll[0]:0)/(k||1),z=(g.clientY-tapEvt.clientY+i.y)/(L||1)+($?$[1]-ghostRelativeParentInitialScroll[1]:0)/(L||1);if(!Sortable.active&&!awaitingDragStarted){if(r&&Math.max(Math.abs(g.clientX-this._lastX),Math.abs(g.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(ghostEl){y?(y.e+=V-(lastDx||0),y.f+=z-(lastDy||0)):y={a:1,b:0,c:0,d:1,e:V,f:z};var j="matrix(".concat(y.a,",").concat(y.b,",").concat(y.c,",").concat(y.d,",").concat(y.e,",").concat(y.f,")");css(ghostEl,"webkitTransform",j),css(ghostEl,"mozTransform",j),css(ghostEl,"msTransform",j),css(ghostEl,"transform",j),lastDx=V,lastDy=z,touchEvt=g}e.cancelable&&e.preventDefault()}},_appendGhost:function t(){if(!ghostEl){var e=this.options.fallbackOnBody?document.body:rootEl,n=getRect(dragEl,!0,PositionGhostAbsolutely,!0,e),r=this.options;if(PositionGhostAbsolutely){for(ghostRelativeParent=e;css(ghostRelativeParent,"position")==="static"&&css(ghostRelativeParent,"transform")==="none"&&ghostRelativeParent!==document;)ghostRelativeParent=ghostRelativeParent.parentNode;ghostRelativeParent!==document.body&&ghostRelativeParent!==document.documentElement?(ghostRelativeParent===document&&(ghostRelativeParent=getWindowScrollingElement()),n.top+=ghostRelativeParent.scrollTop,n.left+=ghostRelativeParent.scrollLeft):ghostRelativeParent=getWindowScrollingElement(),ghostRelativeParentInitialScroll=getRelativeScrollOffset(ghostRelativeParent)}ghostEl=dragEl.cloneNode(!0),toggleClass(ghostEl,r.ghostClass,!1),toggleClass(ghostEl,r.fallbackClass,!0),toggleClass(ghostEl,r.dragClass,!0),css(ghostEl,"transition",""),css(ghostEl,"transform",""),css(ghostEl,"box-sizing","border-box"),css(ghostEl,"margin",0),css(ghostEl,"top",n.top),css(ghostEl,"left",n.left),css(ghostEl,"width",n.width),css(ghostEl,"height",n.height),css(ghostEl,"opacity","0.8"),css(ghostEl,"position",PositionGhostAbsolutely?"absolute":"fixed"),css(ghostEl,"zIndex","100000"),css(ghostEl,"pointerEvents","none"),Sortable.ghost=ghostEl,e.appendChild(ghostEl),css(ghostEl,"transform-origin",tapDistanceLeft/parseInt(ghostEl.style.width)*100+"% "+tapDistanceTop/parseInt(ghostEl.style.height)*100+"%")}},_onDragStart:function t(e,n){var r=this,i=e.dataTransfer,g=r.options;if(pluginEvent("dragStart",this,{evt:e}),Sortable.eventCanceled){this._onDrop();return}pluginEvent("setupClone",this),Sortable.eventCanceled||(cloneEl=clone(dragEl),cloneEl.removeAttribute("id"),cloneEl.draggable=!1,cloneEl.style["will-change"]="",this._hideClone(),toggleClass(cloneEl,this.options.chosenClass,!1),Sortable.clone=cloneEl),r.cloneId=_nextTick(function(){pluginEvent("clone",r),!Sortable.eventCanceled&&(r.options.removeCloneOnHide||rootEl.insertBefore(cloneEl,dragEl),r._hideClone(),_dispatchEvent({sortable:r,name:"clone"}))}),!n&&toggleClass(dragEl,g.dragClass,!0),n?(ignoreNextClick=!0,r._loopId=setInterval(r._emulateDragOver,50)):(off(document,"mouseup",r._onDrop),off(document,"touchend",r._onDrop),off(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",g.setData&&g.setData.call(r,i,dragEl)),on(document,"drop",r),css(dragEl,"transform","translateZ(0)")),awaitingDragStarted=!0,r._dragStartId=_nextTick(r._dragStarted.bind(r,n,e)),on(document,"selectstart",r),moved=!0,window.getSelection().removeAllRanges(),Safari&&css(document.body,"user-select","none")},_onDragOver:function t(e){var n=this.el,r=e.target,i,g,y,k=this.options,L=k.group,$=Sortable.active,V=activeGroup===L,z=k.sort,j=putSortable||$,oe,re=this,ie=!1;if(_silent)return;function ae(qe,Ne){pluginEvent(qe,re,_objectSpread2({evt:e,isOwner:V,axis:oe?"vertical":"horizontal",revert:y,dragRect:i,targetRect:g,canSort:z,fromSortable:j,target:r,completed:de,onMove:function(Pt,hn){return _onMove(rootEl,n,dragEl,i,Pt,getRect(Pt),e,hn)},changed:pe},Ne))}function le(){ae("dragOverAnimationCapture"),re.captureAnimationState(),re!==j&&j.captureAnimationState()}function de(qe){return ae("dragOverCompleted",{insertion:qe}),qe&&(V?$._hideClone():$._showClone(re),re!==j&&(toggleClass(dragEl,putSortable?putSortable.options.ghostClass:$.options.ghostClass,!1),toggleClass(dragEl,k.ghostClass,!0)),putSortable!==re&&re!==Sortable.active?putSortable=re:re===Sortable.active&&putSortable&&(putSortable=null),j===re&&(re._ignoreWhileAnimating=r),re.animateAll(function(){ae("dragOverAnimationComplete"),re._ignoreWhileAnimating=null}),re!==j&&(j.animateAll(),j._ignoreWhileAnimating=null)),(r===dragEl&&!dragEl.animated||r===n&&!r.animated)&&(lastTarget=null),!k.dragoverBubble&&!e.rootEl&&r!==document&&(dragEl.parentNode[expando]._isOutsideThisEl(e.target),!qe&&nearestEmptyInsertDetectEvent(e)),!k.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),ie=!0}function pe(){newIndex=index(dragEl),newDraggableIndex=index(dragEl,k.draggable),_dispatchEvent({sortable:re,name:"change",toEl:n,newIndex,newDraggableIndex,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=closest(r,k.draggable,n,!0),ae("dragOver"),Sortable.eventCanceled)return ie;if(dragEl.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||re._ignoreWhileAnimating===r)return de(!1);if(ignoreNextClick=!1,$&&!k.disabled&&(V?z||(y=parentEl!==rootEl):putSortable===this||(this.lastPutMode=activeGroup.checkPull(this,$,dragEl,e))&&L.checkPut(this,$,dragEl,e))){if(oe=this._getDirection(e,r)==="vertical",i=getRect(dragEl),ae("dragOverValid"),Sortable.eventCanceled)return ie;if(y)return parentEl=rootEl,le(),this._hideClone(),ae("revert"),Sortable.eventCanceled||(nextEl?rootEl.insertBefore(dragEl,nextEl):rootEl.appendChild(dragEl)),de(!0);var ue=lastChild(n,k.draggable);if(!ue||_ghostIsLast(e,oe,this)&&!ue.animated){if(ue===dragEl)return de(!1);if(ue&&n===e.target&&(r=ue),r&&(g=getRect(r)),_onMove(rootEl,n,dragEl,i,r,g,e,!!r)!==!1)return le(),ue&&ue.nextSibling?n.insertBefore(dragEl,ue.nextSibling):n.appendChild(dragEl),parentEl=n,pe(),de(!0)}else if(ue&&_ghostIsFirst(e,oe,this)){var he=getChild(n,0,k,!0);if(he===dragEl)return de(!1);if(r=he,g=getRect(r),_onMove(rootEl,n,dragEl,i,r,g,e,!1)!==!1)return le(),n.insertBefore(dragEl,he),parentEl=n,pe(),de(!0)}else if(r.parentNode===n){g=getRect(r);var _e=0,Ce,xe=dragEl.parentNode!==n,Ie=!_dragElInRowColumn(dragEl.animated&&dragEl.toRect||i,r.animated&&r.toRect||g,oe),Oe=oe?"top":"left",Ve=isScrolledPast(r,"top","top")||isScrolledPast(dragEl,"top","top"),Ue=Ve?Ve.scrollTop:void 0;lastTarget!==r&&(Ce=g[Oe],pastFirstInvertThresh=!1,isCircumstantialInvert=!Ie&&k.invertSwap||xe),_e=_getSwapDirection(e,r,g,oe,Ie?1:k.swapThreshold,k.invertedSwapThreshold==null?k.swapThreshold:k.invertedSwapThreshold,isCircumstantialInvert,lastTarget===r);var kt;if(_e!==0){var Dt=index(dragEl);do Dt-=_e,kt=parentEl.children[Dt];while(kt&&(css(kt,"display")==="none"||kt===ghostEl))}if(_e===0||kt===r)return de(!1);lastTarget=r,lastDirection=_e;var $e=r.nextElementSibling,Fe=!1;Fe=_e===1;var ze=_onMove(rootEl,n,dragEl,i,r,g,e,Fe);if(ze!==!1)return(ze===1||ze===-1)&&(Fe=ze===1),_silent=!0,setTimeout(_unsilent,30),le(),Fe&&!$e?n.appendChild(dragEl):r.parentNode.insertBefore(dragEl,Fe?$e:r),Ve&&scrollBy(Ve,0,Ue-Ve.scrollTop),parentEl=dragEl.parentNode,Ce!==void 0&&!isCircumstantialInvert&&(targetMoveDistance=Math.abs(Ce-getRect(r)[Oe])),pe(),de(!0)}if(n.contains(dragEl))return de(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function t(){off(document,"mousemove",this._onTouchMove),off(document,"touchmove",this._onTouchMove),off(document,"pointermove",this._onTouchMove),off(document,"dragover",nearestEmptyInsertDetectEvent),off(document,"mousemove",nearestEmptyInsertDetectEvent),off(document,"touchmove",nearestEmptyInsertDetectEvent)},_offUpEvents:function t(){var e=this.el.ownerDocument;off(e,"mouseup",this._onDrop),off(e,"touchend",this._onDrop),off(e,"pointerup",this._onDrop),off(e,"pointercancel",this._onDrop),off(e,"touchcancel",this._onDrop),off(document,"selectstart",this)},_onDrop:function t(e){var n=this.el,r=this.options;if(newIndex=index(dragEl),newDraggableIndex=index(dragEl,r.draggable),pluginEvent("drop",this,{evt:e}),parentEl=dragEl&&dragEl.parentNode,newIndex=index(dragEl),newDraggableIndex=index(dragEl,r.draggable),Sortable.eventCanceled){this._nulling();return}awaitingDragStarted=!1,isCircumstantialInvert=!1,pastFirstInvertThresh=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),_cancelNextTick(this.cloneId),_cancelNextTick(this._dragStartId),this.nativeDraggable&&(off(document,"drop",this),off(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Safari&&css(document.body,"user-select",""),css(dragEl,"transform",""),e&&(moved&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),ghostEl&&ghostEl.parentNode&&ghostEl.parentNode.removeChild(ghostEl),(rootEl===parentEl||putSortable&&putSortable.lastPutMode!=="clone")&&cloneEl&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),dragEl&&(this.nativeDraggable&&off(dragEl,"dragend",this),_disableDraggable(dragEl),dragEl.style["will-change"]="",moved&&!awaitingDragStarted&&toggleClass(dragEl,putSortable?putSortable.options.ghostClass:this.options.ghostClass,!1),toggleClass(dragEl,this.options.chosenClass,!1),_dispatchEvent({sortable:this,name:"unchoose",toEl:parentEl,newIndex:null,newDraggableIndex:null,originalEvent:e}),rootEl!==parentEl?(newIndex>=0&&(_dispatchEvent({rootEl:parentEl,name:"add",toEl:parentEl,fromEl:rootEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"remove",toEl:parentEl,originalEvent:e}),_dispatchEvent({rootEl:parentEl,name:"sort",toEl:parentEl,fromEl:rootEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:e})),putSortable&&putSortable.save()):newIndex!==oldIndex&&newIndex>=0&&(_dispatchEvent({sortable:this,name:"update",toEl:parentEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:e})),Sortable.active&&((newIndex==null||newIndex===-1)&&(newIndex=oldIndex,newDraggableIndex=oldDraggableIndex),_dispatchEvent({sortable:this,name:"end",toEl:parentEl,originalEvent:e}),this.save()))),this._nulling()},_nulling:function t(){pluginEvent("nulling",this),rootEl=dragEl=parentEl=ghostEl=nextEl=cloneEl=lastDownEl=cloneHidden=tapEvt=touchEvt=moved=newIndex=newDraggableIndex=oldIndex=oldDraggableIndex=lastTarget=lastDirection=putSortable=activeGroup=Sortable.dragged=Sortable.ghost=Sortable.clone=Sortable.active=null,savedInputChecked.forEach(function(e){e.checked=!0}),savedInputChecked.length=lastDx=lastDy=0},handleEvent:function t(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":dragEl&&(this._onDragOver(e),_globalDragOver(e));break;case"selectstart":e.preventDefault();break}},toArray:function t(){for(var e=[],n,r=this.el.children,i=0,g=r.length,y=this.options;i<g;i++)n=r[i],closest(n,y.draggable,this.el,!1)&&e.push(n.getAttribute(y.dataIdAttr)||_generateId(n));return e},sort:function t(e,n){var r={},i=this.el;this.toArray().forEach(function(g,y){var k=i.children[y];closest(k,this.options.draggable,i,!1)&&(r[g]=k)},this),n&&this.captureAnimationState(),e.forEach(function(g){r[g]&&(i.removeChild(r[g]),i.appendChild(r[g]))}),n&&this.animateAll()},save:function t(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function t(e,n){return closest(e,n||this.options.draggable,this.el,!1)},option:function t(e,n){var r=this.options;if(n===void 0)return r[e];var i=PluginManager.modifyOption(this,e,n);typeof i<"u"?r[e]=i:r[e]=n,e==="group"&&_prepareGroup(r)},destroy:function t(){pluginEvent("destroy",this);var e=this.el;e[expando]=null,off(e,"mousedown",this._onTapStart),off(e,"touchstart",this._onTapStart),off(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(off(e,"dragover",this),off(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),sortables.splice(sortables.indexOf(this.el),1),this.el=e=null},_hideClone:function t(){if(!cloneHidden){if(pluginEvent("hideClone",this),Sortable.eventCanceled)return;css(cloneEl,"display","none"),this.options.removeCloneOnHide&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),cloneHidden=!0}},_showClone:function t(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(cloneHidden){if(pluginEvent("showClone",this),Sortable.eventCanceled)return;dragEl.parentNode==rootEl&&!this.options.group.revertClone?rootEl.insertBefore(cloneEl,dragEl):nextEl?rootEl.insertBefore(cloneEl,nextEl):rootEl.appendChild(cloneEl),this.options.group.revertClone&&this.animate(dragEl,cloneEl),css(cloneEl,"display",""),cloneHidden=!1}}};function _globalDragOver(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function _onMove(t,e,n,r,i,g,y,k){var L,$=t[expando],V=$.options.onMove,z;return window.CustomEvent&&!IE11OrLess&&!Edge?L=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(L=document.createEvent("Event"),L.initEvent("move",!0,!0)),L.to=e,L.from=t,L.dragged=n,L.draggedRect=r,L.related=i||e,L.relatedRect=g||getRect(e),L.willInsertAfter=k,L.originalEvent=y,t.dispatchEvent(L),V&&(z=V.call($,L,y)),z}function _disableDraggable(t){t.draggable=!1}function _unsilent(){_silent=!1}function _ghostIsFirst(t,e,n){var r=getRect(getChild(n.el,0,n.options,!0)),i=getChildContainingRectFromElement(n.el,n.options,ghostEl),g=10;return e?t.clientX<i.left-g||t.clientY<r.top&&t.clientX<r.right:t.clientY<i.top-g||t.clientY<r.bottom&&t.clientX<r.left}function _ghostIsLast(t,e,n){var r=getRect(lastChild(n.el,n.options.draggable)),i=getChildContainingRectFromElement(n.el,n.options,ghostEl),g=10;return e?t.clientX>i.right+g||t.clientY>r.bottom&&t.clientX>r.left:t.clientY>i.bottom+g||t.clientX>r.right&&t.clientY>r.top}function _getSwapDirection(t,e,n,r,i,g,y,k){var L=r?t.clientY:t.clientX,$=r?n.height:n.width,V=r?n.top:n.left,z=r?n.bottom:n.right,j=!1;if(!y){if(k&&targetMoveDistance<$*i){if(!pastFirstInvertThresh&&(lastDirection===1?L>V+$*g/2:L<z-$*g/2)&&(pastFirstInvertThresh=!0),pastFirstInvertThresh)j=!0;else if(lastDirection===1?L<V+targetMoveDistance:L>z-targetMoveDistance)return-lastDirection}else if(L>V+$*(1-i)/2&&L<z-$*(1-i)/2)return _getInsertDirection(e)}return j=j||y,j&&(L<V+$*g/2||L>z-$*g/2)?L>V+$/2?1:-1:0}function _getInsertDirection(t){return index(dragEl)<index(t)?1:-1}function _generateId(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function _saveInputCheckedState(t){savedInputChecked.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&savedInputChecked.push(r)}}function _nextTick(t){return setTimeout(t,0)}function _cancelNextTick(t){return clearTimeout(t)}documentExists&&on(document,"touchmove",function(t){(Sortable.active||awaitingDragStarted)&&t.cancelable&&t.preventDefault()}),Sortable.utils={on,off,css,find,is:function t(e,n){return!!closest(e,n,e,!1)},extend,throttle,closest,toggleClass,clone,index,nextTick:_nextTick,cancelNextTick:_cancelNextTick,detectDirection:_detectDirection,getChild,expando},Sortable.get=function(t){return t[expando]},Sortable.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Sortable.utils=_objectSpread2(_objectSpread2({},Sortable.utils),r.utils)),PluginManager.mount(r)})},Sortable.create=function(t,e){return new Sortable(t,e)},Sortable.version=version;var autoScrolls=[],scrollEl,scrollRootEl,scrolling=!1,lastAutoScrollX,lastAutoScrollY,touchEvt$1,pointerElemChangedInterval;function AutoScrollPlugin(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var r=n.originalEvent;this.sortable.nativeDraggable?on(document,"dragover",this._handleAutoScroll):this.options.supportPointer?on(document,"pointermove",this._handleFallbackAutoScroll):r.touches?on(document,"touchmove",this._handleFallbackAutoScroll):on(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?off(document,"dragover",this._handleAutoScroll):(off(document,"pointermove",this._handleFallbackAutoScroll),off(document,"touchmove",this._handleFallbackAutoScroll),off(document,"mousemove",this._handleFallbackAutoScroll)),clearPointerElemChangedInterval(),clearAutoScrolls(),cancelThrottle()},nulling:function(){touchEvt$1=scrollRootEl=scrollEl=scrolling=pointerElemChangedInterval=lastAutoScrollX=lastAutoScrollY=null,autoScrolls.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,r){var i=this,g=(n.touches?n.touches[0]:n).clientX,y=(n.touches?n.touches[0]:n).clientY,k=document.elementFromPoint(g,y);if(touchEvt$1=n,r||this.options.forceAutoScrollFallback||Edge||IE11OrLess||Safari){autoScroll(n,this.options,k,r);var L=getParentAutoScrollElement(k,!0);scrolling&&(!pointerElemChangedInterval||g!==lastAutoScrollX||y!==lastAutoScrollY)&&(pointerElemChangedInterval&&clearPointerElemChangedInterval(),pointerElemChangedInterval=setInterval(function(){var $=getParentAutoScrollElement(document.elementFromPoint(g,y),!0);$!==L&&(L=$,clearAutoScrolls()),autoScroll(n,i.options,$,r)},10),lastAutoScrollX=g,lastAutoScrollY=y)}else{if(!this.options.bubbleScroll||getParentAutoScrollElement(k,!0)===getWindowScrollingElement()){clearAutoScrolls();return}autoScroll(n,this.options,getParentAutoScrollElement(k,!1),!1)}}},_extends(t,{pluginName:"scroll",initializeByDefault:!0})}function clearAutoScrolls(){autoScrolls.forEach(function(t){clearInterval(t.pid)}),autoScrolls=[]}function clearPointerElemChangedInterval(){clearInterval(pointerElemChangedInterval)}var autoScroll=throttle(function(t,e,n,r){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,y=e.scrollSensitivity,k=e.scrollSpeed,L=getWindowScrollingElement(),$=!1,V;scrollRootEl!==n&&(scrollRootEl=n,clearAutoScrolls(),scrollEl=e.scroll,V=e.scrollFn,scrollEl===!0&&(scrollEl=getParentAutoScrollElement(n,!0)));var z=0,j=scrollEl;do{var oe=j,re=getRect(oe),ie=re.top,ae=re.bottom,le=re.left,de=re.right,pe=re.width,ue=re.height,he=void 0,_e=void 0,Ce=oe.scrollWidth,xe=oe.scrollHeight,Ie=css(oe),Oe=oe.scrollLeft,Ve=oe.scrollTop;oe===L?(he=pe<Ce&&(Ie.overflowX==="auto"||Ie.overflowX==="scroll"||Ie.overflowX==="visible"),_e=ue<xe&&(Ie.overflowY==="auto"||Ie.overflowY==="scroll"||Ie.overflowY==="visible")):(he=pe<Ce&&(Ie.overflowX==="auto"||Ie.overflowX==="scroll"),_e=ue<xe&&(Ie.overflowY==="auto"||Ie.overflowY==="scroll"));var Ue=he&&(Math.abs(de-i)<=y&&Oe+pe<Ce)-(Math.abs(le-i)<=y&&!!Oe),kt=_e&&(Math.abs(ae-g)<=y&&Ve+ue<xe)-(Math.abs(ie-g)<=y&&!!Ve);if(!autoScrolls[z])for(var Dt=0;Dt<=z;Dt++)autoScrolls[Dt]||(autoScrolls[Dt]={});(autoScrolls[z].vx!=Ue||autoScrolls[z].vy!=kt||autoScrolls[z].el!==oe)&&(autoScrolls[z].el=oe,autoScrolls[z].vx=Ue,autoScrolls[z].vy=kt,clearInterval(autoScrolls[z].pid),(Ue!=0||kt!=0)&&($=!0,autoScrolls[z].pid=setInterval((function(){r&&this.layer===0&&Sortable.active._onTouchMove(touchEvt$1);var $e=autoScrolls[this.layer].vy?autoScrolls[this.layer].vy*k:0,Fe=autoScrolls[this.layer].vx?autoScrolls[this.layer].vx*k:0;typeof V=="function"&&V.call(Sortable.dragged.parentNode[expando],Fe,$e,t,touchEvt$1,autoScrolls[this.layer].el)!=="continue"||scrollBy(autoScrolls[this.layer].el,Fe,$e)}).bind({layer:z}),24))),z++}while(e.bubbleScroll&&j!==L&&(j=getParentAutoScrollElement(j,!1)));scrolling=$}},30),drop=function t(e){var n=e.originalEvent,r=e.putSortable,i=e.dragEl,g=e.activeSortable,y=e.dispatchSortableEvent,k=e.hideGhostForTarget,L=e.unhideGhostForTarget;if(n){var $=r||g;k();var V=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,z=document.elementFromPoint(V.clientX,V.clientY);L(),$&&!$.el.contains(z)&&(y("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function Revert(){}Revert.prototype={startIndex:null,dragStart:function t(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function t(e){var n=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=getChild(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),r&&r.animateAll()},drop},_extends(Revert,{pluginName:"revertOnSpill"});function Remove(){}Remove.prototype={onSpill:function t(e){var n=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop},_extends(Remove,{pluginName:"removeOnSpill"}),Sortable.mount(new AutoScrollPlugin),Sortable.mount(Remove,Revert);const useTable=(t,e={},n=!0,r,i,g=y=>y)=>{const y=vue.reactive({tableData:[],pageable:{page:1,size:10,total:0},searchParam:{},searchInitParam:{},totalParam:{},loading:!1}),k=vue.computed({get:()=>({page:y.pageable.page,size:y.pageable.size}),set:ie=>{console.log("我是分页更新之后的值",ie)}}),L=async()=>{if(y.loading=!0,!t){y.loading=!1;return}try{const ie=localStorage.getItem("MytaskGotoListPageQuery");if(ie){e={},y.totalParam={};const le=JSON.parse(ie);e={...e,...le},y.searchParam={...le}}Object.assign(y.totalParam,e,n?k.value:{});for(const le in y.searchParam)y.searchParam[le]===""&&delete y.searchParam[le];let ae=await t(g({...y.searchInitParam,...y.totalParam}));if(r&&(ae=await r(ae)),y.tableData=n?ae.list:ae,n){const{currentPage:le,pageSize:de,total:pe}=ae;V({page:le,size:de,total:pe})}}catch(ie){i&&i(ie)}finally{y.loading=!1}},$=()=>{y.totalParam={},y.searchInitParam={},e={};const ie={};for(const ae in y.searchParam)(y.searchParam[ae]||y.searchParam[ae]===!1||y.searchParam[ae]===0)&&(ie[ae]=y.searchParam[ae]);Object.assign(y.totalParam,ie,n?k.value:{})},V=ie=>{Object.assign(y.pageable,ie)},z=()=>{y.pageable.page=1,$(),L().then()},j=()=>{y.pageable.page=1,y.searchParam={...y.searchInitParam},$(),L().then()},oe=ie=>{y.pageable.page=1,y.pageable.size=ie,L().then()},re=ie=>{y.pageable.page=ie,L().then()};return{...vue.toRefs(y),getTableList:L,search:z,reset:j,handleSizeChange:oe,handleCurrentChange:re,updatedTotalParam:$}},useSelection=(t="id",e)=>{const n=vue.ref(!1),r=vue.ref([]),i=vue.computed(()=>{const y=[];return r.value.forEach(k=>y.push(get$5(k,t))),y});return{isSelected:n,selectedList:r,selectedListIds:i,selectionChange:y=>{y.length?n.value=!0:n.value=!1,r.value=y,e&&e(y)}}},_hoisted_1$5={class:"search-form-item"},_sfc_main$6=vue.defineComponent({name:"SearchFormItem",__name:"SearchFormItem",props:{column:{},searchParam:{}},emits:["search"],setup(t,{emit:e}){vue.useCssVars(ae=>({"011911cb":z.value}));const n=t,r=e,i=vue.computed(()=>n.searchParam),g=vue.computed(()=>{var ae,le,de;return{label:((ae=n.column.fieldNames)==null?void 0:ae.label)??"label",value:((le=n.column.fieldNames)==null?void 0:le.value)??"value",children:((de=n.column.fieldNames)==null?void 0:de.children)??"children"}}),y=vue.inject("enumMap",vue.ref(new Map)),k=vue.computed(()=>{var le;let ae=y.value.get(n.column.prop);return ae?(((le=n.column.search)==null?void 0:le.el)==="select-v2"&&n.column.fieldNames&&(ae=ae.map(de=>({...de,label:de[g.value.label],value:de[g.value.value]}))),ae):[]}),L=vue.computed(()=>{var ae,le;return((le=(ae=n.column.search)==null?void 0:ae.props)==null?void 0:le.options)??k.value??[]}),$=vue.computed(()=>{var he,_e;const ae=g.value.label,le=g.value.value,de=g.value.children,pe=(he=n.column.search)==null?void 0:he.el;let ue=((_e=n.column.search)==null?void 0:_e.props)??{};return pe==="tree-select"&&(ue={...ue,props:{...ue.props,label:ae,children:de},nodeKey:le}),pe==="cascader"&&(ue={...ue,props:{...ue.props,label:ae,value:le,children:de}}),ue}),V=vue.computed(()=>{var de,pe,ue,he,_e,Ce,xe;const ae=n.column.search;return["datetimerange","daterange","monthrange"].includes((de=ae==null?void 0:ae.props)==null?void 0:de.type)||(pe=ae==null?void 0:ae.props)!=null&&pe.isRange?{rangeSeparator:((ue=ae==null?void 0:ae.props)==null?void 0:ue.rangeSeparator)??"-",startPlaceholder:((he=ae==null?void 0:ae.props)==null?void 0:he.startPlaceholder)??"开始时间",endPlaceholder:((_e=ae==null?void 0:ae.props)==null?void 0:_e.endPlaceholder)??"结束时间"}:{placeholder:((Ce=ae==null?void 0:ae.props)==null?void 0:Ce.placeholder)??((xe=ae==null?void 0:ae.el)!=null&&xe.includes("input")?"请输入":"请选择")}}),z=vue.computed(()=>{var ue,he;const ae=n.column.search,le=i.value[(ae==null?void 0:ae.key)??handleProp(n.column.prop)],de=ae==null?void 0:ae.el,pe=(ue=ae==null?void 0:ae.props)==null?void 0:ue.placeholder;if(ae!=null&&ae.width)if(isFunction$2(ae==null?void 0:ae.width)){if(ae==null?void 0:ae.width(le))return(ae==null?void 0:ae.width(le))+"px"}else return(ae==null?void 0:ae.width)+"px";if(le&&le.length!==0&&["select","select-v2","tree-select","cascader"].includes(de||"")){if(isArray$2(le)){let xe=L.value;const Ie=[];if(le.forEach(Oe=>{const Ve=xe.find(kt=>kt[g.value.value]===Oe);Ie.push(Ve?Ve[g.value.label]:Oe);const Ue=Ve[g.value.children]??L.value;xe=Ve?Ue:[]}),(he=ae==null?void 0:ae.props)!=null&&he.multiple){const Ue=getWidthByText(Ie[0])+42;return le.length>1?Ue+26+getWidthByText("+ "+(le.length-1))+"px":Ue+"px"}return getWidthByText(Ie.join(" / "))+"px"}let _e=L.value.find(xe=>xe[g.value.value]===le);const Ce=_e?_e[g.value.label]:le;return getWidthByText(Ce)+"px"}else return pe?getWidthByText(pe)+"px":"100px"}),j=vue.computed(()=>{var ae,le,de,pe,ue;return(de=(le=(ae=n.column)==null?void 0:ae.search)==null?void 0:le.props)!=null&&de.multiple&&((ue=(pe=n.column)==null?void 0:pe.search)==null?void 0:ue.el)==="select"?{collapseTags:!0,collapseTagsTooltip:!0}:{}}),oe=vue.computed(()=>{var le;const ae=n.column.search;return((le=ae==null?void 0:ae.props)==null?void 0:le.clearable)??((ae==null?void 0:ae.defaultValue)==null||!1)}),re=ae=>{var le,de,pe,ue,he,_e,Ce,xe,Ie;if(((pe=(de=(le=n.column)==null?void 0:le.search)==null?void 0:de.props)==null?void 0:pe.type)==="daterange"){const{searchParam:Oe}=vue.toRefs(n);if(ae!=null&&ae.length){const Ve=((_e=(he=(ue=n.column)==null?void 0:ue.search)==null?void 0:he.props)==null?void 0:_e.beginTime)||"beginTime",Ue=((Ie=(xe=(Ce=n.column)==null?void 0:Ce.search)==null?void 0:xe.props)==null?void 0:Ie.endTime)||"endTime";Oe.value[Ve]=ae[0],Oe.value[Ue]=ae[1]}else delete Oe.value.beginTime,delete Oe.value.endTime}(ae==null||ae==="")&&r("search"),ae instanceof Array&&!ae.length&&r("search")},ie=()=>{var ae;["input","input-number"].includes(((ae=n.column.search)==null?void 0:ae.el)||"")&&r("search")};return(ae,le)=>{var de,pe,ue,he,_e,Ce,xe;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(((de=ae.column.search)==null?void 0:de.render)??`el-${(pe=ae.column.search)==null?void 0:pe.el}`),vue.mergeProps({...$.value,...V.value,searchParam:i.value,clearable:oe.value,...j.value},{modelValue:i.value[((ue=ae.column.search)==null?void 0:ue.key)??vue.unref(handleProp)(ae.column.prop)],"onUpdate:modelValue":le[0]||(le[0]=Ie=>{var Oe;return i.value[((Oe=ae.column.search)==null?void 0:Oe.key)??vue.unref(handleProp)(ae.column.prop)]=Ie}),modelModifiers:{trim:!0},data:((he=ae.column.search)==null?void 0:he.el)==="tree-select"?k.value:[],options:L.value,"prefix-icon":(Ce=(_e=ae.column.search)==null?void 0:_e.props)==null?void 0:Ce.prefixIcon,onChange:re,onKeyup:vue.withKeys(ie,["enter"])}),vue.createSlots({default:vue.withCtx(()=>{var Ie;return[((Ie=ae.column.search)==null?void 0:Ie.el)==="select"?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(k.value,(Oe,Ve)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent("el-option"),{key:Ve,label:Oe[g.value.label]??"",value:Oe[g.value.value]},null,8,["label","value"]))),128)):vue.renderSlot(ae.$slots,"default",{key:1},void 0,!0)]}),_:2},[((xe=ae.column.search)==null?void 0:xe.el)==="cascader"?{name:"default",fn:vue.withCtx(({data:Ie})=>[vue.createElementVNode("span",null,vue.toDisplayString(Ie[g.value.label]),1)]),key:"0"}:void 0]),1040,["modelValue","data","options","prefix-icon"]))])}}}),SearchFormItem=_export_sfc(_sfc_main$6,[["__scopeId","data-v-b68822f7"]]),_hoisted_1$4={class:"table-search"},_hoisted_2$3={key:0},_hoisted_3$3={key:0,class:"operation"},_sfc_main$5=vue.defineComponent({name:"SearchForm",__name:"SearchForm",props:{columns:{default:()=>[]},searchParam:{default:()=>({})},search:{},reset:{},isShowResetBtn:{type:Boolean,default:!0},isShowSearchBtn:{type:Boolean,default:!0}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElForm),{ref:"formRef",model:n.searchParam,class:"table-search--left",onSubmit:r[0]||(r[0]=vue.withModifiers(()=>{},["prevent"]))},{default:vue.withCtx(()=>[vue.renderSlot(n.$slots,"default",{},void 0,!0),n.columns.length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.columns,i=>{var g,y,k;return vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:i.prop},[!vue.unref(isBoolean$1)((g=i.search)==null?void 0:g.isShow)||(y=i.search)!=null&&y.isShow?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$3,[vue.createVNode(vue.unref(ElFormItem),null,vue.createSlots({default:vue.withCtx(()=>[vue.createVNode(SearchFormItem,{column:i,"search-param":n.searchParam,onSearch:n.search},null,8,["column","search-param","onSearch"])]),_:2},[(k=i.search)!=null&&k.label?{name:"label",fn:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSpace),{size:4},{default:vue.withCtx(()=>{var L,$;return[vue.createElementVNode("span",null,vue.toDisplayString(`${i.search.label}`),1),(L=i.search)!=null&&L.tooltip?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,effect:"dark",content:($=i.search)==null?void 0:$.tooltip,placement:"top"},{default:vue.withCtx(()=>r[1]||(r[1]=[vue.createElementVNode("i",{class:vue.normalizeClass("iconfont icon-yiwen")},null,-1)])),_:2},1032,["content"])):vue.createCommentVNode("",!0)]}),_:2},1024),r[2]||(r[2]=vue.createElementVNode("span",null,":",-1))]),key:"0"}:void 0]),1024)])):vue.createCommentVNode("",!0)],64)}),128)),e.isShowSearchBtn?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:0,type:"primary",class:"table-search--search-btn",onClick:n.search},{icon:vue.withCtx(()=>r[3]||(r[3]=[vue.createElementVNode("i",{class:"ztable-iconfont icon-zhihao-table-search"},null,-1)])),default:vue.withCtx(()=>[r[4]||(r[4]=vue.createTextVNode(" 搜索 "))]),_:1},8,["onClick"])):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0)]),_:3},8,["model"]),e.isShowResetBtn&&n.columns.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$3,[vue.createVNode(vue.unref(ElTooltip),{class:"box-item",effect:"light",content:"重置",placement:"top"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{class:"table-search--reset-btn",onClick:n.reset},{icon:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{size:14},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(refresh_left_default))]),_:1})]),_:1},8,["onClick"])]),_:1})])):vue.createCommentVNode("",!0)]))}}),SearchForm=_export_sfc(_sfc_main$5,[["__scopeId","data-v-78af7c4d"]]),_hoisted_1$3={class:"el-pagination__total zh-page-total"},_sfc_main$4=vue.defineComponent({name:"Pagination",__name:"tablePagination",props:{pageable:{},handleSizeChange:{type:Function},handleCurrentChange:{type:Function}},setup(t){return(e,n)=>e.pageable.total?(vue.openBlock(),vue.createBlock(vue.unref(ElPagination),{key:0,class:"zh-pagination",background:!0,"current-page":e.pageable.page,"page-size":e.pageable.size,total:e.pageable.total,teleported:!1,layout:"slot, sizes, prev, pager, next, jumper",onSizeChange:e.handleSizeChange,onCurrentChange:e.handleCurrentChange},{default:vue.withCtx(()=>[vue.renderSlot(e.$slots,"zhPaginationLeftSlot",{pageable:e.pageable},()=>[vue.createElementVNode("div",_hoisted_1$3,"共"+vue.toDisplayString(e.pageable.total)+"条数据",1)],!0)]),_:3},8,["current-page","page-size","total","onSizeChange","onCurrentChange"])):vue.createCommentVNode("",!0)}}),TablePagination=_export_sfc(_sfc_main$4,[["__scopeId","data-v-5965b30c"]]);function _isSlot(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vue.isVNode(t)}const _sfc_main$3=vue.defineComponent({name:"TableColumn",__name:"TableColumn",props:{column:{},customColumn:{type:Boolean}},setup(t){const e=t,n=vue.ref(e.column),r=vue.useSlots(),i=vue.inject("enumMap",vue.ref(new Map)),g=(L,$)=>i.value.get(L.prop)&&L.isFilterEnum?filterEnum(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop),L.fieldNames):formatValue(handleRowAccordingToProp($.row,L.prop)),y=(L,$)=>filterEnum(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop),L.fieldNames,"tag"),k=L=>vue.createVNode(vue.Fragment,null,[L.isShow&&vue.createVNode(ElTableColumn,vue.mergeProps(L,{"class-name":L.wrap&&"table-column--wrap",showOverflowTooltip:L.showOverflowTooltip??L.prop!=="operation"}),{default:$=>{var z,j,oe;let V;if(L._children)return L._children.map(re=>k(re));if(L.render)return L.render($);if(L.prop==="operation"){if(!r[handleProp(L.prop)]){n.value.width=0;return}const re=((j=(z=r[handleProp(L.prop)]($))==null?void 0:z.at(0))==null?void 0:j.children)||[],ie=Ce=>Array.from(Ce).map(xe=>{var Ie,Oe;return((Ie=xe.type)==null?void 0:Ie.name)==="ElButton"&&xe.children!=="v-if"?xe:(Oe=xe.children)!=null&&Oe.length?ie(xe.children):null}).filter(Boolean).flat(),ae=ie(re),le=Ce=>{let xe="";return Ce.forEach(Ie=>{xe+=Ie.children.default()[0].children}),getWidthByText(xe,14)+16*(Ce.length>0?Ce.length-1:0)},de=Ce=>{n.value.hasOperationMaxWidth||(n.value.width=0,n.value.hasOperationMaxWidth=!0);const xe=n.value.width;let Ie=0;Ce>0&&(Ie=Math.round(Ce)+32),Ie>Number.parseInt((xe==null?void 0:xe.toString())||"0")&&(n.value.width=Ie,n.value.hasOperationMaxWidth=!0)};if(ae.length<=3||L.expandOperationButtons){const Ce=Math.ceil(le(ae));let xe=Ce;return e.customColumn&&(xe=ae.length?ae.length===1?Ce+30:Ce:50),de(xe),vue.createVNode("div",{class:"operation-container all-action"},[r[handleProp(L.prop)]($)])}const pe=[],ue=ae.slice(0,2),he=vue.createVNode(ElButton,{link:!0,type:"primary"},{default:()=>[vue.createTextVNode("更多")]});pe.push(...ue),pe[3]=vue.createVNode(ElDropdown,null,{default:()=>he,dropdown:()=>{let Ce;return vue.createVNode(ElDropdownMenu,null,_isSlot(Ce=ae.slice(2).map(xe=>vue.createVNode(ElDropdownItem,null,_isSlot(xe)?xe:{default:()=>[xe]})))?Ce:{default:()=>[Ce]})}});const _e=le([...ue,he]);return de(_e),vue.createVNode("div",{class:"operation-container"},[pe])}return r[handleProp(L.prop)]?r[handleProp(L.prop)]($):L.tag?vue.createVNode(ElTag,{type:y(L,$)},_isSlot(V=g(L,$))?V:{default:()=>[V]}):L.click&&g(L,$)!==DEFAULT_VALUE$1?vue.createVNode("span",{class:"el-link el-link--primary scan-link",onClick:function(){L.click($==null?void 0:$.row,$==null?void 0:$.$index)}},[L.formatter?L.formatter($.row,$.column,$.row[L.prop],$.$index):g(L,$)]):vue.createVNode("span",{class:((oe=filterEnumObj(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop)))==null?void 0:oe.state)||"text"},[L.formatter?L.formatter($.row,$.column,$.row[L.prop],$.$index):g(L,$)])},header:$=>L.headerRender?L.headerRender($):r[`${handleProp(L.prop)}Header`]?r[`${handleProp(L.prop)}Header`]($):L.label})]);return(L,$)=>(vue.openBlock(),vue.createBlock(k,vue.normalizeProps(vue.guardReactiveProps(n.value)),null,16))}}),_hoisted_1$2={class:"custom-column-dialog"},_hoisted_2$2={class:"table-body"},_hoisted_3$2={class:"name"},_hoisted_4$1={key:0,class:"ml-10"},_hoisted_5$1={class:"custom-width-label text"},_hoisted_6$1={key:0,class:"custom-width-input-box"},_hoisted_7$1={class:"custom-column-footer"},_hoisted_8$1={class:"flex-1"},_sfc_main$2=vue.defineComponent({name:"ColSetting",__name:"ColSetting",props:{originTableColumns:{default:()=>[]}},emits:["close","submit","dragSort"],setup(t,{expose:e,emit:n}){const r=vue.ref(),i=vue.ref(!1),g=t,y=vue.ref([]),k=vue.ref(new Date().getTime()),L=vue.ref(!1),$=vue.ref(),V=le=>{y.value=le,L.value=!0,vue.nextTick(()=>{re()})},z=le=>{i.value=le},j=n,oe=async()=>{j("submit",y.value),L.value=!1},re=()=>{$.value&&($.value.destroy(),k.value=new Date().getTime(),r.value.doLayout()),vue.nextTick(()=>{const le=document.querySelector(".custom-column-dialog tbody");$.value=Sortable.create(le,{handle:".move",animation:300,filter:".operation",onEnd({newIndex:de,oldIndex:pe}){if(!de&&de!==0||!pe&&pe!==0)return;let ue=cloneDeep(y.value);const he=ue[pe];if(de<pe)for(let _e=de;_e<pe;_e++)ue[_e].order=String(Number(ue[_e].order)+1);else for(let _e=pe+1;_e<=de;_e++)ue[_e].order=String(Number(ue[_e].order)-1);he.order=String(de),y.value=cloneDeep(ue)}})})},ie=()=>{const le=cloneDeep(g.originTableColumns);i.value?y.value=le:y.value=y.value.map(de=>{const pe=y.value.find(ue=>ue.prop===de.prop);return!(pe!=null&&pe.isShow)||pe.prop==="operation"?de:le.find(ue=>ue.prop===de.prop)}),re()},ae=()=>{L.value=!1};return e({openColSetting:V}),(le,de)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createVNode(_sfc_main$s,{modelValue:L.value,"onUpdate:modelValue":de[1]||(de[1]=pe=>L.value=pe),size:"middle"},{header:vue.withCtx(()=>de[2]||(de[2]=[vue.createElementVNode("div",{class:"title"},"自定义列",-1),vue.createElementVNode("div",{class:"sub-title"},"勾选需要展示的列,拖动列名进行排序",-1)])),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$1,[vue.createVNode(vue.unref(ElCheckbox),{modelValue:i.value,"onUpdate:modelValue":de[0]||(de[0]=pe=>i.value=pe),class:"checkbox",label:"全局",onChange:z},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_8$1,[vue.createVNode(ZhButton$1,{plain:"",onClick:ae},{default:vue.withCtx(()=>de[4]||(de[4]=[vue.createTextVNode("取消")])),_:1}),vue.createVNode(ZhButton$1,{plain:"",class:"w-auto",onClick:ie},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.value?"全局恢复默认":"恢复默认"),1)]),_:1}),vue.createVNode(ZhButton$1,{type:"primary",onClick:oe},{default:vue.withCtx(()=>de[5]||(de[5]=[vue.createTextVNode("保存")])),_:1})])])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$2,[(vue.openBlock(),vue.createBlock(vue.unref(ElTable),{ref_key:"tableRef",ref:r,class:"custom-colum-table",key:k.value,data:y.value.filter(pe=>!pe.hideInCustomColumn),"row-class-name":pe=>pe.row.prop==="operation"?"operation":""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTableColumn),{width:"100",label:"选择"},{default:vue.withCtx(({row:pe})=>[vue.createVNode(vue.unref(ElCheckbox),{class:"custom-column-check",modelValue:pe.isShow,"onUpdate:modelValue":ue=>pe.isShow=ue,disabled:pe.readonly},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:1}),vue.createVNode(vue.unref(ElTableColumn),{prop:"label",label:"名称"},{default:vue.withCtx(({row:pe})=>[vue.createElementVNode("div",_hoisted_3$2,[vue.createTextVNode(vue.toDisplayString(pe.label)+" ",1),pe.readonly?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$1,"(必选)")):vue.createCommentVNode("",!0),pe.prop!=="operation"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:"move move-icon"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(rank_default))]),_:1})):vue.createCommentVNode("",!0)])]),_:1}),vue.createVNode(vue.unref(ElTableColumn),{prop:"width",label:"宽度",width:"180"},{default:vue.withCtx(({row:pe})=>[vue.createElementVNode("div",{class:vue.normalizeClass(`custom-width-box ${pe.readonly&&"readonly"}`)},[de[3]||(de[3]=vue.createElementVNode("span",{class:"text"},"宽度",-1)),vue.createElementVNode("span",_hoisted_5$1,vue.toDisplayString(pe.width)+" px",1),pe.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$1,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:pe.width,"onUpdate:modelValue":ue=>pe.width=ue,class:"custom-width-input",min:10,max:1e3,controls:!1},null,8,["modelValue","onUpdate:modelValue"])]))],2)]),_:1})]),_:1},8,["data","row-class-name"]))])]),_:1},8,["modelValue"])]))}}),ColSetting=_export_sfc(_sfc_main$2,[["__scopeId","data-v-2a1bd8b9"]]),_hoisted_1$1={class:"no-card table-main zh-table"},_hoisted_2$1={class:"table-title-container"},_hoisted_3$1={key:0,class:"table-title"},_hoisted_4={key:1,class:"table-header-tip"},_hoisted_5={class:"table-header-container"},_hoisted_6={key:0,class:"table-header"},_hoisted_7={class:"header-button-ri"},_hoisted_8={key:0},_hoisted_9={class:"table-body-container"},_hoisted_10={class:"text d-flex inline-input-text pointer"},_hoisted_11={key:1,class:"inline-input-box d-flex"},_hoisted_12={class:"table-empty"},_hoisted_13=["src"],_sfc_main$1=vue.defineComponent({name:"ZhTable",__name:"Table",props:{columns:{default:()=>[]},data:{},requestApi:{},requestAuto:{type:Boolean,default:!0},requestError:{type:Function,default:t=>{console.error("protable中请求数据错误",t)}},handleParam:{},dataCallback:{},selectChangeCallback:{},title:{},pagination:{type:Boolean,default:!0},initParam:{default:{}},border:{type:Boolean,default:!1},rowKey:{default:"id"},isShowSearch:{type:Boolean,default:!0},maxHeight:{},isShowSearchBtn:{type:Boolean,default:!0},isShowResetBtn:{type:Boolean,default:!0},customColumn:{type:Boolean,default:!1},onSortChange:{},offset:{},customColumnCacheKey:{},customColumnPageCacheKey:{},beforeReset:{}},emits:["search","reset","dargSort"],setup(t,{expose:e,emit:n}){var Un;const r=vue.ref(new Date().getTime()),i={mounted(xn){var On;(On=xn.querySelector("input"))==null||On.focus()}},g=vue.useSlots(),y=t,k=vue.ref(),L=["selection","radio","index","expand","sort","input"],$=vue.ref(y.isShowSearch),V=vue.ref(""),z=vue.ref({}),j=vue.ref(y.maxHeight||"1000px"),{selectionChange:oe,selectedList:re,selectedListIds:ie,isSelected:ae}=useSelection(y.rowKey,y.selectChangeCallback),{loading:le,tableData:de,pageable:pe,searchParam:ue,searchInitParam:he,getTableList:_e,search:Ce,reset:xe,handleSizeChange:Ie,handleCurrentChange:Oe}=useTable(y.requestApi,y.initParam,y.pagination,y.dataCallback,y.requestError,y.handleParam),Ve=xn=>{function On(er){return er.replace(/[A-Z]/g,ar=>"_"+ar.toLowerCase())}const Ln={ascending:"asc",descending:"desc"},{prop:_n,order:Mn}=xn,Wn=On(handleProp(_n)),Qn=Ln[Mn];ue.value={...ue.value,sortKey:Wn,sortOrder:Qn},pe.value.page=1,Ce()},Ue=()=>k.value.clearSelection(),kt=()=>k.value.clearSort(),Dt=vue.ref(!1),$e=()=>{En(),y.customColumn&&Zn(),y.requestAuto&&_e(),y.data&&(pe.value.total=y.data.length)};vue.onMounted(()=>{$e(),vue.nextTick(()=>{Dt.value=!0})}),vue.onActivated(()=>{Dt.value&&$e()}),vue.onDeactivated(()=>{}),vue.onUnmounted(()=>{});const Fe=vue.computed(()=>y.data?y.pagination?y.data.slice((pe.value.page-1)*pe.value.size,pe.value.size*pe.value.page):y.data:de.value),ze=xn=>{pe.value.total=xn};vue.watch(()=>y.initParam,_e,{deep:!0});let qe=vue.reactive(y.columns);const Ne=vue.computed(()=>hn(qe)),Et=vue.ref(new Map),Pt=async({prop:xn,enum:On})=>{if(!On||Et.value.has(xn)&&(typeof On=="function"||Et.value.get(xn)===On))return;if(typeof On!="function")return Et.value.set(xn,vue.unref(On));Et.value.set(xn,[]);const{data:Ln}=await On();Et.value.set(xn,Ln)};vue.provide("enumMap",Et);const hn=(xn,On=[])=>(xn.forEach(async Ln=>{var _n;(_n=Ln._children)!=null&&_n.length&&On.push(...hn(Ln._children)),On.push(Ln),Ln.isShow=Ln.isShow??!0,Ln.isFilterEnum=Ln.isFilterEnum??!0,await Pt(Ln)}),On.filter(Ln=>{var _n;return!((_n=Ln._children)!=null&&_n.length)})),Lt=vue.computed(()=>{var xn;return(xn=Ne.value)==null?void 0:xn.filter(On=>{var Ln,_n;return((Ln=On.search)==null?void 0:Ln.el)||((_n=On.search)==null?void 0:_n.render)}).sort((On,Ln)=>On.search.order-Ln.search.order)});(Un=Lt.value)==null||Un.forEach((xn,On)=>{var Mn,Wn,Qn;xn.search.order=((Mn=xn.search)==null?void 0:Mn.order)??On+2;const Ln=((Wn=xn.search)==null?void 0:Wn.key)??handleProp(xn.prop),_n=(Qn=xn.search)==null?void 0:Qn.defaultValue;_n!=null&&(he.value[Ln]=_n,ue.value[Ln]=_n)});const jt=n,Tn=()=>{var xn;(xn=k.value)==null||xn.clearSelection(),Ce(),jt("search")},kn=()=>{y.beforeReset&&y.beforeReset(),xe(),kt(),jt("reset")},En=()=>{const xn=document.querySelector(".el-table__body-wrapper tbody");xn&&Sortable.create(xn,{handle:".move",animation:300,onEnd({newIndex:On,oldIndex:Ln}){const[_n]=Fe.value.splice(Ln,1);Fe.value.splice(On,0,_n),jt("dargSort",{newIndex:On,oldIndex:Ln})}})},Cn=vue.ref(0),In=(xn,On)=>{const Ln=de.value.findIndex(_n=>_n.$showInput);Ln>-1&&(de.value[Ln]=cloneDeep(z.value),de.value[Ln].$showInput=!1),Cn.value=$get(xn,String(On)),xn.$showInput=!0,z.value=cloneDeep(xn)},An=async(xn,On,Ln)=>{set$2(xn,On,Cn.value),Ln&&await Ln(xn),xn.$showInput=!1,ElMessage.success("更新成功"),await _e()},Nn=async xn=>{const On=de.value.findIndex(Ln=>isEqual(pickBy$1(Ln,identity$1),pickBy$1(xn,identity$1)));On>-1&&(de.value[On]=cloneDeep(z.value),de.value[On].$showInput=!1)},Vn=useColSetting(y.customColumnCacheKey),Bn=vue.ref(null),Yn=()=>qe.map((xn,On)=>({readonly:xn.isCustomDisable||["id","operation"].includes(String(xn.prop)),order:On,index:On,width:xn.width||xn.minWidth,...xn})).sort((xn,On)=>{const Ln=Number(xn.order),_n=Number(On.order);return Ln-_n}),Xn=()=>{zn=vue.reactive(Yn()),vue.nextTick(()=>{Bn.value.openColSetting(cloneDeep(zn))})},Zn=()=>{if(!y.customColumnPageCacheKey)return;const xn=Vn.getColumnCache(y.customColumnPageCacheKey);if(xn!=null&&xn.length){const On=qe.map(Ln=>{const _n=xn.find(Mn=>Mn.prop===Ln.prop);if(_n){const Mn={...Ln,order:_n.order||Ln.order,isShow:_n.isShow!==void 0?_n.isShow:Ln.isShow,readonly:_n.readonly!==void 0?_n.readonly:Ln.readonly,prop:_n.prop||Ln.prop,index:_n.index||Ln.index};return Ln.minWidth&&(Mn.minWidth=_n.minWidth||Ln.minWidth),Ln.width&&(Mn.width=_n.width||Ln.width),Mn}return Ln});zn=vue.reactive(On),qe=vue.reactive(zn)}};let zn=vue.reactive(Yn());const jn=cloneDeep(Yn()),$n=xn=>{if(!y.customColumnPageCacheKey)return console.error("请添加自定义列缓存配置项:customColumnPageCacheKey");xn=xn.map(On=>{const Ln=jn.find(_n=>_n.prop===On.prop);return Ln&&Ln.minWidth&&(On.minWidth=On.width,delete On.width),On}),qe=vue.reactive(cloneDeep(xn)),Vn.setColumnCache(y.customColumnPageCacheKey,xn),r.value=new Date().getTime(),k.value.doLayout()};return e({element:k,tableData:Fe,radio:V,pageable:pe,searchParam:ue,searchInitParam:he,setPageTotal:ze,getTableList:_e,search:Ce,reset:xe,handleSizeChange:Ie,handleCurrentChange:Oe,clearSelection:Ue,enumMap:Et,isSelected:ae,selectedList:re,selectedListIds:ie}),(xn,On)=>{const Ln=vue.resolveDirective("loading");return vue.openBlock(),vue.createBlock(vue.unref(ElConfigProvider),{locale:vue.unref(zhCn)},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[xn.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,vue.toDisplayString(xn.title),1)):vue.createCommentVNode("",!0),vue.unref(g).headerTip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4,[vue.renderSlot(xn.$slots,"headerTip",{},void 0,!0)])):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",_hoisted_5,[vue.withDirectives(vue.createVNode(SearchForm,{search:Tn,reset:kn,columns:Lt.value,"search-param":vue.unref(ue),"is-show-reset-btn":y.isShowResetBtn,"is-show-search-btn":y.isShowSearchBtn},{default:vue.withCtx(()=>[xn.$slots.tableHeader?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6,[vue.createElementVNode("div",_hoisted_7,[vue.renderSlot(xn.$slots,"tableHeader",{selectedList:vue.unref(re),selectedListIds:vue.unref(ie),isSelected:vue.unref(ae)},void 0,!0)])])):vue.createCommentVNode("",!0)]),_:3},8,["columns","search-param","is-show-reset-btn","is-show-search-btn"]),[[vue.vShow,$.value]])]),vue.unref(g).searchBarBottom?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8,[vue.renderSlot(xn.$slots,"searchBarBottom",{},void 0,!0)])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_9,[y.customColumn?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"col-setting-button",onClick:Xn},[vue.createVNode(vue.unref(ElTooltip),{class:"box-item",effect:"dark",content:"自定义列",placement:"top"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{size:14,color:"#000000a6"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(setting_default))]),_:1})]),_:1})])):vue.createCommentVNode("",!0),vue.withDirectives((vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.mergeProps({ref_key:"tableRef",ref:k},xn.$attrs,{key:r.value,data:Fe.value,border:xn.border,"row-key":xn.rowKey,"max-height":j.value,"row-style":{height:"42px"},"tooltip-effect":"light","tooltip-options":{showArrow:!1,placement:"bottom-start",offset:y.offset?y.offset:-20}},vue.toHandlers(xn.$attrs),{onSelectionChange:vue.unref(oe),onSortChange:On[1]||(On[1]=_n=>y.onSortChange?y.onSortChange(_n):Ve(_n))}),{append:vue.withCtx(()=>[vue.renderSlot(xn.$slots,"append",{},void 0,!0)]),empty:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_12,[vue.renderSlot(xn.$slots,"empty",{},()=>[vue.createElementVNode("img",{src:`${vue.unref(CDN_URL$1)}ghy-components/empty.png`,class:"zh-empty-img",alt:"notData"},null,8,_hoisted_13),On[5]||(On[5]=vue.createElementVNode("div",null,"暂无数据",-1))],!0)])]),default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(qe).sort((_n,Mn)=>_n.order-Mn.order),_n=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:_n},[_n.type&&L.includes(_n.type)&&_n.isShow?(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:0,ref_for:!0},_n,{align:_n.align??"left","reserve-selection":_n.type=="selection"}),vue.createSlots({default:vue.withCtx(Mn=>[_n.type=="expand"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_n.render?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_n.render),vue.mergeProps({key:0,ref_for:!0},Mn),null,16)):vue.renderSlot(xn.$slots,_n.type,vue.mergeProps({key:1,ref_for:!0},Mn),void 0,!0)],64)):vue.createCommentVNode("",!0),_n.type=="sort"?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,class:"move"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(d_caret_default))]),_:1})]),_:1})):vue.createCommentVNode("",!0),_n.type=="input"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[Mn.row.$showInput?(vue.openBlock(),vue.createElementBlock("div",_hoisted_11,[vue.withDirectives(vue.createVNode(vue.unref(ElInputNumber),{modelValue:Cn.value,"onUpdate:modelValue":On[0]||(On[0]=Wn=>Cn.value=Wn),min:0,controls:!1},null,8,["modelValue"]),[[i]]),vue.createVNode(vue.unref(ElLink),{underline:!1,type:"primary",onClick:Wn=>An(Mn.row,String(_n.prop),_n.blurCallback),class:"ml-5"},{default:vue.withCtx(()=>On[3]||(On[3]=[vue.createTextVNode(" 保存 ")])),_:2},1032,["onClick"]),vue.createVNode(vue.unref(ElLink),{type:"primary",underline:!1,onClick:Wn=>Nn(Mn.row),class:"ml-5"},{default:vue.withCtx(()=>On[4]||(On[4]=[vue.createTextVNode(" 取消 ")])),_:2},1032,["onClick"])])):(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:"编辑",placement:"top"},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_10,[vue.createTextVNode(vue.toDisplayString(vue.unref($get)(Mn.row,String(_n.prop)))+" ",1),vue.createVNode(vue.unref(ElLink),{underline:!1,class:"text d-flex inline-input-text pointer",onClick:Wn=>In(Mn.row,_n.prop)},{default:vue.withCtx(()=>On[2]||(On[2]=[vue.createElementVNode("i",{class:"iconfont icon-edit"},null,-1)])),_:2},1032,["onClick"])])]),_:2},1024))],64)):vue.createCommentVNode("",!0)]),_:2},[_n.headerRender?{name:"header",fn:vue.withCtx(Mn=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_n.headerRender),vue.mergeProps({ref_for:!0},Mn),null,16))]),key:"0"}:void 0]),1040,["align","reserve-selection"])):vue.createCommentVNode("",!0),!_n.type&&_n.prop&&_n.isShow?(vue.openBlock(),vue.createBlock(_sfc_main$3,{key:1,column:_n,"custom-column":xn.customColumn},vue.createSlots({_:2},[vue.renderList(Object.keys(xn.$slots),Mn=>({name:Mn,fn:vue.withCtx(Wn=>[vue.renderSlot(xn.$slots,Mn,vue.mergeProps({ref_for:!0},Wn),void 0,!0)])}))]),1032,["column","custom-column"])):vue.createCommentVNode("",!0)],64))),128))]),_:3},16,["data","border","row-key","max-height","tooltip-options","onSelectionChange"])),[[Ln,vue.unref(le)]])]),vue.renderSlot(xn.$slots,"pagination",{},()=>[xn.pagination?(vue.openBlock(),vue.createBlock(TablePagination,{key:0,pageable:vue.unref(pe),"handle-size-change":vue.unref(Ie),"handle-current-change":vue.unref(Oe)},{zhPaginationLeftSlot:vue.withCtx(_n=>[vue.renderSlot(xn.$slots,"zhPaginationLeft",vue.normalizeProps(vue.guardReactiveProps(_n)),void 0,!0)]),_:3},8,["pageable","handle-size-change","handle-current-change"])):vue.createCommentVNode("",!0)],!0)]),y.customColumn?(vue.openBlock(),vue.createBlock(ColSetting,{key:0,ref_key:"colRef",ref:Bn,"origin-table-columns":vue.unref(jn),onSubmit:$n},null,8,["origin-table-columns"])):vue.createCommentVNode("",!0)]),_:3},8,["locale"])}}}),Table=_export_sfc(_sfc_main$1,[["__scopeId","data-v-83e26bf1"]]),ZhTable=withInstall$1(Table),_hoisted_1={key:1},_hoisted_2={key:1,class:"zh-base-item--value--file"},_hoisted_3={key:2},_sfc_main=vue.defineComponent({name:"ZhBaseItem",__name:"BaseItem",props:{label:{},labelRender:{},colon:{type:Boolean,default:!1},value:{},fileId:{},rewriteFileName:{},valueRender:{},onClick:{},labelWidth:{},infoDirection:{default:"horizontal"},defaultValue:{default:DEFAULT_VALUE$1},className:{},labelClassName:{},valueClassName:{},span:{default:1},showFileName:{type:Boolean,default:!0},fetchFileById:{}},setup(t){const e=vue.useSlots(),n=t,r=vue.inject("infoLabelWidth",void 0),i=vue.computed(()=>!!(n.onClick&&n.value)),g=vue.computed(()=>!!(!n.value&&n.fileId)),y=vue.ref(),k=vue.computed(()=>{var j;const z=(j=y.value)==null?void 0:j.name;if(!z)return"";if(n.rewriteFileName){const oe=z.substring(z.lastIndexOf("."));return n.rewriteFileName+oe}return z}),L=vue.computed(()=>{const z={},j=n.labelWidth||r;return j&&n.infoDirection==="horizontal"&&(isNaN(Number(j))?z.width=j:z.width=j+"px"),z}),$=vue.computed(()=>({...L.value})),V=vue.computed(()=>n.value===""?DEFAULT_VALUE$1:n.value??DEFAULT_VALUE$1);return vue.watchEffect(async()=>{!g.value||!n.fileId||!n.fetchFileById||(y.value=await n.fetchFileById(n.fileId))}),(z,j)=>(vue.openBlock(),vue.createBlock(vue.unref(ZhGridItem),{span:z.span,label:z.label},{default:vue.withCtx(oe=>{var re;return[vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item",[z.infoDirection,z.className]])},[vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item-label",[z.infoDirection,z.labelClassName]]),style:vue.normalizeStyle({width:z.infoDirection==="horizontal"&&oe.maxLabelWidthInCol?oe.maxLabelWidthInCol+"px":void 0,...$.value})},[z.labelRender?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(z.labelRender),{key:0})):(vue.openBlock(),vue.createElementBlock("span",_hoisted_1,vue.toDisplayString(z.label)+vue.toDisplayString(z.colon?":":""),1))],6),vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item-value",z.valueClassName])},[vue.unref(e).value?vue.renderSlot(z.$slots,"value",{key:0,content:z.value}):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[i.value?(vue.openBlock(),vue.createBlock(vue.unref(ElLink),{key:0,type:"primary",class:"zh-base-item--value--link",onClick:j[0]||(j[0]=vue.withModifiers(ie=>z.onClick&&z.onClick(z.value),["stop"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(z.value),1)]),_:1})):g.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2,[z.showFileName?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(vue.unref(ElIcon),{class:"iconfont"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1}),vue.createTextVNode(" "+vue.toDisplayString(k.value),1)],64)):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(ElLink),{type:"primary",href:(re=y.value)==null?void 0:re.path,target:"_blank",class:vue.normalizeClass({"ml-8":z.showFileName})},{default:vue.withCtx(()=>j[1]||(j[1]=[vue.createTextVNode(" 查看/下载 ")])),_:1},8,["href","class"])])):z.valueRender?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(z.valueRender)))])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:3},[vue.createTextVNode(vue.toDisplayString(V.value),1)],64))],64))],2)],2)]}),_:3},8,["span","label"]))}}),ZhBaseItem=withInstall$1(_sfc_main),components=[ZhBaseInfo,ZhButton,ZhDatePicker,ZhDetailHeader,ZhDetailSubTitle,ZhDialog,ZhDiyDataTable,ZhEditInfoPair,ZhFileWrapper,ZhGrid,ZhGridItem,ZhMultiGrid,ZhInfoPair,ZhInput,ZhInputNumber,ZhLoading,ZhMessageBox,ZhConfirm,ZhAlert,ZhPrompt,ZhMoneyInput,ZhPageHeadPanel,ZhToolTips,ZhMap,ZhButtonGroup,ZhTable],installer=makeInstaller(components);exports.BaseMapType=BaseMapType,exports.CDN_URL=CDN_URL,exports.COPY_RIGHT_TYPE=COPY_RIGHT_TYPE,exports.DEFAULT_VALUE=DEFAULT_VALUE,exports.DIY_DATA_TYPE=DIY_DATA_TYPE,exports.LOG_DATE_FORMAT=LOG_DATE_FORMAT,exports.SEARCH_TYPE=SEARCH_TYPE,exports.ZhAlert=ZhAlert,exports.ZhBaseInfo=ZhBaseInfo,exports.ZhBaseItem=ZhBaseItem,exports.ZhButton=ZhButton,exports.ZhButtonGroup=ZhButtonGroup,exports.ZhConfirm=ZhConfirm,exports.ZhDatePicker=ZhDatePicker,exports.ZhDetailHeader=ZhDetailHeader,exports.ZhDetailSubTitle=ZhDetailSubTitle,exports.ZhDialog=ZhDialog,exports.ZhDiyDataTable=ZhDiyDataTable,exports.ZhEditInfoPair=ZhEditInfoPair,exports.ZhFileWrapper=ZhFileWrapper,exports.ZhGrid=ZhGrid,exports.ZhGridItem=ZhGridItem,exports.ZhInfoPair=ZhInfoPair,exports.ZhInput=ZhInput,exports.ZhInputNumber=ZhInputNumber,exports.ZhLoading=ZhLoading,exports.ZhMap=ZhMap,exports.ZhMessageBox=ZhMessageBox,exports.ZhMoneyInput=ZhMoneyInput,exports.ZhMultiGrid=ZhMultiGrid,exports.ZhPageHeadPanel=ZhPageHeadPanel,exports.ZhPrompt=ZhPrompt,exports.ZhTable=ZhTable,exports.ZhToolTips=ZhToolTips,exports.baseMap=baseMap,exports.default=installer,exports.mapDefaultCenter=mapDefaultCenter,exports.mapZoom=mapZoom,exports.projection=projection,exports.renderShipsLimit=renderShipsLimit,exports.tiandituKey=tiandituKey,exports.zhongkeKey=zhongkeKey,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});