var Ht=Object.defineProperty,Ut=Object.defineProperties;var Kt=Object.getOwnPropertyDescriptors;var Ke=Object.getOwnPropertySymbols;var Yt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable;var Ye=(l,i,r)=>i in l?Ht(l,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[i]=r,A=(l,i)=>{for(var r in i||(i={}))Yt.call(i,r)&&Ye(l,r,i[r]);if(Ke)for(var r of Ke(i))Qt.call(i,r)&&Ye(l,r,i[r]);return l},E=(l,i)=>Ut(l,Kt(i));var I=(l,i,r)=>new Promise((k,S)=>{var f=y=>{try{w(r.next(y))}catch($){S($)}},u=y=>{try{w(r.throw(y))}catch($){S($)}},w=y=>y.done?k(y.value):Promise.resolve(y.value).then(f,u);w((r=r.apply(l,i)).next())});import{g as Qe}from"./index-e9f36657-1784045078568.js";import{A as Jt}from"./assets-4a378a39-1784045078568.js";/* empty css */import{f as Xt,c as Je,b as Zt,g as Xe}from"./townshipBoundaries-1b068bef-1784045078568.js";import{g as en,b as tn,a as nn,c as sn}from"./openApi-528034ce-1784045078568.js";import{c as rn,F as an,g as ln,a as un}from"./featurePanelLayout-5da16b00-1784045078568.js";import{q as Ze,r as on,s as cn}from"./screen2Standard-98cd5b6c-1784045078568.js";import{M as dn}from"./index-c252ce06-1784045078568.js";import{_ as vn}from"./TopicSwitcher-2ffd167b-1784045078568.js";import{_ as fn}from"./LayerPanel-67768a91-1784045078568.js";import{a as et,_ as gn}from"./FeatureInfoPanel-b2a9b292-1784045078568.js";import{_ as mn,g as c,o as _,c as L,a as b,t as Ne,F as Te,y as xe,n as de,J as ve,d as g,q as hn,h as wn,w as B,A as ee,b as q,C as tt,x as nt,u as Se,j as ce,z as yn}from"./index-1784045078568.js";import{_ as st}from"./index-27149dbd-1784045078568.js";import"./index-6a8ef8cf-1784045078568.js";import"./geoserver-6ded2e06-1784045078568.js";const bn="/jsyApi/api/map/ndvi_timeline";function kn(){return I(this,null,function*(){const l=yield fetch(bn,{credentials:"include",headers:{Accept:"application/json"}});if(!l.ok){const k=new Error(`HTTP ${l.status}`);throw k.status=l.status,k}const i=yield l.json().catch(()=>({}));if((i==null?void 0:i.code)===401||(i==null?void 0:i.code)==="401"){const k=new Error((i==null?void 0:i.msg)||(i==null?void 0:i.message)||"NDVI 时间轴未授权");throw k.status=401,k}const r=Array.isArray(i==null?void 0:i.data)?i.data:Array.isArray(i)?i:[];return _n(r)})}function _n(l=[]){const i=new Set;return l.map((r,k)=>{const S=pn(it(r,["url","layerName","layer_name","layer","name"]));if(!S)return null;const f=it(r,["date","month","time","label"])||S,u=Ln(f);return{key:`${S}-${f||k}`,label:u,date:String(f),layerName:S,source:r}}).filter(Boolean).filter(r=>i.has(r.key)?!1:(i.add(r.key),!0))}function it(l,i){for(const r of i)if((l==null?void 0:l[r])!==void 0&&(l==null?void 0:l[r])!==null&&(l==null?void 0:l[r])!=="")return l[r]}function pn(l){const i=String(l||"").trim();return i?i.includes(":")||/^https?:\/\//i.test(i)?i:`ne:${i}`:""}function Ln(l){const i=String(l||"").trim();if(!i)return"";const r=i.match(/(\d{4})[-_/年. ]?(0?[1-9]|1[0-2])(?:月)?/);return r?`${r[1]}.${String(Number(r[2])).padStart(2,"0")}`:i}const Sn={class:"grassland-ndvi-timeline-head"},Nn={key:0,class:"grassland-ndvi-timeline-state"},Tn={key:1,class:"grassland-ndvi-timeline-state"},xn={key:2,class:"grassland-ndvi-timeline-body"},Pn=["aria-checked","title","onClick"],Cn={class:"grassland-ndvi-timeline-label"},$n=42,Mn=28,Fn={__name:"GrasslandNdviTimeline",props:{items:{type:Array,default:()=>[]},modelValue:{type:String,default:""},loading:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(l,{emit:i}){const r=l,k=i,S=c(()=>r.items.findIndex(v=>v.key===r.modelValue)),f=c(()=>S.value===-1?Math.max(0,r.items.length-1):S.value),u=c(()=>r.items[f.value]||null),w=c(()=>r.loading?"加载中":"未选择"),y=c(()=>r.items.length>7),$=c(()=>y.value?Mn:$n),te=c(()=>K(f.value)),ne=c(()=>G(f.value));function H(v){if(!r.items.length)return;const d=Math.min(r.items.length-1,Math.max(0,f.value+v));k("update:modelValue",r.items[d].key)}function se(v){!v||v.key===r.modelValue||k("update:modelValue",v.key)}function U(v){return!r.items.length||v<0?0:r.items.length===1?.5:v/(r.items.length-1)}function K(v){const d=U(v),x=p(d*100),m=$.value*(1-d*2);return`calc(${x}% ${m<0?"-":"+"} ${p(Math.abs(m))}px)`}function G(v){const d=U(v);return d<=0?"0px":`calc(${p(d*100)}% - ${p($.value*2*d)}px)`}function p(v){return Number(v.toFixed(4)).toString()}return(v,d)=>{var x;return _(),L("div",{class:de(["grassland-ndvi-timeline",{"is-dense":y.value}])},[b("div",Sn,[d[2]||(d[2]=b("span",null,"草地健康/退化",-1)),b("strong",null,Ne(((x=u.value)==null?void 0:x.label)||w.value),1)]),l.loading?(_(),L("div",Nn,"加载月份数据")):l.items.length?(_(),L("div",xn,[b("button",{class:"grassland-ndvi-timeline-nav",type:"button",title:"上一期",onClick:d[0]||(d[0]=m=>H(-1))},"‹"),b("div",{class:"grassland-ndvi-timeline-track",style:ve({"--timeline-active-left":te.value,"--timeline-fill-width":ne.value,"--timeline-edge-offset":`${$.value}px`}),role:"radiogroup","aria-label":"草地健康退化月份"},[d[4]||(d[4]=b("div",{class:"grassland-ndvi-timeline-line"},null,-1)),d[5]||(d[5]=b("div",{class:"grassland-ndvi-timeline-fill"},null,-1)),d[6]||(d[6]=b("div",{class:"grassland-ndvi-timeline-thumb"},[b("i")],-1)),(_(!0),L(Te,null,xe(l.items,(m,R)=>{var j,N;return _(),L("button",{key:m.key,class:de(["grassland-ndvi-timeline-mark",{"is-active":m.key===((j=u.value)==null?void 0:j.key),"is-past":R<=f.value,"is-staggered":y.value&&R%2===1}]),type:"button",role:"radio","aria-checked":m.key===((N=u.value)==null?void 0:N.key),style:ve({left:K(R)}),title:m.date,onClick:Y=>se(m)},[d[3]||(d[3]=b("span",{class:"grassland-ndvi-timeline-tick"},null,-1)),b("span",Cn,Ne(m.label),1)],14,Pn)}),128))],4),b("button",{class:"grassland-ndvi-timeline-nav",type:"button",title:"下一期",onClick:d[1]||(d[1]=m=>H(1))},"›")])):(_(),L("div",Tn,"暂无月份数据"))],2)}}},An=mn(Fn,[["__scopeId","data-v-86212a95"]]),In={class:"forest-grass-wet"},Vn={class:"forest-grass-wet-ui",id:"forest-grass-wet-ui"},En={class:"fgw-left"},Bn={class:"fgw-side-stack is-left"},qn={class:"fgw-right"},Gn={class:"fgw-side-stack is-right"},Rn={key:1,class:"fgw-ndvi-timeline"},jn={class:"fgw-bottom-topic"},Dn={key:0,class:"loading"},zn={class:"loading-progress"},Wn={class:"value"},ls={__name:"index",props:{showLoading:{type:Boolean,default:!0},active:{type:Boolean,default:!0}},emits:["topic-stats"],setup(l,{expose:i,emit:r}){const k=l,S=r,f=g(null),u=g(Xt[0].key),w=g(""),y=g([]),$=g([]),te=g("idle"),ne=g(!1),H=g({title:"业务统计",rows:[]}),se=g({title:"业务统计",rows:[]}),U=g([]),K=g([]),G=g(null),p=g(""),v=g(null),d=g(!1),x=g(!1),m=g(null),R=g(0),j=g(k.showLoading),N=g([]),Y=g("idle"),M=g(""),V=g({type:"idle",text:"等待 GeoServer 图层加载"});let Q=null,C=!1,fe=!1,D=!1,F=null,Pe=0,Ce=0,ge=0,z=0,ie=!1,me=!1;const rt={图斑编号:"patch_no",图斑号:"patch_no",湿地编号:"land_number",草地编号:"land_number",林地类型:"dlmc",地类:"landUseName",地类名称:"landUseName",所在乡镇:"townName",所在区域:"full_name",面积:"acreage",图斑面积:"acreage",湿地面积:"acreage",草场面积:"acreage",草原类:"grassTypeName",草原型:"grassMinType",草原等级:"grasslandLevel",草原类型:"basic_type_name",小斑干草产量:"xbGcYield",小斑鲜草产量:"xbXcYield",鲜草产量:"xcYield",干草产量:"gcYield",海拔:"elevation",地貌:"landformName",权属单位:"qsdwmc",坐落单位:"zldwmc",林班:"lin_ban",小班:"xiao_ban",森林类别:"sen_lin_lb",林种:"lin_zhong",公益林等级:"gjgyl_bhdj",保护等级:"bh_dj",质量等级:"zl_dj",优势树种:"you_shi_sz",起源:"qi_yuan",龄组:"ling_zu",郁闭度:"yu_bi_du",林地权属:"ld_qs",土地使用权属:"tdsyqs",林木权属:"lmqs",生态区位:"stqwmc",坡度等级:"slope"},at=new Set(["grassland-distribution","wetland-distribution","woodland-distribution","woodland-protection","woodland-type","woodland-quality","woodland-ownership"]),lt=[{topicKey:"wetland",layerKey:"wetland-distribution",name:"湿地分布",legendName:"湿地资源"},{topicKey:"grassland",layerKey:"grassland-distribution",name:"草地分布",legendName:"草地资源"},{topicKey:"woodland",layerKey:"woodland-distribution",name:"林地分布",legendName:"林地资源"}],ut=new Set(["code","msg","message","success","data","result","grassland","wetland","woodland","basicGrassland","dyColumn","geom","wkt","geometry","the_geom","theGeom","shape","shape_leng","shape_length","length","perimeter","gid","id","objectid","object_id","fid","key_uid","bsm","ysdm"].map(e=>e.toLowerCase()));c(()=>Je(u.value));const ot=c(()=>Zt(u.value)),re=c(()=>lt.map(e=>kt(e)).filter(Boolean)),ae=c(()=>u.value==="overview"?re.value:ot.value),$e=c({get(){return u.value==="overview"?y.value:w.value},set(e){if(u.value==="overview"){y.value=Array.isArray(e)?e.map(String).filter(Boolean):[];return}w.value=String(e||"")}}),J=c(()=>w.value?Xe(u.value,w.value):null),X=c(()=>u.value==="grassland"&&w.value==="grassland-health"),ct=c(()=>X.value),dt=c(()=>N.value.find(e=>e.key===M.value)||null),W=c(()=>{var e;return(((e=J.value)==null?void 0:e.legends)||[]).find(t=>t.key===p.value)||null}),vt=c(()=>re.value.flatMap(e=>e.legends||[])),he=c(()=>{var e;return u.value==="overview"?vt.value:((e=J.value)==null?void 0:e.legends)||[]}),ft=c(()=>ae.value.length>0),Me=c(()=>ae.value.length<=6&&he.value.length<=8),Fe=c(()=>{if(!Me.value)return 430;const e=Math.max(1,ae.value.length),t=Math.max(1,he.value.length),n=e*32,s=30+t*28;return Math.max(272,Math.min(520,96+n+s))}),gt=c(()=>{var s;if(u.value==="overview"){const a=new Set(y.value),o=re.value.filter(h=>a.has(h.key));return _t(o)}const e=J.value;if(!e)return null;let t=(s=W.value)!=null&&s.cqlFilter?E(A({},e),{cqlFilter:W.value.cqlFilter,activeLegend:W.value,name:W.value.name||e.name}):e;const n=dt.value;return X.value&&(n!=null&&n.layerName)&&(t=E(A({},t),{layerName:n.layerName,name:`${e.name} ${n.label}`,timelineDate:n.label,timelineItem:n})),t}),Ae=g(typeof window=="undefined"?1080:window.innerHeight),Ie=Ze.sideCardWidth;c(()=>Ze.sideCardGap);const Ve=c(()=>on(Ae.value)),mt=c(()=>cn(Ve.value,2)),we=c(()=>!!m.value),ht=an,Ee=c(()=>rn({point:m.value?bt(m.value):null,rowCount:v.value?pe(v.value):0,loading:x.value,empty:d.value||!v.value})),wt=c(()=>Ee.value.height),yt=c(()=>Ee.value.style);function bt(e){const t=document.querySelector(".forest-grass-wet"),n=t==null?void 0:t.getBoundingClientRect();return!(n!=null&&n.width)||!(n!=null&&n.height)?e:{x:(e.x-n.left)/n.width*1920,y:(e.y-n.top)/n.height*1080}}function ye(){Ae.value=typeof window=="undefined"?1080:window.innerHeight}function kt({topicKey:e,layerKey:t,name:n,legendName:s}){var h;const a=Xe(e,t);if(!a||a.key!==t)return null;const o=((h=a.legends)==null?void 0:h[0])||{};return E(A({},a),{name:n,overviewTopicKey:e,legends:[E(A({},o),{key:`overview-${t}`,name:s,selectable:!1})]})}function _t(e=[]){const t=e.filter(Boolean);if(!t.length)return null;const[n,...s]=t;return E(A({},n),{overlayLayers:s})}hn(()=>{ye(),window.addEventListener("resize",ye),document.addEventListener("pointerdown",Oe,!0),pt(),ke(u.value,""),le(u.value,"")}),wn(()=>{C=!0,F&&window.clearTimeout(F),window.removeEventListener("resize",ye),document.removeEventListener("pointerdown",Oe,!0)}),B(u,e=>{ie=!0,p.value="",w.value="",e==="overview"&&(y.value=[]),T(),V.value={type:"idle",text:"等待 GeoServer 图层加载"},ke(e,""),le(e,"",null),ee(()=>{ie=!1})}),B(w,()=>{ie||(me=!0,p.value="",T(),V.value={type:w.value?"loading":"idle",text:w.value?"正在加载 GeoServer 图层":"等待 GeoServer 图层加载"},u.value!=="woodland"&&ke(u.value,w.value),le(u.value,w.value,null),ee(()=>{me=!1}))}),B(y,()=>{u.value==="overview"&&(p.value="",T(),V.value={type:y.value.length?"loading":"idle",text:y.value.length?"正在加载 GeoServer 图层":"等待 GeoServer 图层加载"},G.value=We("overview",y.value.join(",")))},{deep:!0}),B(p,()=>{ie||me||(T(),le(u.value,w.value,W.value))}),B(X,e=>{if(e){Nt();return}M.value=""}),B(M,()=>{X.value&&T()}),B(()=>k.active,e=>{var t,n,s,a;f.value&&(e?(be(),(n=(t=f.value).resume)==null||n.call(t)):(a=(s=f.value).pause)==null||a.call(s))});function pt(){var n;Q=new Jt;const e={progress:0};Q.instance.on("onProgress",(s,a,o)=>{const h=Math.floor(a/o*100);Qe.to(e,{progress:h,onUpdate:()=>{R.value=Math.floor(e.progress)}})});const t=()=>{C||fe||(fe=!0,be())};Q.instance.on("onLoad",t),(n=Q.ready)==null||n.then(t).catch(()=>{C||(V.value={type:"error",text:"地图资源加载失败"})})}function be(){C||!k.active||!fe||D||(D=!0,F&&window.clearTimeout(F),F=window.setTimeout(()=>{F=null,Be()},600))}function Be(e=0){return I(this,null,function*(){var n,s,a,o,h;if(C)return;if(!k.active){D=!1;return}if(yield ee(),!k.active){D=!1;return}if(!!((s=(n=f.value)==null?void 0:n.loadMap)!=null&&s.call(n,Q)||(o=(a=f.value)==null?void 0:a.hasMap)!=null&&o.call(a))){yield Ot(),yield ee(),(h=f.value)==null||h.play();return}if(e<24){window.setTimeout(()=>Be(e+1),120);return}D=!1})}function Lt(){F&&(window.clearTimeout(F),F=null)}function qe(){var e,t,n,s;(t=(e=f.value)==null?void 0:e.resume)==null||t.call(e),(s=(n=f.value)==null?void 0:n.refreshView)==null||s.call(n)}function St(){var e,t;if(T(),V.value={type:"loading",text:"地图正在复位"},(t=(e=f.value)==null?void 0:e.hasMap)!=null&&t.call(e)){qe(),V.value={type:"success",text:"地图已复位"};return}Lt(),D=!1,ee(()=>{be()})}i({refreshMapView:qe,resetMap:St});function ke(n){return I(this,arguments,function*(e,t=w.value){const s=e==="woodland"?"":t,a=++Ce;ne.value=!0,te.value="loading";const o=yield en(e,s);C||a!==Ce||e===u.value&&(e!=="woodland"&&(s||"")!==(w.value||"")||Tt(o,e))})}function Nt(e=!1){return I(this,null,function*(){if(!X.value)return;if(!e&&N.value.length){Ge();return}const t=++ge;Y.value="loading";try{const n=yield kn();if(C||t!==ge)return;N.value=n,Y.value=n.length?"success":"empty",Ge()}catch(n){if(C||t!==ge)return;N.value=[],M.value="",Y.value="error"}})}function Ge(){if(!N.value.length){M.value="";return}N.value.some(t=>t.key===M.value)||(M.value=N.value[N.value.length-1].key)}function Tt(e,t){var s,a,o;const n=xt(e);$.value=n.core||[],H.value=n.left||{title:"业务统计",rows:[]},se.value=n.right||{title:"业务统计",rows:[]},U.value=(s=n.leftPanels)!=null&&s.length?n.leftPanels:[H.value],K.value=(a=n.rightPanels)!=null&&a.length?n.rightPanels:[se.value],te.value=n.status,ne.value=!1,S("topic-stats",{topicKey:t,topicName:Je(t).name,items:((o=n.top)!=null&&o.length?n.top:n.core||[]).slice(0,4)})}function xt(e){return e||{}}function Re(e,t){return`${u.value}-${t}-${(e==null?void 0:e.key)||(e==null?void 0:e.title)||"panel"}`}function _e(e){var n;const t=((n=e==null?void 0:e.rows)==null?void 0:n.length)||0;return(e==null?void 0:e.span)===1?!1:(e==null?void 0:e.span)===2?!0:(e==null?void 0:e.type)==="spotlight"||(e==null?void 0:e.type)==="metric"||(e==null?void 0:e.type)==="column"&&t<=5?!1:(e==null?void 0:e.type)==="rank"&&t>4||(e==null?void 0:e.type)==="split"&&t>4||(e==null?void 0:e.type)==="donut"&&t>5||(e==null?void 0:e.type)==="structure"&&t>4||(e==null?void 0:e.type)==="bar"&&t>4||(e==null?void 0:e.type)==="line"&&t>6}function je(e){return _e(e)?mt.value:Ve.value}function pe(e){const t=(e==null?void 0:e.properties)||{};return Object.keys(t).filter(s=>De(s,t[s])).length}function De(e,t){return t==null||t===""||Array.isArray(t)||typeof t=="object"?!1:!ut.has(String(e||"").toLowerCase())}function Pt(){if(u.value==="overview"){const e=new Set(y.value);return re.value.filter(t=>e.has(t.key)).slice().reverse()}return J.value?[J.value]:[]}function Ct(e={}){const t=String(e.overviewTopicKey||u.value||"").toLowerCase(),n=`${e.key||""} ${e.layerName||""} ${t}`.toLowerCase();return n.includes("basic-grassland")||n.includes("t_basic_grassland")?"basicGrassland":t==="woodland"||n.includes("woodland")||n.includes("t_woodland")?"woodland":t==="wetland"||n.includes("wetland")||n.includes("shidi")?"wetland":t==="grassland"||n.includes("grassland")||n.includes("caodi")?"grassland":""}function $t(e={}){const t=ze(e.lng),n=ze(e.lat);return t===""||n===""?"":`POINT(${t} ${n})`}function ze(e){const t=Number(e);return Number.isFinite(t)?t.toFixed(8).replace(/\.?0+$/,""):""}function Mt(){return I(this,arguments,function*(e={}){var h,O,P,Z,ue,He;const t=Number((h=e==null?void 0:e.lngLat)==null?void 0:h.lng),n=Number((O=e==null?void 0:e.lngLat)==null?void 0:O.lat),s=Pt();if(!Number.isFinite(t)||!Number.isFinite(n)||!s.length){T();return}const a=++z,o=e.screen||{x:960,y:540};m.value=null,v.value=null,d.value=!1,x.value=!0,(Z=(P=f.value)==null?void 0:P.clearSelectedFeature)==null||Z.call(P);try{for(const Ue of s){const oe=yield Ft(Ue,{lng:t,lat:n});if(a!==z||C)return;if(oe){v.value=oe,m.value=Le(oe,o),d.value=!1,(He=(ue=f.value)==null?void 0:ue.highlightFeature)==null||He.call(ue,oe,{highlightTone:"v21"});return}}a===z&&T()}catch(Ue){a===z&&T()}finally{a===z&&(x.value=!1)}})}function Ft(e,t){return I(this,null,function*(){const n=Ct(e);if(!n)return null;const s=$t(t);let a=null;n==="grassland"?a=yield ln({wkt:s}):n==="wetland"?a=yield un({wkt:s}):n==="woodland"?a=yield nn(s):n==="basicGrassland"&&(a=yield sn(s));const o=At(a,n);if(!Vt(o))return null;const h=Bt(o,e,t,n);return pe(h)>0?h:null})}function At(e,t){var s,a,o,h,O;const n=[e==null?void 0:e[t],e==null?void 0:e.grassland,e==null?void 0:e.wetland,e==null?void 0:e.woodland,e==null?void 0:e.basicGrassland,(s=e==null?void 0:e.data)==null?void 0:s[t],(a=e==null?void 0:e.data)==null?void 0:a.grassland,(o=e==null?void 0:e.data)==null?void 0:o.wetland,(h=e==null?void 0:e.data)==null?void 0:h.woodland,(O=e==null?void 0:e.data)==null?void 0:O.basicGrassland,e==null?void 0:e.data,e==null?void 0:e.result,e];for(const P of n){const Z=It(P);if(Z)return Z}return null}function It(e){return Array.isArray(e)?e.find(t=>t&&typeof t=="object")||null:e&&typeof e=="object"?e:null}function Vt(e){return!e||typeof e!="object"?!1:Array.isArray(e.dyColumn)&&e.dyColumn.some(Et)?!0:Object.keys(e).some(t=>De(t,e[t]))}function Et(e={}){const t=e==null?void 0:e.value;return t==null||t===""?!1:!!String((e==null?void 0:e.field)||(e==null?void 0:e.title)||"").trim()}function Bt(e,t,n,s){const a=Gt(e),o=qt(e);return{id:e.id||e.patchNo||e.patch_no||e.landNumber||e.land_number||`${s}-${n.lng}-${n.lat}`,properties:a,feature:{type:"Feature",properties:a,geometry:o},geometry:o,layer:t,lngLat:n}}function qt(e={}){return e.geometry||e.geom||e.wkt||e.the_geom||e.theGeom||e.geo||e.geometryWkt||e.geometry_wkt||e.shape||null}function Gt(e={}){const t=A({},e);return(Array.isArray(e.dyColumn)?e.dyColumn:[]).forEach(s=>{const a=s==null?void 0:s.value;if(a==null||a==="")return;const o=rt[String((s==null?void 0:s.title)||"").trim()],h=String((s==null?void 0:s.field)||"").trim();[h,Rt(h),o].filter(Boolean).forEach(P=>{(t[P]===void 0||t[P]===null||t[P]==="")&&(t[P]=a)})}),t}function Rt(e){return String(e||"").replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function le(s,a){return I(this,arguments,function*(e,t,n=W.value){const o=++Pe;if(!t||!jt(t,n)){G.value=We(e,t);return}const h=yield tn(e,t,n);C||o!==Pe||e!==u.value||t!==w.value||((n==null?void 0:n.key)||"")===p.value&&(G.value=E(A({},h),{hideTownLabelStats:!0}))})}function jt(e,t=null){return!!(t!=null&&t.key)||at.has(e)}function We(e,t){return{status:"disabled",topicKey:e,layerKey:t,title:"",unit:"",hideTownLabelStats:!0,rows:[]}}function Dt(e){var n,s;const t=(s=(n=e==null?void 0:e.feature)!=null?n:e)!=null?s:null;if(!t||pe(t)<=0){T();return}v.value=t,d.value=!1,m.value=Le(t,(e==null?void 0:e.screen)||m.value)}function Le(e,t=null){var n,s,a,o;return((s=(n=f.value)==null?void 0:n.getVectorFeatureAnchorScreen)==null?void 0:s.call(n,e))||((o=(a=f.value)==null?void 0:a.getVectorFeatureScreen)==null?void 0:o.call(a,e))||t}function zt(){if(!we.value||!v.value)return;const e=Le(v.value,m.value);if(!e)return;const t=m.value;t&&Math.abs(Number(t.x)-Number(e.x))<.5&&Math.abs(Number(t.y)-Number(e.y))<.5||(m.value=e)}function Wt(e){V.value=e}function T(){var e,t;z+=1,v.value=null,d.value=!1,x.value=!1,m.value=null,(t=(e=f.value)==null?void 0:e.clearSelectedFeature)==null||t.call(e)}function Oe(e){if(!we.value)return;const t=document.querySelector(".fgw-map-feature-info"),n=document.querySelector(".forest-grass-wet .cesium-map"),s=e.target;t&&s instanceof Node&&t.contains(s)||n&&s instanceof Node&&n.contains(s)||T()}function Ot(){return j.value?new Promise(e=>{Qe.to(".forest-grass-wet .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{j.value=!1,e()}})}):Promise.resolve()}return(e,t)=>(_(),L("div",In,[q(dn,{ref_key:"mapSceneRef",ref:f,"active-layer":gt.value,"map-ranking":G.value,"admin-boundary-line-scale":2.4,"initial-zoom":9.55,"max-zoom":21,"hide-town-label-stats":"","enable-imagery-feature-pick":!1,"enable-town-polygon-pick":!1,onFeatureLoading:t[0]||(t[0]=n=>x.value=n),onFeatureInfo:Dt,onMapClick:Mt,onLayerStatus:Wt,onViewChange:zt},null,8,["active-layer","map-ranking"]),b("div",Vn,[b("div",En,[b("div",Bn,[(_(!0),L(Te,null,xe(U.value,n=>(_(),tt(st,{key:Re(n,"left"),class:de(["fgw-side-card left-card",{"is-double":_e(n)}]),title:n.title,width:Se(Ie),height:je(n)},{default:nt(()=>[q(et,{panel:n,compact:"","column-label-standard":"","visual-version":"v21"},null,8,["panel"])]),_:2},1032,["class","title","width","height"]))),128))])]),b("div",qn,[b("div",Gn,[(_(!0),L(Te,null,xe(K.value,n=>(_(),tt(st,{key:Re(n,"right"),class:de(["fgw-side-card right-card",{"is-double":_e(n)}]),title:n.title,width:Se(Ie),height:je(n)},{default:nt(()=>[q(et,{panel:n,compact:"","column-label-standard":"","visual-version":"v21"},null,8,["panel"])]),_:2},1032,["class","title","width","height"]))),128))])]),ft.value?(_(),L("div",{key:0,class:"fgw-map-layer-tools",style:ve({height:`${Fe.value}px`})},[q(fn,{modelValue:$e.value,"onUpdate:modelValue":t[1]||(t[1]=n=>$e.value=n),"selected-legend-key":p.value,"onUpdate:selectedLegendKey":t[2]||(t[2]=n=>p.value=n),"topic-key":u.value,layers:ae.value,legends:he.value,multiple:u.value==="overview",width:248,height:Fe.value,compact:Me.value},null,8,["modelValue","selected-legend-key","topic-key","layers","legends","multiple","height","compact"])],4)):ce("",!0),ct.value?(_(),L("div",Rn,[q(An,{modelValue:M.value,"onUpdate:modelValue":t[3]||(t[3]=n=>M.value=n),items:N.value,loading:Y.value==="loading"},null,8,["modelValue","items","loading"])])):ce("",!0),we.value?(_(),L("div",{key:2,class:"fgw-map-feature-info",style:ve(yt.value)},[q(gn,{feature:v.value,empty:d.value,loading:x.value,width:Se(ht),height:wt.value,closable:"",onClose:T},null,8,["feature","empty","loading","width","height"])],4)):ce("",!0),b("div",jn,[q(vn,{modelValue:u.value,"onUpdate:modelValue":t[4]||(t[4]=n=>u.value=n)},null,8,["modelValue"])])]),j.value?(_(),L("div",Dn,[t[6]||(t[6]=yn('
LOADING
',1)),b("div",zn,[b("span",Wn,Ne(R.value),1),t[5]||(t[5]=b("span",{class:"unit"},"%",-1))])])):ce("",!0)]))}};export{ls as default};