PageSourceSearch

https://app.geovio.com/assets/Index-CuqfhGWZ.js

js geovio.com collected 2026-10-08 01:26:59 UTC 89,308 bytes, 2 lines download raw bytes

1import{bV as ut,bW as T,bE as Rt,bX as Ft,bY as ht,bz as je,bZ as pe,b_ as dt,b$ as ke,c0 as At,c1 as ce,c2 as ue,c3 as Pe,c4 as Dt,c5 as Bt,c6 as mt,c7 as Ot,c8 as Vt,c9 as Gt,ca as Nt,cb as Ht,bd as jt,be as Ge,bf as zt,cc as Yt,cd as $t,ce as qt,cf as ze,cg as Ut,aA as Wt,bC as Jt,ch as Xt,ci as Kt,cj as Qt,ck as Zt,cl as ei,cm as ti,cn as ii,co as si,_ as j,o as y,k as V,a7 as O,aK as ft,a4 as gt,r as v,F as ie,D as ye,c as I,a6 as ni,d as pt,cp as oi,cq as ve,cr as Ye,cs as ri,ct as li,b as L,m as M,h as Ne,a as Q,E as ai,w as C,R as H,y as Te,T as ae,ah as $e,bu as Ie,aM as ne,aN as fe,aO as be,aP as _e,aR as ee,aQ as ci,cu as ui,cv as hi,cw as di,aB as mi,as as fi,A as yt,ap as gi,e as Re,bU as St,a0 as pi,bS as xt,K as Fe,bT as yi,H as W,ab as Si,aa as xi,a3 as vi,z as vt,B as It,bL as Ii,cx as qe,J as bi,a2 as Ue,cy as _i,cz as oe,am as Ei,ay as We,i as wi,u as Li}from"./index-Dd9GMlt8.js";import{C as de}from"./ListCard-C3UibWsP.js";import{F as Ci}from"./FilterChipSelectionList-DsWlElJp.js";import{V as Mi}from"./VisibilityCard-BeT2pDfg.js";import"./ListWrapper-CoTAingI.js";class ki extends ut{constructor(e,t,s,i,o){const l=o!==void 0?T.IDLE:T.LOADED;super(e,t,s,l),this.loader_=o!==void 0?o:null,this.canvas_=i,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=T.ERROR):this.state=T.LOADED,this.changed()}load(){this.state==T.IDLE&&(this.state=T.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}const q=11102230246251565e-32,D=134217729,Pi=(3+8*q)*q;function Ee(n,e,t,s,i){let o,l,r,c,u=e[0],d=s[0],a=0,h=0;d>u==d>-u?(o=u,u=e[++a]):(o=d,d=s[++h]);let f=0;if(a<n&&h<t)for(d>u==d>-u?(l=u+o,r=o-(l-u),u=e[++a]):(l=d+o,r=o-(l-d),d=s[++h]),o=l,r!==0&&(i[f++]=r);a<n&&h<t;)d>u==d>-u?(l=o+u,c=l-o,r=o-(l-c)+(u-c),u=e[++a]):(l=o+d,c=l-o,r=o-(l-c)+(d-c),d=s[++h]),o=l,r!==0&&(i[f++]=r);for(;a<n;)l=o+u,c=l-o,r=o-(l-c)+(u-c),u=e[++a],o=l,r!==0&&(i[f++]=r);for(;h<t;)l=o+d,c=l-o,r=o-(l-c)+(d-c),d=s[++h],o=l,r!==0&&(i[f++]=r);return(o!==0||f===0)&&(i[f++]=o),f}function Ti(n,e){let t=e[0];for(let s=1;s<n;s++)t+=e[s];return t}function me(n){return new Float64Array(n)}const Ri=(3+16*q)*q,Fi=(2+12*q)*q,Ai=(9+64*q)*q*q,se=me(4),Je=me(8),Xe=me(12),Ke=me(16),B=me(4);function Di(n,e,t,s,i,o,l){let r,c,u,d,a,h,f,S,p,g,x,b,_,E,k,P,R,m;const w=n-i,F=t-i,A=e-o,G=s-o;E=w*G,h=D*w,f=h-(h-w),S=w-f,h=D*G,p=h-(h-G),g=G-p,k=S*g-(E-f*p-S*p-f*g),P=A*F,h=D*A,f=h-(h-A),S=A-f,h=D*F,p=h-(h-F),g=F-p,R=S*g-(P-f*p-S*p-f*g),x=k-R,a=k-x,se[0]=k-(x+a)+(a-R),b=E+x,a=b-E,_=E-(b-a)+(x-a),x=_-P,a=_-x,se[1]=_-(x+a)+(a-P),m=b+x,a=m-b,se[2]=b-(m-a)+(x-a),se[3]=m;let N=Ti(4,se),U=Fi*l;if(N>=U||-N>=U||(a=n-w,r=n-(w+a)+(a-i),a=t-F,u=t-(F+a)+(a-i),a=e-A,c=e-(A+a)+(a-o),a=s-G,d=s-(G+a)+(a-o),r===0&&c===0&&u===0&&d===0)||(U=Ai*l+Pi*Math.abs(N),N+=w*d+G*r-(A*u+F*c),N>=U||-N>=U))return N;E=r*G,h=D*r,f=h-(h-r),S=r-f,h=D*G,p=h-(h-G),g=G-p,k=S*g-(E-f*p-S*p-f*g),P=c*F,h=D*c,f=h-(h-c),S=c-f,h=D*F,p=h-(h-F),g=F-p,R=S*g-(P-f*p-S*p-f*g),x=k-R,a=k-x,B[0]=k-(x+a)+(a-R),b=E+x,a=b-E,_=E-(b-a)+(x-a),x=_-P,a=_-x,B[1]=_-(x+a)+(a-P),m=b+x,a=m-b,B[2]=b-(m-a)+(x-a),B[3]=m;const kt=Ee(4,se,4,B,Je);E=w*d,h=D*w,f=h-(h-w),S=w-f,h=D*d,p=h-(h-d),g=d-p,k=S*g-(E-f*p-S*p-f*g),P=A*u,h=D*A,f=h-(h-A),S=A-f,h=D*u,p=h-(h-u),g=u-p,R=S*g-(P-f*p-S*p-f*g),x=k-R,a=k-x,B[0]=k-(x+a)+(a-R),b=E+x,a=b-E,_=E-(b-a)+(x-a),x=_-P,a=_-x,B[1]=_-(x+a)+(a-P),m=b+x,a=m-b,B[2]=b-(m-a)+(x-a),B[3]=m;const Pt=Ee(kt,Je,4,B,Xe);E=r*d,h=D*r,f=h-(h-r),S=r-f,h=D*d,p=h-(h-d),g=d-p,k=S*g-(E-f*p-S*p-f*g),P=c*u,h=D*c,f=h-(h-c),S=c-f,h=D*u,p=h-(h-u),g=u-p,R=S*g-(P-f*p-S*p-f*g),x=k-R,a=k-x,B[0]=k-(x+a)+(a-R),b=E+x,a=b-E,_=E-(b-a)+(x-a),x=_-P,a=_-x,B[1]=_-(x+a)+(a-P),m=b+x,a=m-b,B[2]=b-(m-a)+(x-a),B[3]=m;const Tt=Ee(Pt,Xe,4,B,Ke);return Ke[Tt-1]}function Bi(n,e,t,s,i,o){const l=(e-o)*(t-i),r=(n-i)*(s-o),c=l-r,u=Math.abs(l+r);return Math.abs(c)>=Ri*u?c:-Di(n,e,t,s,i,o,u)}class Oi extends Rt{constructor(e){e=e||{},super(e)}}class bt extends Ft{constructor(e){super(e),this.image_=null}getImage(){return this.image_?this.image_.getImage():null}prepareFrame(e){const t=e.layerStatesArray[e.layerIndex],s=e.pixelRatio,i=e.viewState,o=i.resolution,l=this.getLayer().getSource(),r
1=e.viewHints;let c=e.extent;if(t.extent!==void 0&&(c=ht(c,je(t.extent,i.projection))),!r[pe.ANIMATING]&&!r[pe.INTERACTING]&&!dt(c))if(l){const u=i.projection,d=l.getImage(c,o,s,u);d&&(this.loadImage(d)?this.image_=d:d.getState()===T.EMPTY&&(this.image_=null))}else this.image_=null;return!!this.image_}getData(e){const t=this.frameState;if(!t)return null;const s=this.getLayer(),i=ke(t.pixelToCoordinateTransform,e.slice()),o=s.getExtent();if(o&&!At(o,i))return null;const l=this.image_.getExtent(),r=this.image_.getImage(),c=ce(l),u=Math.floor(r.width*((i[0]-l[0])/c));if(u<0||u>=r.width)return null;const d=ue(l),a=Math.floor(r.height*((l[3]-i[1])/d));return a<0||a>=r.height?null:this.getImageData(r,u,a)}renderFrame(e,t){const s=this.image_,i=s.getExtent(),o=s.getResolution(),l=s.getPixelRatio(),r=e.layerStatesArray[e.layerIndex],c=e.pixelRatio,u=e.viewState,d=u.center,a=u.resolution,h=c*o/(a*l),f=e.extent,S=u.resolution,p=u.rotation,g=Math.round(ce(f)/S*c),x=Math.round(ue(f)/S*c);Pe(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/c,1/c,p,-g/2,-x/2),Dt(this.inversePixelTransform,this.pixelTransform);const b=Bt(this.pixelTransform);this.useContainer(t,b,this.getBackground(e));const _=this.context,E=_.canvas;E.width!=g||E.height!=x?(E.width=g,E.height=x):this.containerReused||_.clearRect(0,0,g,x);let k=!1,P=!0;if(r.extent){const A=je(r.extent,u.projection);P=mt(A,e.extent),k=P&&!Ot(A,e.extent),k&&this.clipUnrotated(_,e,A)}const R=s.getImage(),m=Pe(this.tempTransform,g/2,x/2,h,h,0,l*(i[0]-d[0])/o,l*(d[1]-i[3])/o);this.renderedResolution=o*c/l;const w=R.width*m[0],F=R.height*m[3];if(this.getLayer().getSource().getInterpolate()||(_.imageSmoothingEnabled=!1),this.preRender(_,e),P&&w>=.5&&F>=.5){const A=m[4],G=m[5],N=r.opacity;let U;N!==1&&(U=_.globalAlpha,_.globalAlpha=N),_.drawImage(R,0,0,+R.width,+R.height,A,G,w,F),N!==1&&(_.globalAlpha=U)}return this.postRender(_,e),k&&_.restore(),_.imageSmoothingEnabled=!0,b!==E.style.transform&&(E.style.transform=b),this.container}}class Vi extends Oi{constructor(e){super(e)}createRenderer(){return new bt(this)}getData(e){return super.getData(e)}}class Gi extends ut{constructor(e,t,s,i,o,l,r){const c=e.getExtent(),u=t.getExtent(),d=u?ht(s,u):s,a=Vt(d),h=Gt(e,t,a,i),f=Yt,S=new Nt(e,t,d,c,h*f,i),p=S.calculateSourceExtent(),g=l(p,h,o),x=g?T.IDLE:T.EMPTY,b=g?g.getPixelRatio():1;super(s,i,b,x),this.targetProj_=t,this.maxSourceExtent_=c,this.triangulation_=S,this.targetResolution_=i,this.targetExtent_=s,this.sourceImage_=g,this.sourcePixelRatio_=b,this.interpolate_=r,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==T.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==T.LOADED){const t=ce(this.targetExtent_)/this.targetResolution_,s=ue(this.targetExtent_)/this.targetResolution_;this.canvas_=Ht(t,s,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=e,this.changed()}load(){if(this.state==T.IDLE){this.state=T.LOADING,this.changed();const e=this.sourceImage_.getState();e==T.LOADED||e==T.ERROR?this.reproject_():(this.sourceListenerKey_=jt(this.sourceImage_,Ge.CHANGE,function(t){const s=this.sourceImage_.getState();(s==T.LOADED||s==T.ERROR)&&(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}}unlistenSource_(){zt(this.sourceListenerKey_),this.sourceListenerKey_=null}}const we={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class Ni extends Jt{constructor(e,t){super(e),this.image=t}}class Hi extends $t{constructor(e){super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:e.interpolate!==void 0?e.interpolate:!0}),this.on,this.once,this.un,this.resolutions_=e.resolutions!==void 0?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0}getResolutions(){return this.resolutions_}setResolutions(e){this.resolutions_=e}findNearestResolution(e){const t=this.getResolutions();if(t){const s=qt(t,e,0);e=t[s]}return e}getImage(e,t,s,i){const o=this.getProjection();if(!o||!i||ze(o,i))return o&&(i=o),this.getImageInternal(e,t,s,i);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&ze(this.reprojectedImage_.getProjection(),i)&&this.reprojectedImage_.getResolution()==t&&Ut(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Gi(o,i,e,t,s,(l,r,c)=>this.getImageInternal(l,r,c,o),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,s,i){return Wt()}handleImageChange(e){const t=e.target;let s;switch(t.getState()){case T.LOADING:this.loading=!0,s=we.IMAGELOADSTART;break;case T.LOADED:this.loading=!1,s=we.IMAGELOADEND;break;case T.ERROR:this.loading=!1,s=we.IMAGELOADERROR;break;default:return}this.hasListener(s)&&this.dispatchEvent(new Ni(s,t))}}function ji(n,e){n.getImage().src=e}class zi extends bt{constructor(e){super(e),this.vectorRenderer_=new Xt(e),this.layerImageRatio_=e.getImageRatio(),this.coordinateToVectorPixelTransform_=Kt(),this.renderedPixelToCoordinateTransform_=null}disposeInternal(){this.vectorRenderer_.dispose(),super.disposeInternal()}getFeatures(e){if(!this.vectorRenderer_)return Promise.resolve([]);const t=ke(this.coordinateToVectorPixelTransform_,ke(this.renderedPixelToCoordinateTransform_,e.slice()));return this.vectorRenderer_.getFeatures(t)}handleFontsChanged(){this.vectorRenderer_.handleFontsChanged()}prepareFrame(e){const t=e.pixelRatio,s=e.viewState,i=s.resolution,o=e.viewHints,l=this.vectorRenderer_;let r=e.extent;this.layerImageRatio_!==1&&(r=r.slice(0),Qt(r,this.layerImageRatio_));const c=ce(r)/i,u=ue(r)/i;if(!o[pe.ANIMATING]&&!o[pe.INTERACTING]&&!dt(r)){l.useContainer(null,null);const d=l.context,a=e.layerStatesArray[e.layerIndex];d.globalAlpha=a.opacity;const h=Object.assign({},a,{opacity:1}),f=Object.assign({},e,{declutterTree:new Zt(9),extent:r,size:[c,u],viewState:Object.assign({},e.viewState,{rotation:0}),layerStatesArray:[h],layerIndex:0});let S=!0;const p=new ki(r,i,t,d.canvas,function(g){l.prepareFrame(f)&&l.replayGroupChanged&&(l.clipping=!1,l.renderFrame(f,null)&&(l.renderDeclutter(f),S=!1),g())});p.addEventListener(Ge.CHANGE,()=>{if(p.getState()!==T.LOADED)return;this.image_=S?null:p;const g=p.getResolution(),x=p.getPixelRatio(),b=g*t/x;this.renderedResolution=b,this.coordinateToVectorPixelTransform_=Pe(this.coordinateToVectorPixelTransform_,c/2,u/2,1/b,-1/b,0,-s.center[0],-s.center[1])}),p.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice()),!!this.image_}preRender(){}postRender(){}renderDeclutter(){}forEachFeatureAtCoordinate(e,t,s,i,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,t,s,i,o):super.forEachFeatureAtCoordinate(e,t,s,i,o)}}class Qe extends ei{constructor(e){e=e||{};const t=Object.assign({},e);delete t.imageRatio,super(t),this.imageRatio_=e.imageRatio!==void 0?e.imageRatio:1}getImageRatio(){return this.imageRatio_}createRenderer(){return new zi(this)}}class Yi extends Hi{constructor(e){const t=e.crossOrigin!==void 0?e.crossOrigin:null,s=e.imageLoadFunction!==void 0?e.imageLoadFunction:ji;super({attributions:e.attributions,interpolate:e.interpolate,projection:ti(e.projection)}),this.url_=e.url,this.imageExtent_=e.imageExtent,this.image_=new ii(this.imageExtent_,void 0,1,this.url_,t,s),this.imageSize_=e.imageSize?e.imageSize:null,this.image_.addEventListener(Ge.CHANGE,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(e,t,s,i){return mt(e,this.image_.getExtent())?this.image_:null}getUrl(){return this.url_}handleImageChange(e){if(this.image_.getState()==T.LOADED){const t=this.image_.getExtent(),s=this.image_.getImage();let i,o;this.imageSize_?(i=this.imageSize_[0],o=this.imageSize_[1]):(i=s.width,o=s.height);const l=ce(t),r=ue(t),c=l/i,u=r/o;let d=i,a=o;if(c>u?d=Math.round(l/u):a=Math.round(r/c),d!==i||a!==o){const h=si(d,a);this.getInterpolate()||(h.imageSmoothingEnabled=!1);const f=h.canvas;h.drawImage(s,0,0,i,o,0,0,f.width,f.height),this.image_.setImage(f)}}super.handleImageChange(e)}}const $i={},qi={class:"grow overflow-hidden self-stretch px-card-card-list-horizontal-padding"},Ui={class:"h-full flex flex-row items-start overflow-y-auto custom_scrollbar self-stretch"};function Wi(n,e){return y(),V("div",qi,[O("div",Ui,[ft(n.$slots,"default")])])}const Ji=j($i,[["render",Wi]]),Xi={props:{data:{type:Array,required:!0}},components:{EChip:gt}},Ki={class:"flex flex-row flex-wrap gap-2"};function Qi(n,e,t,s,i,o){const l=v("EChip");return y(),V("div",Ki,[(y(!0),V(ie,null,ye(t.data,r=>(y(),I(l,{key:r.id,labelText:r.text,disabled:!!r.disabled,selected:!!r.checked,onClick:c=>n.$emit("itemClick",r)},null,8,["labelText","disabled","selected","onClick"]))),128))])}const Zi=j(Xi,[["render",Qi]]),es={name:"MosaicForm",components:{ESegmentedButton:oi,CheckboxFilterchipList:Zi,EInput:pt,EInputParagraph:ni},props:{goBack:Function,disabled:{type:Boolean,default:!0},selectedFilters:Object,resetSelection:Function,name:{},description:{},resolution:{},bands:{}},emits:["update:name","update:description"],setup(){return{v$:li()}},data(){return{form:{name:this.name,description:this.description,resolution:this.resolution},formValidators:{name:{required:ve.withMessage(()=>"Polozka je povinna",Ye)},description:{minLength:ve.withMessage(()=>
1"Minimalni pocet znaku je 5",ri(5)),required:ve.withMessage(()=>"Polozka je povinna",Ye)}}}},methods:{onResolutionSegmentClicked(n){this.resolution.map(e=>{e.selected=e.id===n.id})},onClickFilterChip(n){if(n.disabled)return;let e=this.bands.find(t=>t.id===n.id);e.checked=!e.checked}}},ts={class:"px-4"},is={class:"flex flex-col gap-2"},ss={class:"flex flex-col item-start gap-2 w-full mb-2"},ns=O("div",{class:"mb-2 label_large"}," Image resolution: ",-1),os={class:"flex flex-col"},rs=O("div",{class:"mb-2 label_large"}," Bands avaiable for selected resolution: ",-1);function ls(n,e,t,s,i,o){const l=v("EInput"),r=v("EInputParagraph"),c=v("ESegmentedButton"),u=v("CheckboxFilterchipList");return y(),V("div",ts,[O("div",null,[O("div",null,[O("div",is,[L(l,{modelValue:i.form.name,"onUpdate:modelValue":e[0]||(e[0]=d=>i.form.name=d),label:"Name",floating:!0,onInput:e[1]||(e[1]=d=>n.$emit("update:name",d.target.value))},null,8,["modelValue"]),L(r,{label:"Description",modelValue:i.form.description,floating:!0,onInput:e[2]||(e[2]=d=>n.$emit("update:description",d.target.value))},null,8,["modelValue"])]),O("div",ss,[ns,L(c,{segments:t.resolution,"onClick:selectSegment":o.onResolutionSegmentClicked},null,8,["segments","onClick:selectSegment"])]),O("div",os,[rs,t.bands.length>0?(y(),I(u,{key:0,data:t.bands,onItemClick:o.onClickFilterChip},null,8,["data","onItemClick"])):M("",!0)])])])])}const as=j(es,[["render",ls]]),cs={name:"CloudinessSelectionList",components:{SmartList:Ne},emits:["change","custom"],data(){return{options:[{value:.2,title:"20% or less"},{value:.5,title:"50% or less"},{value:1,title:"Any amount of cloud cover"},{value:"custom",title:"Customize value"}]}}};function us(n,e,t,s,i,o){const l=v("SmartList");return y(),I(l,{modelValue:i.options,"onUpdate:modelValue":e[0]||(e[0]=r=>i.options=r),identifier:"value",formatLine1:r=>r.title,onChange:e[1]||(e[1]=r=>r.value==="custom"?n.$emit("custom"):n.$emit("change",r.value))},null,8,["modelValue","formatLine1"])}const _t=j(cs,[["render",us]]),hs={name:"CloudinessPopup",emits:["cloudiness","close"],props:{cloudiness:{type:Number,default:.5}},data(){return{cloudinessValue:this.cloudiness,buttonVariants:Q.Variants}},components:{EDialog:ai,EButton:Q,EInput:pt},watch:{cloudiness(){this.cloudinessValue=this.cloudiness}}};function ds(n,e,t,s,i,o){const l=v("EInput"),r=v("EButton"),c=v("EDialog");return y(),I(c,{mobile:n.$store.state.mobileLayout,title:"Cloudiness value","onClick:close":e[2]||(e[2]=u=>n.$emit("close"))},{content:C(()=>[L(l,{modelValue:i.cloudinessValue,"onUpdate:modelValue":e[0]||(e[0]=u=>i.cloudinessValue=u),class:"px-6 self-stretch",valueType:"number",cancelable:!0,min:0,max:100,step:1,helperText:"Enter maximum image cloudiness allowed"},null,8,["modelValue"])]),footer:C(()=>[L(r,{variant:i.buttonVariants.TEXT,labelText:"Set value",onClick:e[1]||(e[1]=u=>n.$emit("cloudiness",i.cloudinessValue))},null,8,["variant"])]),_:1},8,["mobile"])}const Et=j(hs,[["render",ds]]),ms={text:null,value:null,checked:!1},Le={value:1,text:"Sentinel-2 MSI",valueId:"sentinel-2_msi"},fs=[{id:0,title:"Day"},{id:1,title:"Night"}],gs={value:0,text:"Day",checked:!0},ps=()=>({time:{...gs},platform:null}),ys=()=>({cloudiness:null}),Ss={name:"Filters",emits:["submit","cardStatus"],components:{ScrollListWrapper:Ji,ListCard:de,SmartList:Ne,CloudinessSelectionList:_t,CloudinessPopup:Et},props:{goBack:{type:Function},filters:{type:Object},aoi:{type:Object},currentFilter:{type:String},modalElement:{type:Object}},data(){var t;const n=this.getInitialFilters();return{showCloudinessDialog:!1,bottomSheetSizeType:null,openedFilter:null,platforms:(t=this.filters)!=null&&t.platform?[{id:this.filters.platform.value,title:this.filters.platform.text,valueId:this.filters.platform.valueId}]:[],timeOptions:fs,selectedFilters:{...n}}},watch:{filters:{deep:!0,handler(){var e;const n=this.getInitialFilters();this.platforms=(e=this.filters)!=null&&e.platform?[{id:this.filters.platform.value,title:this.filters.platform.text,valueId:this.filters.platform.valueId}]:[{id:Le.value,title:Le.text,valueId:Le.valueId}],this.selectedFilters={...n}}}},mounted(){this.$emit("cardStatus",{visible:!0,hiddenGlobalBar:!0,bottomSheetSizeStyle:"height: 50%; border-radius: 8px 8px 0px 0px;"})},methods:{getInitialFilters(){var t,s,i;const n=(t=this.filters)!=null&&t.platform?{platform:this.filters.platform,time:this.filters.time}:ps(),e=!((s=this.filters)!=null&&s.cloudiness)&&this.currentFilter=="cloudiness"?ys():{cloudiness:(i=this.filters)==null?void 0:i.cloudiness};return Object.assign({},n,e)},toggleDropdown(n){n&&this.openedFilter===n?this.openedFilter=null:this.openedFilter=n}
1,getPlatformOptions(){return new Promise((n,e)=>{H.getPlatforms({canPreselect:!0}).then(t=>{this.list=t.map(s=>({...s,title:s.name,id:s.id})),n(this.list)}).catch(t=>{e(t),console.error(t)})})},onChange(n,e){this.selectedFilters[e]||(this.selectedFilters[e]={}),e==="time"?(this.selectedFilters.time.text=n[0].title,this.selectedFilters.time.checked=!0,this.selectedFilters.time.value=n[0].id):e==="platform"?n&&n.length?(this.selectedFilters.platform.text=n[0].title,this.selectedFilters.platform.checked=!0,this.selectedFilters.platform.value=n[0].id,this.selectedFilters.platform.valueId=n[0].valueId,this.selectedFilters.platform.premium=n[0].premium):this.selectedFilters.platform={...ms}:e==="cloudiness"&&(this.selectedFilters.cloudiness.text=`Cloud cover ${n}%`,this.selectedFilters.cloudiness.checked=!0,this.selectedFilters.cloudiness.value=n),this.openedFilter=null},submit(){this.$emit("submit",this.selectedFilters)},cancelSelection(n,e){this.openedFilter=null,this.selectedFilters[e].text=null,this.selectedFilters[e].checked=!1}}};function xs(n,e,t,s,i,o){var d;const l=v("SmartList"),r=v("CloudinessSelectionList"),c=v("ListCard"),u=v("CloudinessPopup");return y(),V(ie,null,[L(c,{title:t.currentFilter==="platform"?"Image source":"Maximum cloudiness",backAction:!0,closeAction:!1,onBack:t.goBack},{content:C(()=>[t.currentFilter==="platform"?(y(),I(Te,{key:0},{default:C(()=>{var a;return[L(l,{formatLine1:h=>h.title,formatLine2:h=>"Multiband satellite imagery (missing description)",selected:(a=i.selectedFilters.platform)==null?void 0:a.value,load:o.getPlatformOptions,onChange:e[0]||(e[0]=h=>(i.platforms=[h],o.onChange(i.platforms,"platform"),o.submit()))},null,8,["formatLine1","formatLine2","selected","load"])]}),_:1})):t.currentFilter==="cloudiness"?(y(),I(Te,{key:1},{default:C(()=>{var a;return[L(r,{selected:((a=i.selectedFilters.cloudiness)==null?void 0:a.value)/100,onChange:e[1]||(e[1]=h=>(o.onChange(Math.round(h*100),"cloudiness"),o.submit())),onCustom:e[2]||(e[2]=h=>i.showCloudinessDialog=!0)},null,8,["selected"])]}),_:1})):M("",!0)]),_:1},8,["title","onBack"]),t.modalElement?(y(),I(ae,{key:0,to:t.modalElement},[i.showCloudinessDialog?(y(),I(u,{key:0,cloudiness:Math.round((d=i.selectedFilters.cloudiness)==null?void 0:d.value),onCloudiness:e[3]||(e[3]=a=>(o.onChange(Math.round(a),"cloudiness"),o.submit(),i.showCloudinessDialog=!1)),onClose:e[4]||(e[4]=a=>i.showCloudinessDialog=!1)},null,8,["cloudiness"])):M("",!0)],8,["to"])):M("",!0)],64)}const vs=j(Ss,[["render",xs]]);function wt(n,e,t){t===void 0&&(t={});var s={type:"Feature"};return(t.id===0||t.id)&&(s.id=t.id),t.bbox&&(s.bbox=t.bbox),s.properties=e||{},s.geometry=n,s}function Is(n,e,t){t===void 0&&(t={});for(var s=0,i=n;s<i.length;s++){var o=i[s];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<o[o.length-1].length;l++)if(o[o.length-1][l]!==o[0][l])throw new Error("First and last Position are not equivalent.")}var r={type:"Polygon",coordinates:n};return wt(r,e,t)}function bs(n,e,t){t===void 0&&(t={});var s={type:"MultiPolygon",coordinates:n};return wt(s,e,t)}function Ze(n){return n.type==="Feature"?n.geometry:n}class Z{constructor(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}}function _s(n,e){return n>e?1:n<e?-1:0}function J(n,e,t){const s=new Z(null,null);let i=s,o=s;for(;;){const l=t(n,e.key);if(l<0){if(e.left===null)break;if(t(n,e.left.key)<0){const r=e.left;if(e.left=r.right,r.right=e,e=r,e.left===null)break}o.left=e,o=e,e=e.left}else if(l>0){if(e.right===null)break;if(t(n,e.right.key)>0){const r=e.right;if(e.right=r.left,r.left=e,e=r,e.right===null)break}i.right=e,i=e,e=e.right}else break}return i.right=e.left,o.left=e.right,e.left=s.right,e.right=s.left,e}function Ce(n,e,t,s){const i=new Z(n,e);if(t===null)return i.left=i.right=null,i;t=J(n,t,s);const o=s(n,t.key);return o<0?(i.left=t.left,i.right=t,t.left=null):o>=0&&(i.right=t.right,i.left=t,t.right=null),i}function et(n,e,t){let s=null,i=null;if(e){e=J(n,e,t);const o=t(e.key,n);o===0?(s=e.left,i=e.right):o<0?(i=e.right,e.right=null,s=e):(s=e.left,e.left=null,i=e)}return{left:s,right:i}}function Es(n,e,t){return e===null?n:(n===null||(e=J(n.key,e,t),e.left=n),e)}function Ae(n,e,t,s,i){if(n){s(`${e}${t?"└── ":"├── "}${i(n)}
2`);const o=e+(t?"    ":"│   ");
2n.left&&Ae(n.left,o,!1,s,i),n.right&&Ae(n.right,o,!0,s,i)}}class He{constructor(e=_s){this._root=null,this._size=0,this._comparator=e}insert(e,t){return this._size++,this._root=Ce(e,t,this._root,this._comparator)}add(e,t){const s=new Z(e,t);this._root===null&&(s.left=s.right=null,this._size++,this._root=s);const i=this._comparator,o=J(e,this._root,i),l=i(e,o.key);return l===0?this._root=o:(l<0?(s.left=o.left,s.right=o,o.left=null):l>0&&(s.right=o.right,s.left=o,o.right=null),this._size++,this._root=s),this._root}remove(e){this._root=this._remove(e,this._root,this._comparator)}_remove(e,t,s){let i;return t===null?null:(t=J(e,t,s),s(e,t.key)===0?(t.left===null?i=t.right:(i=J(e,t.left,s),i.right=t.right),this._size--,i):t)}pop(){let e=this._root;if(e){for(;e.left;)e=e.left;return this._root=J(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null}findStatic(e){let t=this._root;const s=this._comparator;for(;t;){const i=s(e,t.key);if(i===0)return t;i<0?t=t.left:t=t.right}return null}find(e){return this._root&&(this._root=J(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root}contains(e){let t=this._root;const s=this._comparator;for(;t;){const i=s(e,t.key);if(i===0)return!0;i<0?t=t.left:t=t.right}return!1}forEach(e,t){let s=this._root;const i=[];let o=!1;for(;!o;)s!==null?(i.push(s),s=s.left):i.length!==0?(s=i.pop(),e.call(t,s),s=s.right):o=!0;return this}range(e,t,s,i){const o=[],l=this._comparator;let r=this._root,c;for(;o.length!==0||r;)if(r)o.push(r),r=r.left;else{if(r=o.pop(),c=l(r.key,t),c>0)break;if(l(r.key,e)>=0&&s.call(i,r))return this;r=r.right}return this}keys(){const e=[];return this.forEach(({key:t})=>{e.push(t)}),e}values(){const e=[];return this.forEach(({data:t})=>{e.push(t)}),e}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}at(e){let t=this._root,s=!1,i=0;const o=[];for(;!s;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),i===e)return t;i++,t=t.right}else s=!0;return null}next(e){let t=this._root,s=null;if(e.right){for(s=e.right;s.left;)s=s.left;return s}const i=this._comparator;for(;t;){const o=i(e.key,t.key);if(o===0)break;o<0?(s=t,t=t.left):t=t.right}return s}prev(e){let t=this._root,s=null;if(e.left!==null){for(s=e.left;s.right;)s=s.right;return s}const i=this._comparator;for(;t;){const o=i(e.key,t.key);if(o===0)break;o<0?t=t.left:(s=t,t=t.right)}return s}clear(){return this._root=null,this._size=0,this}toList(){return Ls(this._root)}load(e,t=[],s=!1){let i=e.length;const o=this._comparator;if(s&&Oe(e,t,0,i-1,o),this._root===null)this._root=De(e,t,0,i),this._size=i;else{const l=Cs(this.toList(),ws(e,t),o);i=this._size+i,this._root=Be({head:l},0,i)}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(e=t=>String(t.key)){const t=[];return Ae(this._root,"",!0,s=>t.push(s),e),t.join("")}update(e,t,s){const i=this._comparator;let{left:o,right:l}=et(e,this._root,i);i(e,t)<0?l=Ce(t,s,l,i):o=Ce(t,s,o,i),this._root=Es(o,l,i)}split(e){return et(e,this._root,this._comparator)}*[Symbol.iterator](){let e=this._root;const t=[];let s=!1;for(;!s;)e!==null?(t.push(e),e=e.left):t.length!==0?(e=t.pop(),yield e,e=e.right):s=!0}}function De(n,e,t,s){const i=s-t;if(i>0){const o=t+Math.floor(i/2),l=n[o],r=e[o],c=new Z(l,r);return c.left=De(n,e,t,o),c.right=De(n,e,o+1,s),c}return null}function ws(n,e){const t=new Z(null,null);let s=t;for(let i=0;i<n.length;i++)s=s.next=new Z(n[i],e[i]);return s.next=null,t.next}function Ls(n){let e=n;const t=[];let s=!1;const i=new Z(null,null);let o=i;for(;!s;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):s=!0;return o.next=null,i.next}function Be(n,e,t){const s=t-e;if(s>0){const i=e+Math.floor(s/2),o=Be(n,e,i),l=n.head;return l.left=o,n.head=n.head.next,l.right=Be(n,i+1,t),l}return null}function Cs(n,e,t){const s=new Z(null,null);let i=s,o=n,l=e;for(;o!==null&&l!==null;)t(o.key,l.key)<0?(i.next=o,o=o.next):(i.next=l,l=l.next),i=i.next;return o!==null?i.next=o:l!==null&&(i.next=l),s.next}function Oe(n,e,t,s,i){if(t>=s)return;const o=n[t+s>>1];let l=t-1,r=s+1;for(;;){do l++;while(i(n[l],o)<0);do r--;while(i(n[r],o)>0);if(l>=r)break;let c=n[l];n[l]=n[r],n[r]=c,c=e[l],e[l]=e[r],e[r]=c}Oe(n,e,t,r,i),Oe(n,e,r+1,s,i)}var Lt={};const re=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Ve=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;const t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,s=n.ur.x<e.ur.x?n.ur.x:e.ur.x,i=n.ll.y<e.ll.y?e.ll.y:n.ll.y,o=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return{ll:{x:t,y:i},ur:{x:s,y:o}}};let X=Number.EPSILON;X===void 0&&(X=Math.pow(2,-52));const Ms=X*X,tt=(n,e)=>{if(-X<n&&n<X&&-X<e&&e<X)return 0;const t=n-e;return t*t<Ms*n*e?0:n<e?-1:1};class ks{constructor(){this.reset()}reset(){this.xRounder=new it,this.yRounder=new it}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class it{constructor(){this.tree=new He,this.round(0)}round(e){const t=this.tree.add(e),s=this.tree.prev(t);if(s!==null&&tt(t.key,s.key)===0)return this.tree.remove(e),s.key;const i=this.tree.next(t);return i!==null&&tt(t.key,i.key)===0?(this.tree.remove(e),i.key):e}}const he=new ks,ge=(n,e)=>n.x*e.y-n.y*e.x,Ct=(n,e)=>n.x*e.x+n.y*e.y,st=(n,e,t)=>{const s=Bi(n.x,n.y,e.x,e.y,t.x,t.y);return s>0?-1:s<0?1:0},Se=n=>Math.sqrt(Ct(n,n)),Ps=(n,e,t)=>{const s={x:e.x-n.x,y:e.y-n.y},i={x:t.x-n.x,y:t.y-n.y};return ge(i,s)/Se(i)/Se(s)},Ts=(n,e,t)=>{const s={x:e.x-n.x,y:e.y-n.y},i={x:t.x-n.x,y:t.y-n.y};return Ct(i,s)/Se(i)/Se(s)},nt=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},ot=(n,e,t)=>
2e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},Rs=(n,e,t,s)=>{if(e.x===0)return ot(t,s,n.x);if(s.x===0)return ot(n,e,t.x);if(e.y===0)return nt(t,s,n.y);if(s.y===0)return nt(n,e,t.y);const i=ge(e,s);if(i==0)return null;const o={x:t.x-n.x,y:t.y-n.y},l=ge(o,e)/i,r=ge(o,s)/i,c=n.x+r*e.x,u=t.x+l*s.x,d=n.y+r*e.y,a=t.y+l*s.y,h=(c+u)/2,f=(d+a)/2;return{x:h,y:f}};class z{static compare(e,t){const s=z.comparePoints(e.point,t.point);return s!==0?s:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:K.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let s=0,i=t.length;s<i;s++){const o=t[s];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const s=this.point.events[t];if(s.segment.consumedBy===void 0)for(let i=t+1;i<e;i++){const o=this.point.events[i];o.consumedBy===void 0&&s.otherSE.point.events===o.otherSE.point.events&&s.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,s=this.point.events.length;t<s;t++){const i=this.point.events[t];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&e.push(i)}return e}getLeftmostComparator(e){const t=new Map,s=i=>{const o=i.otherSE;t.set(i,{sine:Ps(this.point,e.point,o.point),cosine:Ts(this.point,e.point,o.point)})};return(i,o)=>{t.has(i)||s(i),t.has(o)||s(o);const{sine:l,cosine:r}=t.get(i),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?r<u?1:r>u?-1:0:l<0&&c<0?r<u?-1:r>u?1:0:c<l?-1:c>l?1:0}}}let Fs=0;class K{static compare(e,t){const s=e.leftSE.point.x,i=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<s)return 1;if(o<i)return-1;const r=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,d=t.rightSE.point.y;if(s<i){if(c<r&&c<u)return 1;if(c>r&&c>u)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const h=t.comparePoint(e.rightSE.point);return h!==0?h:-1}if(s>i){if(r<c&&r<d)return-1;if(r>c&&r>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const h=e.comparePoint(t.rightSE.point);return h<0?1:h>0?-1:1}if(r<c)return-1;if(r>c)return 1;if(o<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-r,h=o-s,f=d-c,S=l-i;if(a>h&&f<S)return 1;if(a<h&&f>S)return-1}return o>l?1:o<l||u<d?-1:u>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,s,i){this.id=++Fs,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=s,this.windings=i}
2static fromRing(e,t,s){let i,o,l;const r=z.comparePoints(e,t);if(r<0)i=e,o=t,l=1;else if(r>0)i=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new z(i,!0),u=new z(o,!1);return new K(c,u,[s],[l])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,s=this.rightSE.point,i=this.vector();if(t.x===s.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/i.y,l=t.x+o*i.x;if(e.x===l)return 0;const r=(e.x-t.x)/i.x,c=t.y+r*i.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),s=e.bbox(),i=Ve(t,s);if(i===null)return null;const o=this.leftSE.point,l=this.rightSE.point,r=e.leftSE.point,c=e.rightSE.point,u=re(t,r)&&this.comparePoint(r)===0,d=re(s,o)&&e.comparePoint(o)===0,a=re(t,c)&&this.comparePoint(c)===0,h=re(s,l)&&e.comparePoint(l)===0;if(d&&u)return h&&!a?l:!h&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return h&&l.x===r.x&&l.y===r.y?null:r;if(h&&a)return null;if(h)return l;if(a)return c;const f=Rs(o,this.vector(),r,e.vector());return f===null||!re(i,f)?null:he.round(f.x,f.y)}split(e){const t=[],s=e.events!==void 0,i=new z(e,!0),o=new z(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(i);const r=new K(i,l,this.rings.slice(),this.windings.slice());return z.comparePoints(r.leftSE.point,r.rightSE.point)>0&&r.swapEvents(),z.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),s&&(i.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,s=this.windings.length;t<s;t++)this.windings[t]*=-1}consume(e){let t=this,s=e;for(;t.consumedBy;)t=t.consumedBy;for(;s.consumedBy;)s=s.consumedBy;const i=K.compare(t,s);if(i!==0){if(i>0){const o=t;t=s,s=o}if(t.prev===s){const o=t;t=s,s=o}for(let o=0,l=s.rings.length;o<l;o++){const r=s.rings[o],c=s.windings[o],u=t.rings.indexOf(r);u===-1?(t.rings.push(r),t.windings.push(c)):t.windings[u]+=c}s.rings=null,s.windings=null,s.consumedBy=t,s.leftSE.consumedBy=t.leftSE,s.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,s=this._afterState.windings,i=this._afterState.multiPolys;for(let r=0,c=this.rings.length;r<c;r++){const u=this.rings[r],d=this.windings[r],a=t.indexOf(u);a===-1?(t.push(u),s.push(d)):s[a]+=d}const o=[],l=[];for(let r=0,c=t.length;r<c;r++){if(s[r]===0)continue;const u=t[r],d=u.poly;if(l.indexOf(d)===-1)if(u.isExterior)o.push(d);else{l.indexOf(d)===-1&&l.push(d);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let r=0,c=o.length;r<c;r++){const u=o[r].multiPoly;i.indexOf(u)===-1&&i.push(u)}return this._afterState}
2isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(Y.type){case"union":{const s=e.length===0,i=t.length===0;this._isInResult=s!==i;break}case"intersection":{let s,i;e.length<t.length?(s=e.length,i=t.length):(s=t.length,i=e.length),this._isInResult=i===Y.numMultiPolys&&s<i;break}case"xor":{const s=Math.abs(e.length-t.length);this._isInResult=s%2===1;break}case"difference":{const s=i=>i.length===1&&i[0].isSubject;this._isInResult=s(e)!==s(t);break}default:throw new Error(`Unrecognized operation type found ${Y.type}`)}return this._isInResult}}class rt{constructor(e,t,s){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=s,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=he.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let o=i;for(let l=1,r=e.length;l<r;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=he.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(K.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(K.fromRing(o,i,this))}getSweepEvents(){const e=[];for(let t=0,s=this.segments.length;t<s;t++){const i=this.segments[t];e.push(i.leftSE),e.push(i.rightSE)}return e}}class As{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new rt(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let s=1,i=e.length;s<i;s++){const o=new rt(e[s],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,s=this.interiorRings.length;t<s;t++){const i=this.interiorRings[t].getSweepEvents();for(let o=0,l=i.length;o<l;o++)e.push(i[o])}return e}}class lt{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let s=0,i=e.length;s<i;s++){const o=new As(e[s],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,s=this.polys.length;t<s;t++){const i=this.polys[t].getSweepEvents();for(let o=0,l=i.length;o<l;o++)e.push(i[o])}return e}}class xe{static factory(e){const t=[];for(let s=0,i=e.length;s<i;s++){const o=e[s];if(!o.isInResult()||o.ringOut)continue;let l=null,r=o.leftSE,c=o.rightSE;const u=[r],d=r.point,a=[];for(;l=r,r=c,u.push(r),r.point!==d;)for(;;){const h=r.getAvailableLinkedEvents();if(h.length===0){const p=u[0].point,g=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${g.x}, ${g.y}].`)}if(h.length===1){c=h[0].otherSE;break}let f=null;for(let p=0,g=a.length;p<g;p++)if(a[p].point===r.point){f=p;break}if(f!==null){const p=a.splice(f)[0],g=u.splice(p.index);g.unshift(g[0].otherSE),t.push(new xe(g.reverse()));continue}a.push({index:u.length,point:r.point});const S=r.getLeftmostComparator(l);c=h.sort(S)[0].otherSE;break}t.push(new xe(u))}return t}constructor(e){this.events=e;for(let t=0,s=e.length;t<s;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let u=1,d=this.events.length-1;u<d;u++){const a=this.events[u].point,h=this.events[u+1].point;
2st(a,e,h)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const s=t[0],i=t[1];st(s,e,i)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,r=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=r;u+=o)c.push([t[u].x,t[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let i=1,o=this.events.length;i<o;i++){const l=this.events[i];z.compare(e,l)>0&&(e=l)}let t=e.segment.prevInResult(),s=t?t.prevInResult():null;for(;;){if(!t)return null;if(!s)return t.ringOut;if(s.ringOut!==t.ringOut)return s.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=s.prevInResult(),s=t?t.prevInResult():null}}}class at{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,s=this.interiorRings.length;t<s;t++){const i=this.interiorRings[t].getGeom();i!==null&&e.push(i)}return e}}class Ds{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,s=this.polys.length;t<s;t++){const i=this.polys[t].getGeom();i!==null&&e.push(i)}return e}_composePolys(e){const t=[];for(let s=0,i=e.length;s<i;s++){const o=e[s];if(!o.poly)if(o.isExteriorRing())t.push(new at(o));else{const l=o.enclosingRing();l.poly||t.push(new at(l)),l.poly.addInterior(o)}}return t}}class Bs{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:K.compare;this.queue=e,this.tree=new He(t),this.segments=[]}process(e){const t=e.segment,s=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),s;const i=e.isLeft?this.tree.add(t):this.tree.find(t);if(!i)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=i,l=i,r,c;for(;r===void 0;)o=this.tree.prev(o),o===null?r=null:o.key.consumedBy===void 0&&(r=o.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(r){const a=r.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!r.isAnEndpoint(a))){const h=this._splitSafely(r,a);for(let f=0,S=h.length;f<S;f++)s.push(h[f])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const h=this._splitSafely(c,a);for(let f=0,S=h.length;f<S;f++)s.push(h[f])}}if(u!==null||d!==null){let a=null;u===null?a=d:d===null?a=u:a=z.comparePoints(u,d)<=0?u:d,this.queue.remove(t.rightSE),s.push(t.rightSE);const h=t.split(a);for(let f=0,S=h.length;f<S;f++)s.push(h[f])}s.length>0?(this.tree.remove(t),s.push(e)):(this.segments.push(t),t.prev=r)}else{if(r&&c){const u=r.getIntersection(c);if(u!==null){if(!r.isAnEndpoint(u)){const d=this._splitSafely(r,u);for(let a=0,h=d.length;a<h;a++)s.push(d[a])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let a=0,h=d.length;a<h;a++)s.push(d[a])}}}this.tree.remove(t)}return s}_splitSafely(e,t){this.tree.remove(e);const s=e.rightSE;this.queue.remove(s);const i=e.split(t);return i.push(s),e.consumedBy===void 0&&this.tree.add(e),i}}const ct=typeof process<"u"&&Lt.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Os=typeof process<"u"&&Lt.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Vs{run(e,t,s){Y.type=e,he.reset();const i=[new lt(t,!0)];for(let a=0,h=s.length;a<h;a++)i.push(new lt(s[a],!1));if(Y.numMultiPolys=i.length,Y.type==="difference"){const a=i[0];let h=1;for(;h<i.length;)Ve(i[h].bbox,a.bbox)!==null?h++:i.splice(h,1)}if(Y.type==="intersection")for(let a=0,h=i.length;a<h;a++){const f=i[a];for(let S=a+1,p=i.length;S<p;S++)if(Ve(f.bbox,i[S].bbox)===null)return[]}const o=new He(z.compare);for(let a=0,h=i.length;a<h;a++){const f=i[a].getSweepEvents();for(let S=0,p=f.length;S<p;S++)if(o.insert(f[S]),o.size>ct)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Bs(o);let r=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===r){const f=a.segment;
2throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${f.id} [${f.leftSE.point.x}, ${f.leftSE.point.y}] -> [${f.rightSE.point.x}, ${f.rightSE.point.y}] from queue.`)}if(o.size>ct)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Os)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const h=l.process(a);for(let f=0,S=h.length;f<S;f++){const p=h[f];p.consumedBy===void 0&&o.insert(p)}r=o.size,c=o.pop()}he.reset();const u=xe.factory(l.segments);return new Ds(u).getGeom()}}const Y=new Vs,Gs=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return Y.run("union",n,t)},Ns=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return Y.run("intersection",n,t)},Hs=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return Y.run("xor",n,t)},js=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return Y.run("difference",n,t)};var zs={union:Gs,intersection:Ns,xor:Hs,difference:js};function Ys(n,e,t){t===void 0&&(t={});var s=Ze(n),i=Ze(e),o=zs.intersection(s.coordinates,i.coordinates);return o.length===0?null:o.length===1?Is(o[0],t.properties):bs(o,t.properties)}class $s{constructor(e,t,{onItemSelected:s=null,onItemHovered:i=null},o){this.STROKE_WIDTH=1.7,this._callbacks={onItemSelected:s,onItemHovered:i},this._map=e,this._aoi=o,this._previewLayerGroup=new $e({layers:new Ie}),this._fpStyle=new ne({stroke:new be({color:"rgba(235, 255, 0, 0)",width:this.STROKE_WIDTH}),fill:new fe({color:"rgba(0,0,0,0)"})}),this._aoiSource=new _e({features:new ee().readFeatures(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}),this._footprintLayer=new Qe({source:new _e({features:new Ie}),style:this._fpStyle}),this._aoiLayer=new Qe({source:this._aoiSource,style:new ne({stroke:new be({color:"rgba(240, 25, 21, 1)",width:this.STROKE_WIDTH}),fill:new fe({color:"rgba(0,0,0,0)"})})}),this._hoverLayer=new ci({source:new _e,style:new ne({stroke:new be({color:"#1D4ED8",width:this.STROKE_WIDTH+1})})}),this._lastHoveredFeature=null,this._selectedItem=null,this._hoveredGeoJSON=null,this._mainLg=new $e({layers:new Ie([this._previewLayerGroup,this._footprintLayer,this._aoiLayer,this._hoverLayer])}),this._maskStyle=new ne({fill:new fe({color:"black"})}),this._aoiGeoJSON=t,this._onPointerMove=this._onPointerMove.bind(this),this._onMapClick=this._onMapClick.bind(this),this._map.addLayer(this._mainLg),this._map.on("pointermove",this._onPointerMove),this._map.on("click",this._onMapClick)}_parseCoords(e,t,s,i){if(Array.isArray(e[0]))return e.map(a=>this._parseCoords(a,t,s,i));const[o,l]=e,[r,c,u,d]=i;return[(o-r)/(u-r)*t,s-(l-c)/(d-c)*s]}_createImageLoader(e,t){return(s,i)=>{this._aoiGeoJSON;const o=new Image;o.onload=l=>{const r=new ee().readGeometry(e.footprintFrame).getExtent(),c=t.geometry.coordinates.map(f=>this._parseCoords(f,o.width,o.height,r)),u=document.createElement("canvas");u.width=o.width,u.height=o.height;const d=u.getContext("2d"),a=ui(d,{size:[o.width,o.height]});a.setFillStrokeStyle(new fe({color:"black"})),a.drawGeometry(new ee().readGeometry({type:t.geometry.type,coordinates:c})),d.globalCompositeOperation="source-in";const h=hi;d.scale(h,h),d.drawImage(o,0,0),d.globalCompositeOperation="source-over",d.scale(1,1),s.getImage().src=u.toDataURL()},o.crossOrigin="use-credentials",o.src=i}}async _onMapClick(e){const t=this._aoiLayer,s=this._map.hasFeatureAtPixel(e.pixel,{layerFilter(o){return o===t}});if(this._callbacks.onItemSelected){const o=await this._getFeatureOnPixel(e);if(s){var i=this._map.getCoordinateFromPixel(e.pixel);const l=di(i,"EPSG:3857","EPSG:4326");this._callbacks.onItemSelected(o?o.getProperties().item:null,l)}else this._callbacks.onItemSelected(null);o?(this._selectedItem=o.getProperties().item,this._lastHoveredFeature!==o&&(this._lastHoveredFeature&&this._hoverLayer.getSource().clear(),o&&this._hoverLayer.getSource().addFeature(o),this._lastHoveredFeature=o)):this._selectedItem=null}}async _getFeatureOnPixel(e){const t=this._aoiLayer,s=this._footprintLayer,i=this._map.hasFeatureAtPixel(e.pixel,{layerFilter(l){return l===t}});let o;if(i)try{const l=await s.getFeatures(e.pixel);l&&l.length&&(o=l[0])}catch{}return o}async _onPointerMove(e){const t=await this._getFeatureOnPixel(e);this._lastHoveredFeature!==t&&(this._lastHoveredFeature&&this._hoverLayer.getSource().clear(),t&&this._hoverLayer.getSource().addFeature(t),this._lastHoveredFeature=t)}toggle(e,t){const s=this._footprintLayer.getSource(),i=s.getFeaturesCollection(),o=s.getFeatureById(e),l=i.getArray().findIndex(u=>u===o),r=this._previewLayerGroup.getLayers().item(l),c=typeof t>"u"?r.getVisible():!t;o.setStyle(c?new ne(null):null),r.setVisible(!c)}
2add(e,t){const s=e.footprint,i=Ys(s,this._aoiGeoJSON),o=new ee().readGeometry(e.footprintFrame,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}),l=new ee().readGeometry(s,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}),r=new mi(l);r.setProperties({item:e,intersection:i}),r.setId(e.id);const c=o.getExtent(),u=e.getThumbnailUrl(this._aoi.id),d=new Vi({source:new Yi({url:u,imageExtent:c,imageLoadFunction:this._createImageLoader(e,i)})}),a=this._footprintLayer.getSource().getFeaturesCollection();typeof t>"u"&&(t=a.getLength()),t=Math.max(0,Math.min(t,a.getLength())),a.insertAt(t,r),d.setProperties({id:e.id,itemId:e.id}),this._previewLayerGroup.getLayers().insertAt(t,d)}remove(e){const t=this._footprintLayer.getSource(),s=t.getFeatureById(e),i=t.getFeaturesCollection(),o=i.getArray().findIndex(r=>r===s);this._previewLayerGroup.getLayers().removeAt(o),i.removeAt(o)}removeAll(){const t=this._footprintLayer.getSource().getFeaturesCollection();this._previewLayerGroup.getLayers().clear(),t.clear()}zoom(e){const s=this._footprintLayer.getSource().getFeatureById(e).getProperties(),{item:i,intersection:o}=s,l=new ee().readGeometry(o.geometry,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}).getExtent(),r=[10,10,10,10];fi(this._map,l,{duration:500,maxZoom:10,padding:r,paddingUnit:"%"})}setOpacity(e,t){if(t=Math.min(Math.max(0,t),1),!e){this._previewLayerGroup.setOpacity(t);return}t=Math.min(Math.max(0,t),1),this._previewLayerGroup.getLayers().getArray().find(i=>i.get("id")===e).setOpacity(t)}getOpacity(e){const t=e?this._previewLayerGroup.getLayers().getArray().find(s=>s.get("id")===e):this._previewLayerGroup;return t.getVisible()?t.getOpacity():0}highlight(e){const t=typeof e>"u"||e===null;this._previewLayerGroup.getLayers().getArray().forEach(s=>{const i=s.get("id"),o=t||i===e?1:.45;s.setOpacity(o)})}zoomToMask(){const e=this._aoiSource.getExtent();this._map.getView().fit(e,{duration:500})}hoverGeoJSON(e){if(this._hoveredGeoJSON!==e){const t=new ee().readFeatures(e,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})[0];this._lastHoveredFeature&&this._hoverLayer.getSource().clear(),t&&this._hoverLayer.getSource().addFeature(t),this._lastHoveredFeature=t}}moveTo(e,t){const s=this._footprintLayer.getSource(),i=s.getFeaturesCollection(),o=s.getFeatureById(e),l=i.getArray().findIndex(u=>u===o);if(l===-1)return;t=Math.min(Math.max(t,0),i.getLength()-1),i.removeAt(l),i.insertAt(t,o);const r=this._previewLayerGroup.getLayers(),c=r.removeAt(l);r.insertAt(t,c)}destroy(){this._map.removeLayer(this._mainLg),this._map.un("pointermove",this._onPointerMove),this._map.un("click",this._onMapClick)}}const qs={text:null,value:null,checked:!1},Us=()=>({aoi:{...qs}}),Ws={name:"NewMosaic",components:{EButton:Q,AoiSelectionList:yt,ListCard:de},props:{goBack:{type:Function},aoi:{type:Object}},emits:["cardStatus","submit","change"],data(){return{showFulltext:!1,bottomSheetSizeType:"m",aois:this.aoi?[this.aoi]:[],selectedFilters:{...Us()},EAppbarVariants:Re.Variants,buttonVariants:Q.Variants}},watch:{aoi(){this.aois=this.aoi?[this.aoi]:[]}},methods:{async postNewAoi(){var e;const n=await gi.create(null,(e=this.$route.query)==null?void 0:e.workspace);this.$router.push({name:"aoi-detail",params:{id:n.data}})},resetAllFilters(){this.aois=[],this.onChange()},changeSelectedItems(n){this.aois=n,this.$emit("change",this.aois)},getAoiOptions(n){return new Promise((e,t)=>{H.getAoiList(n).then(s=>{e(s.data)}).catch(s=>{t(s),console.error(s)})})},toggleDropdown(n){n&&this.openedFilter===n?this.openedFilter=null:this.openedFilter=n},cancelSelection(){this.selectedFilters.aoi.text=null,this.selectedFilters.aoi.checked=!1}}};function Js(n,e,t,s,i,o){const l=v("AoiSelectionList"),r=v("EButton"),c=v("ListCard");return y(),I(c,{title:"Select area of interest",backAction:!0,closeAction:!1,onBack:t.goBack},{content:C(()=>{var u,d;return[L(l,{filters:{workspace:(u=n.$route.query)==null?void 0:u.workspace,accessMode:1},selected:(d=t.aoi)==null?void 0:d.id,onChange:e[0]||(e[0]=a=>o.changeSelectedItems([a]))},null,8,["filters","selected"])]}),actions:C(()=>[L(r,{onClick:o.postNewAoi,labelText:"Add area of interest",variant:i.buttonVariants.TEXT},null,8,["onClick","variant"])]),_:1},8,["onBack"])}const Xs=j(Ws,[["render",Js]]);let Mt=new Date;const Ks=Mt.toISOString().split("T")[0];let te=new Date,Me=Mt.getMonth();Me-3<0?(te.setMonth(Me-3+12),te.setFullYear(te.getFullYear()-1)):te.setMonth(Me-3);te=te.toISOString().split("T")[0];const Qs={name:"ChooseDate",components:{EDatePicker:St,EButton:Q,ListCard:de},emits:["cardStatus","submit"],props:{fromDate:{type:String},toDate:{type:String},goBack:{type:Function}},mounted(){this.$emit("cardStatus",{visible:!0,bottomSheetSizeStyle:"height: 80%; border-radius: 8px 8px 0px 0px;",size:"full",hiddenGlobalBar:!0})},data(){return{errorMsg:null,bottomSheetSizeType:"full",selectedFilters:{fromDateValue:{value:this.fromDate?this.fromDate:te},toDateValue:{value:this.toDate?this.toDate:Ks}},dateFormat:this.$store.state.dateFormat,buttonVariants:Q.Variants}}};function Zs(n,e,t,s,i,o){const l=v("EDatePicker"),r=v("EButton"),c=v("ListCard");return y(),I(c,{title:"Sensing dates",backAction:!0,closeAction:!1,onBack:t.goBack}
2,{content:C(()=>[L(l,{"onUpdate:fromDateValue":e[0]||(e[0]=u=>i.selectedFilters.fromDateValue.value=u),"onUpdate:toDateValue":e[1]||(e[1]=u=>i.selectedFilters.toDateValue.value=u),fromDateValue:i.selectedFilters.fromDateValue.value,toDateValue:i.selectedFilters.toDateValue.value,range:""},null,8,["fromDateValue","toDateValue"])]),actions:C(()=>[L(r,{onClick:e[2]||(e[2]=()=>n.$emit("submit",i.selectedFilters)),labelText:"Choose sorting preference",variant:i.buttonVariants.TEXT},null,8,["variant"])]),_:1},8,["onBack"])}const en=j(Qs,[["render",Zs]]),tn={name:"Preferences",components:{SmartList:Ne,ListCard:de},props:{goBack:{type:Function},preference:{type:String}},emits:["submit","cardStatus"],computed:{activeSegmentId(){var n;return(n=this.sortSegments.find(e=>e.value===this.preference))==null?void 0:n.id}},data(){return{sortBy:"cloudiness",sortSegments:[{id:1,value:"Cloudiness",description:"Images with maximum visible area",title:"Less cloudy",icon:"cloud"},{id:2,value:"Sensing date",description:"Images might be cloudy",title:"Most recent",icon:"today"}],bottomSheetSizeType:null}},mounted(){this.$emit("cardStatus",{visible:!0,hiddenGlobalBar:!0,bottomSheetSizeStyle:"height: 50%; border-radius: 8px 8px 0px 0px;"})},methods:{}};function sn(n,e,t,s,i,o){const l=v("SmartList"),r=v("ListCard");return y(),I(r,{title:"Sorting preference",backAction:!0,closeAction:!1,onBack:t.goBack},{content:C(()=>[(y(),I(Te,null,{default:C(()=>[L(l,{formatLine1:c=>c.title,formatLine2:c=>c.description,getLeadingIcon:c=>c.icon,load:async()=>i.sortSegments,selected:o.activeSegmentId,onChange:e[0]||(e[0]=c=>n.$emit("submit",c.value))},null,8,["formatLine1","formatLine2","getLeadingIcon","load","selected"])]),_:1}))]),_:1},8,["onBack"])}const nn=j(tn,[["render",sn]]),on={components:{Draggable:yi,EList:Fe,EListItem:xt},props:{listItems:{type:Array},apiUrl:{type:String},selectable:{type:Boolean,default:!0},aoi:{type:pi}},emits:["updateModelValue","mouseEnter","mouseClick","moveItem","visibility","cardStatus"],data(){return{selected:this.listItems.reduce((n,e)=>Object.assign(n,{[e.id]:!0}),{})}},mounted(){this.$emit("cardStatus",{visible:!0,hiddenGlobalBar:!0,bottomSheetSizeStyle:"height: auto; border-radius: 8px 8px 0px 0px;"})},methods:{onEnd(n){const e=n.clone.id,t=n.newIndex;this.$emit("moveItem",{id:e,position:t})},createDateTimeFormat(n){const e=W(new Date(n),"DD/MM/YY",!0).split(" ");return`${e[0]} at ${e[1]}`},selectItem(n){this.selected[n.id]=!this.selected[n.id],this.$emit("visibility",n.id,this.selected[n.id])}}};function rn(n,e,t,s,i,o){const l=v("EListItem"),r=v("Draggable"),c=v("EList");return y(),I(c,null,{default:C(()=>[n.$store.state.mobileLayout?(y(!0),V(ie,{key:1},ye(t.listItems,u=>(y(),I(l,{id:u.id,key:u.id,title:o.createDateTimeFormat(u.sensingTime),label:`${parseInt(u.cloudCoverage)}% cloudiness`,"onClick:listItem":()=>n.$emit("mouseClick",u),image:`${u.getThumbnailUrl(this.aoi.id)}`,showImagePlaceholder:!0,trailingIcon:t.selectable&&i.selected[u.id]?"check_box_full":"check_box_outline_blank","onClick:trailingItem":d=>t.selectable&&o.selectItem(u),onMouseover:()=>n.$emit("mouseEnter",u)},null,8,["id","title","label","onClick:listItem","image","trailingIcon","onClick:trailingItem","onMouseover"]))),128)):(y(),I(r,{key:0,"ghost-class":"ghost",modelValue:t.listItems,"item-key":"id",class:"self-stretch","onUpdate:modelValue":e[0]||(e[0]=u=>n.$emit("updateModelValue",u)),onEnd:e[1]||(e[1]=u=>o.onEnd(u))},{item:C(({element:u})=>[O("div",null,[(y(),I(l,{id:u.id,key:u.id,title:o.createDateTimeFormat(u.sensingTime),label:`${parseInt(u.cloudCoverage)}% cloudiness`,"onClick:listItem":()=>n.$emit("mouseClick",u),image:`${u.getThumbnailUrl(this.aoi.id)}`,showImagePlaceholder:!0,trailingIcon:t.selectable&&i.selected[u.id]?"check_box_full":"check_box_outline_blank","onClick:trailingItem":d=>t.selectable&&o.selectItem(u),onMouseover:()=>n.$emit("mouseEnter",u)},null,8,["id","title","label","onClick:listItem","image","trailingIcon","onClick:trailingItem","onMouseover"]))])]),_:1},8,["modelValue"]))]),_:1})}const ln=j(on,[["render",rn]]),an={name:"ScrollToElement",props:{scrollIndex:Number,itemHeight:Number,itemCount:Number},data(){return{scrollPosition:null}},mounted(){setTimeout(()=>{this.scroll()},0)},watch:{scrollIndex(){setTimeout(()=>{this.scroll()},100)}},methods:{scroll(){const n=this.$refs.scrollTo,e=n.clientHeight;this.scrollPosition=this.scrollIndex*this.itemHeight-e/2+this.itemHeight/2,n.scrollTo(0,this.scrollPosition)}}},cn={ref:"scrollTo"};function un(n,e,t,s,i,o){return y(),V("div",cn,[ft(n.$slots,"default")],512)}const hn=j(an,[["render",un]]),dn={emits:["aoi","dateRange","platform","cloudiness","time","submit"],props:{modalElement:{type:Object},customClass:{type:String},aoi:{type:Object},platform:{type:Object},time:{type:Object},fromDate:{type:String},toDate:{type:String},cloudiness:{type:Number,validator(n){return n==null||n>=0&&n<=1}}},data(){return{showCloudinessDialog:!1,cloudinessValue:this.cloudiness,timeList:[{id:0,name:"Day"},{id:1,name:"Night"}]}},methods:{async getPlatforms(){return await H.getPlatforms({canPreselect:!0})},updateFromDate(n){this.$emit("dateRange",n,null)},updateToDate(n){this.$emit("dateRange",null,n)}},computed:{cloudinessText(){return this.cloudiness===1?"Any amount of cloud cover":this.cloudiness===0?"N
2o cloudiness":`${Math.round(this.cloudiness*100)}% or less`}},watch:{cloudiness(){this.cloudinessValue=Math.round(this.cloudiness*100)}},components:{EFilterBar:vi,PopupScrollListWrapper:xi,EChip:gt,EPopupWindow:Si,AoiSelectionList:yt,EDatePicker:St,FilterChipSelectionList:Ci,CloudinessSelectionList:_t,CloudinessPopup:Et}},mn={class:"min-w-[360px]"},fn={class:"min-w-[360px]"},gn={class:"min-w-[360px]"};function pn(n,e,t,s,i,o){const l=v("EChip"),r=v("EDatePicker"),c=v("EPopupWindow"),u=v("FilterChipSelectionList"),d=v("AoiSelectionList"),a=v("PopupScrollListWrapper"),h=v("CloudinessSelectionList"),f=v("EFilterBar"),S=v("CloudinessPopup");return y(),V(ie,null,[L(f,{customClass:t.customClass,scrollable:!0},{default:C(()=>{var p;return[vt(L(c,{mask:n.$store.state.mobileLayout,forceFixed:!0},{activator:C(({toggle:g})=>[L(l,{leadingIcon:"today",labelText:`${t.fromDate||""} - ${t.toDate||""}`,class:"pointer-events-auto",onClick:g},null,8,["labelText","onClick"])]),content:C(()=>[O("div",mn,[L(r,{"onUpdate:fromDateValue":o.updateFromDate,"onUpdate:toDateValue":o.updateToDate,fromDateValue:t.fromDate,toDateValue:t.toDate,range:""},null,8,["onUpdate:fromDateValue","onUpdate:toDateValue","fromDateValue","toDateValue"])])]),_:1},8,["mask"]),[[It,t.fromDate||t.toDate]]),t.platform?(y(),I(u,{key:0,formatLine1:g=>g.name,iconBefore:"satellite",selectedItem:t.platform,load:o.getPlatforms,onChange:e[0]||(e[0]=g=>n.$emit("platform",g))},null,8,["formatLine1","selectedItem","load"])):M("",!0),t.time&&((p=t.platform)==null?void 0:p.valueId)==="landsat_oli_tirs"?(y(),I(u,{key:1,formatLine1:g=>g.name,iconBefore:"light_mode",selectedItem:t.time,data:i.timeList,onChange:e[1]||(e[1]=g=>n.$emit("time",g))},null,8,["formatLine1","selectedItem","data"])):M("",!0),t.aoi?(y(),I(c,{key:2,mask:n.$store.state.mobileLayout,forceFixed:!0},{activator:C(({toggle:g})=>[L(l,{leadingIcon:"shapes",labelText:t.aoi.title||t.aoi.name,disabled:n.$route.query.aoi!==void 0,class:"pointer-events-auto",onClick:g},null,8,["labelText","disabled","onClick"])]),content:C(({close:g,transition:x})=>[O("div",fn,[L(a,null,{default:C(()=>{var b,_;return[L(d,{selected:(b=t.aoi)==null?void 0:b.id,bgFiltersCount:null,transition:x,filters:{workspace:(_=n.$route.query)==null?void 0:_.workspace,accessMode:1},onChange:E=>(n.$emit("aoi",E),g())},null,8,["selected","transition","filters","onChange"])]}),_:2},1024)])]),_:1},8,["mask"])):M("",!0),t.cloudiness>=0?(y(),I(c,{key:3,mask:n.$store.state.mobileLayout,forceFixed:!0},{activator:C(({toggle:g})=>[L(l,{leadingIcon:"cloud",labelText:o.cloudinessText,selected:!1,class:"pointer-events-auto",onClick:g},null,8,["labelText","onClick"])]),content:C(({close:g})=>[O("div",gn,[L(a,null,{default:C(()=>[L(h,{selected:t.cloudiness,onChange:x=>(n.$emit("cloudiness",x),g()),onCustom:x=>(i.showCloudinessDialog=!0,g())},null,8,["selected","onChange","onCustom"])]),_:2},1024)])]),_:1},8,["mask"])):M("",!0)]}),_:1},8,["customClass"]),(y(),I(ae,{to:t.modalElement},[i.showCloudinessDialog?(y(),I(S,{key:0,cloudiness:Math.round(t.cloudiness*100),onCloudiness:e[2]||(e[2]=p=>(n.$emit("cloudiness",p/100),i.showCloudinessDialog=!1)),onClose:e[3]||(e[3]=p=>i.showCloudinessDialog=!1)},null,8,["cloudiness"])):M("",!0)],8,["to"]))],64)}const yn=j(dn,[["render",pn]]),le={IMAGE_LIST:"MOSAIC",MOSAIC_FORM:"EDIT",VISIBILITY:"VISIBILITY"},$={S1:"STEP_1",S2:"STEP_2",S3:"STEP_3",S4:"STEP_4",S5:"STEP_5",S6:"STEP_6"},Sn={setup(){const n=wi("useRouterUtils"),{navBack:e,navLastDirection:t}=n(),{showSnackBar:s,removeSnackBar:i}=Li();return{navBack:e,navLastDirection:t,showSnackBar:s,removeSnackBar:i}},name:"DataSourcesIndex",components:{NewMosaic:Xs,MosaicForm:as,Filters:vs,DraggablePreselection:ln,ChooseDate:en,Preferences:nn,ScrollToElement:hn,CreateMosaicChipSet:yn,VisibilityCard:Mi,ListCard:de,EAppBar:Re,EList:Fe,EListItem:xt,EButton:Q,ContactSupportDialog:Ii},inheritAttrs:!1,emits:["cardStatus","expandBar"],props:{modalElement:Object,navigationElement:{}},data(){const n=this;return{infobarButtonVariants:We.EInfoBarButtonVariants,dateFormatter:W,HISTORY_STEPS:$,actualHistoryStep:$.S1,opacity:1,preselectionPromise:null,infoBarConfig:{get title(){return n.name||"New image mosaic"},label:"Image mosaic preview",get action(){return n.preselectionRequestState==="request"?n.infobarButtonVariants.UPTODATE:n.infobarButtonVariants.CREATE},get forceShowFilters(){return!!n.selectedAoi},get disabledRightAction(){return n.preselectionRequestState==="request"}},bottomSheetSizeType:null,thumbnailPreviewManager:null,showImageList:!1,dayScene:1,metadataList:[],selectionList:[],carouselList:[],preSelectionList:[],activeMetadataItemIndex:null,activeMetadataItem:null,thumbnailToolBarProps:{opacity:{value:100},carousel:{class:"justify-center order-2",selectedItemId:null,images:[]}},filter:null,sortBy:"cloudiness",sortSegments:[{text:"Cloudiness",checked:!0},{text:"Sensing date",checked:!1}
2],VIEWS:le,selectedAoi:null,selectedFromDate:null,selectedToDate:null,requestState:null,preselectionRequestState:null,hoveredMetadata:null,selectedPlatformId:"sentinel-2_msi",selectedFilters:null,apiUrl:H.getApi(),globalMapInstance:this.$store.state.globalMapInstance,carousel:{class:"justify-center order-2",selectedItemId:"a4",images:[]},name:"New image mosaic",description:"",resolution:[],bands:[],successText:"We are downloading your image. It will take a few minutes. Please wait.",failureText:"Something went wrong",selectedPreference:null,emptyGeoJson:!1,lastSelectedMetadataObj:null,lastPoint:null,lastSelectedGeoJson:null,addMonthButtonVisible:!1,subtractMonthButtonVisible:!1,lastSensingTimeLoadMore:null,lastLoadMoreMetadata:!1,lastSensingTimeLoadPrevious:null,lastLoadPreviousMetadata:!1,EAppBarVariants:Re.Variants,listConfigurations:Fe.Configurations,buttonVariants:Q.Variants,showContactSupportDialog:!1}},watch:{selectedPlatformId(n,e){n!==e&&this.fetchCodelist(n,this.dayScene)},dayScene(n,e){n!==e&&this.fetchCodelist(this.selectedPlatformId,n)},selectedFilters:{deep:!0,handler(){this.actualHistoryStep===$.S6&&this.submitPreselection(this.selectedFilters)}},async selectedAoi(){var n,e;!((n=this.selectedAoi)!=null&&n.simpleFeature)&&this.selectedAoi&&await this.fetchAoi(this.selectedAoi.id),this.name=((e=this.selectedAoi)==null?void 0:e.name)||"New image mosaic"},"$route.query.aoi":{immediate:!0,handler(n){n?(this.fetchAoi(n),this.actualHistoryStep=this.HISTORY_STEPS.S2):this.selectedAoi=null}},"$store.state.navigation.activeItemId":{immediate:!1,handler(n){this.onActionToolClick(n)}},tools:{immediate:!0,handler(n){this.$store.commit("navigation/setItems",n)}},displayedView:{immediate:!0,handler(n){this.$store.commit("navigation/setActiveItem",n)}}},computed:{displayedView:{get(){var n;return(n=this.$route.query)==null?void 0:n.view},set(n){this.$emit("cardStatus",{visible:!!n,size:"full",hiddenGlobalBar:!0}),this.$router.replace({name:this.$route.name,params:this.$route.params,query:{...this.$route.query,view:n}})}},tools(){var n,e;return[{id:"MOSAIC",icon:"details",label:"Mosaic"},{id:"VISIBILITY",icon:"visibility",label:"Visibility",disabled:!((n=this.selectionList)!=null&&n.length)},{id:"OUTPUTS",icon:"map",label:"Outputs",disabled:!0},{id:"EDIT",icon:"mode_edit",label:"Edit",disabled:!((e=this.selectionList)!=null&&e.length)},{id:"COPY",icon:"content_copy",label:"Copy",disabled:!0},{id:"SHARE",icon:"share",label:"Share",disabled:!0}]},activeFilters(){return{time:{id:1,text:this.selectedFilters.time.text,icon:"light_mode"},date:{id:2,text:`${this.selectedFromDate} - ${this.selectedToDate}`,icon:"today"},aoi:{id:3,text:this.selectedAoi.title},cloudiness:{id:4,text:`Clouds ${this.selectedFilters.cloudiness.value} or less`,icon:"cloud"},platform:{id:5,text:this.selectedFilters.platform.text,icon:"satellite",valueId:this.selectedFilters.platform.valueId}}}},async mounted(){this.fetchCodelist(this.selectedPlatformId,this.dayScene);const n=new Ei("infoBar","top-left",Ue(We),this.infoBarConfig,{"click:back":()=>{this.navBack()},"click:action":()=>{this.createMosaic()},rendered:e=>{this.$store.commit("setInfoBarContainer",e)}});this.$emit("cardStatus",{visible:!0,size:"full",hiddenGlobalBar:!0}),this.$store.state.globalMapTools.addTool(n)},beforeUnmount(){this.$store.commit("navigation/setItems",null)},unmounted(){this.reset(),this.thumbnailPreviewManager&&this.thumbnailPreviewManager.destroy(),this.$store.state.globalMapTools.removeTool("infoBar")},methods:{async handleChipAoiChange(n){await this.fetchAoi(n.id),this.selectedFilters=this.selectedFilters?Object.assign(this.selectedFilters,{aoi:n==null?void 0:n.id}):{aoi:n==null?void 0:n.id}},createMosaic(){this.actualHistoryStep===$.S6?this.postMosaic():this.showSnackBar("To create an image mosaic finish mosaic parameter selection.")},onItemVisibility(n,e){this.thumbnailPreviewManager.toggle(n,e),this.selectionList.some(s=>this.thumbnailPreviewManager.getOpacity(s.id))||this.showSnackBar("Select at least one image in a mosaic.","Restore recommended",()=>{this.actualHistoryStep===$.S6&&this.submitPreselection(this.selectedFilters),this.removeSnackBar()})},async onActionToolClick(n){if(!n){this.displayedView=null;return}switch(n){case"MOSAIC":case"VISIBILITY":case"OUTPUTS":case"EDIT":this.displayedView=n;return;case"SHARE":case"DOWNLOAD":return;default:throw new Error(`Not defined action '${n}'`)}},submitPreselection(n){if(n){this.selectedFilters=n;
2const e={time:this.selectedFilters.time.value,platform:this.selectedFilters.platform.valueId,cloudiness:this.selectedFilters.cloudiness.value,fromDate:this.selectedFromDate,toDate:this.selectedToDate,offset:0,limit:10};this.bottomSheetSizeType="s",this.selectedFilters.platform.value===1?this.dayScene=1:this.selectedFilters.time.value===0?this.dayScene=1:this.dayScene=0,this.filterChange(e),this.actualHistoryStep=$.S6}else console.error("RENDER SNACKBAR ERROR")},onSelectedListItemClick(n){this.showImageList=!0;const e=this.selectionList.findIndex(s=>s.id===n),t=this.selectionList[e];this.hideCarousel(),this.activeMetadataItem=t,this.activeMetadataItemIndex=e,this.thumbnailPreviewManager.zoom(t.id),this.showCarousel(t),this.fetchCarouselData(t)},onMetadataHover(n){this.hoveredMetadata!==n&&(this.hoveredMetadata=n,n?this.thumbnailPreviewManager.hoverGeoJSON(n.footprint):this.thumbnailPreviewManager.hoverGeoJSON(null))},onCarouselSelectItem(n){const e=this.carouselList.dataArray.find(t=>t.id===n.id);if(this.emptyGeoJson&&(this.activeMetadataItem=e,this.emptyGeoJson=!1),this.activeMetadataItem.id!==e.id){const t=this.selectionList.findIndex(i=>i.id===e.id),s=this.selectionList[t];if(this.thumbnailToolBarProps.carousel.selectedItemId=e.id,s){if(this.selectionList.findIndex(i=>i.id===e.id)>0){this.thumbnailPreviewManager.moveTo(this.activeMetadataItem.id,this.selectionList.length-1);const i=this.selectionList.splice(this.activeMetadataItemIndex,1)[0];this.selectionList.unshift(i)}}else{const i=e.identifier.substring(27,44),o=this.selectionList.find(r=>r.identifier.substring(27,44)===i);o&&this.remove(o.id);const l=this.carouselList.dataArray.find(r=>r.id===e.id);this.thumbnailPreviewManager.add(l),this.selectionList.unshift(l)}this.activeMetadataItem=e,this.activeMetadataItemIndex=this.selectionList.findIndex(i=>i.id===e.id)}else console.log("CLICKED ON ACTIVE ITEM")},moveTo(n,e){const t=this.selectionList.length-(e+1);this.thumbnailPreviewManager.moveTo(n,t)},remove(n){this.selectionList=this.selectionList.filter(e=>e.id!==n),this.thumbnailPreviewManager.remove(n)},showCarousel(n){this.bottomSheetSizeType="xs",this.showImageList=!0,this.thumbnailToolBarProps.opacity.value=n?this.thumbnailPreviewManager.getOpacity(n.id)*100:100,n&&this.thumbnailPreviewManager.highlight(n.id)},hideCarousel(){if(this.activeMetadataItem&&this.selectionList&&this.thumbnailToolBarProps.opacity.value===0){const n=this.selectionList.findIndex(e=>e.id===this.activeMetadataItem.id);n>-1&&(this.selectionList.splice(n,1),this.thumbnailPreviewManager.remove(this.activeMetadataItem.id))}this.carouselList=[],this.activeMetadataItem=null,this.activeMetadataItemIndex=null,this.thumbnailPreviewManager&&this.thumbnailPreviewManager.highlight(),this.bottomSheetSizeType="s",this.showImageList=!1},loadMore(n){const e=this.lastSelectedGeoJson,t=this.carouselList.dataArray;this.lastSensingTimeLoadMore=this.lastLoadMoreMetadata?W(new Date(this.lastSensingTimeLoadMore),"YYYY-MM-DDThh:mm:ss",!1):W(new Date(t[t.length-1].sensingTime),"YYYY-MM-DDThh:mm:ss",!1);const s=n?this.lastLoadMoreMetadata?new Date(oe(new Date(this.lastSensingTimeLoadMore),"add","month",1)):new Date(oe(new Date(t[t.length-1].sensingTime),"add","month",1)):this.filter.toDate,i={...this.filter,fromDate:new Date(t[t.length-1].sensingTime),toDate:s,direction:10,limit:10};H.getMetadataByGeomExternal({...i,aoiId:this.selectedAoi.id,aoiGeoJSON:this.selectedAoi.simpleFeature,geoJSON:e,sensingTime:this.lastSensingTimeLoadMore}).then(o=>{const l=this.carouselList.dataArray.reduce((c,u)=>Object.assign(c,{[u.id]:!0}),{}),r=o.dataArray.filter(c=>!l[c.id]);this.carouselList.dataArray=this.carouselList.dataArray.concat(r),r.length===0?(this.lastSensingTimeLoadMore=s,this.lastLoadMoreMetadata=!0):this.lastLoadMoreMetadata=!1,this.addMonthButtonVisible=r.length<10}).catch(o=>{console.error("ERROR : ",o)})},loadPrevious(n){const e=this.lastSelectedGeoJson,t=this.carouselList.dataArray;this.lastSensingTimeLoadPrevious=this.lastLoadPreviousMetadata?W(new Date(this.lastSensingTimeLoadPrevious),"YYYY-MM-DDThh:mm:ss",!1):W(new Date(t[0].sensingTime),"YYYY-MM-DDThh:mm:ss",!1);const s=n?this.lastLoadPreviousMetadata?new Date(oe(new Date(this.lastSensingTimeLoadPrevious),"subtract","month",1)):new Date(oe(new Date(t[0].sensingTime),"subtract","month",1)):this.filter.fromDate,o={...this.filter,fromDate:s,direction:0,limit:10};H.getMetadataByGeomExternal({...o,aoiId:this.selectedAoi.id,aoiGeoJSON:this.selectedAoi.simpleFeature,geoJSON:e,sensingTime:this.lastSensingTimeLoadPrevious}).then(l=>{const r=this.carouselList.dataArray.reduce((u,d)=>Object.assign(u,{[d.id]:!0}),{}),c=l.dataArray.filter(u=>!r[u.id]);this.carouselList.dataArray=c.concat(this.carouselList.dataArray),c.length===0?(this.lastSensingTimeLoadPrevious=s,this.lastLoadPreviousMetadata=!0):this.lastLoadPreviousMetadata=!1,this.subtractMonthButtonVisible=c.length<10}).catch(l=>{console.error("ERROR : ",l)})},fetchCarouselData(n,e=null){this.lastSelectedMetadataObj=n;const t=e!==null?{type:"Point",coordinates:e}:n.footprint;this.carouselList=[],this.emptyGeoJson=!n,this.lastSelectedGeoJson=t;const s=Math.floor(_i(this.filter.fromDate,this.filter.toDate,"day")),i=oe(this.filter.toDate,"subtract","day",
2s),o=n?n.sensingTime:W(new Date(i),"YYYY-MM-DDThh:mm:ss",!1),l={...this.filter,direction:0,limit:5};H.getMetadataByGeomExternal({...l,geoJSON:t,sensingTime:o,aoiId:this.selectedAoi.id,aoiGeoJSON:this.selectedAoi.simpleFeature}).then(r=>{this.carouselList=r,this.thumbnailToolBarProps.carousel.images=r.dataArray.map(c=>({id:c.id,label:W(new Date(c.sensingTime),this.$store.state.dateFormat,!0),image:c.getThumbnailUrl(this.selectedAoi.id)})),this.thumbnailToolBarProps.carousel.selectedItemId=n?n.id:null}).catch(r=>{console.error("ERROR : ",r)})},reset(){this.metadataList=[],this.selectionList=[],this.showImageList=!1,this.hideCarousel()},async fetchAoi(n){try{const e=await H.getAoi(n);this.selectedAoi=e,this.thumbnailPreviewManager&&this.thumbnailPreviewManager.destroy(),this.thumbnailPreviewManager=Ue(new $s(this.globalMapInstance.map,JSON.parse(e.simpleFeature),{onItemSelected:(t,s)=>{t||s?(this.hideCarousel(),this.activeMetadataItem=null,this.activeMetadataItemIndex=null,t&&(this.thumbnailPreviewManager.zoom(t.id),this.activeMetadataItem=t,this.activeMetadataItemIndex=this.selectionList.findIndex(i=>i.id===t.id)),this.fetchCarouselData(t,s),this.showCarousel(t)):this.hideCarousel()},onItemHovered(t){}},this.selectedAoi)),this.thumbnailPreviewManager.zoomToMask()}catch(e){console.error(e),this.$router.push({name:"not-found"})}},filterChange(n){(!n||!Object.keys(n).length)&&this.reset(),n.platform&&(this.filter={...n,aoi:this.selectedAoi.id,fromDate:new Date(this.selectedFromDate),toDate:new Date(this.selectedToDate),dayScene:this.dayScene,cloudWeight:this.selectedPreference==="Cloudiness"?3:1,dateWeight:this.selectedPreference==="Sensing date"?3:1,areaWeight:1},this.selectedFilters.platform&&this.selectedFilters.platform.valueId==="sentinel-1_sar"&&(this.filter.cloudWeight=0,this.filter.areaWeight=0),this.fetchPreselection(this.filter)),this.selectedPlatformId=n.platform},fetchPreselection(n=null){this.preselectionRequestState="request",this.thumbnailPreviewManager&&this.thumbnailPreviewManager.removeAll(),this.reset();const e=H.getMetadataPreselectionExternal({...n,geoJSON:this.selectedAoi.simpleFeature,aoiId:this.selectedAoi.id}).then(t=>{this.preselectionPromise===e&&(this.reset(),this.preSelectionList=t,this.selectionList=t.dataArray.reverse(),this.preselectionRequestState="success",this.thumbnailPreviewManager&&t.dataArray.slice(0).reverse().map((s,i)=>{this.thumbnailPreviewManager.add(s,i)}))}).catch(t=>{this.preselectionRequestState="failure"});this.preselectionPromise=e},async postMosaic(){const n=this.name,e=this.description,t=this.resolution.filter(o=>o.selected===!0).map(o=>parseInt(o.id))[0],s=this.bands.filter(o=>o.checked===!0).map(o=>parseInt(o.id));let i=null;if(this.selectedFilters.platform.premium){const o=await H.getSubscriptionsForPlatform(this.selectedFilters.platform.value,this.selectedAoi.id);o&&o.data&&o.data[0]&&(i=o.data[0].id)}this.requestState="running",H.postMosaic(this.selectedAoi.id,this.selectedFilters.platform.value,this.selectedFilters.platform.valueId,t,this.selectionList.filter(o=>this.thumbnailPreviewManager.getOpacity(o.id)).map(o=>o.id),this.selectionList.filter(o=>this.thumbnailPreviewManager.getOpacity(o.id)).map(o=>o.serialize()),n,e,s,i).then(o=>{this.requestState="success",this.$router.push({name:"mosaic-detail",params:{id:o.data}})}).catch(o=>{o.response&&o.response.status===402?this.showContactSupportDialog=!0:(console.error(o),this.requestState="failure",this.showSnackBar(this.failureText))})},goBack(){const n=parseInt(this.actualHistoryStep.split("_")[1]);n>1&&!(n===2&&this.$route.query.aoi)?this.actualHistoryStep=$[`S${n-1}`]:this.navBack()},resetSelection(){this.actualHistoryStep=this.$route.query.aoi?$.S2:$.S1,this.displayedView=this.VIEWS.IMAGE_LIST},fetchCodelist(n,e){this.bands=[],H.getPlatformResolutions(n).then(t=>{this.resolution=[],t.map((s,i)=>{this.resolution.push({id:s.id,label:s.name,selected:i===0})})}),H.getPlatformBands({platformValue:n,dayScene:e}).then(t=>{t.forEach(s=>{s.text=`${s.name} ${s.description}`,n=="planet-planetscope"&&(s.disabled=!0)}),this.bands=t})},actionFn(){this.removeSnackBar()},renderTitleStep5(){return this.displayedView===this.VIEWS.IMAGE_LIST?this.showImageList?"Images for selected coordinate":"Generating preview":"Mosaic settings"},handleClose(){this.displayedView=void 0},handleBack(){this.hideCarousel(),this.showImageList=!1}},beforeRouteEnter(n,e,t){if(!n.query.view||n.query.view!==le.IMAGE_LIST){t({name:n.name,query:{...n.query,view:le.IMAGE_LIST}});return}t()},beforeRouteUpdate(n,e){},created(){var n;this.$store.commit("setSessionManager",new bi),!((n=this.selectionList)!=null&&n.length)&&this.displayedView!==le.IMAGE_LIST&&(this.displayedView=le.IMAGE_LIST)}},xn={key:0,class:"body_large px-2 py-4"},vn=O("br",null,null,-1),In={key:1,class:"w-full"},bn={key:2,class:"body_large px-2 py-4"},_n={class:"flex flex-row"},En={class:"flex flex-row"};function wn(n,e,t,s,i,o){var k,P,R;const l=v("EAppBar"),r=v("CreateMosaicChipSet"),c=v("NewMosaic"),u=v("Filters"),d=v("Cho
2oseDate"),a=v("Preferences"),h=v("MosaicForm"),f=v("ListCard"),S=v("VisibilityCard"),p=v("DraggablePreselection"),g=v("EButton"),x=v("EListItem"),b=v("EList"),_=v("ScrollToElement"),E=v("ContactSupportDialog");return y(),V(ie,null,[t.navigationElement?(y(),I(ae,{key:0,to:t.navigationElement},[L(l,{class:"md:hidden",title:i.infoBarConfig.title,label:i.infoBarConfig.label,variant:i.EAppBarVariants.INFOBAR,infobarButton:i.infobarButtonVariants.CREATE,"onClick:infobarAction":o.createMosaic,"onClick:back":s.navBack},null,8,["title","label","variant","infobarButton","onClick:infobarAction","onClick:back"])],8,["to"])):M("",!0),n.$store.state.infoBarContainer?(y(),I(ae,{key:1,to:n.$store.state.infoBarContainer},[L(r,{modalElement:t.modalElement,aoi:i.selectedAoi,fromDate:i.selectedFromDate,toDate:i.selectedToDate,platform:((k=i.selectedFilters)==null?void 0:k.platform)&&{id:i.selectedFilters.platform.value,name:i.selectedFilters.platform.text,valueId:i.selectedFilters.platform.valueId,premium:i.selectedFilters.platform.premium},time:((P=i.selectedFilters)==null?void 0:P.time)&&{id:i.selectedFilters.time.value,name:i.selectedFilters.time.text},cloudiness:((R=i.selectedFilters)==null?void 0:R.cloudiness)&&i.selectedFilters.cloudiness.value/100,onAoi:o.handleChipAoiChange,onPlatform:e[0]||(e[0]=m=>{this.selectedPlatformId=m.valueId,this.selectedFilters.platform={...this.selectedFilters.platform,text:m.name,value:m.value,valueId:m.valueId,premium:m.premium}}),onTime:e[1]||(e[1]=m=>{this.selectedFilters.time={...i.selectedFilters.time,value:m.id,text:m.name}}),onCloudiness:e[2]||(e[2]=m=>i.selectedFilters.cloudiness={...i.selectedFilters.cloudiness,text:`Cloud cover ${m*100}%`,value:m*100}),onDateRange:e[3]||(e[3]=(m,w)=>{m&&(this.selectedFromDate=m),w&&(this.selectedToDate=w),(m||w)&&Object.assign(this.selectedFilters,{...m&&{fromDate:m},...w&&{toDate:w}})})},null,8,["modalElement","aoi","fromDate","toDate","platform","time","cloudiness","onAoi"])],8,["to"])):M("",!0),this.actualHistoryStep===i.HISTORY_STEPS.S1?(y(),I(c,{key:2,goBack:this.goBack,aoi:this.selectedAoi,onCardStatus:e[4]||(e[4]=m=>{this.$emit("cardStatus",m)}),onChange:e[5]||(e[5]=m=>{m&&m.length&&m[0]&&(this.selectedAoi=m[0],this.actualHistoryStep=i.HISTORY_STEPS.S2)}),onSubmit:e[6]||(e[6]=m=>{m&&m.length&&m[0]?(this.selectedAoi!==m[0].id&&(this.selectedAoi=m[0]),this.actualHistoryStep=i.HISTORY_STEPS.S2):this.showSnackBar("Select an area of interest from a list or create a new area.")})},null,8,["goBack","aoi"])):M("",!0),this.actualHistoryStep===i.HISTORY_STEPS.S2?(y(),I(u,{key:3,goBack:this.goBack,filters:this.selectedFilters,aoi:this.selectedAoi,currentFilter:"platform",onSubmit:e[7]||(e[7]=m=>{i.actualHistoryStep=i.HISTORY_STEPS.S3,i.selectedFilters=m}),onCardStatus:e[8]||(e[8]=m=>this.$emit("cardStatus",m))},null,8,["goBack","filters","aoi"])):M("",!0),this.actualHistoryStep===i.HISTORY_STEPS.S3?(y(),I(d,{key:4,goBack:this.goBack,fromDate:this.selectedFromDate,toDate:this.selectedToDate,onCardStatus:e[9]||(e[9]=m=>this.$emit("cardStatus",m)),onSubmit:e[10]||(e[10]=m=>{const w=m.fromDateValue.value,F=m.toDateValue.value;w&&F?(this.selectedFromDate=w,this.selectedToDate=F,this.actualHistoryStep=i.HISTORY_STEPS.S4):console.error("RENDER SNACKBAR ERROR",m)})},null,8,["goBack","fromDate","toDate"])):M("",!0),this.actualHistoryStep===i.HISTORY_STEPS.S4?(y(),I(a,{key:5,preference:this.selectedPreference,goBack:this.goBack,onCardStatus:e[11]||(e[11]=m=>this.$emit("cardStatus",m)),onSubmit:e[12]||(e[12]=m=>{m?(this.selectedPreference=m,this.actualHistoryStep=i.HISTORY_STEPS.S5):console.error("RENDER SNACKBAR ERROR")})},null,8,["preference","goBack"])):M("",!0),this.actualHistoryStep===i.HISTORY_STEPS.S5?(y(),I(u,{key:6,modalElement:t.modalElement,goBack:this.goBack,filters:this.selectedFilters,currentFilter:"cloudiness",onCardStatus:e[13]||(e[13]=m=>this.$emit("cardStatus",m)),onSubmit:e[14]||(e[14]=m=>{i.actualHistoryStep=i.HISTORY_STEPS.S6,i.selectedFilters=m})},null,8,["modalElement","goBack","filters"])):M("",!0),this.actualHistoryStep===i.HISTORY_STEPS.S6&&this.displayedView===i.VIEWS.MOSAIC_FORM?(y(),I(f,{key:7,title:"Edit",backButton:!1,onClose:e[19]||(e[19]=m=>o.displayedView=void 0)},{content:C(()=>[L(h,{disabled:this.selectionList.length<1||this.requestState==="running",requestState:this.requestState,selectedCount:this.selectionList.length,goBack:()=>this.displayedView=this.VIEWS.IMAGE_LIST,selectedFilters:this.activeFilters,resetSelection:this.resetSelection,name:this.name,"onUpdate:name":e[15]||(e[15]=m=>this.name=m),description:this.description,"onUpdate:description":e[16]||(e[16]=m=>this.description=m),resolution:this.resolution,"onUpdate:resolution":e[17]||(e[17]=m=>this.resolution=m),bands:this.bands,"onUpdate:bands":e[18]||(e[18]=m=>this.bands=m)}
2,null,8,["disabled","requestState","selectedCount","goBack","selectedFilters","resetSelection","name","description","resolution","bands"])]),_:1})):M("",!0),this.actualHistoryStep===i.HISTORY_STEPS.S6&&o.displayedView===i.VIEWS.VISIBILITY?(y(),I(S,{key:8,opacity:i.opacity,onVisibility:e[20]||(e[20]=m=>{var w;return(w=i.thumbnailPreviewManager)==null||w.setOpacity(null,m),i.opacity=m}),onClose:e[21]||(e[21]=m=>o.displayedView=null)},null,8,["opacity"])):this.actualHistoryStep===i.HISTORY_STEPS.S6&&o.displayedView!==null?(y(),I(f,{key:9},{header:C(()=>{var m,w;return[this.preselectionRequestState==="request"?(y(),I(l,{key:0,title:"Generating preview",progressbar:!0,closeButton:!1,backButton:!1})):this.showImageList&&((w=(m=this.carouselList)==null?void 0:m.dataArray)!=null&&w.length)?(y(),I(l,{key:1,title:"Images on a coordinate",closeButton:!1,"onClick:back":o.handleBack},null,8,["onClick:back"])):(y(),I(l,{key:2,title:"Image mosaic",backButton:!1,"onClick:close":o.handleClose},null,8,["onClick:close"]))]}),content:C(()=>[this.preselectionRequestState==="request"?(y(),V("div",xn,[qe(" Please hold on a few seconds. "),vn,qe(" We are preparing an image mosaic preview. ")])):i.preselectionRequestState==="success"?vt((y(),V("div",In,[L(p,{emptyTitle:"No images found",emptyMessage:"Refine filters and try again",onUpdateModelValue:e[22]||(e[22]=m=>this.selectionList=m),onMouseEnter:e[23]||(e[23]=m=>this.onMetadataHover(m)),onMouseClick:e[24]||(e[24]=m=>this.onSelectedListItemClick(m.id)),onCardStatus:e[25]||(e[25]=m=>this.$emit("cardStatus",m)),onMoveItem:e[26]||(e[26]=m=>this.moveTo(m.id,m.position)),listItems:this.selectionList,apiUrl:this.apiUrl,aoi:this.selectedAoi,onVisibility:o.onItemVisibility},null,8,["listItems","apiUrl","aoi","onVisibility"])],512)),[[It,!this.showImageList]]):this.preselectionRequestState==="failure"?(y(),V("div",bn," Sorry, we are unable to create this image mosaic at the moment. Try again or change parameters. ")):M("",!0),this.showImageList&&this.carouselList&&this.carouselList.dataArray&&this.carouselList.dataArray.length&&!this.emptyGeoJson?(y(),I(_,{key:3,class:"flex flex-col items-start overflow-y-auto self-stretch grow-1 custom_scrollbar",scrollIndex:this.carouselList.dataArray.findIndex(m=>m.id===this.activeMetadataItem.id),itemHeight:86,itemCount:this.carouselList.dataArray.length},{default:C(()=>[L(b,{configuration:n.$store.state.mobileLayout?i.listConfigurations.CARD:i.listConfigurations.LIST},{default:C(()=>[O("div",_n,[this.subtractMonthButtonVisible?M("",!0):(y(),I(g,{key:0,labelText:"Load Previous",variant:i.buttonVariants.TEXT,onClick:e[27]||(e[27]=()=>this.loadPrevious(!1))},null,8,["variant"])),this.subtractMonthButtonVisible?(y(),I(g,{key:1,labelText:"Subtract one month",variant:i.buttonVariants.TEXT,onClick:e[28]||(e[28]=()=>this.loadPrevious(!0))},null,8,["variant"])):M("",!0)]),(y(!0),V(ie,null,ye(this.carouselList.dataArray,m=>(y(),I(x,{key:m.id,active:this.activeMetadataItem.id===m.id,title:i.dateFormatter(new Date(m.sensingTime),this.$store.state.dateFormat,!0),label:`${parseInt(m.cloudCoverage)}% cloudiness`,configuration:n.$store.state.mobileLayout?i.listConfigurations.CARD:i.listConfigurations.LIST,image:m.getThumbnailUrl(this.selectedAoi.id),"onClick:listItem":()=>this.onCarouselSelectItem(m),onMouseenter:()=>this.onMetadataHover(m),onMouseleave:e[29]||(e[29]=()=>this.onMetadataHover())},null,8,["active","title","label","configuration","image","onClick:listItem","onMouseenter"]))),128)),O("div",En,[this.addMonthButtonVisible?M("",!0):(y(),I(g,{key:0,labelText:"Load More",variant:i.buttonVariants.TEXT,onClick:e[30]||(e[30]=()=>this.loadMore(!1))},null,8,["variant"])),this.addMonthButtonVisible?(y(),I(g,{key:1,labelText:"Add one month",variant:i.buttonVariants.TEXT,onClick:e[31]||(e[31]=()=>this.loadMore(!0))},null,8,["variant"])):M("",!0)])]),_:1},8,["configuration"])]),_:1},8,["scrollIndex","itemCount"])):M("",!0),this.showImageList&&this.carouselList&&this.carouselList.dataArray&&this.carouselList.dataArray.length&&this.emptyGeoJson?(y(),I(_,{key:4,class:"flex flex-col items-start overflow-y-auto self-stretch grow-1 custom_scrollbar",itemHeight:86,itemCount:this.carouselList.dataArray.length},{default:C(()=>[L(b,{configuration:n.$store.state.mobileLayout?i.listConfigurations.CARD:i.listConfigurations.LIST},{default:C(()=>[(y(!0),V(ie,null,ye(this.carouselList.dataArray,m=>(y(),I(x,{key:m.id,title:i.dateFormatter(new Date(m.sensingTime),this.$store.state.dateFormat,!0),label:`${parseInt(m.cloudCoverage)}% cloudiness`,configuration:n.$store.state.mobileLayout?i.listConfigurations.CARD:i.listConfigurations.LIST,image:m.getThumbnailUrl(this.selectedAoi.id),"onClick:listItem":()=>this.onCarouselSelectItem(m),onMouseenter:()=>this.onMetadataHover(m),onMouseleave:e[32]||(e[32]=()=>this.onMetadataHover())},null,8,["title","label","configuration","image","onClick:listItem","onMouseenter"]))),128))]),_:1},8,["configuration"])]),_:1},8,["itemCount"])):M("",!0)]),_:1})):M("",!0),t.modalElement?(y(),I(ae,{key:10,to:t.modalElement},[i.showContactSupportDialog?(y(),I(E,{key:0,onClose:e[33]||(e[33]=m=>i.showContactSupportDialog=!1)})):M("",!0)],8,["to"])):M("",!0)],64)}const Tn=j(Sn,[["render",wn]]);
2export{Tn as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.