@abi-software/mapintegratedvuer 0.7.0-vue3.4 → 0.7.0-vue3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -425,7 +425,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
425
425
  </g>
426
426
  </svg>`,h0e=(e,t,r,n)=>{const i=["title","desc","defs","style"],o=["width","height"],s=n||[];let l=document.createElement("div");l.innerHTML=e,t&&i.map(u=>{const d=l.querySelector(u);d&&d.remove()}),r&&o.map(u=>{l.querySelector("svg").removeAttribute(u)}),n&&s.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},f0e=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,r)=>"".replace.apply(t,r),e).trim(),Lot=!0,Sot=!0,kot=["fill"],Vj=Object.assign({"/assets/icons/2horpanel.svg":D2e,"/assets/icons/2vertpanel.svg":F2e,"/assets/icons/3panel.svg":z2e,"/assets/icons/4panel.svg":j2e,"/assets/icons/5panel.svg":U2e,"/assets/icons/6panel.svg":G2e,"/assets/icons/6panelVertical.svg":q2e,"/assets/icons/changeBckgd.svg":Z2e,"/assets/icons/close-no-bk.svg":W2e,"/assets/icons/close.svg":K2e,"/assets/icons/closeFullScreen.svg":X2e,"/assets/icons/dock.svg":J2e,"/assets/icons/fitWindow.svg":Y2e,"/assets/icons/fullScreen.svg":$2e,"/assets/icons/help.svg":e0e,"/assets/icons/magnifyingGlass.svg":t0e,"/assets/icons/noun-filter.svg":r0e,"/assets/icons/openMap.svg":n0e,"/assets/icons/pause.svg":i0e,"/assets/icons/permalink.svg":o0e,"/assets/icons/play.svg":a0e,"/assets/icons/resetZoom.svg":s0e,"/assets/icons/singlepanel.svg":l0e,"/assets/icons/tooltips.svg":c0e,"/assets/icons/undock.svg":u0e,"/assets/icons/zoomIn.svg":d0e,"/assets/icons/zoomOut.svg":p0e});Object.keys(Vj).map(e=>{const t=h0e(Vj[e],Lot,Sot,kot),r=e.replace(/^.+\/(\w+).svg$/,"$1");return f0e(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
427
427
  `);const Mot=!0,Cot=!0,Ij=Object.assign({"/assets/icons/2horpanel.svg":D2e,"/assets/icons/2vertpanel.svg":F2e,"/assets/icons/3panel.svg":z2e,"/assets/icons/4panel.svg":j2e,"/assets/icons/5panel.svg":U2e,"/assets/icons/6panel.svg":G2e,"/assets/icons/6panelVertical.svg":q2e,"/assets/icons/changeBckgd.svg":Z2e,"/assets/icons/close-no-bk.svg":W2e,"/assets/icons/close.svg":K2e,"/assets/icons/closeFullScreen.svg":X2e,"/assets/icons/dock.svg":J2e,"/assets/icons/fitWindow.svg":Y2e,"/assets/icons/fullScreen.svg":$2e,"/assets/icons/help.svg":e0e,"/assets/icons/magnifyingGlass.svg":t0e,"/assets/icons/noun-filter.svg":r0e,"/assets/icons/openMap.svg":n0e,"/assets/icons/pause.svg":i0e,"/assets/icons/permalink.svg":o0e,"/assets/icons/play.svg":a0e,"/assets/icons/resetZoom.svg":s0e,"/assets/icons/singlepanel.svg":l0e,"/assets/icons/tooltips.svg":c0e,"/assets/icons/undock.svg":u0e,"/assets/icons/zoomIn.svg":d0e,"/assets/icons/zoomOut.svg":p0e}),Eot=Object.keys(Ij).map(e=>{const t=h0e(Ij[e],Mot,Cot),r=e.replace(/^.+\/(\w+).svg$/,"$1");return f0e(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),Aot={name:"MapSvgSpriteColor",svgContext:Ij,svgSprite:Eot.join(`
428
- `)},Oot=["innerHTML"];function Hot(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,Oot)}const BC=B2e(Aot,[["render",Hot]]),Pj=()=>({entries:[{resource:"Rat",type:"MultiFlatmap",mode:"main",id:1,state:void 0,label:"",discoverId:void 0}]}),Vot=async(e,t)=>{let r={};if(e==="AC")r={resource:"Rat",type:"MultiFlatmap",mode:"main",state:void 0,label:"",discoverId:void 0};else if(e==="FC")r={resource:"FunctionalConnectivity",type:"Flatmap",mode:"main",state:void 0,label:"Functional",discoverId:void 0};else if(e==="3D"){const n=await Nj(t,"human");r={resource:n.url,type:"Scaffold",mode:"main",state:void 0,label:"Human",discoverId:n.datasetInfo.discoverId,contextCardUrl:n.datasetInfo.contextCardUrl,s3uri:n.datasetInfo.s3uri,version:n.datasetInfo.version,isBodyScaffold:!0}}return r},Iot=async(e,t)=>{const r=Pj();if(e==="FC")r.entries[0].resource="FunctionalConnectivity",r.entries[0].type="Flatmap",r.entries[0].label="Functional";else if(e==="WholeBody"){const n=await Nj(t,"human");r.entries[0].resource=n.url,r.entries[0].contextCardUrl=n.datasetInfo.contextCardUrl,r.entries[0].discoverId=n.datasetInfo.discoverId,r.entries[0].s3uri=n.datasetInfo.s3uri,r.entries[0].version=n.datasetInfo.version,r.entries[0].type="Scaffold",r.entries[0].label="Human",r.entries[0].isBodyScaffold=!0}return r},m0e=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),g0e=()=>({"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayLatestChanges:!0,displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayLatestChanges:!0,displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0,displayWarning:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayLatestChanges:!0,displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayLatestChanges:!0,displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayLatestChanges:!0,displayWarning:!0}}),Pot=e=>{if(e){const t=g0e();for(let r in t)if(e.taxo===t[r].taxo)if(e.biologicalSex&&t[r].biologicalSex){if(e.biologicalSex===t[r].biologicalSex)return r}else return r}return""},Not=e=>{if(e){const t=e.split("//")[1];if(t){const r=t.split("/")[0],n=t.indexOf("/"),i=t.substring(n+1);return{s3Bucket:r,s3Prefix:i}}}},Nj=async(e,t)=>{let r="",n;const i=await fetch(`${e}get_body_scaffold_info/${t}`);if(i.ok){const o=await i.json(),s=Not(o.s3uri);r=`${e}s3-resource/${s.s3Prefix}files/${o.path}?s3BucketName=${s.s3Bucket}`;const l=`${e}s3-resource/${s.s3Prefix}files/${o.contextinfo}?s3BucketName=${s.s3Bucket}`;n={s3uri:o.s3uri,contextCardUrl:l,discoverId:o.id,version:o.version}}else t==="rat"?r="https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json":t==="human"&&(r="https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/27-4-23-human/human_body_metadata.json");return{url:r,datasetInfo:n}},DC=gl.defineStore("entries",{state:()=>Pj(),getters:{findIndexOfId:e=>t=>{for(let r=0;r<e.entries.length;r++)if(e.entries[r].id==t)return r;return-1}},actions:{addNewEntry(e){this.entries.push(e)},destroyEntry(e){e>-1&&this.entries.splice(e,1)},setAll(e){this.entries=[],Object.assign(this.entries,e)},updateViewForEntry({id:e,viewUrl:t}){const r=this.entries.find(n=>n.id===e);r.viewUrl=t}}}),rg=gl.defineStore("settings",{state:()=>({shareLink:void 0,sparcApi:void 0,algoliaIndex:"k-core_dev_published_time_desc",algoliaKey:void 0,algoliaId:void 0,pennsieveApi:void 0,flatmapAPI:void 0,nlLinkPrefix:void 0,rootUrl:void 0,facets:{species:[],gender:[],organ:[]},facetLabels:[],markers:[],featuredMarkers:[],featuredMarkerIdentifiers:[],featuredMarkerDois:[],featuredMarkerSpecies:[],featuredDatasetIdentifiers:[],helpDelay:0}),getters:{isFeaturedMarkerIdentifier:e=>t=>e.featuredMarkerIdentifiers.includes(t),featuredMarkerDoi:e=>t=>{const r=e.featuredMarkerIdentifiers.findIndex(n=>n==t);return e.featuredMarkerDois[r]}},actions:{updateShareLink(e){this.shareLink=e},updateSparcAPI(e){this.sparcApi=e},updateAlgoliaIndex(e){this.algoliaIndex=e},updateAlgoliaKey(e){this.algoliaKey=e},updateAlgoliaId(e){this.algoliaId=e},updatePennsieveApi(e){this.pennsieveApi=e},updateFlatmapAPI(e){this.flatmapAPI=e},updateNLLinkPrefix(e){this.nlLinkPrefix=e},updateRootUrl(e){this.rootUrl=e},updateMarkers(e){this.markers=e},updateFeatured(e){this.featuredMarkerIdentifiers=new Array(e.length),this.featuredMarkers=new Array(e.length),this.featuredMarkerDois=new Array(e.length),this.featuredMarkerSpecies=new Array(e.length),this.featuredDatasetIdentifiers=e},updateFeaturedMarker(e){const t=this.featuredDatasetIdentifiers.findIndex(r=>r==e.identifier);this.featuredMarkers[t]=e.marker,this.featuredMarkerDois[t]=e.doi,this.featuredMarkerSpecies[t]=e.species},updateFeaturedMarkerIdentifier(e){this.featuredMarkerIdentifiers[e.index]=e.markerIdentifier},resetFeaturedMarkerIdentifier(){this.featuredMarkerIdentifiers=new Array(this.featuredDatasetIdentifiers.length)},updateFacets(e){let t={species:[],gender:[],organ:[]};if(e){e.forEach(r=>{switch(r.term.toLowerCase()){case"species":r.facet.toLowerCase()!=="show all"?(t.species.push(r.facet),this.facets.species.includes(r.facet)||this.facets.species.push(r.facet)):this.facets.species=[];break;case"gender":r.facet.toLowerCase()!=="show all"&&(t.gender.push(r.facet),this.facets.species.includes(r.facet)||this.facets.gender.push(r.facet));break;case"organ":r.facet.toLowerCase()!=="show all"&&(t.organ.push(r.facet),this.facets.species.includes(r.facet)||this.facets.organ.push(r.facet));break}});for(const[r,n]of Object.entries(this.facets)){let i=0;for(i=n.length-1;i>=0;i-=1)t[r].indexOf(n[i])==-1&&n.splice(i,1)}}},updateFacetLabels(e){this.facetLabels=e}}}),y0e=e=>{switch(e){case"2horpanel":return{"split-1":{content:!1,horizontal:!0,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"2vertpanel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"3panel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3}};case"4panel":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4}};case"5panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-5"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5}};case"6panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"6panelVertical":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"singlepanel":default:return{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}}}},Rot=(e,t)=>{const r=[],n=[];for(const[i,o]of Object.entries(t))o.content&&(r.includes(o.id)?n.push(i):r.push(o.id));n.forEach(i=>{let o=!1;for(let s=0;s<e.length&&!o;s++)r.includes(e[s].id)||(t[i].id=e[s].id,r.push(e.id),o=!0)})},Bot=e=>{const t={};for(const[r,n]of Object.entries(e))n.content&&(t[r]=n);return t},FC=(e,t)=>{const r=Bot(e),n=y0e(t);for(const[i,o]of Object.entries(r))n[i]=o;return n},Q8=(e,t)=>Object.keys(e).find(r=>e[r].id===t),b8=gl.defineStore("splitFlow",{state:()=>({activeView:"singlepanel",viewIcons:[{icon:"singlepanel",name:"Single view",min:1},{icon:"2horpanel",name:"Horizontal split",min:2},{icon:"2vertpanel",name:"Vertical split",min:2},{icon:"3panel",name:"Three panes",min:3},{icon:"4panel",name:"Four panes",min:4},{icon:"5panel",name:"Five panes",min:5},{icon:"6panel",name:"Six (horizontal)",min:6},{icon:"6panelVertical",name:"Six (vertical)",min:6}],customLayout:{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}},splitters:{first:50,second:50,third:50},globalCallback:!1,syncMode:!1}),getters:{getPaneNameById:e=>t=>Q8(e.customLayout,t),getState:e=>()=>({activeView:e.activeView,splitters:e.splitters,globalCallback:e.globalCallback,customLayout:e.customLayout,syncMode:e.syncMode})},actions:{assignOrSwapPaneWithIds(e){let t=Q8(this.customLayout,e.source),r=Q8(this.customLayout,e.target);this.syncMode&&!(r||t)&&(this.syncMode=!1,this.globalCallback=!1),r&&(this.customLayout[r].id=e.source),t&&(this.customLayout[t].id=e.target)},toggleGlobalCallback(e){this.globalCallback=e},updateActiveView(e){if(this.syncMode){const r=this.viewIcons.find(i=>this.activeView===i.icon),n=this.viewIcons.find(i=>e.view===i.icon);r.min==2&&n.min==2||(this.syncMode=!1,this.globalCallback=!1)}this.activeView=e.view;const t=FC(this.customLayout,this.activeView);Rot(e.entries,t);for(const[r,n]of Object.entries(t))this.customLayout[r]=n},setSplitter(e){this.splitters[e.name]&&(this.splitters[e.name]=e.value)},setState(e){if(e){let t;if(e.activeView&&(this.activeView=e.activeView),e.customLayout)t=e.customLayout;else if(t=y0e(this.activeView),console.log(e,t),e.slotInfo)for(let r=0;r<e.slotInfo.length;r++)switch(e.slotInfo[r].name){case"first":t["pane-1"].id=e.slotInfo[r].id;break;case"second":"pane-2"in t&&(t["pane-2"].id=e.slotInfo[r].id);break;case"thrid":"pane-3"in t&&(t["pane-3"].id=e.slotInfo[r].id);break;case"fourth":"pane-4"in t&&(t["pane-4"].id=e.slotInfo[r].id);break;case"fifth":"pane-5"in t&&(t["pane-5"].id=e.slotInfo[r].id);break;case"sixth":"pane-6"in t&&(t["pane-6"].id=e.slotInfo[r].id);break}for(const[r,n]of Object.entries(t))this.customLayout[r]=n;e.globalCallback&&(this.globalCallback=e.globalCallback);for(const[r,n]of Object.entries(e.splitters))this.splitters[r]=n;e.syncMode&&(this.syncMode=e.syncMode)}},setIdToPrimaryPane(e){const t=Q8(this.customLayout,e),r=this.customLayout["pane-1"].id;this.customLayout["pane-1"].id=e,t&&(this.customLayout[t].id=r)},setSyncMode(e){if(e)if(e.flag===!0){this.activeView=e.layout;const t=FC(this.customLayout,this.activeView),r=Q8(t,1),n=t["pane-1"].id;r!=="pane-1"&&(t["pane-1"].id=n),t["pane-1"].id=1,t["pane-2"].id=e.newId;for(const[i,o]of Object.entries(t))this.customLayout[i]=o;this.syncMode=!0,this.globalCallback=!0}else{this.activeView="singlepanel";const t=FC(this.customLayout,this.activeView);for(const[r,n]of Object.entries(t))this.customLayout[r]=n;this.syncMode=!1,this.globalCallback=!1}},closeSlot(e){if(e){this.syncMode=!1,this.globalCallback=!1;let t=0;if(e.id===1)t=1;else if(e.entries)for(let r=0;r<e.entries.length&&t==0;r++)Q8(e.entries[r].id)===void 0&&(t=e.entries[r].id);if(this.activeView!=="customise"){const r=this.activeView;switch(this.activeView){case"2horpanel":case"2vertpanel":this.activeView="singlepanel";break;case"3panel":this.activeView="2vertpanel";break;case"4panel":this.activeView="3panel";break;case"5panel":this.activeView="4panel";break;case"6panelVertical":case"6panel":this.activeView="5panel";break}const n=FC(this.customLayout,this.activeView);switch(Q8(n,e.id)){case"pane-1":switch(r){case"2horpanel":case"2vertpanel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=t;break;case"3panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=t;break;case"4panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-2":switch(r){case"2horpanel":case"2vertpanel":n["pane-2"].id=t;break;case"3panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=t;break;case"4panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-3":switch(r){case"3panel":n["pane-3"].id=t;break;case"4panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-4":switch(r){case"4panel":n["pane-4"].id=t;break;case"5panel":n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-5":switch(r){case"5panel":n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-6":switch(r){case"6panelVertical":case"6panel":n["pane-6"].id=t;break}break}for(const[o,s]of Object.entries(n))this.customLayout[o]=s}}}}}),Dot={name:"ContentBar",components:{ElIconArrowDown:Gz,ElIconArrowUp:yce,ElIconInfoFilled:Qce,Input:Gb,Option:e2e,Popover:wC,Row:xC,Select:$1e,ContextCard:N2e,FlatmapContextCard:R2e,MapSvgIcon:Wb},props:{entry:Object},data:function(){return{contextCardVisible:!1,slot:{},boundariesElement:null,showDetails:!0,contextCardEntry:void 0}},computed:{...gl.mapStores(DC,rg,b8),helpDelay(){return this.settingsStore.helpDelay},activeView:function(){return this.splitFlowStore.activeView},envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},popperOptions:function(){return{preventOverflow:{enabled:!0,boundary:this.boundariesElement}}},entries:function(){return this.entriesStore.entries}},methods:{closeAndRemove:function(){this.splitFlowStore.closeSlot({id:this.entry.id,entries:this.entries}),Xo.emit("RemoveEntryRequest",this.entry.id)},getEntryTitle:function(e){if(e){let t=e.label?e.label+" ":"",r=e.type;return r=="Scaffold"&&(r="3D Scaffold"),t+=r,e.datasetId?t+=" ("+e.datasetId+")":e.discoverId&&(t+=" ("+e.discoverId+")"),t}return"Viewer"},viewerChanged:function(e){this.entry.id&&this.entry.id!=e&&(this.splitFlowStore.assignOrSwapPaneWithIds({source:this.entry.id,target:e}),this.$nextTick(()=>{setTimeout(()=>{this.$emit("chooser-changed")},1200)}))},setPopperWidth:function(e){let t=this.entries.find(r=>r.id===e);if(t)return t.type=="Flatmap"||t.type=="MultiFlatmap"?"240px":"440px"},setBoundary:function(e){this.boundariesElement=e},setupFlatmapContextCard:function(e){this.contextCardVisible=!1;let t=Object.assign({mapImpProv:e.prov},this.entry);this.contextCardEntry=t},setupScaffoldContextCard:function(){this.entry.contextCardUrl&&(this.contextCardEntry={...this.entry})}},mounted:function(){this.setupScaffoldContextCard()}},Fot={class:"toolbar-flex-container"},zot={key:1,class:"toolbar-title"};function jot(e,t,r,n,i,o){const s=e2e,l=$1e,c=yce,u=Ks,d=Gz,p=R2e,h=N2e,f=Qce,m=wC,g=a.resolveComponent("map-svg-icon"),T=xC;return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",Fot,[o.entries.length>1?(a.openBlock(),a.createBlock(l,{key:0,teleported:!1,"model-value":r.entry.id,placeholder:"Select",class:"select-box","popper-class":"viewer_dropdown",onChange:t[0]||(t[0]=y=>o.viewerChanged(y))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.entries,y=>(a.openBlock(),a.createBlock(s,{key:y.id,label:o.getEntryTitle(y),value:y.id},null,8,["label","value"]))),128))]),_:1},8,["model-value"])):(a.openBlock(),a.createElementBlock("div",zot,a.toDisplayString(o.getEntryTitle(r.entry)),1))]),a.createVNode(T,{class:"icon-group"},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=y=>e.contextCardVisible=!1)},[a.createTextVNode(" Hide information "),a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1})],512),[[a.vShow,e.contextCardEntry&&e.contextCardVisible]]),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[2]||(t[2]=y=>e.contextCardVisible=!0)},[a.createTextVNode(" Show information "),a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})],512),[[a.vShow,e.contextCardEntry&&!e.contextCardVisible]]),a.createVNode(m,{placement:"bottom",teleported:!1,trigger:"manual",width:o.setPopperWidth(e.slot.id),offset:0,"popper-class":"context-card-popover","popper-options":o.popperOptions,visible:e.contextCardVisible},a.createSlots({reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{class:"info-icon",onClick:t[5]||(t[5]=y=>e.contextCardVisible=!e.contextCardVisible)},{default:a.withCtx(()=>[a.createVNode(f)]),_:1},512),[[a.vShow,e.contextCardEntry]])]),_:2},[e.contextCardEntry?{name:"default",fn:a.withCtx(()=>[e.contextCardEntry.type=="Flatmap"||e.contextCardEntry.type=="MultiFlatmap"?(a.openBlock(),a.createBlock(p,{key:0,class:"flatmap-context-card",mapImpProv:e.contextCardEntry.mapImpProv},null,8,["mapImpProv"])):a.createCommentVNode("",!0),e.contextCardEntry.type.toLowerCase()=="scaffold"?(a.openBlock(),a.createBlock(h,{key:1,entry:e.contextCardEntry,envVars:o.envVars,class:"context-card",onContextReady:t[3]||(t[3]=y=>e.contextCardVisible=!0),onScaffoldViewClicked:t[4]||(t[4]=y=>e.$emit("scaffold-view-clicked",y))},null,8,["entry","envVars"])):a.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["width","popper-options","visible"]),a.createVNode(m,{class:"tooltip",content:"Close and remove",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(g,{icon:"close",class:"header-icon",onClick:t[6]||(t[6]=y=>o.closeAndRemove())},null,512),[[a.vShow,o.activeView!=="singlepanel"&&r.entry.mode!=="main"]])]),_:1},8,["show-after"])]),_:1})])}const T0e=Gl(Dot,[["render",jot],["__scopeId","data-v-702854ca"]]),O4=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var v0e;const Xs=typeof window<"u",Uot=e=>typeof e=="string",Q0e=()=>{},b0e=Xs&&((v0e=window==null?void 0:window.navigator)==null?void 0:v0e.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function x0e(e){return typeof e=="function"?e():a.unref(e)}function Got(e){return e}function Rj(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function qot(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function rh(e){var t;const r=x0e(e);return(t=r==null?void 0:r.$el)!=null?t:r}const Bj=Xs?window:void 0;function nh(...e){let t,r,n,i;if(Uot(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=Bj):[t,r,n,i]=e,!t)return Q0e;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,p,h,f)=>(d.addEventListener(p,h,f),()=>d.removeEventListener(p,h,f)),c=a.watch(()=>[rh(t),x0e(i)],([d,p])=>{s(),d&&o.push(...r.flatMap(h=>n.map(f=>l(d,h,f,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return Rj(u),u}let _0e=!1;function Zot(e,t,r={}){const{window:n=Bj,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;b0e&&!_0e&&(_0e=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Q0e)));let l=!0;const c=d=>i.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(h=>h===d.target||d.composedPath().includes(h));{const h=rh(p);return h&&(d.target===h||d.composedPath().includes(h))}}),u=[nh(n,"click",d=>{const p=rh(e);if(!(!p||p===d.target||d.composedPath().includes(p))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),nh(n,"pointerdown",d=>{const p=rh(e);p&&(l=!d.composedPath().includes(p)&&!c(d))},{passive:!0}),s&&nh(n,"blur",d=>{var p;const h=rh(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function Wot(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),qot(n,t),r}const w0e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},L0e="__vueuse_ssr_handlers__";w0e[L0e]=w0e[L0e]||{};var S0e=Object.getOwnPropertySymbols,Kot=Object.prototype.hasOwnProperty,Xot=Object.prototype.propertyIsEnumerable,Jot=(e,t)=>{var r={};for(var n in e)Kot.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&S0e)for(var n of S0e(e))t.indexOf(n)<0&&Xot.call(e,n)&&(r[n]=e[n]);return r};function zC(e,t,r={}){const n=r,{window:i=Bj}=n,o=Jot(n,["window"]);let s;const l=Wot(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>rh(e),p=>{c(),l.value&&i&&p&&(s=new ResizeObserver(t),s.observe(p,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Rj(d),{isSupported:l,stop:d}}var k0e;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(k0e||(k0e={}));var Yot=Object.defineProperty,M0e=Object.getOwnPropertySymbols,$ot=Object.prototype.hasOwnProperty,eat=Object.prototype.propertyIsEnumerable,C0e=(e,t,r)=>t in e?Yot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tat=(e,t)=>{for(var r in t||(t={}))$ot.call(t,r)&&C0e(e,r,t[r]);if(M0e)for(var r of M0e(t))eat.call(t,r)&&C0e(e,r,t[r]);return e};tat({linear:Got},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const rat=()=>Xs&&/firefox/i.test(window.navigator.userAgent),Dj=e=>{let t,r;return e.type==="touchend"?(r=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):e.type.startsWith("touch")?(r=e.touches[0].clientY,t=e.touches[0].clientX):(r=e.clientY,t=e.clientX),{clientX:t,clientY:r}};process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kb=()=>{},nat=Object.prototype.hasOwnProperty,x8=(e,t)=>nat.call(e,t),ng=Array.isArray,g2=e=>typeof e=="function",Js=e=>typeof e=="string",Sc=e=>e!==null&&typeof e=="object",iat=Object.prototype.toString,oat=e=>iat.call(e),Fj=e=>oat(e).slice(8,-1),E0e=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},aat=/-(\w)/g,sat=E0e(e=>e.replace(aat,(t,r)=>r?r.toUpperCase():"")),lat=/\B([A-Z])/g,cat=E0e(e=>e.replace(lat,"-$1").toLowerCase());var A0e=typeof global=="object"&&global&&global.Object===Object&&global,uat=typeof self=="object"&&self&&self.Object===Object&&self,R3=A0e||uat||Function("return this")(),B3=R3.Symbol,O0e=Object.prototype,dat=O0e.hasOwnProperty,pat=O0e.toString,Xb=B3?B3.toStringTag:void 0;function hat(e){var t=dat.call(e,Xb),r=e[Xb];try{e[Xb]=void 0;var n=!0}catch{}var i=pat.call(e);return n&&(t?e[Xb]=r:delete e[Xb]),i}var fat=Object.prototype,mat=fat.toString;function gat(e){return mat.call(e)}var yat="[object Null]",Tat="[object Undefined]",H0e=B3?B3.toStringTag:void 0;function ig(e){return e==null?e===void 0?Tat:yat:H0e&&H0e in Object(e)?hat(e):gat(e)}function og(e){return e!=null&&typeof e=="object"}var vat="[object Symbol]";function jC(e){return typeof e=="symbol"||og(e)&&ig(e)==vat}function Qat(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var D3=Array.isArray,bat=1/0,V0e=B3?B3.prototype:void 0,I0e=V0e?V0e.toString:void 0;function P0e(e){if(typeof e=="string")return e;if(D3(e))return Qat(e,P0e)+"";if(jC(e))return I0e?I0e.call(e):"";var t=e+"";return t=="0"&&1/e==-bat?"-0":t}var xat=/\s/;function _at(e){for(var t=e.length;t--&&xat.test(e.charAt(t)););return t}var wat=/^\s+/;function Lat(e){return e&&e.slice(0,_at(e)+1).replace(wat,"")}function ih(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var N0e=NaN,Sat=/^[-+]0x[0-9a-f]+$/i,kat=/^0b[01]+$/i,Mat=/^0o[0-7]+$/i,Cat=parseInt;function zj(e){if(typeof e=="number")return e;if(jC(e))return N0e;if(ih(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ih(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Lat(e);var r=kat.test(e);return r||Mat.test(e)?Cat(e.slice(2),r?2:8):Sat.test(e)?N0e:+e}var R0e=1/0,Eat=17976931348623157e292;function Aat(e){if(!e)return e===0?e:0;if(e=zj(e),e===R0e||e===-R0e){var t=e<0?-1:1;return t*Eat}return e===e?e:0}function Oat(e){var t=Aat(e),r=t%1;return t===t?r?t-r:t:0}function B0e(e){return e}var Hat="[object AsyncFunction]",Vat="[object Function]",Iat="[object GeneratorFunction]",Pat="[object Proxy]";function D0e(e){if(!ih(e))return!1;var t=ig(e);return t==Vat||t==Iat||t==Hat||t==Pat}var jj=R3["__core-js_shared__"],F0e=function(){var e=/[^.]+$/.exec(jj&&jj.keys&&jj.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Nat(e){return!!F0e&&F0e in e}var Rat=Function.prototype,Bat=Rat.toString;function _8(e){if(e!=null){try{return Bat.call(e)}catch{}try{return e+""}catch{}}return""}var Dat=/[\\^$.*+?()[\]{}|]/g,Fat=/^\[object .+?Constructor\]$/,zat=Function.prototype,jat=Object.prototype,Uat=zat.toString,Gat=jat.hasOwnProperty,qat=RegExp("^"+Uat.call(Gat).replace(Dat,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zat(e){if(!ih(e)||Nat(e))return!1;var t=D0e(e)?qat:Fat;return t.test(_8(e))}function Wat(e,t){return e==null?void 0:e[t]}function w8(e,t){var r=Wat(e,t);return Zat(r)?r:void 0}var Uj=w8(R3,"WeakMap");function Kat(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Xat=800,Jat=16,Yat=Date.now;function $at(e){var t=0,r=0;return function(){var n=Yat(),i=Jat-(n-r);if(r=n,i>0){if(++t>=Xat)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function est(e){return function(){return e}}var UC=function(){try{var e=w8(Object,"defineProperty");return e({},"",{}),e}catch{}}(),tst=UC?function(e,t){return UC(e,"toString",{configurable:!0,enumerable:!1,value:est(t),writable:!0})}:B0e,rst=$at(tst);function nst(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var ist=9007199254740991,ost=/^(?:0|[1-9]\d*)$/;function Gj(e,t){var r=typeof e;return t=t??ist,!!t&&(r=="number"||r!="symbol"&&ost.test(e))&&e>-1&&e%1==0&&e<t}function ast(e,t,r){t=="__proto__"&&UC?UC(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function qj(e,t){return e===t||e!==e&&t!==t}var sst=Object.prototype,lst=sst.hasOwnProperty;function cst(e,t,r){var n=e[t];(!(lst.call(e,t)&&qj(n,r))||r===void 0&&!(t in e))&&ast(e,t,r)}var z0e=Math.max;function ust(e,t,r){return t=z0e(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=z0e(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(s),Kat(e,this,l)}}var dst=9007199254740991;function Zj(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=dst}function pst(e){return e!=null&&Zj(e.length)&&!D0e(e)}var hst=Object.prototype;function fst(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||hst;return e===r}function mst(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var gst="[object Arguments]";function j0e(e){return og(e)&&ig(e)==gst}var U0e=Object.prototype,yst=U0e.hasOwnProperty,Tst=U0e.propertyIsEnumerable,Wj=j0e(function(){return arguments}())?j0e:function(e){return og(e)&&yst.call(e,"callee")&&!Tst.call(e,"callee")};function vst(){return!1}var G0e=typeof bn=="object"&&bn&&!bn.nodeType&&bn,q0e=G0e&&typeof module=="object"&&module&&!module.nodeType&&module,Qst=q0e&&q0e.exports===G0e,Z0e=Qst?R3.Buffer:void 0,bst=Z0e?Z0e.isBuffer:void 0,Kj=bst||vst,xst="[object Arguments]",_st="[object Array]",wst="[object Boolean]",Lst="[object Date]",Sst="[object Error]",kst="[object Function]",Mst="[object Map]",Cst="[object Number]",Est="[object Object]",Ast="[object RegExp]",Ost="[object Set]",Hst="[object String]",Vst="[object WeakMap]",Ist="[object ArrayBuffer]",Pst="[object DataView]",Nst="[object Float32Array]",Rst="[object Float64Array]",Bst="[object Int8Array]",Dst="[object Int16Array]",Fst="[object Int32Array]",zst="[object Uint8Array]",jst="[object Uint8ClampedArray]",Ust="[object Uint16Array]",Gst="[object Uint32Array]",da={};da[Nst]=da[Rst]=da[Bst]=da[Dst]=da[Fst]=da[zst]=da[jst]=da[Ust]=da[Gst]=!0,da[xst]=da[_st]=da[Ist]=da[wst]=da[Pst]=da[Lst]=da[Sst]=da[kst]=da[Mst]=da[Cst]=da[Est]=da[Ast]=da[Ost]=da[Hst]=da[Vst]=!1;function qst(e){return og(e)&&Zj(e.length)&&!!da[ig(e)]}function Zst(e){return function(t){return e(t)}}var W0e=typeof bn=="object"&&bn&&!bn.nodeType&&bn,Jb=W0e&&typeof module=="object"&&module&&!module.nodeType&&module,Wst=Jb&&Jb.exports===W0e,Xj=Wst&&A0e.process,K0e=function(){try{var e=Jb&&Jb.require&&Jb.require("util").types;return e||Xj&&Xj.binding&&Xj.binding("util")}catch{}}(),X0e=K0e&&K0e.isTypedArray,J0e=X0e?Zst(X0e):qst,Kst=Object.prototype,Xst=Kst.hasOwnProperty;function Jst(e,t){var r=D3(e),n=!r&&Wj(e),i=!r&&!n&&Kj(e),o=!r&&!n&&!i&&J0e(e),s=r||n||i||o,l=s?mst(e.length,String):[],c=l.length;for(var u in e)(t||Xst.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Gj(u,c)))&&l.push(u);return l}function Yst(e,t){return function(r){return e(t(r))}}var $st=Yst(Object.keys,Object),elt=Object.prototype,tlt=elt.hasOwnProperty;function rlt(e){if(!fst(e))return $st(e);var t=[];for(var r in Object(e))tlt.call(e,r)&&r!="constructor"&&t.push(r);return t}function Y0e(e){return pst(e)?Jst(e):rlt(e)}var nlt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ilt=/^\w*$/;function Jj(e,t){if(D3(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||jC(e)?!0:ilt.test(e)||!nlt.test(e)||t!=null&&e in Object(t)}var Yb=w8(Object,"create");function olt(){this.__data__=Yb?Yb(null):{},this.size=0}function alt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var slt="__lodash_hash_undefined__",llt=Object.prototype,clt=llt.hasOwnProperty;function ult(e){var t=this.__data__;if(Yb){var r=t[e];return r===slt?void 0:r}return clt.call(t,e)?t[e]:void 0}var dlt=Object.prototype,plt=dlt.hasOwnProperty;function hlt(e){var t=this.__data__;return Yb?t[e]!==void 0:plt.call(t,e)}var flt="__lodash_hash_undefined__";function mlt(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Yb&&t===void 0?flt:t,this}function L8(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}L8.prototype.clear=olt,L8.prototype.delete=alt,L8.prototype.get=ult,L8.prototype.has=hlt,L8.prototype.set=mlt;function glt(){this.__data__=[],this.size=0}function GC(e,t){for(var r=e.length;r--;)if(qj(e[r][0],t))return r;return-1}var ylt=Array.prototype,Tlt=ylt.splice;function vlt(e){var t=this.__data__,r=GC(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Tlt.call(t,r,1),--this.size,!0}function Qlt(e){var t=this.__data__,r=GC(t,e);return r<0?void 0:t[r][1]}function blt(e){return GC(this.__data__,e)>-1}function xlt(e,t){var r=this.__data__,n=GC(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function H4(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}H4.prototype.clear=glt,H4.prototype.delete=vlt,H4.prototype.get=Qlt,H4.prototype.has=blt,H4.prototype.set=xlt;var $b=w8(R3,"Map");function _lt(){this.size=0,this.__data__={hash:new L8,map:new($b||H4),string:new L8}}function wlt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function qC(e,t){var r=e.__data__;return wlt(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Llt(e){var t=qC(this,e).delete(e);return this.size-=t?1:0,t}function Slt(e){return qC(this,e).get(e)}function klt(e){return qC(this,e).has(e)}function Mlt(e,t){var r=qC(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function V4(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}V4.prototype.clear=_lt,V4.prototype.delete=Llt,V4.prototype.get=Slt,V4.prototype.has=klt,V4.prototype.set=Mlt;var Clt="Expected a function";function Yj(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Clt);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Yj.Cache||V4),r}Yj.Cache=V4;var Elt=500;function Alt(e){var t=Yj(e,function(n){return r.size===Elt&&r.clear(),n}),r=t.cache;return t}var Olt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hlt=/\\(\\)?/g,Vlt=Alt(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Olt,function(r,n,i,o){t.push(i?o.replace(Hlt,"$1"):n||r)}),t});function Ilt(e){return e==null?"":P0e(e)}function ZC(e,t){return D3(e)?e:Jj(e,t)?[e]:Vlt(Ilt(e))}var Plt=1/0;function ex(e){if(typeof e=="string"||jC(e))return e;var t=e+"";return t=="0"&&1/e==-Plt?"-0":t}function $j(e,t){t=ZC(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[ex(t[r++])];return r&&r==n?e:void 0}function y2(e,t,r){var n=e==null?void 0:$j(e,t);return n===void 0?r:n}function $0e(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var eue=B3?B3.isConcatSpreadable:void 0;function Nlt(e){return D3(e)||Wj(e)||!!(eue&&e&&e[eue])}function tue(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=Nlt),i||(i=[]);++o<s;){var l=e[o];t>0&&r(l)?t>1?tue(l,t-1,r,n,i):$0e(i,l):n||(i[i.length]=l)}return i}function Rlt(e){var t=e==null?0:e.length;return t?tue(e,1):[]}function Blt(e){return rst(ust(e,void 0,Rlt),e+"")}function Dlt(){this.__data__=new H4,this.size=0}function Flt(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function zlt(e){return this.__data__.get(e)}function jlt(e){return this.__data__.has(e)}var Ult=200;function Glt(e,t){var r=this.__data__;if(r instanceof H4){var n=r.__data__;if(!$b||n.length<Ult-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new V4(n)}return r.set(e,t),this.size=r.size,this}function I4(e){var t=this.__data__=new H4(e);this.size=t.size}I4.prototype.clear=Dlt,I4.prototype.delete=Flt,I4.prototype.get=zlt,I4.prototype.has=jlt,I4.prototype.set=Glt;function qlt(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Zlt(){return[]}var Wlt=Object.prototype,Klt=Wlt.propertyIsEnumerable,rue=Object.getOwnPropertySymbols,Xlt=rue?function(e){return e==null?[]:(e=Object(e),qlt(rue(e),function(t){return Klt.call(e,t)}))}:Zlt;const Jlt=Xlt;function Ylt(e,t,r){var n=t(e);return D3(e)?n:$0e(n,r(e))}function nue(e){return Ylt(e,Y0e,Jlt)}var eU=w8(R3,"DataView"),tU=w8(R3,"Promise"),rU=w8(R3,"Set"),iue="[object Map]",$lt="[object Object]",oue="[object Promise]",aue="[object Set]",sue="[object WeakMap]",lue="[object DataView]",ect=_8(eU),tct=_8($b),rct=_8(tU),nct=_8(rU),ict=_8(Uj),S8=ig;(eU&&S8(new eU(new ArrayBuffer(1)))!=lue||$b&&S8(new $b)!=iue||tU&&S8(tU.resolve())!=oue||rU&&S8(new rU)!=aue||Uj&&S8(new Uj)!=sue)&&(S8=function(e){var t=ig(e),r=t==$lt?e.constructor:void 0,n=r?_8(r):"";if(n)switch(n){case ect:return lue;case tct:return iue;case rct:return oue;case nct:return aue;case ict:return sue}return t});const cue=S8;var oct=R3.Uint8Array;const uue=oct;var act="__lodash_hash_undefined__";function sct(e){return this.__data__.set(e,act),this}function lct(e){return this.__data__.has(e)}function WC(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new V4;++t<r;)this.add(e[t])}WC.prototype.add=WC.prototype.push=sct,WC.prototype.has=lct;function cct(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function uct(e,t){return e.has(t)}var dct=1,pct=2;function due(e,t,r,n,i,o){var s=r&dct,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var p=-1,h=!0,f=r&pct?new WC:void 0;for(o.set(e,t),o.set(t,e);++p<l;){var m=e[p],g=t[p];if(n)var T=s?n(g,m,p,t,e,o):n(m,g,p,e,t,o);if(T!==void 0){if(T)continue;h=!1;break}if(f){if(!cct(t,function(y,v){if(!uct(f,v)&&(m===y||i(m,y,r,n,o)))return f.push(v)})){h=!1;break}}else if(!(m===g||i(m,g,r,n,o))){h=!1;break}}return o.delete(e),o.delete(t),h}function hct(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function fct(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var mct=1,gct=2,yct="[object Boolean]",Tct="[object Date]",vct="[object Error]",Qct="[object Map]",bct="[object Number]",xct="[object RegExp]",_ct="[object Set]",wct="[object String]",Lct="[object Symbol]",Sct="[object ArrayBuffer]",kct="[object DataView]",pue=B3?B3.prototype:void 0,nU=pue?pue.valueOf:void 0;function Mct(e,t,r,n,i,o,s){switch(r){case kct:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Sct:return!(e.byteLength!=t.byteLength||!o(new uue(e),new uue(t)));case yct:case Tct:case bct:return qj(+e,+t);case vct:return e.name==t.name&&e.message==t.message;case xct:case wct:return e==t+"";case Qct:var l=hct;case _ct:var c=n&mct;if(l||(l=fct),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=gct,s.set(e,t);var d=due(l(e),l(t),n,i,o,s);return s.delete(e),d;case Lct:if(nU)return nU.call(e)==nU.call(t)}return!1}var Cct=1,Ect=Object.prototype,Act=Ect.hasOwnProperty;function Oct(e,t,r,n,i,o){var s=r&Cct,l=nue(e),c=l.length,u=nue(t),d=u.length;if(c!=d&&!s)return!1;for(var p=c;p--;){var h=l[p];if(!(s?h in t:Act.call(t,h)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var T=s;++p<c;){h=l[p];var y=e[h],v=t[h];if(n)var _=s?n(v,y,h,t,e,o):n(y,v,h,e,t,o);if(!(_===void 0?y===v||i(y,v,r,n,o):_)){g=!1;break}T||(T=h=="constructor")}if(g&&!T){var b=e.constructor,L=t.constructor;b!=L&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof L=="function"&&L instanceof L)&&(g=!1)}return o.delete(e),o.delete(t),g}var Hct=1,hue="[object Arguments]",fue="[object Array]",KC="[object Object]",Vct=Object.prototype,mue=Vct.hasOwnProperty;function Ict(e,t,r,n,i,o){var s=D3(e),l=D3(t),c=s?fue:cue(e),u=l?fue:cue(t);c=c==hue?KC:c,u=u==hue?KC:u;var d=c==KC,p=u==KC,h=c==u;if(h&&Kj(e)){if(!Kj(t))return!1;s=!0,d=!1}if(h&&!d)return o||(o=new I4),s||J0e(e)?due(e,t,r,n,i,o):Mct(e,t,c,r,n,i,o);if(!(r&Hct)){var f=d&&mue.call(e,"__wrapped__"),m=p&&mue.call(t,"__wrapped__");if(f||m){var g=f?e.value():e,T=m?t.value():t;return o||(o=new I4),i(g,T,r,n,o)}}return h?(o||(o=new I4),Oct(e,t,r,n,i,o)):!1}function XC(e,t,r,n,i){return e===t?!0:e==null||t==null||!og(e)&&!og(t)?e!==e&&t!==t:Ict(e,t,r,n,XC,i)}var Pct=1,Nct=2;function Rct(e,t,r,n){var i=r.length,o=i,s=!n;if(e==null)return!o;for(e=Object(e);i--;){var l=r[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){l=r[i];var c=l[0],u=e[c],d=l[1];if(s&&l[2]){if(u===void 0&&!(c in e))return!1}else{var p=new I4;if(n)var h=n(u,d,c,e,t,p);if(!(h===void 0?XC(d,u,Pct|Nct,n,p):h))return!1}}return!0}function gue(e){return e===e&&!ih(e)}function Bct(e){for(var t=Y0e(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,gue(i)]}return t}function yue(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Dct(e){var t=Bct(e);return t.length==1&&t[0][2]?yue(t[0][0],t[0][1]):function(r){return r===e||Rct(r,e,t)}}function Fct(e,t){return e!=null&&t in Object(e)}function zct(e,t,r){t=ZC(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=ex(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&Zj(i)&&Gj(s,i)&&(D3(e)||Wj(e)))}function Tue(e,t){return e!=null&&zct(e,t,Fct)}var jct=1,Uct=2;function Gct(e,t){return Jj(e)&&gue(t)?yue(ex(e),t):function(r){var n=y2(r,e);return n===void 0&&n===t?Tue(r,e):XC(t,n,jct|Uct)}}function qct(e){return function(t){return t==null?void 0:t[e]}}function Zct(e){return function(t){return $j(t,e)}}function Wct(e){return Jj(e)?qct(ex(e)):Zct(e)}function Kct(e){return typeof e=="function"?e:e==null?B0e:typeof e=="object"?D3(e)?Gct(e[0],e[1]):Dct(e):Wct(e)}var iU=function(){return R3.Date.now()},Xct="Expected a function",Jct=Math.max,Yct=Math.min;function oU(e,t,r){var n,i,o,s,l,c,u=0,d=!1,p=!1,h=!0;if(typeof e!="function")throw new TypeError(Xct);t=zj(t)||0,ih(r)&&(d=!!r.leading,p="maxWait"in r,o=p?Jct(zj(r.maxWait)||0,t):o,h="trailing"in r?!!r.trailing:h);function f(w){var k=n,C=i;return n=i=void 0,u=w,s=e.apply(C,k),s}function m(w){return u=w,l=setTimeout(y,t),d?f(w):s}function g(w){var k=w-c,C=w-u,A=t-k;return p?Yct(A,o-C):A}function T(w){var k=w-c,C=w-u;return c===void 0||k>=t||k<0||p&&C>=o}function y(){var w=iU();if(T(w))return v(w);l=setTimeout(y,g(w))}function v(w){return l=void 0,h&&n?f(w):(n=i=void 0,s)}function _(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function b(){return l===void 0?s:v(iU())}function L(){var w=iU(),k=T(w);if(n=arguments,i=this,c=w,k){if(l===void 0)return m(c);if(p)return clearTimeout(l),l=setTimeout(y,t),f(c)}return l===void 0&&(l=setTimeout(y,t)),s}return L.cancel=_,L.flush=b,L}var $ct=Math.max,e1t=Math.min;function t1t(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=n-1;return r!==void 0&&(i=Oat(r),i=r<0?$ct(n+i,0):e1t(i,n-1)),nst(e,Kct(t),i,!0)}function JC(e){for(var t=-1,r=e==null?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n}function aU(e,t){return XC(e,t)}function oh(e){return e==null}function r1t(e){return e===void 0}function n1t(e,t,r,n){if(!ih(e))return e;t=ZC(t,e);for(var i=-1,o=t.length,s=o-1,l=e;l!=null&&++i<o;){var c=ex(t[i]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(i!=s){var d=l[c];u=n?n(d,c,l):void 0,u===void 0&&(u=ih(d)?d:Gj(t[i+1])?[]:{})}cst(l,c,u),l=l[c]}return e}function i1t(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],l=$j(e,s);r(l,s)&&n1t(o,ZC(s,e),l)}return o}function o1t(e,t){return i1t(e,t,function(r,n){return Tue(e,n)})}var a1t=Blt(function(e,t){return e==null?{}:o1t(e,t)});const tx=e=>e===void 0,ah=e=>typeof e=="boolean",Ys=e=>typeof e=="number",rx=e=>typeof Element>"u"?!1:e instanceof Element,s1t=e=>Js(e)?!Number.isNaN(Number(e)):!1,l1t=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),vue=e=>Object.keys(e);let Que=class extends Error{constructor(t){super(t),this.name="ElementPlusError"}};function c1t(e,t){throw new Que(`[${e}] ${t}`)}function $s(e,t){if(process.env.NODE_ENV!=="production"){const r=Js(e)?new Que(`[${e}] ${t}`):e;console.warn(r)}}const u1t="utils/dom/style",bue=(e="")=>e.split(" ").filter(t=>!!t.trim()),sU=(e,t)=>{!e||!t.trim()||e.classList.add(...bue(t))},k8=(e,t)=>{!e||!t.trim()||e.classList.remove(...bue(t))},nx=(e,t)=>{var r;if(!Xs||!e||!t)return"";let n=sat(t);n==="float"&&(n="cssFloat");try{const i=e.style[n];if(i)return i;const o=(r=document.defaultView)==null?void 0:r.getComputedStyle(e,"");return o?o[n]:""}catch{return e.style[n]}};function ag(e,t="px"){if(!e)return"";if(Ys(e)||s1t(e))return`${e}${t}`;if(Js(e))return e;$s(u1t,"binding value must be a string or number")}function d1t(e,t){if(!Xs)return;if(!t){e.scrollTop=0;return}const r=[];let n=t.offsetParent;for(;n!==null&&e!==n&&e.contains(n);)r.push(n),n=n.offsetParent;const i=t.offsetTop+r.reduce((c,u)=>c+u.offsetTop,0),o=i+t.offsetHeight,s=e.scrollTop,l=s+e.clientHeight;i<s?e.scrollTop=i:o>l&&(e.scrollTop=o-e.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var p1t=a.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),sh=p1t,h1t=a.defineComponent({name:"ArrowLeft",__name:"arrow-left",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),xue=h1t,f1t=a.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),YC=f1t,m1t=a.defineComponent({name:"CaretRight",__name:"caret-right",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),g1t=m1t,y1t=a.defineComponent({name:"CircleCheck",__name:"circle-check",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),a.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),T1t=y1t,v1t=a.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),lU=v1t,Q1t=a.defineComponent({name:"Close",__name:"close",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),ix=Q1t,b1t=a.defineComponent({name:"Edit",__name:"edit",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),a.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),_ue=b1t,x1t=a.defineComponent({name:"Hide",__name:"hide",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),a.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),_1t=x1t,w1t=a.defineComponent({name:"Loading",__name:"loading",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),cU=w1t,L1t=a.defineComponent({name:"Notebook",__name:"notebook",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32"}),a.createElementVNode("path",{fill:"currentColor",d:"M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32"})]))}}),S1t=L1t,k1t=a.defineComponent({name:"View",__name:"view",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),M1t=k1t,C1t=a.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),wue=C1t,E1t=a.defineComponent({name:"Warning",__name:"warning",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}}),Lue=E1t;const Sue="__epPropKey",mi=e=>e,A1t=e=>Sc(e)&&!!e[Sue],$C=(e,t)=>{if(!Sc(e)||A1t(e))return e;const{values:r,required:n,default:i,type:o,validator:s}=e,l={type:o,required:!!n,validator:r||s?c=>{let u=!1,d=[];if(r&&(d=Array.from(r),x8(e,"default")&&d.push(i),u||(u=d.includes(c))),s&&(u||(u=s(c))),!u&&d.length>0){const p=[...new Set(d)].map(h=>JSON.stringify(h)).join(", ");a.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${p}], got value ${JSON.stringify(c)}.`)}return u}:void 0,[Sue]:!0};return x8(e,"default")&&(l.default=i),l},Lo=e=>JC(Object.entries(e).map(([t,r])=>[t,$C(r,t)])),lh=mi([String,Object,Function]),kue={validating:cU,success:T1t,error:lU},Jc=(e,t)=>{if(e.install=r=>{for(const n of[e,...Object.values(t??{})])r.component(n.name,n)},t)for(const[r,n]of Object.entries(t))e[r]=n;return e},O1t=(e,t)=>(e.install=r=>{r.directive(t,e)},e),Qu=e=>(e.install=Kb,e),kc={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},ss="update:modelValue",eE="change",uU=["","default","small","large"],H1t={large:40,default:32,small:24},V1t=e=>H1t[e||"default"],I1t=e=>["",...uU].includes(e),Mue=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),sg=e=>e,P1t=["class","style"],N1t=/^on[A-Z]/,R1t=(e={})=>{const{excludeListeners:t=!1,excludeKeys:r}=e,n=a.computed(()=>((r==null?void 0:r.value)||[]).concat(P1t)),i=a.getCurrentInstance();return i?a.computed(()=>{var o;return JC(Object.entries((o=i.proxy)==null?void 0:o.$attrs).filter(([s])=>!n.value.includes(s)&&!(t&&N1t.test(s))))}):($s("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},Cue=({from:e,replacement:t,scope:r,version:n,ref:i,type:o="API"},s)=>{a.watch(()=>a.unref(s),l=>{l&&$s(r,`[${o}] ${e} is about to be deprecated in version ${n}, please use ${t} instead.
428
+ `)},Oot=["innerHTML"];function Hot(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,Oot)}const BC=B2e(Aot,[["render",Hot]]),Pj=()=>({entries:[{resource:"Rat",type:"MultiFlatmap",mode:"main",id:1,state:void 0,label:"",discoverId:void 0}]}),Vot=async(e,t)=>{let r={};if(e==="AC")r={resource:"Rat",type:"MultiFlatmap",mode:"main",state:void 0,label:"",discoverId:void 0};else if(e==="FC")r={resource:"FunctionalConnectivity",type:"Flatmap",mode:"main",state:void 0,label:"Functional",discoverId:void 0};else if(e==="3D"){const n=await Nj(t,"human");r={resource:n.url,type:"Scaffold",mode:"main",state:void 0,label:"Human",discoverId:n.datasetInfo.discoverId,contextCardUrl:n.datasetInfo.contextCardUrl,s3uri:n.datasetInfo.s3uri,version:n.datasetInfo.version,isBodyScaffold:!0}}return r},Iot=async(e,t)=>{const r=Pj();if(e==="FC")r.entries[0].resource="FunctionalConnectivity",r.entries[0].type="Flatmap",r.entries[0].label="Functional";else if(e==="WholeBody"){const n=await Nj(t,"human");r.entries[0].resource=n.url,r.entries[0].contextCardUrl=n.datasetInfo.contextCardUrl,r.entries[0].discoverId=n.datasetInfo.discoverId,r.entries[0].s3uri=n.datasetInfo.s3uri,r.entries[0].version=n.datasetInfo.version,r.entries[0].type="Scaffold",r.entries[0].label="Human",r.entries[0].isBodyScaffold=!0}return r},m0e=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),g0e=()=>({"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayLatestChanges:!0,displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayLatestChanges:!0,displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0,displayWarning:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayLatestChanges:!0,displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayLatestChanges:!0,displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayLatestChanges:!0,displayWarning:!0}}),Pot=e=>{if(e){const t=g0e();for(let r in t)if(e.taxo===t[r].taxo)if(e.biologicalSex&&t[r].biologicalSex){if(e.biologicalSex===t[r].biologicalSex)return r}else return r}return""},Not=e=>{if(e){const t=e.split("//")[1];if(t){const r=t.split("/")[0],n=t.indexOf("/"),i=t.substring(n+1);return{s3Bucket:r,s3Prefix:i}}}},Nj=async(e,t)=>{let r="",n;const i=await fetch(`${e}get_body_scaffold_info/${t}`);if(i.ok){const o=await i.json(),s=Not(o.s3uri);r=`${e}s3-resource/${s.s3Prefix}files/${o.path}?s3BucketName=${s.s3Bucket}`;const l=`${e}s3-resource/${s.s3Prefix}files/${o.contextinfo}?s3BucketName=${s.s3Bucket}`;n={s3uri:o.s3uri,contextCardUrl:l,discoverId:o.id,version:o.version}}else t==="rat"?r="https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json":t==="human"&&(r="https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/27-4-23-human/human_body_metadata.json");return{url:r,datasetInfo:n}},DC=gl.defineStore("entries",{state:()=>Pj(),getters:{findIndexOfId:e=>t=>{for(let r=0;r<e.entries.length;r++)if(e.entries[r].id==t)return r;return-1}},actions:{addNewEntry(e){this.entries.push(e)},destroyEntry(e){e>-1&&this.entries.splice(e,1)},setAll(e){this.entries=[],Object.assign(this.entries,e)},updateViewForEntry({id:e,viewUrl:t}){const r=this.entries.find(n=>n.id===e);r.viewUrl=t}}}),rg=gl.defineStore("settings",{state:()=>({shareLink:void 0,sparcApi:void 0,algoliaIndex:"k-core_dev_published_time_desc",algoliaKey:void 0,algoliaId:void 0,pennsieveApi:void 0,flatmapAPI:void 0,nlLinkPrefix:void 0,rootUrl:void 0,facets:{species:[],gender:[],organ:[]},facetLabels:[],markers:[],featuredMarkers:[],featuredMarkerIdentifiers:[],featuredMarkerDois:[],featuredMarkerSpecies:[],featuredDatasetIdentifiers:[],helpDelay:0}),getters:{isFeaturedMarkerIdentifier:e=>t=>e.featuredMarkerIdentifiers.includes(t),featuredMarkerDoi:e=>t=>{const r=e.featuredMarkerIdentifiers.findIndex(n=>n==t);return e.featuredMarkerDois[r]}},actions:{updateShareLink(e){this.shareLink=e},updateSparcAPI(e){this.sparcApi=e},updateAlgoliaIndex(e){this.algoliaIndex=e},updateAlgoliaKey(e){this.algoliaKey=e},updateAlgoliaId(e){this.algoliaId=e},updatePennsieveApi(e){this.pennsieveApi=e},updateFlatmapAPI(e){this.flatmapAPI=e},updateNLLinkPrefix(e){this.nlLinkPrefix=e},updateRootUrl(e){this.rootUrl=e},updateMarkers(e){this.markers=e},updateFeatured(e){this.featuredMarkerIdentifiers=new Array(e.length),this.featuredMarkers=new Array(e.length),this.featuredMarkerDois=new Array(e.length),this.featuredMarkerSpecies=new Array(e.length),this.featuredDatasetIdentifiers=e},updateFeaturedMarker(e){const t=this.featuredDatasetIdentifiers.findIndex(r=>r==e.identifier);this.featuredMarkers[t]=e.marker,this.featuredMarkerDois[t]=e.doi,this.featuredMarkerSpecies[t]=e.species},updateFeaturedMarkerIdentifier(e){this.featuredMarkerIdentifiers[e.index]=e.markerIdentifier},resetFeaturedMarkerIdentifier(){this.featuredMarkerIdentifiers=new Array(this.featuredDatasetIdentifiers.length)},updateFacets(e){let t={species:[],gender:[],organ:[]};if(e){e.forEach(r=>{switch(r.term.toLowerCase()){case"species":r.facet.toLowerCase()!=="show all"?(t.species.push(r.facet),this.facets.species.includes(r.facet)||this.facets.species.push(r.facet)):this.facets.species=[];break;case"gender":r.facet.toLowerCase()!=="show all"&&(t.gender.push(r.facet),this.facets.species.includes(r.facet)||this.facets.gender.push(r.facet));break;case"organ":r.facet.toLowerCase()!=="show all"&&(t.organ.push(r.facet),this.facets.species.includes(r.facet)||this.facets.organ.push(r.facet));break}});for(const[r,n]of Object.entries(this.facets)){let i=0;for(i=n.length-1;i>=0;i-=1)t[r].indexOf(n[i])==-1&&n.splice(i,1)}}},updateFacetLabels(e){this.facetLabels=e}}}),y0e=e=>{switch(e){case"2horpanel":return{"split-1":{content:!1,horizontal:!0,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"2vertpanel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"3panel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3}};case"4panel":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4}};case"5panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-5"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5}};case"6panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"6panelVertical":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"singlepanel":default:return{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}}}},Rot=(e,t)=>{const r=[],n=[];for(const[i,o]of Object.entries(t))o.content&&(r.includes(o.id)?n.push(i):r.push(o.id));n.forEach(i=>{let o=!1;for(let s=0;s<e.length&&!o;s++)r.includes(e[s].id)||(t[i].id=e[s].id,r.push(e.id),o=!0)})},Bot=e=>{const t={};for(const[r,n]of Object.entries(e))n.content&&(t[r]=n);return t},FC=(e,t)=>{const r=Bot(e),n=y0e(t);for(const[i,o]of Object.entries(r))n[i]=o;return n},Q8=(e,t)=>Object.keys(e).find(r=>e[r].id===t),b8=gl.defineStore("splitFlow",{state:()=>({activeView:"singlepanel",viewIcons:[{icon:"singlepanel",name:"Single view",min:1},{icon:"2horpanel",name:"Horizontal split",min:2},{icon:"2vertpanel",name:"Vertical split",min:2},{icon:"3panel",name:"Three panes",min:3},{icon:"4panel",name:"Four panes",min:4},{icon:"5panel",name:"Five panes",min:5},{icon:"6panel",name:"Six (horizontal)",min:6},{icon:"6panelVertical",name:"Six (vertical)",min:6}],customLayout:{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}},splitters:{first:50,second:50,third:50},globalCallback:!1,syncMode:!1}),getters:{getPaneNameById:e=>t=>Q8(e.customLayout,t),getState:e=>()=>({activeView:e.activeView,splitters:e.splitters,globalCallback:e.globalCallback,customLayout:e.customLayout,syncMode:e.syncMode})},actions:{assignOrSwapPaneWithIds(e){let t=Q8(this.customLayout,e.source),r=Q8(this.customLayout,e.target);this.syncMode&&!(r||t)&&(this.syncMode=!1,this.globalCallback=!1),r&&(this.customLayout[r].id=e.source),t&&(this.customLayout[t].id=e.target)},toggleGlobalCallback(e){this.globalCallback=e},updateActiveView(e){if(this.syncMode){const r=this.viewIcons.find(i=>this.activeView===i.icon),n=this.viewIcons.find(i=>e.view===i.icon);r.min==2&&n.min==2||(this.syncMode=!1,this.globalCallback=!1)}this.activeView=e.view;const t=FC(this.customLayout,this.activeView);Rot(e.entries,t);for(const[r,n]of Object.entries(t))this.customLayout[r]=n},setSplitter(e){this.splitters[e.name]&&(this.splitters[e.name]=e.value)},setState(e){if(e){let t;if(e.activeView&&(this.activeView=e.activeView),e.customLayout)t=e.customLayout;else if(t=y0e(this.activeView),console.log(e,t),e.slotInfo)for(let r=0;r<e.slotInfo.length;r++)switch(e.slotInfo[r].name){case"first":t["pane-1"].id=e.slotInfo[r].id;break;case"second":"pane-2"in t&&(t["pane-2"].id=e.slotInfo[r].id);break;case"thrid":"pane-3"in t&&(t["pane-3"].id=e.slotInfo[r].id);break;case"fourth":"pane-4"in t&&(t["pane-4"].id=e.slotInfo[r].id);break;case"fifth":"pane-5"in t&&(t["pane-5"].id=e.slotInfo[r].id);break;case"sixth":"pane-6"in t&&(t["pane-6"].id=e.slotInfo[r].id);break}for(const[r,n]of Object.entries(t))this.customLayout[r]=n;e.globalCallback&&(this.globalCallback=e.globalCallback);for(const[r,n]of Object.entries(e.splitters))this.splitters[r]=n;e.syncMode&&(this.syncMode=e.syncMode)}},setIdToPrimaryPane(e){const t=Q8(this.customLayout,e),r=this.customLayout["pane-1"].id;this.customLayout["pane-1"].id=e,t&&(this.customLayout[t].id=r)},setSyncMode(e){if(e)if(e.flag===!0){this.activeView=e.layout;const t=FC(this.customLayout,this.activeView),r=Q8(t,1),n=t["pane-1"].id;r!=="pane-1"&&(t["pane-1"].id=n),t["pane-1"].id=1,t["pane-2"].id=e.newId;for(const[i,o]of Object.entries(t))this.customLayout[i]=o;this.syncMode=!0,this.globalCallback=!0}else{this.activeView="singlepanel";const t=FC(this.customLayout,this.activeView);for(const[r,n]of Object.entries(t))this.customLayout[r]=n;this.syncMode=!1,this.globalCallback=!1}},closeSlot(e){if(e){this.syncMode=!1,this.globalCallback=!1;let t=0;if(e.id===1)t=1;else if(e.entries)for(let r=0;r<e.entries.length&&t==0;r++)Q8(e.entries[r].id)===void 0&&(t=e.entries[r].id);if(this.activeView!=="customise"){const r=this.activeView;switch(this.activeView){case"2horpanel":case"2vertpanel":this.activeView="singlepanel";break;case"3panel":this.activeView="2vertpanel";break;case"4panel":this.activeView="3panel";break;case"5panel":this.activeView="4panel";break;case"6panelVertical":case"6panel":this.activeView="5panel";break}const n=FC(this.customLayout,this.activeView);switch(Q8(n,e.id)){case"pane-1":switch(r){case"2horpanel":case"2vertpanel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=t;break;case"3panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=t;break;case"4panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-2":switch(r){case"2horpanel":case"2vertpanel":n["pane-2"].id=t;break;case"3panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=t;break;case"4panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-3":switch(r){case"3panel":n["pane-3"].id=t;break;case"4panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-4":switch(r){case"4panel":n["pane-4"].id=t;break;case"5panel":n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-5":switch(r){case"5panel":n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-6":switch(r){case"6panelVertical":case"6panel":n["pane-6"].id=t;break}break}for(const[o,s]of Object.entries(n))this.customLayout[o]=s}}}}}),Dot={name:"ContentBar",components:{ElIconArrowDown:Gz,ElIconArrowUp:yce,ElIconInfoFilled:Qce,Input:Gb,Option:e2e,Popover:wC,Row:xC,Select:$1e,ContextCard:N2e,FlatmapContextCard:R2e,MapSvgIcon:Wb},props:{entry:Object},data:function(){return{contextCardVisible:!1,slot:{},boundariesElement:null,showDetails:!0,contextCardEntry:void 0}},computed:{...gl.mapStores(DC,rg,b8),helpDelay(){return this.settingsStore.helpDelay},activeView:function(){return this.splitFlowStore.activeView},envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},popperOptions:function(){return{preventOverflow:{enabled:!0,boundary:this.boundariesElement}}},entries:function(){return this.entriesStore.entries}},methods:{closeAndRemove:function(){this.splitFlowStore.closeSlot({id:this.entry.id,entries:this.entries}),Xo.emit("RemoveEntryRequest",this.entry.id)},getEntryTitle:function(e){if(e){let t=e.label?e.label+" ":"",r=e.type;return r=="Scaffold"&&(r="3D Scaffold"),t+=r,e.datasetId?t+=" ("+e.datasetId+")":e.discoverId&&(t+=" ("+e.discoverId+")"),t}return"Viewer"},viewerChanged:function(e){this.entry.id&&this.entry.id!=e&&(this.splitFlowStore.assignOrSwapPaneWithIds({source:this.entry.id,target:e}),this.$nextTick(()=>{setTimeout(()=>{this.$emit("chooser-changed")},1200)}))},setPopperWidth:function(e){let t=this.entries.find(r=>r.id===e);if(t)return t.type=="Flatmap"||t.type=="MultiFlatmap"?"240px":"440px"},setBoundary:function(e){this.boundariesElement=e},setupFlatmapContextCard:function(e){this.contextCardVisible=!1;let t=Object.assign({mapImpProv:e.prov},this.entry);this.contextCardEntry=t},setupScaffoldContextCard:function(){this.entry.contextCardUrl&&(this.contextCardEntry={...this.entry})}},mounted:function(){this.setupScaffoldContextCard()}},Fot={class:"toolbar-flex-container"},zot={key:1,class:"toolbar-title"};function jot(e,t,r,n,i,o){const s=e2e,l=$1e,c=yce,u=Ks,d=Gz,p=R2e,h=N2e,f=Qce,m=wC,g=a.resolveComponent("map-svg-icon"),T=xC;return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",Fot,[o.entries.length>1?(a.openBlock(),a.createBlock(l,{key:0,teleported:!1,"model-value":r.entry.id,placeholder:"Select",class:"select-box","popper-class":"viewer_dropdown",onChange:t[0]||(t[0]=y=>o.viewerChanged(y))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.entries,y=>(a.openBlock(),a.createBlock(s,{key:y.id,label:o.getEntryTitle(y),value:y.id},null,8,["label","value"]))),128))]),_:1},8,["model-value"])):(a.openBlock(),a.createElementBlock("div",zot,a.toDisplayString(o.getEntryTitle(r.entry)),1))]),a.createVNode(T,{class:"icon-group"},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=y=>e.contextCardVisible=!1)},[a.createTextVNode(" Hide information "),a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1})],512),[[a.vShow,e.contextCardEntry&&e.contextCardVisible]]),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[2]||(t[2]=y=>e.contextCardVisible=!0)},[a.createTextVNode(" Show information "),a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})],512),[[a.vShow,e.contextCardEntry&&!e.contextCardVisible]]),a.createVNode(m,{placement:"bottom",teleported:!1,trigger:"manual",width:o.setPopperWidth(e.slot.id),offset:0,"popper-class":"context-card-popover","popper-options":o.popperOptions,visible:e.contextCardVisible},a.createSlots({reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{class:"info-icon",onClick:t[5]||(t[5]=y=>e.contextCardVisible=!e.contextCardVisible)},{default:a.withCtx(()=>[a.createVNode(f)]),_:1},512),[[a.vShow,e.contextCardEntry]])]),_:2},[e.contextCardEntry?{name:"default",fn:a.withCtx(()=>[e.contextCardEntry.type=="Flatmap"||e.contextCardEntry.type=="MultiFlatmap"?(a.openBlock(),a.createBlock(p,{key:0,class:"flatmap-context-card",mapImpProv:e.contextCardEntry.mapImpProv},null,8,["mapImpProv"])):a.createCommentVNode("",!0),e.contextCardEntry.type.toLowerCase()=="scaffold"?(a.openBlock(),a.createBlock(h,{key:1,entry:e.contextCardEntry,envVars:o.envVars,class:"context-card",onContextReady:t[3]||(t[3]=y=>e.contextCardVisible=!0),onScaffoldViewClicked:t[4]||(t[4]=y=>e.$emit("scaffold-view-clicked",y))},null,8,["entry","envVars"])):a.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["width","popper-options","visible"]),a.createVNode(m,{class:"tooltip",content:"Close and remove",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(g,{icon:"close",class:"header-icon",onClick:t[6]||(t[6]=y=>o.closeAndRemove())},null,512),[[a.vShow,o.activeView!=="singlepanel"&&r.entry.mode!=="main"]])]),_:1},8,["show-after"])]),_:1})])}const T0e=Gl(Dot,[["render",jot],["__scopeId","data-v-211633bc"]]),O4=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var v0e;const Xs=typeof window<"u",Uot=e=>typeof e=="string",Q0e=()=>{},b0e=Xs&&((v0e=window==null?void 0:window.navigator)==null?void 0:v0e.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function x0e(e){return typeof e=="function"?e():a.unref(e)}function Got(e){return e}function Rj(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function qot(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function rh(e){var t;const r=x0e(e);return(t=r==null?void 0:r.$el)!=null?t:r}const Bj=Xs?window:void 0;function nh(...e){let t,r,n,i;if(Uot(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=Bj):[t,r,n,i]=e,!t)return Q0e;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,p,h,f)=>(d.addEventListener(p,h,f),()=>d.removeEventListener(p,h,f)),c=a.watch(()=>[rh(t),x0e(i)],([d,p])=>{s(),d&&o.push(...r.flatMap(h=>n.map(f=>l(d,h,f,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return Rj(u),u}let _0e=!1;function Zot(e,t,r={}){const{window:n=Bj,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;b0e&&!_0e&&(_0e=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Q0e)));let l=!0;const c=d=>i.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(h=>h===d.target||d.composedPath().includes(h));{const h=rh(p);return h&&(d.target===h||d.composedPath().includes(h))}}),u=[nh(n,"click",d=>{const p=rh(e);if(!(!p||p===d.target||d.composedPath().includes(p))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),nh(n,"pointerdown",d=>{const p=rh(e);p&&(l=!d.composedPath().includes(p)&&!c(d))},{passive:!0}),s&&nh(n,"blur",d=>{var p;const h=rh(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function Wot(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),qot(n,t),r}const w0e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},L0e="__vueuse_ssr_handlers__";w0e[L0e]=w0e[L0e]||{};var S0e=Object.getOwnPropertySymbols,Kot=Object.prototype.hasOwnProperty,Xot=Object.prototype.propertyIsEnumerable,Jot=(e,t)=>{var r={};for(var n in e)Kot.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&S0e)for(var n of S0e(e))t.indexOf(n)<0&&Xot.call(e,n)&&(r[n]=e[n]);return r};function zC(e,t,r={}){const n=r,{window:i=Bj}=n,o=Jot(n,["window"]);let s;const l=Wot(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>rh(e),p=>{c(),l.value&&i&&p&&(s=new ResizeObserver(t),s.observe(p,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Rj(d),{isSupported:l,stop:d}}var k0e;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(k0e||(k0e={}));var Yot=Object.defineProperty,M0e=Object.getOwnPropertySymbols,$ot=Object.prototype.hasOwnProperty,eat=Object.prototype.propertyIsEnumerable,C0e=(e,t,r)=>t in e?Yot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tat=(e,t)=>{for(var r in t||(t={}))$ot.call(t,r)&&C0e(e,r,t[r]);if(M0e)for(var r of M0e(t))eat.call(t,r)&&C0e(e,r,t[r]);return e};tat({linear:Got},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const rat=()=>Xs&&/firefox/i.test(window.navigator.userAgent),Dj=e=>{let t,r;return e.type==="touchend"?(r=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):e.type.startsWith("touch")?(r=e.touches[0].clientY,t=e.touches[0].clientX):(r=e.clientY,t=e.clientX),{clientX:t,clientY:r}};process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kb=()=>{},nat=Object.prototype.hasOwnProperty,x8=(e,t)=>nat.call(e,t),ng=Array.isArray,g2=e=>typeof e=="function",Js=e=>typeof e=="string",Sc=e=>e!==null&&typeof e=="object",iat=Object.prototype.toString,oat=e=>iat.call(e),Fj=e=>oat(e).slice(8,-1),E0e=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},aat=/-(\w)/g,sat=E0e(e=>e.replace(aat,(t,r)=>r?r.toUpperCase():"")),lat=/\B([A-Z])/g,cat=E0e(e=>e.replace(lat,"-$1").toLowerCase());var A0e=typeof global=="object"&&global&&global.Object===Object&&global,uat=typeof self=="object"&&self&&self.Object===Object&&self,R3=A0e||uat||Function("return this")(),B3=R3.Symbol,O0e=Object.prototype,dat=O0e.hasOwnProperty,pat=O0e.toString,Xb=B3?B3.toStringTag:void 0;function hat(e){var t=dat.call(e,Xb),r=e[Xb];try{e[Xb]=void 0;var n=!0}catch{}var i=pat.call(e);return n&&(t?e[Xb]=r:delete e[Xb]),i}var fat=Object.prototype,mat=fat.toString;function gat(e){return mat.call(e)}var yat="[object Null]",Tat="[object Undefined]",H0e=B3?B3.toStringTag:void 0;function ig(e){return e==null?e===void 0?Tat:yat:H0e&&H0e in Object(e)?hat(e):gat(e)}function og(e){return e!=null&&typeof e=="object"}var vat="[object Symbol]";function jC(e){return typeof e=="symbol"||og(e)&&ig(e)==vat}function Qat(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var D3=Array.isArray,bat=1/0,V0e=B3?B3.prototype:void 0,I0e=V0e?V0e.toString:void 0;function P0e(e){if(typeof e=="string")return e;if(D3(e))return Qat(e,P0e)+"";if(jC(e))return I0e?I0e.call(e):"";var t=e+"";return t=="0"&&1/e==-bat?"-0":t}var xat=/\s/;function _at(e){for(var t=e.length;t--&&xat.test(e.charAt(t)););return t}var wat=/^\s+/;function Lat(e){return e&&e.slice(0,_at(e)+1).replace(wat,"")}function ih(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var N0e=NaN,Sat=/^[-+]0x[0-9a-f]+$/i,kat=/^0b[01]+$/i,Mat=/^0o[0-7]+$/i,Cat=parseInt;function zj(e){if(typeof e=="number")return e;if(jC(e))return N0e;if(ih(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ih(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Lat(e);var r=kat.test(e);return r||Mat.test(e)?Cat(e.slice(2),r?2:8):Sat.test(e)?N0e:+e}var R0e=1/0,Eat=17976931348623157e292;function Aat(e){if(!e)return e===0?e:0;if(e=zj(e),e===R0e||e===-R0e){var t=e<0?-1:1;return t*Eat}return e===e?e:0}function Oat(e){var t=Aat(e),r=t%1;return t===t?r?t-r:t:0}function B0e(e){return e}var Hat="[object AsyncFunction]",Vat="[object Function]",Iat="[object GeneratorFunction]",Pat="[object Proxy]";function D0e(e){if(!ih(e))return!1;var t=ig(e);return t==Vat||t==Iat||t==Hat||t==Pat}var jj=R3["__core-js_shared__"],F0e=function(){var e=/[^.]+$/.exec(jj&&jj.keys&&jj.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Nat(e){return!!F0e&&F0e in e}var Rat=Function.prototype,Bat=Rat.toString;function _8(e){if(e!=null){try{return Bat.call(e)}catch{}try{return e+""}catch{}}return""}var Dat=/[\\^$.*+?()[\]{}|]/g,Fat=/^\[object .+?Constructor\]$/,zat=Function.prototype,jat=Object.prototype,Uat=zat.toString,Gat=jat.hasOwnProperty,qat=RegExp("^"+Uat.call(Gat).replace(Dat,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zat(e){if(!ih(e)||Nat(e))return!1;var t=D0e(e)?qat:Fat;return t.test(_8(e))}function Wat(e,t){return e==null?void 0:e[t]}function w8(e,t){var r=Wat(e,t);return Zat(r)?r:void 0}var Uj=w8(R3,"WeakMap");function Kat(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Xat=800,Jat=16,Yat=Date.now;function $at(e){var t=0,r=0;return function(){var n=Yat(),i=Jat-(n-r);if(r=n,i>0){if(++t>=Xat)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function est(e){return function(){return e}}var UC=function(){try{var e=w8(Object,"defineProperty");return e({},"",{}),e}catch{}}(),tst=UC?function(e,t){return UC(e,"toString",{configurable:!0,enumerable:!1,value:est(t),writable:!0})}:B0e,rst=$at(tst);function nst(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var ist=9007199254740991,ost=/^(?:0|[1-9]\d*)$/;function Gj(e,t){var r=typeof e;return t=t??ist,!!t&&(r=="number"||r!="symbol"&&ost.test(e))&&e>-1&&e%1==0&&e<t}function ast(e,t,r){t=="__proto__"&&UC?UC(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function qj(e,t){return e===t||e!==e&&t!==t}var sst=Object.prototype,lst=sst.hasOwnProperty;function cst(e,t,r){var n=e[t];(!(lst.call(e,t)&&qj(n,r))||r===void 0&&!(t in e))&&ast(e,t,r)}var z0e=Math.max;function ust(e,t,r){return t=z0e(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=z0e(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(s),Kat(e,this,l)}}var dst=9007199254740991;function Zj(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=dst}function pst(e){return e!=null&&Zj(e.length)&&!D0e(e)}var hst=Object.prototype;function fst(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||hst;return e===r}function mst(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var gst="[object Arguments]";function j0e(e){return og(e)&&ig(e)==gst}var U0e=Object.prototype,yst=U0e.hasOwnProperty,Tst=U0e.propertyIsEnumerable,Wj=j0e(function(){return arguments}())?j0e:function(e){return og(e)&&yst.call(e,"callee")&&!Tst.call(e,"callee")};function vst(){return!1}var G0e=typeof bn=="object"&&bn&&!bn.nodeType&&bn,q0e=G0e&&typeof module=="object"&&module&&!module.nodeType&&module,Qst=q0e&&q0e.exports===G0e,Z0e=Qst?R3.Buffer:void 0,bst=Z0e?Z0e.isBuffer:void 0,Kj=bst||vst,xst="[object Arguments]",_st="[object Array]",wst="[object Boolean]",Lst="[object Date]",Sst="[object Error]",kst="[object Function]",Mst="[object Map]",Cst="[object Number]",Est="[object Object]",Ast="[object RegExp]",Ost="[object Set]",Hst="[object String]",Vst="[object WeakMap]",Ist="[object ArrayBuffer]",Pst="[object DataView]",Nst="[object Float32Array]",Rst="[object Float64Array]",Bst="[object Int8Array]",Dst="[object Int16Array]",Fst="[object Int32Array]",zst="[object Uint8Array]",jst="[object Uint8ClampedArray]",Ust="[object Uint16Array]",Gst="[object Uint32Array]",da={};da[Nst]=da[Rst]=da[Bst]=da[Dst]=da[Fst]=da[zst]=da[jst]=da[Ust]=da[Gst]=!0,da[xst]=da[_st]=da[Ist]=da[wst]=da[Pst]=da[Lst]=da[Sst]=da[kst]=da[Mst]=da[Cst]=da[Est]=da[Ast]=da[Ost]=da[Hst]=da[Vst]=!1;function qst(e){return og(e)&&Zj(e.length)&&!!da[ig(e)]}function Zst(e){return function(t){return e(t)}}var W0e=typeof bn=="object"&&bn&&!bn.nodeType&&bn,Jb=W0e&&typeof module=="object"&&module&&!module.nodeType&&module,Wst=Jb&&Jb.exports===W0e,Xj=Wst&&A0e.process,K0e=function(){try{var e=Jb&&Jb.require&&Jb.require("util").types;return e||Xj&&Xj.binding&&Xj.binding("util")}catch{}}(),X0e=K0e&&K0e.isTypedArray,J0e=X0e?Zst(X0e):qst,Kst=Object.prototype,Xst=Kst.hasOwnProperty;function Jst(e,t){var r=D3(e),n=!r&&Wj(e),i=!r&&!n&&Kj(e),o=!r&&!n&&!i&&J0e(e),s=r||n||i||o,l=s?mst(e.length,String):[],c=l.length;for(var u in e)(t||Xst.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Gj(u,c)))&&l.push(u);return l}function Yst(e,t){return function(r){return e(t(r))}}var $st=Yst(Object.keys,Object),elt=Object.prototype,tlt=elt.hasOwnProperty;function rlt(e){if(!fst(e))return $st(e);var t=[];for(var r in Object(e))tlt.call(e,r)&&r!="constructor"&&t.push(r);return t}function Y0e(e){return pst(e)?Jst(e):rlt(e)}var nlt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ilt=/^\w*$/;function Jj(e,t){if(D3(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||jC(e)?!0:ilt.test(e)||!nlt.test(e)||t!=null&&e in Object(t)}var Yb=w8(Object,"create");function olt(){this.__data__=Yb?Yb(null):{},this.size=0}function alt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var slt="__lodash_hash_undefined__",llt=Object.prototype,clt=llt.hasOwnProperty;function ult(e){var t=this.__data__;if(Yb){var r=t[e];return r===slt?void 0:r}return clt.call(t,e)?t[e]:void 0}var dlt=Object.prototype,plt=dlt.hasOwnProperty;function hlt(e){var t=this.__data__;return Yb?t[e]!==void 0:plt.call(t,e)}var flt="__lodash_hash_undefined__";function mlt(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Yb&&t===void 0?flt:t,this}function L8(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}L8.prototype.clear=olt,L8.prototype.delete=alt,L8.prototype.get=ult,L8.prototype.has=hlt,L8.prototype.set=mlt;function glt(){this.__data__=[],this.size=0}function GC(e,t){for(var r=e.length;r--;)if(qj(e[r][0],t))return r;return-1}var ylt=Array.prototype,Tlt=ylt.splice;function vlt(e){var t=this.__data__,r=GC(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Tlt.call(t,r,1),--this.size,!0}function Qlt(e){var t=this.__data__,r=GC(t,e);return r<0?void 0:t[r][1]}function blt(e){return GC(this.__data__,e)>-1}function xlt(e,t){var r=this.__data__,n=GC(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function H4(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}H4.prototype.clear=glt,H4.prototype.delete=vlt,H4.prototype.get=Qlt,H4.prototype.has=blt,H4.prototype.set=xlt;var $b=w8(R3,"Map");function _lt(){this.size=0,this.__data__={hash:new L8,map:new($b||H4),string:new L8}}function wlt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function qC(e,t){var r=e.__data__;return wlt(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Llt(e){var t=qC(this,e).delete(e);return this.size-=t?1:0,t}function Slt(e){return qC(this,e).get(e)}function klt(e){return qC(this,e).has(e)}function Mlt(e,t){var r=qC(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function V4(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}V4.prototype.clear=_lt,V4.prototype.delete=Llt,V4.prototype.get=Slt,V4.prototype.has=klt,V4.prototype.set=Mlt;var Clt="Expected a function";function Yj(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Clt);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Yj.Cache||V4),r}Yj.Cache=V4;var Elt=500;function Alt(e){var t=Yj(e,function(n){return r.size===Elt&&r.clear(),n}),r=t.cache;return t}var Olt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hlt=/\\(\\)?/g,Vlt=Alt(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Olt,function(r,n,i,o){t.push(i?o.replace(Hlt,"$1"):n||r)}),t});function Ilt(e){return e==null?"":P0e(e)}function ZC(e,t){return D3(e)?e:Jj(e,t)?[e]:Vlt(Ilt(e))}var Plt=1/0;function ex(e){if(typeof e=="string"||jC(e))return e;var t=e+"";return t=="0"&&1/e==-Plt?"-0":t}function $j(e,t){t=ZC(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[ex(t[r++])];return r&&r==n?e:void 0}function y2(e,t,r){var n=e==null?void 0:$j(e,t);return n===void 0?r:n}function $0e(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var eue=B3?B3.isConcatSpreadable:void 0;function Nlt(e){return D3(e)||Wj(e)||!!(eue&&e&&e[eue])}function tue(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=Nlt),i||(i=[]);++o<s;){var l=e[o];t>0&&r(l)?t>1?tue(l,t-1,r,n,i):$0e(i,l):n||(i[i.length]=l)}return i}function Rlt(e){var t=e==null?0:e.length;return t?tue(e,1):[]}function Blt(e){return rst(ust(e,void 0,Rlt),e+"")}function Dlt(){this.__data__=new H4,this.size=0}function Flt(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function zlt(e){return this.__data__.get(e)}function jlt(e){return this.__data__.has(e)}var Ult=200;function Glt(e,t){var r=this.__data__;if(r instanceof H4){var n=r.__data__;if(!$b||n.length<Ult-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new V4(n)}return r.set(e,t),this.size=r.size,this}function I4(e){var t=this.__data__=new H4(e);this.size=t.size}I4.prototype.clear=Dlt,I4.prototype.delete=Flt,I4.prototype.get=zlt,I4.prototype.has=jlt,I4.prototype.set=Glt;function qlt(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Zlt(){return[]}var Wlt=Object.prototype,Klt=Wlt.propertyIsEnumerable,rue=Object.getOwnPropertySymbols,Xlt=rue?function(e){return e==null?[]:(e=Object(e),qlt(rue(e),function(t){return Klt.call(e,t)}))}:Zlt;const Jlt=Xlt;function Ylt(e,t,r){var n=t(e);return D3(e)?n:$0e(n,r(e))}function nue(e){return Ylt(e,Y0e,Jlt)}var eU=w8(R3,"DataView"),tU=w8(R3,"Promise"),rU=w8(R3,"Set"),iue="[object Map]",$lt="[object Object]",oue="[object Promise]",aue="[object Set]",sue="[object WeakMap]",lue="[object DataView]",ect=_8(eU),tct=_8($b),rct=_8(tU),nct=_8(rU),ict=_8(Uj),S8=ig;(eU&&S8(new eU(new ArrayBuffer(1)))!=lue||$b&&S8(new $b)!=iue||tU&&S8(tU.resolve())!=oue||rU&&S8(new rU)!=aue||Uj&&S8(new Uj)!=sue)&&(S8=function(e){var t=ig(e),r=t==$lt?e.constructor:void 0,n=r?_8(r):"";if(n)switch(n){case ect:return lue;case tct:return iue;case rct:return oue;case nct:return aue;case ict:return sue}return t});const cue=S8;var oct=R3.Uint8Array;const uue=oct;var act="__lodash_hash_undefined__";function sct(e){return this.__data__.set(e,act),this}function lct(e){return this.__data__.has(e)}function WC(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new V4;++t<r;)this.add(e[t])}WC.prototype.add=WC.prototype.push=sct,WC.prototype.has=lct;function cct(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function uct(e,t){return e.has(t)}var dct=1,pct=2;function due(e,t,r,n,i,o){var s=r&dct,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var p=-1,h=!0,f=r&pct?new WC:void 0;for(o.set(e,t),o.set(t,e);++p<l;){var m=e[p],g=t[p];if(n)var T=s?n(g,m,p,t,e,o):n(m,g,p,e,t,o);if(T!==void 0){if(T)continue;h=!1;break}if(f){if(!cct(t,function(y,v){if(!uct(f,v)&&(m===y||i(m,y,r,n,o)))return f.push(v)})){h=!1;break}}else if(!(m===g||i(m,g,r,n,o))){h=!1;break}}return o.delete(e),o.delete(t),h}function hct(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function fct(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var mct=1,gct=2,yct="[object Boolean]",Tct="[object Date]",vct="[object Error]",Qct="[object Map]",bct="[object Number]",xct="[object RegExp]",_ct="[object Set]",wct="[object String]",Lct="[object Symbol]",Sct="[object ArrayBuffer]",kct="[object DataView]",pue=B3?B3.prototype:void 0,nU=pue?pue.valueOf:void 0;function Mct(e,t,r,n,i,o,s){switch(r){case kct:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Sct:return!(e.byteLength!=t.byteLength||!o(new uue(e),new uue(t)));case yct:case Tct:case bct:return qj(+e,+t);case vct:return e.name==t.name&&e.message==t.message;case xct:case wct:return e==t+"";case Qct:var l=hct;case _ct:var c=n&mct;if(l||(l=fct),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=gct,s.set(e,t);var d=due(l(e),l(t),n,i,o,s);return s.delete(e),d;case Lct:if(nU)return nU.call(e)==nU.call(t)}return!1}var Cct=1,Ect=Object.prototype,Act=Ect.hasOwnProperty;function Oct(e,t,r,n,i,o){var s=r&Cct,l=nue(e),c=l.length,u=nue(t),d=u.length;if(c!=d&&!s)return!1;for(var p=c;p--;){var h=l[p];if(!(s?h in t:Act.call(t,h)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var T=s;++p<c;){h=l[p];var y=e[h],v=t[h];if(n)var _=s?n(v,y,h,t,e,o):n(y,v,h,e,t,o);if(!(_===void 0?y===v||i(y,v,r,n,o):_)){g=!1;break}T||(T=h=="constructor")}if(g&&!T){var b=e.constructor,L=t.constructor;b!=L&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof L=="function"&&L instanceof L)&&(g=!1)}return o.delete(e),o.delete(t),g}var Hct=1,hue="[object Arguments]",fue="[object Array]",KC="[object Object]",Vct=Object.prototype,mue=Vct.hasOwnProperty;function Ict(e,t,r,n,i,o){var s=D3(e),l=D3(t),c=s?fue:cue(e),u=l?fue:cue(t);c=c==hue?KC:c,u=u==hue?KC:u;var d=c==KC,p=u==KC,h=c==u;if(h&&Kj(e)){if(!Kj(t))return!1;s=!0,d=!1}if(h&&!d)return o||(o=new I4),s||J0e(e)?due(e,t,r,n,i,o):Mct(e,t,c,r,n,i,o);if(!(r&Hct)){var f=d&&mue.call(e,"__wrapped__"),m=p&&mue.call(t,"__wrapped__");if(f||m){var g=f?e.value():e,T=m?t.value():t;return o||(o=new I4),i(g,T,r,n,o)}}return h?(o||(o=new I4),Oct(e,t,r,n,i,o)):!1}function XC(e,t,r,n,i){return e===t?!0:e==null||t==null||!og(e)&&!og(t)?e!==e&&t!==t:Ict(e,t,r,n,XC,i)}var Pct=1,Nct=2;function Rct(e,t,r,n){var i=r.length,o=i,s=!n;if(e==null)return!o;for(e=Object(e);i--;){var l=r[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){l=r[i];var c=l[0],u=e[c],d=l[1];if(s&&l[2]){if(u===void 0&&!(c in e))return!1}else{var p=new I4;if(n)var h=n(u,d,c,e,t,p);if(!(h===void 0?XC(d,u,Pct|Nct,n,p):h))return!1}}return!0}function gue(e){return e===e&&!ih(e)}function Bct(e){for(var t=Y0e(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,gue(i)]}return t}function yue(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Dct(e){var t=Bct(e);return t.length==1&&t[0][2]?yue(t[0][0],t[0][1]):function(r){return r===e||Rct(r,e,t)}}function Fct(e,t){return e!=null&&t in Object(e)}function zct(e,t,r){t=ZC(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=ex(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&Zj(i)&&Gj(s,i)&&(D3(e)||Wj(e)))}function Tue(e,t){return e!=null&&zct(e,t,Fct)}var jct=1,Uct=2;function Gct(e,t){return Jj(e)&&gue(t)?yue(ex(e),t):function(r){var n=y2(r,e);return n===void 0&&n===t?Tue(r,e):XC(t,n,jct|Uct)}}function qct(e){return function(t){return t==null?void 0:t[e]}}function Zct(e){return function(t){return $j(t,e)}}function Wct(e){return Jj(e)?qct(ex(e)):Zct(e)}function Kct(e){return typeof e=="function"?e:e==null?B0e:typeof e=="object"?D3(e)?Gct(e[0],e[1]):Dct(e):Wct(e)}var iU=function(){return R3.Date.now()},Xct="Expected a function",Jct=Math.max,Yct=Math.min;function oU(e,t,r){var n,i,o,s,l,c,u=0,d=!1,p=!1,h=!0;if(typeof e!="function")throw new TypeError(Xct);t=zj(t)||0,ih(r)&&(d=!!r.leading,p="maxWait"in r,o=p?Jct(zj(r.maxWait)||0,t):o,h="trailing"in r?!!r.trailing:h);function f(w){var k=n,C=i;return n=i=void 0,u=w,s=e.apply(C,k),s}function m(w){return u=w,l=setTimeout(y,t),d?f(w):s}function g(w){var k=w-c,C=w-u,A=t-k;return p?Yct(A,o-C):A}function T(w){var k=w-c,C=w-u;return c===void 0||k>=t||k<0||p&&C>=o}function y(){var w=iU();if(T(w))return v(w);l=setTimeout(y,g(w))}function v(w){return l=void 0,h&&n?f(w):(n=i=void 0,s)}function _(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function b(){return l===void 0?s:v(iU())}function L(){var w=iU(),k=T(w);if(n=arguments,i=this,c=w,k){if(l===void 0)return m(c);if(p)return clearTimeout(l),l=setTimeout(y,t),f(c)}return l===void 0&&(l=setTimeout(y,t)),s}return L.cancel=_,L.flush=b,L}var $ct=Math.max,e1t=Math.min;function t1t(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=n-1;return r!==void 0&&(i=Oat(r),i=r<0?$ct(n+i,0):e1t(i,n-1)),nst(e,Kct(t),i,!0)}function JC(e){for(var t=-1,r=e==null?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n}function aU(e,t){return XC(e,t)}function oh(e){return e==null}function r1t(e){return e===void 0}function n1t(e,t,r,n){if(!ih(e))return e;t=ZC(t,e);for(var i=-1,o=t.length,s=o-1,l=e;l!=null&&++i<o;){var c=ex(t[i]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(i!=s){var d=l[c];u=n?n(d,c,l):void 0,u===void 0&&(u=ih(d)?d:Gj(t[i+1])?[]:{})}cst(l,c,u),l=l[c]}return e}function i1t(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var s=t[n],l=$j(e,s);r(l,s)&&n1t(o,ZC(s,e),l)}return o}function o1t(e,t){return i1t(e,t,function(r,n){return Tue(e,n)})}var a1t=Blt(function(e,t){return e==null?{}:o1t(e,t)});const tx=e=>e===void 0,ah=e=>typeof e=="boolean",Ys=e=>typeof e=="number",rx=e=>typeof Element>"u"?!1:e instanceof Element,s1t=e=>Js(e)?!Number.isNaN(Number(e)):!1,l1t=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),vue=e=>Object.keys(e);let Que=class extends Error{constructor(t){super(t),this.name="ElementPlusError"}};function c1t(e,t){throw new Que(`[${e}] ${t}`)}function $s(e,t){if(process.env.NODE_ENV!=="production"){const r=Js(e)?new Que(`[${e}] ${t}`):e;console.warn(r)}}const u1t="utils/dom/style",bue=(e="")=>e.split(" ").filter(t=>!!t.trim()),sU=(e,t)=>{!e||!t.trim()||e.classList.add(...bue(t))},k8=(e,t)=>{!e||!t.trim()||e.classList.remove(...bue(t))},nx=(e,t)=>{var r;if(!Xs||!e||!t)return"";let n=sat(t);n==="float"&&(n="cssFloat");try{const i=e.style[n];if(i)return i;const o=(r=document.defaultView)==null?void 0:r.getComputedStyle(e,"");return o?o[n]:""}catch{return e.style[n]}};function ag(e,t="px"){if(!e)return"";if(Ys(e)||s1t(e))return`${e}${t}`;if(Js(e))return e;$s(u1t,"binding value must be a string or number")}function d1t(e,t){if(!Xs)return;if(!t){e.scrollTop=0;return}const r=[];let n=t.offsetParent;for(;n!==null&&e!==n&&e.contains(n);)r.push(n),n=n.offsetParent;const i=t.offsetTop+r.reduce((c,u)=>c+u.offsetTop,0),o=i+t.offsetHeight,s=e.scrollTop,l=s+e.clientHeight;i<s?e.scrollTop=i:o>l&&(e.scrollTop=o-e.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var p1t=a.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),sh=p1t,h1t=a.defineComponent({name:"ArrowLeft",__name:"arrow-left",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),xue=h1t,f1t=a.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),YC=f1t,m1t=a.defineComponent({name:"CaretRight",__name:"caret-right",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),g1t=m1t,y1t=a.defineComponent({name:"CircleCheck",__name:"circle-check",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),a.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),T1t=y1t,v1t=a.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),lU=v1t,Q1t=a.defineComponent({name:"Close",__name:"close",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),ix=Q1t,b1t=a.defineComponent({name:"Edit",__name:"edit",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),a.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),_ue=b1t,x1t=a.defineComponent({name:"Hide",__name:"hide",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),a.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),_1t=x1t,w1t=a.defineComponent({name:"Loading",__name:"loading",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),cU=w1t,L1t=a.defineComponent({name:"Notebook",__name:"notebook",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32"}),a.createElementVNode("path",{fill:"currentColor",d:"M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32"})]))}}),S1t=L1t,k1t=a.defineComponent({name:"View",__name:"view",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),M1t=k1t,C1t=a.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),wue=C1t,E1t=a.defineComponent({name:"Warning",__name:"warning",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}}),Lue=E1t;const Sue="__epPropKey",mi=e=>e,A1t=e=>Sc(e)&&!!e[Sue],$C=(e,t)=>{if(!Sc(e)||A1t(e))return e;const{values:r,required:n,default:i,type:o,validator:s}=e,l={type:o,required:!!n,validator:r||s?c=>{let u=!1,d=[];if(r&&(d=Array.from(r),x8(e,"default")&&d.push(i),u||(u=d.includes(c))),s&&(u||(u=s(c))),!u&&d.length>0){const p=[...new Set(d)].map(h=>JSON.stringify(h)).join(", ");a.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${p}], got value ${JSON.stringify(c)}.`)}return u}:void 0,[Sue]:!0};return x8(e,"default")&&(l.default=i),l},Lo=e=>JC(Object.entries(e).map(([t,r])=>[t,$C(r,t)])),lh=mi([String,Object,Function]),kue={validating:cU,success:T1t,error:lU},Jc=(e,t)=>{if(e.install=r=>{for(const n of[e,...Object.values(t??{})])r.component(n.name,n)},t)for(const[r,n]of Object.entries(t))e[r]=n;return e},O1t=(e,t)=>(e.install=r=>{r.directive(t,e)},e),Qu=e=>(e.install=Kb,e),kc={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},ss="update:modelValue",eE="change",uU=["","default","small","large"],H1t={large:40,default:32,small:24},V1t=e=>H1t[e||"default"],I1t=e=>["",...uU].includes(e),Mue=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),sg=e=>e,P1t=["class","style"],N1t=/^on[A-Z]/,R1t=(e={})=>{const{excludeListeners:t=!1,excludeKeys:r}=e,n=a.computed(()=>((r==null?void 0:r.value)||[]).concat(P1t)),i=a.getCurrentInstance();return i?a.computed(()=>{var o;return JC(Object.entries((o=i.proxy)==null?void 0:o.$attrs).filter(([s])=>!n.value.includes(s)&&!(t&&N1t.test(s))))}):($s("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},Cue=({from:e,replacement:t,scope:r,version:n,ref:i,type:o="API"},s)=>{a.watch(()=>a.unref(s),l=>{l&&$s(r,`[${o}] ${e} is about to be deprecated in version ${n}, please use ${t} instead.
429
429
  For more detail, please visit: ${i}
430
430
  `)},{immediate:!0})};var B1t={name:"en",el:{colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color."},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"}}};const D1t=e=>(t,r)=>F1t(t,r,a.unref(e)),F1t=(e,t,r)=>y2(r,e,e).replace(/\{(\w+)\}/g,(n,i)=>{var o;return`${(o=t==null?void 0:t[i])!=null?o:`{${i}}`}`}),z1t=e=>{const t=a.computed(()=>a.unref(e).name),r=a.isRef(e)?e:a.ref(e);return{lang:t,locale:r,t:D1t(e)}},Eue=Symbol("localeContextKey"),lg=e=>{const t=e||a.inject(Eue,a.ref());return z1t(a.computed(()=>t.value||B1t))},tE="el",j1t="is-",M8=(e,t,r,n,i)=>{let o=`${e}-${t}`;return r&&(o+=`-${r}`),n&&(o+=`__${n}`),i&&(o+=`--${i}`),o},Aue=Symbol("namespaceContextKey"),dU=e=>{const t=e||(a.getCurrentInstance()?a.inject(Aue,a.ref(tE)):a.ref(tE));return a.computed(()=>a.unref(t)||tE)},li=(e,t)=>{const r=dU(t);return{namespace:r,b:(n="")=>M8(r.value,e,n,"",""),e:n=>n?M8(r.value,e,"",n,""):"",m:n=>n?M8(r.value,e,"","",n):"",be:(n,i)=>n&&i?M8(r.value,e,n,i,""):"",em:(n,i)=>n&&i?M8(r.value,e,"",n,i):"",bm:(n,i)=>n&&i?M8(r.value,e,n,"",i):"",bem:(n,i,o)=>n&&i&&o?M8(r.value,e,n,i,o):"",is:(n,...i)=>{const o=i.length>=1?i[0]:!0;return n&&o?`${j1t}${n}`:""},cssVar:n=>{const i={};for(const o in n)n[o]&&(i[`--${r.value}-${o}`]=n[o]);return i},cssVarName:n=>`--${r.value}-${n}`,cssVarBlock:n=>{const i={};for(const o in n)n[o]&&(i[`--${r.value}-${e}-${o}`]=n[o]);return i},cssVarBlockName:n=>`--${r.value}-${e}-${n}`}},U1t=$C({type:mi(Boolean),default:null}),G1t=$C({type:mi(Function)}),q1t=e=>{const t=`update:${e}`,r=`onUpdate:${e}`,n=[t],i={[e]:U1t,[r]:G1t};return{useModelToggle:({indicator:o,toggleReason:s,shouldHideWhenRouteChanges:l,shouldProceed:c,onShow:u,onHide:d})=>{const p=a.getCurrentInstance(),{emit:h}=p,f=p.props,m=a.computed(()=>g2(f[r])),g=a.computed(()=>f[e]===null),T=w=>{o.value!==!0&&(o.value=!0,s&&(s.value=w),g2(u)&&u(w))},y=w=>{o.value!==!1&&(o.value=!1,s&&(s.value=w),g2(d)&&d(w))},v=w=>{if(f.disabled===!0||g2(c)&&!c())return;const k=m.value&&Xs;k&&h(t,!0),(g.value||!k)&&T(w)},_=w=>{if(f.disabled===!0||!Xs)return;const k=m.value&&Xs;k&&h(t,!1),(g.value||!k)&&y(w)},b=w=>{ah(w)&&(f.disabled&&w?m.value&&h(t,!1):o.value!==w&&(w?T():y()))},L=()=>{o.value?_():v()};return a.watch(()=>f[e],b),l&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{l.value&&o.value&&_()}),a.onMounted(()=>{b(f[e])}),{hide:_,show:v,toggle:L,hasUpdateHandler:m}},useModelToggleProps:i,useModelToggleEmits:n}},Oue=e=>{const t=a.getCurrentInstance();return a.computed(()=>{var r,n;return(n=(r=t==null?void 0:t.proxy)==null?void 0:r.$props)==null?void 0:n[e]})};var M1="top",n0="bottom",i0="right",C1="left",pU="auto",ox=[M1,n0,i0,C1],cg="start",ax="end",Z1t="clippingParents",Hue="viewport",sx="popper",W1t="reference",Vue=ox.reduce(function(e,t){return e.concat([t+"-"+cg,t+"-"+ax])},[]),rE=[].concat(ox,[pU]).reduce(function(e,t){return e.concat([t,t+"-"+cg,t+"-"+ax])},[]),K1t="beforeRead",X1t="read",J1t="afterRead",Y1t="beforeMain",$1t="main",e2t="afterMain",t2t="beforeWrite",r2t="write",n2t="afterWrite",i2t=[K1t,X1t,J1t,Y1t,$1t,e2t,t2t,r2t,n2t];function F3(e){return e?(e.nodeName||"").toLowerCase():null}function bu(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ug(e){var t=bu(e).Element;return e instanceof t||e instanceof Element}function o0(e){var t=bu(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function hU(e){if(typeof ShadowRoot>"u")return!1;var t=bu(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function o2t(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},o=t.elements[r];!o0(o)||!F3(o)||(Object.assign(o.style,n),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function a2t(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],o=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),l=s.reduce(function(c,u){return c[u]="",c},{});!o0(i)||!F3(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}var Iue={name:"applyStyles",enabled:!0,phase:"write",fn:o2t,effect:a2t,requires:["computeStyles"]};function z3(e){return e.split("-")[0]}var C8=Math.max,nE=Math.min,dg=Math.round;function pg(e,t){t===void 0&&(t=!1);var r=e.getBoundingClientRect(),n=1,i=1;if(o0(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(n=dg(r.width)/s||1),o>0&&(i=dg(r.height)/o||1)}return{width:r.width/n,height:r.height/i,top:r.top/i,right:r.right/n,bottom:r.bottom/i,left:r.left/n,x:r.left/n,y:r.top/i}}function fU(e){var t=pg(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Pue(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&hU(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function P4(e){return bu(e).getComputedStyle(e)}function s2t(e){return["table","td","th"].indexOf(F3(e))>=0}function ch(e){return((ug(e)?e.ownerDocument:e.document)||window.document).documentElement}function iE(e){return F3(e)==="html"?e:e.assignedSlot||e.parentNode||(hU(e)?e.host:null)||ch(e)}function Nue(e){return!o0(e)||P4(e).position==="fixed"?null:e.offsetParent}function l2t(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&o0(e)){var n=P4(e);if(n.position==="fixed")return null}var i=iE(e);for(hU(i)&&(i=i.host);o0(i)&&["html","body"].indexOf(F3(i))<0;){var o=P4(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function lx(e){for(var t=bu(e),r=Nue(e);r&&s2t(r)&&P4(r).position==="static";)r=Nue(r);return r&&(F3(r)==="html"||F3(r)==="body"&&P4(r).position==="static")?t:r||l2t(e)||t}function mU(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cx(e,t,r){return C8(e,nE(t,r))}function c2t(e,t,r){var n=cx(e,t,r);return n>r?r:n}function Rue(){return{top:0,right:0,bottom:0,left:0}}function Bue(e){return Object.assign({},Rue(),e)}function Due(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var u2t=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Bue(typeof e!="number"?e:Due(e,ox))};function d2t(e){var t,r=e.state,n=e.name,i=e.options,o=r.elements.arrow,s=r.modifiersData.popperOffsets,l=z3(r.placement),c=mU(l),u=[C1,i0].indexOf(l)>=0,d=u?"height":"width";if(!(!o||!s)){var p=u2t(i.padding,r),h=fU(o),f=c==="y"?M1:C1,m=c==="y"?n0:i0,g=r.rects.reference[d]+r.rects.reference[c]-s[c]-r.rects.popper[d],T=s[c]-r.rects.reference[c],y=lx(o),v=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,_=g/2-T/2,b=p[f],L=v-h[d]-p[m],w=v/2-h[d]/2+_,k=cx(b,w,L),C=c;r.modifiersData[n]=(t={},t[C]=k,t.centerOffset=k-w,t)}}function p2t(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||!Pue(t.elements.popper,i)||(t.elements.arrow=i))}var h2t={name:"arrow",enabled:!0,phase:"main",fn:d2t,effect:p2t,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function hg(e){return e.split("-")[1]}var f2t={top:"auto",right:"auto",bottom:"auto",left:"auto"};function m2t(e){var t=e.x,r=e.y,n=window,i=n.devicePixelRatio||1;return{x:dg(t*i)/i||0,y:dg(r*i)/i||0}}function Fue(e){var t,r=e.popper,n=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,p=e.isFixed,h=s.x,f=h===void 0?0:h,m=s.y,g=m===void 0?0:m,T=typeof d=="function"?d({x:f,y:g}):{x:f,y:g};f=T.x,g=T.y;var y=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),_=C1,b=M1,L=window;if(u){var w=lx(r),k="clientHeight",C="clientWidth";if(w===bu(r)&&(w=ch(r),P4(w).position!=="static"&&l==="absolute"&&(k="scrollHeight",C="scrollWidth")),w=w,i===M1||(i===C1||i===i0)&&o===ax){b=n0;var A=p&&w===L&&L.visualViewport?L.visualViewport.height:w[k];g-=A-n.height,g*=c?1:-1}if(i===C1||(i===M1||i===n0)&&o===ax){_=i0;var O=p&&w===L&&L.visualViewport?L.visualViewport.width:w[C];f-=O-n.width,f*=c?1:-1}}var N=Object.assign({position:l},u&&f2t),I=d===!0?m2t({x:f,y:g}):{x:f,y:g};if(f=I.x,g=I.y,c){var B;return Object.assign({},N,(B={},B[b]=v?"0":"",B[_]=y?"0":"",B.transform=(L.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",B))}return Object.assign({},N,(t={},t[b]=v?g+"px":"",t[_]=y?f+"px":"",t.transform="",t))}function g2t(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,o=r.adaptive,s=o===void 0?!0:o,l=r.roundOffsets,c=l===void 0?!0:l,u={placement:z3(t.placement),variation:hg(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Fue(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Fue(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var zue={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:g2t,data:{}},oE={passive:!0};function y2t(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,o=i===void 0?!0:i,s=n.resize,l=s===void 0?!0:s,c=bu(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",r.update,oE)}),l&&c.addEventListener("resize",r.update,oE),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",r.update,oE)}),l&&c.removeEventListener("resize",r.update,oE)}}var jue={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:y2t,data:{}},T2t={left:"right",right:"left",bottom:"top",top:"bottom"};function aE(e){return e.replace(/left|right|bottom|top/g,function(t){return T2t[t]})}var v2t={start:"end",end:"start"};function Uue(e){return e.replace(/start|end/g,function(t){return v2t[t]})}function gU(e){var t=bu(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function yU(e){return pg(ch(e)).left+gU(e).scrollLeft}function Q2t(e){var t=bu(e),r=ch(e),n=t.visualViewport,i=r.clientWidth,o=r.clientHeight,s=0,l=0;return n&&(i=n.width,o=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=n.offsetLeft,l=n.offsetTop)),{width:i,height:o,x:s+yU(e),y:l}}function b2t(e){var t,r=ch(e),n=gU(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=C8(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=C8(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-n.scrollLeft+yU(e),c=-n.scrollTop;return P4(i||r).direction==="rtl"&&(l+=C8(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function TU(e){var t=P4(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Gue(e){return["html","body","#document"].indexOf(F3(e))>=0?e.ownerDocument.body:o0(e)&&TU(e)?e:Gue(iE(e))}function ux(e,t){var r;t===void 0&&(t=[]);var n=Gue(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=bu(n),s=i?[o].concat(o.visualViewport||[],TU(n)?n:[]):n,l=t.concat(s);return i?l:l.concat(ux(iE(s)))}function vU(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function x2t(e){var t=pg(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function que(e,t){return t===Hue?vU(Q2t(e)):ug(t)?x2t(t):vU(b2t(ch(e)))}function _2t(e){var t=ux(iE(e)),r=["absolute","fixed"].indexOf(P4(e).position)>=0,n=r&&o0(e)?lx(e):e;return ug(n)?t.filter(function(i){return ug(i)&&Pue(i,n)&&F3(i)!=="body"}):[]}function w2t(e,t,r){var n=t==="clippingParents"?_2t(e):[].concat(t),i=[].concat(n,[r]),o=i[0],s=i.reduce(function(l,c){var u=que(e,c);return l.top=C8(u.top,l.top),l.right=nE(u.right,l.right),l.bottom=nE(u.bottom,l.bottom),l.left=C8(u.left,l.left),l},que(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Zue(e){var t=e.reference,r=e.element,n=e.placement,i=n?z3(n):null,o=n?hg(n):null,s=t.x+t.width/2-r.width/2,l=t.y+t.height/2-r.height/2,c;switch(i){case M1:c={x:s,y:t.y-r.height};break;case n0:c={x:s,y:t.y+t.height};break;case i0:c={x:t.x+t.width,y:l};break;case C1:c={x:t.x-r.width,y:l};break;default:c={x:t.x,y:t.y}}var u=i?mU(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case cg:c[u]=c[u]-(t[d]/2-r[d]/2);break;case ax:c[u]=c[u]+(t[d]/2-r[d]/2);break}}return c}function dx(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,o=r.boundary,s=o===void 0?Z1t:o,l=r.rootBoundary,c=l===void 0?Hue:l,u=r.elementContext,d=u===void 0?sx:u,p=r.altBoundary,h=p===void 0?!1:p,f=r.padding,m=f===void 0?0:f,g=Bue(typeof m!="number"?m:Due(m,ox)),T=d===sx?W1t:sx,y=e.rects.popper,v=e.elements[h?T:d],_=w2t(ug(v)?v:v.contextElement||ch(e.elements.popper),s,c),b=pg(e.elements.reference),L=Zue({reference:b,element:y,strategy:"absolute",placement:i}),w=vU(Object.assign({},y,L)),k=d===sx?w:b,C={top:_.top-k.top+g.top,bottom:k.bottom-_.bottom+g.bottom,left:_.left-k.left+g.left,right:k.right-_.right+g.right},A=e.modifiersData.offset;if(d===sx&&A){var O=A[i];Object.keys(C).forEach(function(N){var I=[i0,n0].indexOf(N)>=0?1:-1,B=[M1,n0].indexOf(N)>=0?"y":"x";C[N]+=O[B]*I})}return C}function L2t(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,o=r.rootBoundary,s=r.padding,l=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?rE:c,d=hg(n),p=d?l?Vue:Vue.filter(function(m){return hg(m)===d}):ox,h=p.filter(function(m){return u.indexOf(m)>=0});h.length===0&&(h=p);var f=h.reduce(function(m,g){return m[g]=dx(e,{placement:g,boundary:i,rootBoundary:o,padding:s})[z3(g)],m},{});return Object.keys(f).sort(function(m,g){return f[m]-f[g]})}function S2t(e){if(z3(e)===pU)return[];var t=aE(e);return[Uue(e),t,Uue(t)]}function k2t(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,o=i===void 0?!0:i,s=r.altAxis,l=s===void 0?!0:s,c=r.fallbackPlacements,u=r.padding,d=r.boundary,p=r.rootBoundary,h=r.altBoundary,f=r.flipVariations,m=f===void 0?!0:f,g=r.allowedAutoPlacements,T=t.options.placement,y=z3(T),v=y===T,_=c||(v||!m?[aE(T)]:S2t(T)),b=[T].concat(_).reduce(function(he,me){return he.concat(z3(me)===pU?L2t(t,{placement:me,boundary:d,rootBoundary:p,padding:u,flipVariations:m,allowedAutoPlacements:g}):me)},[]),L=t.rects.reference,w=t.rects.popper,k=new Map,C=!0,A=b[0],O=0;O<b.length;O++){var N=b[O],I=z3(N),B=hg(N)===cg,F=[M1,n0].indexOf(I)>=0,j=F?"width":"height",G=dx(t,{placement:N,boundary:d,rootBoundary:p,altBoundary:h,padding:u}),P=F?B?i0:C1:B?n0:M1;L[j]>w[j]&&(P=aE(P));var Z=aE(P),K=[];if(o&&K.push(G[I]<=0),l&&K.push(G[P]<=0,G[Z]<=0),K.every(function(he){return he})){A=N,C=!1;break}k.set(N,K)}if(C)for(var U=m?3:1,X=function(he){var me=b.find(function(ie){var be=k.get(ie);if(be)return be.slice(0,he).every(function(re){return re})});if(me)return A=me,"break"},ee=U;ee>0;ee--){var oe=X(ee);if(oe==="break")break}t.placement!==A&&(t.modifiersData[n]._skip=!0,t.placement=A,t.reset=!0)}}var M2t={name:"flip",enabled:!0,phase:"main",fn:k2t,requiresIfExists:["offset"],data:{_skip:!1}};function Wue(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Kue(e){return[M1,i0,n0,C1].some(function(t){return e[t]>=0})}function C2t(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=dx(t,{elementContext:"reference"}),l=dx(t,{altBoundary:!0}),c=Wue(s,n),u=Wue(l,i,o),d=Kue(c),p=Kue(u);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}var E2t={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:C2t};function A2t(e,t,r){var n=z3(e),i=[C1,M1].indexOf(n)>=0?-1:1,o=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[C1,i0].indexOf(n)>=0?{x:l,y:s}:{x:s,y:l}}function O2t(e){var t=e.state,r=e.options,n=e.name,i=r.offset,o=i===void 0?[0,0]:i,s=rE.reduce(function(d,p){return d[p]=A2t(p,t.rects,o),d},{}),l=s[t.placement],c=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[n]=s}var H2t={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:O2t};function V2t(e){var t=e.state,r=e.name;t.modifiersData[r]=Zue({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Xue={name:"popperOffsets",enabled:!0,phase:"read",fn:V2t,data:{}};function I2t(e){return e==="x"?"y":"x"}function P2t(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,o=i===void 0?!0:i,s=r.altAxis,l=s===void 0?!1:s,c=r.boundary,u=r.rootBoundary,d=r.altBoundary,p=r.padding,h=r.tether,f=h===void 0?!0:h,m=r.tetherOffset,g=m===void 0?0:m,T=dx(t,{boundary:c,rootBoundary:u,padding:p,altBoundary:d}),y=z3(t.placement),v=hg(t.placement),_=!v,b=mU(y),L=I2t(b),w=t.modifiersData.popperOffsets,k=t.rects.reference,C=t.rects.popper,A=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,O=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(w){if(o){var B,F=b==="y"?M1:C1,j=b==="y"?n0:i0,G=b==="y"?"height":"width",P=w[b],Z=P+T[F],K=P-T[j],U=f?-C[G]/2:0,X=v===cg?k[G]:C[G],ee=v===cg?-C[G]:-k[G],oe=t.elements.arrow,he=f&&oe?fU(oe):{width:0,height:0},me=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Rue(),ie=me[F],be=me[j],re=cx(0,k[G],he[G]),ue=_?k[G]/2-U-re-ie-O.mainAxis:X-re-ie-O.mainAxis,ne=_?-k[G]/2+U+re+be+O.mainAxis:ee+re+be+O.mainAxis,ye=t.elements.arrow&&lx(t.elements.arrow),_e=ye?b==="y"?ye.clientTop||0:ye.clientLeft||0:0,Ie=(B=N==null?void 0:N[b])!=null?B:0,qe=P+ue-Ie-_e,Ge=P+ne-Ie,et=cx(f?nE(Z,qe):Z,P,f?C8(K,Ge):K);w[b]=et,I[b]=et-P}if(l){var Ve,Ne=b==="x"?M1:C1,it=b==="x"?n0:i0,Be=w[L],pt=L==="y"?"height":"width",yt=Be+T[Ne],ct=Be-T[it],xe=[M1,C1].indexOf(y)!==-1,Ue=(Ve=N==null?void 0:N[L])!=null?Ve:0,$e=xe?yt:Be-k[pt]-C[pt]-Ue+O.altAxis,at=xe?Be+k[pt]+C[pt]-Ue-O.altAxis:ct,Ht=f&&xe?c2t($e,Be,at):cx(f?$e:yt,Be,f?at:ct);w[L]=Ht,I[L]=Ht-Be}t.modifiersData[n]=I}}var N2t={name:"preventOverflow",enabled:!0,phase:"main",fn:P2t,requiresIfExists:["offset"]};function R2t(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function B2t(e){return e===bu(e)||!o0(e)?gU(e):R2t(e)}function D2t(e){var t=e.getBoundingClientRect(),r=dg(t.width)/e.offsetWidth||1,n=dg(t.height)/e.offsetHeight||1;return r!==1||n!==1}function F2t(e,t,r){r===void 0&&(r=!1);var n=o0(t),i=o0(t)&&D2t(t),o=ch(t),s=pg(e,i),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((F3(t)!=="body"||TU(o))&&(l=B2t(t)),o0(t)?(c=pg(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=yU(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function z2t(e){var t=new Map,r=new Set,n=[];e.forEach(function(o){t.set(o.name,o)});function i(o){r.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!r.has(l)){var c=t.get(l);c&&i(c)}}),n.push(o)}return e.forEach(function(o){r.has(o.name)||i(o)}),n}function j2t(e){var t=z2t(e);return i2t.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function U2t(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function G2t(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Jue={placement:"bottom",modifiers:[],strategy:"absolute"};function Yue(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function QU(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,o=i===void 0?Jue:i;return function(s,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jue,o),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],p=!1,h={state:u,setOptions:function(g){var T=typeof g=="function"?g(u.options):g;m(),u.options=Object.assign({},o,u.options,T),u.scrollParents={reference:ug(s)?ux(s):s.contextElement?ux(s.contextElement):[],popper:ux(l)};var y=j2t(G2t([].concat(n,u.options.modifiers)));return u.orderedModifiers=y.filter(function(v){return v.enabled}),f(),h.update()},forceUpdate:function(){if(!p){var g=u.elements,T=g.reference,y=g.popper;if(Yue(T,y)){u.rects={reference:F2t(T,lx(y),u.options.strategy==="fixed"),popper:fU(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(C){return u.modifiersData[C.name]=Object.assign({},C.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var _=u.orderedModifiers[v],b=_.fn,L=_.options,w=L===void 0?{}:L,k=_.name;typeof b=="function"&&(u=b({state:u,options:w,name:k,instance:h})||u)}}}},update:U2t(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){m(),p=!0}};if(!Yue(s,l))return h;h.setOptions(c).then(function(g){!p&&c.onFirstUpdate&&c.onFirstUpdate(g)});function f(){u.orderedModifiers.forEach(function(g){var T=g.name,y=g.options,v=y===void 0?{}:y,_=g.effect;if(typeof _=="function"){var b=_({state:u,name:T,instance:h,options:v}),L=function(){};d.push(b||L)}})}function m(){d.forEach(function(g){return g()}),d=[]}return h}}QU();var q2t=[jue,Xue,zue,Iue];QU({defaultModifiers:q2t});var Z2t=[jue,Xue,zue,Iue,H2t,M2t,N2t,h2t,E2t],W2t=QU({defaultModifiers:Z2t});const K2t=(e,t,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=X2t(c);Object.assign(s.value,u)},requires:["computeStyles"]},i=a.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:p}=a.unref(r);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...p||[],n,{name:"applyStyles",enabled:!1}]}}),o=a.shallowRef(),s=a.ref({styles:{popper:{position:a.unref(i).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{o.value&&(o.value.destroy(),o.value=void 0)};return a.watch(i,c=>{const u=a.unref(o);u&&u.setOptions(c)},{deep:!0}),a.watch([e,t],([c,u])=>{l(),!(!c||!u)&&(o.value=W2t(c,u,a.unref(i)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var c;return{...((c=a.unref(o))==null?void 0:c.state)||{}}}),styles:a.computed(()=>a.unref(s).styles),attributes:a.computed(()=>a.unref(s).attributes),update:()=>{var c;return(c=a.unref(o))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=a.unref(o))==null?void 0:c.forceUpdate()},instanceRef:a.computed(()=>a.unref(o))}};function X2t(e){const t=Object.keys(e.elements),r=JC(t.map(i=>[i,e.styles[i]||{}])),n=JC(t.map(i=>[i,e.attributes[i]]));return{styles:r,attributes:n}}function $ue(){let e;const t=(n,i)=>{r(),e=window.setTimeout(n,i)},r=()=>window.clearTimeout(e);return Rj(()=>r()),{registerTimeout:t,cancelTimeout:r}}const bU={prefix:Math.floor(Math.random()*1e4),current:0},J2t=Symbol("elIdInjection"),e3e=()=>a.getCurrentInstance()?a.inject(J2t,bU):bU,px=e=>{const t=e3e();!Xs&&t===bU&&$s("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
431
431
  usage: app.provide(ID_INJECTION_KEY, {
@@ -1486,7 +1486,7 @@ License: MIT
1486
1486
  `:"\r"}(ue,_e)),N=!1,C.delimiter)k(C.delimiter)&&(C.delimiter=C.delimiter(ue),ee.meta.delimiter=C.delimiter);else{var Ie=function(Ge,et,Ve,Ne,it){var Be,pt,yt,ct;it=it||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var xe=0;xe<it.length;xe++){var Ue=it[xe],$e=0,at=0,Ht=0;yt=void 0;for(var Vt=new y({comments:Ne,delimiter:Ue,newline:et,preview:10}).parse(Ge),Dt=0;Dt<Vt.data.length;Dt++)if(Ve&&he(Vt.data[Dt]))Ht++;else{var Gt=Vt.data[Dt].length;at+=Gt,yt!==void 0?0<Gt&&($e+=Math.abs(Gt-yt),yt=Gt):yt=Gt}0<Vt.data.length&&(at/=Vt.data.length-Ht),(pt===void 0||$e<=pt)&&(ct===void 0||ct<at)&&1.99<at&&(pt=$e,Be=Ue,ct=at)}return{successful:!!(C.delimiter=Be),bestDelimiter:Be}}(ue,C.newline,C.skipEmptyLines,C.comments,C.delimitersToGuess);Ie.successful?C.delimiter=Ie.bestDelimiter:(N=!0,C.delimiter=c.DefaultDelimiter),ee.meta.delimiter=C.delimiter}var qe=L(C);return C.preview&&C.header&&qe.preview++,A=ue,O=new y(qe),ee=O.parse(A,ne,ye),me(),K?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return K},this.pause=function(){K=!0,O.abort(),A=k(C.chunk)?"":A.substring(O.getCharIndex())},this.resume=function(){G.streamer._halted?(K=!1,G.streamer.parseChunk(A,!0)):setTimeout(G.resume,3)},this.aborted=function(){return U},this.abort=function(){U=!0,O.abort(),ee.meta.aborted=!0,k(C.complete)&&C.complete(ee),A=""}}function T(C){return C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(C){var A,O=(C=C||{}).delimiter,N=C.newline,I=C.comments,B=C.step,F=C.preview,j=C.fastMode,G=A=C.quoteChar===void 0||C.quoteChar===null?'"':C.quoteChar;if(C.escapeChar!==void 0&&(G=C.escapeChar),(typeof O!="string"||-1<c.BAD_DELIMITERS.indexOf(O))&&(O=","),I===O)throw new Error("Comment character same as delimiter");I===!0?I="#":(typeof I!="string"||-1<c.BAD_DELIMITERS.indexOf(I))&&(I=!1),N!==`
1487
1487
  `&&N!=="\r"&&N!==`\r
1488
1488
  `&&(N=`
1489
- `);var P=0,Z=!1;this.parse=function(K,U,X){if(typeof K!="string")throw new Error("Input must be a string");var ee=K.length,oe=O.length,he=N.length,me=I.length,ie=k(B),be=[],re=[],ue=[],ne=P=0;if(!K)return Je();if(C.header&&!U){var ye=K.split(N)[0].split(O),_e=[],Ie={},qe=!1;for(var Ge in ye){var et=ye[Ge];k(C.transformHeader)&&(et=C.transformHeader(et,Ge));var Ve=et,Ne=Ie[et]||0;for(0<Ne&&(qe=!0,Ve=et+"_"+Ne),Ie[et]=Ne+1;_e.includes(Ve);)Ve=Ve+"_"+Ne;_e.push(Ve)}if(qe){var it=K.split(N);it[0]=_e.join(O),K=it.join(N)}}if(j||j!==!1&&K.indexOf(A)===-1){for(var Be=K.split(N),pt=0;pt<Be.length;pt++){if(ue=Be[pt],P+=ue.length,pt!==Be.length-1)P+=N.length;else if(X)return Je();if(!I||ue.substring(0,me)!==I){if(ie){if(be=[],Ht(ue.split(O)),ft(),Z)return Je()}else Ht(ue.split(O));if(F&&F<=pt)return be=be.slice(0,F),Je(!0)}}return Je()}for(var yt=K.indexOf(O,P),ct=K.indexOf(N,P),xe=new RegExp(T(G)+T(A),"g"),Ue=K.indexOf(A,P);;)if(K[P]!==A)if(I&&ue.length===0&&K.substring(P,P+me)===I){if(ct===-1)return Je();P=ct+he,ct=K.indexOf(N,P),yt=K.indexOf(O,P)}else if(yt!==-1&&(yt<ct||ct===-1))ue.push(K.substring(P,yt)),P=yt+oe,yt=K.indexOf(O,P);else{if(ct===-1)break;if(ue.push(K.substring(P,ct)),Gt(ct+he),ie&&(ft(),Z))return Je();if(F&&be.length>=F)return Je(!0)}else for(Ue=P,P++;;){if((Ue=K.indexOf(A,Ue+1))===-1)return X||re.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:be.length,index:P}),Dt();if(Ue===ee-1)return Dt(K.substring(P,Ue).replace(xe,A));if(A!==G||K[Ue+1]!==G){if(A===G||Ue===0||K[Ue-1]!==G){yt!==-1&&yt<Ue+1&&(yt=K.indexOf(O,Ue+1)),ct!==-1&&ct<Ue+1&&(ct=K.indexOf(N,Ue+1));var $e=Vt(ct===-1?yt:Math.min(yt,ct));if(K.substr(Ue+1+$e,oe)===O){ue.push(K.substring(P,Ue).replace(xe,A)),K[P=Ue+1+$e+oe]!==A&&(Ue=K.indexOf(A,P)),yt=K.indexOf(O,P),ct=K.indexOf(N,P);break}var at=Vt(ct);if(K.substring(Ue+1+at,Ue+1+at+he)===N){if(ue.push(K.substring(P,Ue).replace(xe,A)),Gt(Ue+1+at+he),yt=K.indexOf(O,P),Ue=K.indexOf(A,P),ie&&(ft(),Z))return Je();if(F&&be.length>=F)return Je(!0);break}re.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:be.length,index:P}),Ue++}}else Ue++}return Dt();function Ht(St){be.push(St),ne=P}function Vt(St){var Wt=0;if(St!==-1){var Jt=K.substring(Ue+1,St);Jt&&Jt.trim()===""&&(Wt=Jt.length)}return Wt}function Dt(St){return X||(St===void 0&&(St=K.substring(P)),ue.push(St),P=ee,Ht(ue),ie&&ft()),Je()}function Gt(St){P=St,Ht(ue),ue=[],ct=K.indexOf(N,P)}function Je(St){return{data:be,errors:re,meta:{delimiter:O,linebreak:N,aborted:Z,truncated:!!St,cursor:ne+(U||0)}}}function ft(){B(Je()),be=[],re=[]}},this.abort=function(){Z=!0},this.getCharIndex=function(){return P}}function v(C){var A=C.data,O=s[A.workerId],N=!1;if(A.error)O.userError(A.error,A.file);else if(A.results&&A.results.data){var I={abort:function(){N=!0,_(A.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:b,resume:b};if(k(O.userStep)){for(var B=0;B<A.results.data.length&&(O.userStep({data:A.results.data[B],errors:A.results.errors,meta:A.results.meta},I),!N);B++);delete A.results}else k(O.userChunk)&&(O.userChunk(A.results,I,A.file),delete A.results)}A.finished&&!N&&_(A.workerId,A.results)}function _(C,A){var O=s[C];k(O.userComplete)&&O.userComplete(A),O.terminate(),delete s[C]}function b(){throw new Error("Not implemented.")}function L(C){if(typeof C!="object"||C===null)return C;var A=Array.isArray(C)?[]:{};for(var O in C)A[O]=L(C[O]);return A}function w(C,A){return function(){C.apply(A,arguments)}}function k(C){return typeof C=="function"}return o&&(n.onmessage=function(C){var A=C.data;if(c.WORKER_ID===void 0&&A&&(c.WORKER_ID=A.workerId),typeof A.input=="string")n.postMessage({workerId:c.WORKER_ID,results:c.parse(A.input,A.config),finished:!0});else if(n.File&&A.input instanceof File||A.input instanceof Object){var O=c.parse(A.input,A.config);O&&n.postMessage({workerId:c.WORKER_ID,results:O,finished:!0})}}),(p.prototype=Object.create(d.prototype)).constructor=p,(h.prototype=Object.create(d.prototype)).constructor=h,(f.prototype=Object.create(f.prototype)).constructor=f,(m.prototype=Object.create(d.prototype)).constructor=m,c})})(BSe);var Ier=BSe.exports;const Per=dw(Ier),Ner=(e,t)=>Per.parse(e,{download:!0,complete:t}),x$={loadFile:Ner},DSe={components:{PlotControls:fw},props:{metadata:{type:Object,required:!0},sourceData:{type:Object,required:!0},plotLayout:{type:Object,required:!0},supplementalData:{type:Array,required:!0},version:{type:String,required:!0}},data:function(){return{layout:{paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)"},loading:!1,options:{responsive:!0,scrollZoom:!0}}},computed:{title(){return this.sourceData.url.split("\\").pop().split("/").pop().split(".")[0]}}},Rer={name:"TimeseriesPlot",components:{PlotControls:fw,ElSelect:pw,ElButton:cw,ElOption:hw},mixins:[DSe],data:function(){return{dataValues:[],filterX:[],parsedData:null,time:[],traceData:null,traceNames:[],xAxisLabel:"time"}},computed:{fullMetadata(){let e=JSON.parse(JSON.stringify(this.metadata));return e["y-axes-columns"]||(e["y-axes-columns"]=[]),e["x-axis-column"]||(e["x-axis-column"]=0),e["no-header"]||(e["no-header"]=!1),e["row-major"]||(e["row-major"]=!1),e}},watch:{sourceData:function(){this.loadData(this.sourceData)}},mounted:function(){this.loadData(this.sourceData)},methods:{loadData(e){e.url?(this.loading=!0,x$.loadFile(e.url,this.dataReady)):PL.react(this.$refs.plotlyplot,this.sourceData.data,this.sourceData.layout?this.sourceData.layout:this.layout,this.options)},dataReady(e){this.fullMetadata["no-header"]&&x$.loadFile(this.supplementalData[0].url,this.headerDataReady),this.loading=!1,this.parsedData=e,this.findYaxesCols(),this.populateTime(),this.populateDataValues(),this.fullMetadata["no-header"]||(this.populateXaxisLabel(),this.populateTraceNames()),this.createPlot(this.time,this.xAxisLabel,this.dataValues,this.traceNames)},headerDataReady(e){this.traceData=e,this.populateXaxisLabel(),this.populateTraceNames(),this.loading||this.createPlot(this.time,this.xAxisLabel,this.dataValues,this.traceNames)},filterPlot(){let e=this.filterX;if(e.length===0){this.createPlot(this.time,this.xAxisLabel,this.dataValues,this.traceNames);return}let t=[];for(let i of e)t.push(this.fullMetadata["y-axes-columns"][this.traceNames.indexOf(i)]);let r=[...this.parsedData.data];this.fullMetadata["no-header"]||(r=r.slice(1));let n=[];for(let i of t){const o=r.map(s=>s[i]);n.push(o)}this.createPlot(this.time,this.xAxisLabel,n,e)},createPlot(e,t,r,n){let i=[];for(let s=0;s<r.length;s++)i.push({type:"scatter",mode:"lines",name:n[s],x:e,y:r[s]});const o={title:{text:this.title},xaxis:{title:{text:t}}};PL.react(this.$refs.plotlyplot,i,{...this.layout,...o,...this.plotLayout},this.options)},findYaxesCols(){if(this.fullMetadata["y-axes-columns"].length===0){let e=[...Array(this.parsedData.data[0].length).keys()];e.shift(),e.shift(),console.log("seeting to:",e),this.fullMetadata["y-axes-columns"]=e}},populateXaxisLabel(){this.fullMetadata["no-header"]?this.xAxisLabel=this.traceData.data[0][this.fullMetadata["x-axis-column"]]:this.xAxisLabel=this.parsedData.data[0][this.fullMetadata["x-axis-column"]]},populateTraceNames(){if(this.fullMetadata["no-header"]){window.traceNames=this.traceNames,this.traceNames.splice(0,this.traceNames.length),window.traceData=this.traceData;for(let e of this.fullMetadata["y-axes-columns"])this.traceNames.push(this.traceData.data[0][e]),console.log("pushing:",this.traceData.data[0][e]);this.$set(this.traceNames,0,this.traceNames[0])}else{this.traceNames=[];for(let e of this.fullMetadata["y-axes-columns"])this.traceNames.push(this.parsedData.data[0][e])}},populateTime(){const e=this;let t=[...this.parsedData.data];this.fullMetadata["no-header"]||(t=t.slice(1)),this.time=t.map(function(r){return r[e.fullMetadata["x-axis-column"]]})},populateDataValues(){let e=[...this.parsedData.data];this.fullMetadata["no-header"]||(e=e.slice(1));let t=[];for(let r of this.fullMetadata["y-axes-columns"]){const n=e.map(i=>i[r]);t.push(n)}this.dataValues=t}}},Ber={class:"container"},Der={ref:"plotlyplot",class:"vue-plotly"};function Fer(e,t,r,n,i,o){const s=hw,l=pw,c=cw,u=fw;return a.openBlock(),a.createElementBlock("div",Ber,[a.createElementVNode("div",Der,null,512),a.createElementVNode("div",{class:a.normalizeClass(["chooser-container",{inactive:e.loading}])},[a.createElementVNode("span",null,[a.createVNode(l,{modelValue:e.filterX,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterX=d),class:"channel-select",size:"large",multiple:"",filterable:"","collapse-tags":"","default-first-option":"",teleported:!1,placeholder:"select"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.traceNames,d=>(a.openBlock(),a.createBlock(s,{key:d,label:d,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),a.createElementVNode("span",null,[a.createVNode(c,{class:"view-heatmap-button",onClick:o.filterPlot},{default:a.withCtx(()=>[a.createTextVNode("Filter plot")]),_:1},8,["onClick"])])],2),a.createVNode(u,{"parent-element":{element:e.$refs.plotlyplot},"controls-enabled":!e.loading},null,8,["parent-element","controls-enabled"])])}const zer=wV(Rer,[["render",Fer],["__scopeId","data-v-39f6dfd4"]]),jer={name:"HeatmapPlot",components:{PlotControls:fw,ElSelect:pw,ElOption:hw,ElCollapse:cme,ElCollapseItem:ume,ElButton:cw,ElPopover:VW},mixins:[DSe],data:function(){return{columnHeaders:[],rowHeaders:[],dataValues:[],filterX:[],filterY:[],parsedData:null,loading:!1,logScale:!1,logDataValues:[]}},computed:{fullMetadata(){let e=JSON.parse(JSON.stringify(this.metadata));return e.columnHeaderSize||(e.columnHeaderSize=1),e.columnHeaderIndex||(e.columnHeaderIndex=0),e.rowHeaderSize||(e.rowHeaderSize=1),e.rowHeaderIndex||(e.rowHeaderIndex=0),e},logScaleEnabled(){return!!JSON.parse(JSON.stringify(this.metadata)).logScale},plotTitle(){return this.logScale?this.title+" (Log scale)":this.title}},watch:{sourceData:function(){this.loadData(this.sourceData)}},mounted:function(){this.loadData(this.sourceData)},methods:{loadData(e){e.url?(this.loading=!0,x$.loadFile(e.url,this.dataReady)):PL.react(this.$refs.plotlyplot,this.sourceData.data,this.sourceData.layout?this.sourceData.layout:this.layout,this.options)},dataReady(e){this.loading=!1,this.parsedData=e,this.populateColumnHeaders(),this.populateRowHeaders(),this.populateDataValues(),this.logScaleEnabled?(this.logValues(),this.logScale=!0,this.createPlot(this.columnHeaders,this.rowHeaders,this.logDataValues,"heatmap")):this.createPlot(this.columnHeaders,this.rowHeaders,this.dataValues,"heatmap")},logValues(){this.dataValues.forEach((e,t)=>{this.logDataValues.push([]),e.forEach(r=>{this.logDataValues[t].push(Math.log10(r))})})},logToggle(){this.logScale?(this.logScale=!1,this.createPlot(this.columnHeaders,this.rowHeaders,this.dataValues,"heatmap")):(this.logScale=!0,this.createPlot(this.columnHeaders,this.rowHeaders,this.logDataValues,"heatmap"))},filterPlot(){let e=this.filterX,t=this.filterY;if(e.length===0&&t.length===0){this.createPlot(this.columnHeaders,this.rowHeaders,this.dataValues,"heatmap");return}e.length===0&&(e=this.columnHeaders),t.length===0&&(t=this.rowHeaders);let r=[];for(let o of e)r.push(this.columnHeaders.indexOf(o));let n=[];for(let o of t)n.push(this.rowHeaders.indexOf(o));let i=[];for(let o of r){const s=this.dataValues.map(c=>c[o]);let l=[];for(let c of n)l.push(s[c]);i.push(l)}i=i[0].map((o,s)=>i.map(l=>l[s])),this.createPlot(e,t,i,"heatmap")},createPlot(e,t,r,n){var i=[{x:e,y:t,z:r,type:n}];const o={title:{text:this.plotTitle}};PL.react(this.$refs.plotlyplot,i,{...this.layout,...o,...this.plotLayout},this.options)},populateColumnHeaders(){let e=[...[...this.parsedData.data][this.fullMetadata.columnHeaderIndex]];this.columnHeaders=e.slice(this.fullMetadata.rowHeaderSize)},populateRowHeaders(){const e=[...[...this.parsedData.data].map(t=>t[this.fullMetadata.rowHeaderIndex])];this.rowHeaders=e.slice(this.fullMetadata.columnHeaderSize)},populateDataValues(){const e=this,t=[...this.parsedData.data].slice(this.fullMetadata.columnHeaderSize);this.dataValues=t.map(function(r){return r.slice(e.fullMetadata.rowHeaderSize)})}}},Uer={class:"container"},Ger={ref:"plotlyplot",class:"vue-plotly"},qer={key:0};function Zer(e,t,r,n,i,o){const s=hw,l=pw,c=cw,u=fw;return a.openBlock(),a.createElementBlock("div",Uer,[a.createElementVNode("div",Ger,null,512),a.createElementVNode("div",{class:a.normalizeClass(["chooser-container",{inactive:e.loading}])},[a.createElementVNode("span",null,[a.createVNode(l,{modelValue:e.filterX,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterX=d),class:"channel-select",multiple:"",filterable:"","collapse-tags":"","default-first-option":"",placeholder:"select"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.columnHeaders,d=>(a.openBlock(),a.createBlock(s,{key:d,label:d,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),a.createElementVNode("span",null,[a.createVNode(l,{modelValue:e.filterY,"onUpdate:modelValue":t[1]||(t[1]=d=>e.filterY=d),class:"channel-select",multiple:"",filterable:"","collapse-tags":"","default-first-option":"",placeholder:"select"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.rowHeaders,d=>(a.openBlock(),a.createBlock(s,{key:d,label:d,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),a.createElementVNode("span",null,[a.createVNode(c,{class:"view-heatmap-button",onClick:o.filterPlot},{default:a.withCtx(()=>[a.createTextVNode("Filter plot")]),_:1},8,["onClick"])]),o.logScaleEnabled?(a.openBlock(),a.createElementBlock("span",qer,[a.createVNode(c,{class:"view-heatmap-button",onClick:o.logToggle},{default:a.withCtx(()=>[a.createTextVNode("Toggle log")]),_:1},8,["onClick"])])):a.createCommentVNode("",!0)],2),a.createVNode(u,{"parent-element":{element:e.$refs.plotlyplot},"controls-enabled":!e.loading},null,8,["parent-element","controls-enabled"])])}const Wer=wV(jer,[["render",Zer],["__scopeId","data-v-b959c7dc"]]),Ker=["1.2.0","1.1.0"],Xer={name:"PlotVuer",components:{TimeseriesPlot:zer,HeatmapPlot:Wer},props:{dataSource:{type:Object,default:()=>{}},metadata:{type:Object,required:!0,validator:function(e){return Ker.includes(e.version)&&e.type==="plot"}},plotLayout:{type:Object,default:()=>({height:667})},supplementalData:{type:Array,default:()=>[]},helpMode:{type:Boolean,default:!1}},computed:{plotType:function(){return this.metadata.attrs.style+"-plot"},layout:function(){let e=this.metadata?this.metadata.attrs?this.metadata.attrs.layout?this.metadata.attrs.layout:this.plotLayout:this.plotLayout:this.plotLayout;return e.height=e.height?e.height:667,e}}},Jer={class:"plotvuer_parent"};function Yer(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",Jer,[o.plotType!="-plot"?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.plotType),{key:0,sourceData:r.dataSource,plotLayout:o.layout,version:r.metadata.version,metadata:r.metadata.attrs,supplementalData:r.supplementalData},null,8,["sourceData","plotLayout","version","metadata","supplementalData"])):a.createCommentVNode("",!0)])}const FSe=wV(Xer,[["render",Yer],["__scopeId","data-v-a5e06718"]]),$er={name:"Plot",mixins:[ay],components:{PlotVuer:FSe}};function etr(e,t,r,n,i,o){const s=a.resolveComponent("PlotVuer");return a.openBlock(),a.createBlock(s,{"data-source":e.entry.resource.dataSource,metadata:e.entry.resource.metadata,"supplemental-data":e.entry.resource.supplementalData,style:{overflow:"hidden"}},null,8,["data-source","metadata","supplemental-data"])}const ttr=Gl($er,[["render",etr]]),_p=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var rtr=Object.defineProperty,ntr=Object.defineProperties,itr=Object.getOwnPropertyDescriptors,zSe=Object.getOwnPropertySymbols,otr=Object.prototype.hasOwnProperty,atr=Object.prototype.propertyIsEnumerable,jSe=(e,t,r)=>t in e?rtr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,str=(e,t)=>{for(var r in t||(t={}))otr.call(t,r)&&jSe(e,r,t[r]);if(zSe)for(var r of zSe(t))atr.call(t,r)&&jSe(e,r,t[r]);return e},ltr=(e,t)=>ntr(e,itr(t));function USe(e,t){var r;const n=a.shallowRef();return a.watchEffect(()=>{n.value=e()},ltr(str({},t),{flush:(r=t==null?void 0:t.flush)!=null?r:"sync"})),a.readonly(n)}var GSe;const Bs=typeof window<"u",ctr=e=>typeof e=="string",qSe=()=>{},utr=Bs&&((GSe=window==null?void 0:window.navigator)==null?void 0:GSe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function ZSe(e){return typeof e=="function"?e():a.unref(e)}function dtr(e){return e}function bN(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function ptr(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function wp(e){var t;const r=ZSe(e);return(t=r==null?void 0:r.$el)!=null?t:r}const FL=Bs?window:void 0,htr=Bs?window.document:void 0;function H0(...e){let t,r,n,i;if(ctr(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=FL):[t,r,n,i]=e,!t)return qSe;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,p,h,f)=>(d.addEventListener(p,h,f),()=>d.removeEventListener(p,h,f)),c=a.watch(()=>[wp(t),ZSe(i)],([d,p])=>{s(),d&&o.push(...r.flatMap(h=>n.map(f=>l(d,h,f,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return bN(u),u}let WSe=!1;function ftr(e,t,r={}){const{window:n=FL,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;utr&&!WSe&&(WSe=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",qSe)));let l=!0;const c=d=>i.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(h=>h===d.target||d.composedPath().includes(h));{const h=wp(p);return h&&(d.target===h||d.composedPath().includes(h))}}),u=[H0(n,"click",d=>{const p=wp(e);if(!(!p||p===d.target||d.composedPath().includes(p))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),H0(n,"pointerdown",d=>{const p=wp(e);p&&(l=!d.composedPath().includes(p)&&!c(d))},{passive:!0}),s&&H0(n,"blur",d=>{var p;const h=wp(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function KSe(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),ptr(n,t),r}const XSe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},JSe="__vueuse_ssr_handlers__";XSe[JSe]=XSe[JSe]||{};function mtr({document:e=htr}={}){if(!e)return a.ref("visible");const t=a.ref(e.visibilityState);return H0(e,"visibilitychange",()=>{t.value=e.visibilityState}),t}var YSe=Object.getOwnPropertySymbols,gtr=Object.prototype.hasOwnProperty,ytr=Object.prototype.propertyIsEnumerable,Ttr=(e,t)=>{var r={};for(var n in e)gtr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&YSe)for(var n of YSe(e))t.indexOf(n)<0&&ytr.call(e,n)&&(r[n]=e[n]);return r};function Lp(e,t,r={}){const n=r,{window:i=FL}=n,o=Ttr(n,["window"]);let s;const l=KSe(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>wp(e),p=>{c(),l.value&&i&&p&&(s=new ResizeObserver(t),s.observe(p,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return bN(d),{isSupported:l,stop:d}}var $Se=Object.getOwnPropertySymbols,vtr=Object.prototype.hasOwnProperty,Qtr=Object.prototype.propertyIsEnumerable,btr=(e,t)=>{var r={};for(var n in e)vtr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$Se)for(var n of $Se(e))t.indexOf(n)<0&&Qtr.call(e,n)&&(r[n]=e[n]);return r};function xtr(e,t,r={}){const n=r,{window:i=FL}=n,o=btr(n,["window"]);let s;const l=KSe(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>wp(e),p=>{c(),l.value&&i&&p&&(s=new MutationObserver(t),s.observe(p,o))},{immediate:!0}),d=()=>{c(),u()};return bN(d),{isSupported:l,stop:d}}var eke;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(eke||(eke={}));var _tr=Object.defineProperty,tke=Object.getOwnPropertySymbols,wtr=Object.prototype.hasOwnProperty,Ltr=Object.prototype.propertyIsEnumerable,rke=(e,t,r)=>t in e?_tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Str=(e,t)=>{for(var r in t||(t={}))wtr.call(t,r)&&rke(e,r,t[r]);if(tke)for(var r of tke(t))Ltr.call(t,r)&&rke(e,r,t[r]);return e};Str({linear:dtr},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function ktr({window:e=FL}={}){if(!e)return a.ref(!1);const t=a.ref(e.document.hasFocus());return H0(e,"blur",()=>{t.value=!1}),H0(e,"focus",()=>{t.value=!0}),t}const Mtr=()=>Bs&&/firefox/i.test(window.navigator.userAgent),_$=e=>{let t,r;return e.type==="touchend"?(r=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):e.type.startsWith("touch")?(r=e.touches[0].clientY,t=e.touches[0].clientX):(r=e.clientY,t=e.clientX),{clientX:t,clientY:r}};/**
1489
+ `);var P=0,Z=!1;this.parse=function(K,U,X){if(typeof K!="string")throw new Error("Input must be a string");var ee=K.length,oe=O.length,he=N.length,me=I.length,ie=k(B),be=[],re=[],ue=[],ne=P=0;if(!K)return Je();if(C.header&&!U){var ye=K.split(N)[0].split(O),_e=[],Ie={},qe=!1;for(var Ge in ye){var et=ye[Ge];k(C.transformHeader)&&(et=C.transformHeader(et,Ge));var Ve=et,Ne=Ie[et]||0;for(0<Ne&&(qe=!0,Ve=et+"_"+Ne),Ie[et]=Ne+1;_e.includes(Ve);)Ve=Ve+"_"+Ne;_e.push(Ve)}if(qe){var it=K.split(N);it[0]=_e.join(O),K=it.join(N)}}if(j||j!==!1&&K.indexOf(A)===-1){for(var Be=K.split(N),pt=0;pt<Be.length;pt++){if(ue=Be[pt],P+=ue.length,pt!==Be.length-1)P+=N.length;else if(X)return Je();if(!I||ue.substring(0,me)!==I){if(ie){if(be=[],Ht(ue.split(O)),ft(),Z)return Je()}else Ht(ue.split(O));if(F&&F<=pt)return be=be.slice(0,F),Je(!0)}}return Je()}for(var yt=K.indexOf(O,P),ct=K.indexOf(N,P),xe=new RegExp(T(G)+T(A),"g"),Ue=K.indexOf(A,P);;)if(K[P]!==A)if(I&&ue.length===0&&K.substring(P,P+me)===I){if(ct===-1)return Je();P=ct+he,ct=K.indexOf(N,P),yt=K.indexOf(O,P)}else if(yt!==-1&&(yt<ct||ct===-1))ue.push(K.substring(P,yt)),P=yt+oe,yt=K.indexOf(O,P);else{if(ct===-1)break;if(ue.push(K.substring(P,ct)),Gt(ct+he),ie&&(ft(),Z))return Je();if(F&&be.length>=F)return Je(!0)}else for(Ue=P,P++;;){if((Ue=K.indexOf(A,Ue+1))===-1)return X||re.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:be.length,index:P}),Dt();if(Ue===ee-1)return Dt(K.substring(P,Ue).replace(xe,A));if(A!==G||K[Ue+1]!==G){if(A===G||Ue===0||K[Ue-1]!==G){yt!==-1&&yt<Ue+1&&(yt=K.indexOf(O,Ue+1)),ct!==-1&&ct<Ue+1&&(ct=K.indexOf(N,Ue+1));var $e=Vt(ct===-1?yt:Math.min(yt,ct));if(K.substr(Ue+1+$e,oe)===O){ue.push(K.substring(P,Ue).replace(xe,A)),K[P=Ue+1+$e+oe]!==A&&(Ue=K.indexOf(A,P)),yt=K.indexOf(O,P),ct=K.indexOf(N,P);break}var at=Vt(ct);if(K.substring(Ue+1+at,Ue+1+at+he)===N){if(ue.push(K.substring(P,Ue).replace(xe,A)),Gt(Ue+1+at+he),yt=K.indexOf(O,P),Ue=K.indexOf(A,P),ie&&(ft(),Z))return Je();if(F&&be.length>=F)return Je(!0);break}re.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:be.length,index:P}),Ue++}}else Ue++}return Dt();function Ht(St){be.push(St),ne=P}function Vt(St){var Wt=0;if(St!==-1){var Jt=K.substring(Ue+1,St);Jt&&Jt.trim()===""&&(Wt=Jt.length)}return Wt}function Dt(St){return X||(St===void 0&&(St=K.substring(P)),ue.push(St),P=ee,Ht(ue),ie&&ft()),Je()}function Gt(St){P=St,Ht(ue),ue=[],ct=K.indexOf(N,P)}function Je(St){return{data:be,errors:re,meta:{delimiter:O,linebreak:N,aborted:Z,truncated:!!St,cursor:ne+(U||0)}}}function ft(){B(Je()),be=[],re=[]}},this.abort=function(){Z=!0},this.getCharIndex=function(){return P}}function v(C){var A=C.data,O=s[A.workerId],N=!1;if(A.error)O.userError(A.error,A.file);else if(A.results&&A.results.data){var I={abort:function(){N=!0,_(A.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:b,resume:b};if(k(O.userStep)){for(var B=0;B<A.results.data.length&&(O.userStep({data:A.results.data[B],errors:A.results.errors,meta:A.results.meta},I),!N);B++);delete A.results}else k(O.userChunk)&&(O.userChunk(A.results,I,A.file),delete A.results)}A.finished&&!N&&_(A.workerId,A.results)}function _(C,A){var O=s[C];k(O.userComplete)&&O.userComplete(A),O.terminate(),delete s[C]}function b(){throw new Error("Not implemented.")}function L(C){if(typeof C!="object"||C===null)return C;var A=Array.isArray(C)?[]:{};for(var O in C)A[O]=L(C[O]);return A}function w(C,A){return function(){C.apply(A,arguments)}}function k(C){return typeof C=="function"}return o&&(n.onmessage=function(C){var A=C.data;if(c.WORKER_ID===void 0&&A&&(c.WORKER_ID=A.workerId),typeof A.input=="string")n.postMessage({workerId:c.WORKER_ID,results:c.parse(A.input,A.config),finished:!0});else if(n.File&&A.input instanceof File||A.input instanceof Object){var O=c.parse(A.input,A.config);O&&n.postMessage({workerId:c.WORKER_ID,results:O,finished:!0})}}),(p.prototype=Object.create(d.prototype)).constructor=p,(h.prototype=Object.create(d.prototype)).constructor=h,(f.prototype=Object.create(f.prototype)).constructor=f,(m.prototype=Object.create(d.prototype)).constructor=m,c})})(BSe);var Ier=BSe.exports;const Per=dw(Ier),Ner=(e,t)=>Per.parse(e,{download:!0,complete:t}),x$={loadFile:Ner},DSe={components:{PlotControls:fw},props:{metadata:{type:Object,required:!0},sourceData:{type:Object,required:!0},plotLayout:{type:Object,required:!0},supplementalData:{type:Array,required:!0},version:{type:String,required:!0}},data:function(){return{layout:{paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",autosize:!0,margin:{t:25,l:55,r:55,b:90,pad:4}},loading:!1,options:{responsive:!0,scrollZoom:!0}}},computed:{title(){return this.sourceData.url.split("\\").pop().split("/").pop().split(".")[0]}}},Rer={name:"TimeseriesPlot",components:{PlotControls:fw,ElSelect:pw,ElButton:cw,ElOption:hw},mixins:[DSe],data:function(){return{dataValues:[],filterX:[],parsedData:null,time:[],traceData:null,traceNames:[],xAxisLabel:"time"}},computed:{fullMetadata(){let e=JSON.parse(JSON.stringify(this.metadata));return e["y-axes-columns"]||(e["y-axes-columns"]=[]),e["x-axis-column"]||(e["x-axis-column"]=0),e["no-header"]||(e["no-header"]=!1),e["row-major"]||(e["row-major"]=!1),e}},watch:{sourceData:function(){this.loadData(this.sourceData)}},mounted:function(){this.loadData(this.sourceData)},methods:{loadData(e){e.url?(this.loading=!0,x$.loadFile(e.url,this.dataReady)):PL.react(this.$refs.plotlyplot,this.sourceData.data,this.sourceData.layout?this.sourceData.layout:this.layout,this.options)},dataReady(e){this.fullMetadata["no-header"]&&x$.loadFile(this.supplementalData[0].url,this.headerDataReady),this.loading=!1,this.parsedData=e,this.findYaxesCols(),this.populateTime(),this.populateDataValues(),this.fullMetadata["no-header"]||(this.populateXaxisLabel(),this.populateTraceNames()),this.createPlot(this.time,this.xAxisLabel,this.dataValues,this.traceNames)},headerDataReady(e){this.traceData=e,this.populateXaxisLabel(),this.populateTraceNames(),this.loading||this.createPlot(this.time,this.xAxisLabel,this.dataValues,this.traceNames)},filterPlot(){let e=this.filterX;if(e.length===0){this.createPlot(this.time,this.xAxisLabel,this.dataValues,this.traceNames);return}let t=[];for(let i of e)t.push(this.fullMetadata["y-axes-columns"][this.traceNames.indexOf(i)]);let r=[...this.parsedData.data];this.fullMetadata["no-header"]||(r=r.slice(1));let n=[];for(let i of t){const o=r.map(s=>s[i]);n.push(o)}this.createPlot(this.time,this.xAxisLabel,n,e)},createPlot(e,t,r,n){let i=[];for(let s=0;s<r.length;s++)i.push({type:"scatter",mode:"lines",name:n[s],x:e,y:r[s]});const o={title:{text:this.title},xaxis:{title:{text:t}}};PL.react(this.$refs.plotlyplot,i,{...this.layout,...o},this.options)},findYaxesCols(){if(this.fullMetadata["y-axes-columns"].length===0){let e=[...Array(this.parsedData.data[0].length).keys()];e.shift(),e.shift(),console.log("seeting to:",e),this.fullMetadata["y-axes-columns"]=e}},populateXaxisLabel(){this.fullMetadata["no-header"]?this.xAxisLabel=this.traceData.data[0][this.fullMetadata["x-axis-column"]]:this.xAxisLabel=this.parsedData.data[0][this.fullMetadata["x-axis-column"]]},populateTraceNames(){if(this.fullMetadata["no-header"]){window.traceNames=this.traceNames,this.traceNames.splice(0,this.traceNames.length),window.traceData=this.traceData;for(let e of this.fullMetadata["y-axes-columns"])this.traceNames.push(this.traceData.data[0][e]),console.log("pushing:",this.traceData.data[0][e]);this.$set(this.traceNames,0,this.traceNames[0])}else{this.traceNames=[];for(let e of this.fullMetadata["y-axes-columns"])this.traceNames.push(this.parsedData.data[0][e])}},populateTime(){const e=this;let t=[...this.parsedData.data];this.fullMetadata["no-header"]||(t=t.slice(1)),this.time=t.map(function(r){return r[e.fullMetadata["x-axis-column"]]})},populateDataValues(){let e=[...this.parsedData.data];this.fullMetadata["no-header"]||(e=e.slice(1));let t=[];for(let r of this.fullMetadata["y-axes-columns"]){const n=e.map(i=>i[r]);t.push(n)}this.dataValues=t}}},Ber={class:"container"},Der={ref:"plotlyplot",class:"vue-plotly"};function Fer(e,t,r,n,i,o){const s=hw,l=pw,c=cw,u=fw;return a.openBlock(),a.createElementBlock("div",Ber,[a.createElementVNode("div",Der,null,512),a.createElementVNode("div",{class:a.normalizeClass(["chooser-container",{inactive:e.loading}])},[a.createElementVNode("span",null,[a.createVNode(l,{ref:"selectBox",modelValue:e.filterX,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterX=d),class:"channel-select",size:"large",multiple:"",filterable:"","collapse-tags":"","default-first-option":"",teleported:!1,placeholder:"select"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.traceNames,d=>(a.openBlock(),a.createBlock(s,{key:d,label:d,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),a.createElementVNode("span",null,[a.createVNode(c,{class:"view-heatmap-button",onClick:o.filterPlot},{default:a.withCtx(()=>[a.createTextVNode("Filter plot")]),_:1},8,["onClick"])])],2),a.createVNode(u,{ref:"controls","parent-element":{element:e.$refs.plotlyplot},"controls-enabled":!e.loading},null,8,["parent-element","controls-enabled"])])}const zer=wV(Rer,[["render",Fer],["__scopeId","data-v-61d3eaa9"]]),jer={name:"HeatmapPlot",components:{PlotControls:fw,ElSelect:pw,ElOption:hw,ElCollapse:cme,ElCollapseItem:ume,ElButton:cw,ElPopover:VW},mixins:[DSe],data:function(){return{columnHeaders:[],rowHeaders:[],dataValues:[],filterX:[],filterY:[],parsedData:null,loading:!1,logScale:!1,logDataValues:[]}},computed:{fullMetadata(){let e=JSON.parse(JSON.stringify(this.metadata));return e.columnHeaderSize||(e.columnHeaderSize=1),e.columnHeaderIndex||(e.columnHeaderIndex=0),e.rowHeaderSize||(e.rowHeaderSize=1),e.rowHeaderIndex||(e.rowHeaderIndex=0),e},logScaleEnabled(){return!!JSON.parse(JSON.stringify(this.metadata)).logScale},plotTitle(){return this.logScale?this.title+" (Log scale)":this.title}},watch:{sourceData:function(){this.loadData(this.sourceData)}},mounted:function(){this.loadData(this.sourceData)},methods:{loadData(e){e.url?(this.loading=!0,x$.loadFile(e.url,this.dataReady)):PL.react(this.$refs.plotlyplot,this.sourceData.data,this.sourceData.layout?this.sourceData.layout:this.layout,this.options)},dataReady(e){this.loading=!1,this.parsedData=e,this.populateColumnHeaders(),this.populateRowHeaders(),this.populateDataValues(),this.logScaleEnabled?(this.logValues(),this.logScale=!0,this.createPlot(this.columnHeaders,this.rowHeaders,this.logDataValues,"heatmap")):this.createPlot(this.columnHeaders,this.rowHeaders,this.dataValues,"heatmap")},logValues(){this.dataValues.forEach((e,t)=>{this.logDataValues.push([]),e.forEach(r=>{this.logDataValues[t].push(Math.log10(r))})})},logToggle(){this.logScale?(this.logScale=!1,this.createPlot(this.columnHeaders,this.rowHeaders,this.dataValues,"heatmap")):(this.logScale=!0,this.createPlot(this.columnHeaders,this.rowHeaders,this.logDataValues,"heatmap"))},filterPlot(){let e=this.filterX,t=this.filterY;if(e.length===0&&t.length===0){this.createPlot(this.columnHeaders,this.rowHeaders,this.dataValues,"heatmap");return}e.length===0&&(e=this.columnHeaders),t.length===0&&(t=this.rowHeaders);let r=[];for(let o of e)r.push(this.columnHeaders.indexOf(o));let n=[];for(let o of t)n.push(this.rowHeaders.indexOf(o));let i=[];for(let o of r){const s=this.dataValues.map(c=>c[o]);let l=[];for(let c of n)l.push(s[c]);i.push(l)}i=i[0].map((o,s)=>i.map(l=>l[s])),this.createPlot(e,t,i,"heatmap")},createPlot(e,t,r,n){var i=[{x:e,y:t,z:r,type:n}];const o={title:{text:this.plotTitle}};PL.react(this.$refs.plotlyplot,i,{...this.layout,...o,...this.plotLayout},this.options)},populateColumnHeaders(){let e=[...[...this.parsedData.data][this.fullMetadata.columnHeaderIndex]];this.columnHeaders=e.slice(this.fullMetadata.rowHeaderSize)},populateRowHeaders(){const e=[...[...this.parsedData.data].map(t=>t[this.fullMetadata.rowHeaderIndex])];this.rowHeaders=e.slice(this.fullMetadata.columnHeaderSize)},populateDataValues(){const e=this,t=[...this.parsedData.data].slice(this.fullMetadata.columnHeaderSize);this.dataValues=t.map(function(r){return r.slice(e.fullMetadata.rowHeaderSize)})}}},Uer={class:"container"},Ger={ref:"plotlyplot",class:"vue-plotly"},qer={key:0};function Zer(e,t,r,n,i,o){const s=hw,l=pw,c=cw,u=fw;return a.openBlock(),a.createElementBlock("div",Uer,[a.createElementVNode("div",Ger,null,512),a.createElementVNode("div",{class:a.normalizeClass(["chooser-container",{inactive:e.loading}])},[a.createElementVNode("span",null,[a.createVNode(l,{modelValue:e.filterX,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterX=d),class:"channel-select",multiple:"",filterable:"","collapse-tags":"","default-first-option":"",placeholder:"select"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.columnHeaders,d=>(a.openBlock(),a.createBlock(s,{key:d,label:d,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),a.createElementVNode("span",null,[a.createVNode(l,{modelValue:e.filterY,"onUpdate:modelValue":t[1]||(t[1]=d=>e.filterY=d),class:"channel-select",multiple:"",filterable:"","collapse-tags":"","default-first-option":"",placeholder:"select"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.rowHeaders,d=>(a.openBlock(),a.createBlock(s,{key:d,label:d,value:d},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),a.createElementVNode("span",null,[a.createVNode(c,{class:"view-heatmap-button",onClick:o.filterPlot},{default:a.withCtx(()=>[a.createTextVNode("Filter plot")]),_:1},8,["onClick"])]),o.logScaleEnabled?(a.openBlock(),a.createElementBlock("span",qer,[a.createVNode(c,{class:"view-heatmap-button",onClick:o.logToggle},{default:a.withCtx(()=>[a.createTextVNode("Toggle log")]),_:1},8,["onClick"])])):a.createCommentVNode("",!0)],2),a.createVNode(u,{"parent-element":{element:e.$refs.plotlyplot},"controls-enabled":!e.loading},null,8,["parent-element","controls-enabled"])])}const Wer=wV(jer,[["render",Zer],["__scopeId","data-v-b959c7dc"]]),Ker=["1.2.0","1.1.0"],Xer={name:"PlotVuer",components:{TimeseriesPlot:zer,HeatmapPlot:Wer},props:{dataSource:{type:Object,default:()=>{}},metadata:{type:Object,required:!0,validator:function(e){return Ker.includes(e.version)&&e.type==="plot"}},plotLayout:{type:Object,default:()=>({paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",autosize:!0,margin:{t:25,l:55,r:55,b:90,pad:4},loading:!1,options:{responsive:!0,scrollZoom:!0}})},supplementalData:{type:Array,default:()=>[]},helpMode:{type:Boolean,default:!1}},computed:{plotType:function(){return this.metadata.attrs.style+"-plot"},layout:function(){return this.metadata?this.metadata.attrs?this.metadata.attrs.layout?this.metadata.attrs.layout:this.plotLayout:this.plotLayout:this.plotLayout}}},Jer={class:"plotvuer_parent"};function Yer(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",Jer,[o.plotType!="-plot"?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.plotType),{key:0,sourceData:r.dataSource,plotLayout:o.layout,version:r.metadata.version,metadata:r.metadata.attrs,supplementalData:r.supplementalData},null,8,["sourceData","plotLayout","version","metadata","supplementalData"])):a.createCommentVNode("",!0)])}const FSe=wV(Xer,[["render",Yer],["__scopeId","data-v-487f399b"]]),$er={name:"Plot",mixins:[ay],components:{PlotVuer:FSe}};function etr(e,t,r,n,i,o){const s=a.resolveComponent("PlotVuer");return a.openBlock(),a.createBlock(s,{"data-source":e.entry.resource.dataSource,metadata:e.entry.resource.metadata,"supplemental-data":e.entry.resource.supplementalData,style:{overflow:"hidden"}},null,8,["data-source","metadata","supplemental-data"])}const ttr=Gl($er,[["render",etr]]),_p=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var rtr=Object.defineProperty,ntr=Object.defineProperties,itr=Object.getOwnPropertyDescriptors,zSe=Object.getOwnPropertySymbols,otr=Object.prototype.hasOwnProperty,atr=Object.prototype.propertyIsEnumerable,jSe=(e,t,r)=>t in e?rtr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,str=(e,t)=>{for(var r in t||(t={}))otr.call(t,r)&&jSe(e,r,t[r]);if(zSe)for(var r of zSe(t))atr.call(t,r)&&jSe(e,r,t[r]);return e},ltr=(e,t)=>ntr(e,itr(t));function USe(e,t){var r;const n=a.shallowRef();return a.watchEffect(()=>{n.value=e()},ltr(str({},t),{flush:(r=t==null?void 0:t.flush)!=null?r:"sync"})),a.readonly(n)}var GSe;const Bs=typeof window<"u",ctr=e=>typeof e=="string",qSe=()=>{},utr=Bs&&((GSe=window==null?void 0:window.navigator)==null?void 0:GSe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function ZSe(e){return typeof e=="function"?e():a.unref(e)}function dtr(e){return e}function bN(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function ptr(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function wp(e){var t;const r=ZSe(e);return(t=r==null?void 0:r.$el)!=null?t:r}const FL=Bs?window:void 0,htr=Bs?window.document:void 0;function H0(...e){let t,r,n,i;if(ctr(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=FL):[t,r,n,i]=e,!t)return qSe;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,p,h,f)=>(d.addEventListener(p,h,f),()=>d.removeEventListener(p,h,f)),c=a.watch(()=>[wp(t),ZSe(i)],([d,p])=>{s(),d&&o.push(...r.flatMap(h=>n.map(f=>l(d,h,f,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return bN(u),u}let WSe=!1;function ftr(e,t,r={}){const{window:n=FL,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;utr&&!WSe&&(WSe=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",qSe)));let l=!0;const c=d=>i.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(h=>h===d.target||d.composedPath().includes(h));{const h=wp(p);return h&&(d.target===h||d.composedPath().includes(h))}}),u=[H0(n,"click",d=>{const p=wp(e);if(!(!p||p===d.target||d.composedPath().includes(p))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),H0(n,"pointerdown",d=>{const p=wp(e);p&&(l=!d.composedPath().includes(p)&&!c(d))},{passive:!0}),s&&H0(n,"blur",d=>{var p;const h=wp(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function KSe(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),ptr(n,t),r}const XSe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},JSe="__vueuse_ssr_handlers__";XSe[JSe]=XSe[JSe]||{};function mtr({document:e=htr}={}){if(!e)return a.ref("visible");const t=a.ref(e.visibilityState);return H0(e,"visibilitychange",()=>{t.value=e.visibilityState}),t}var YSe=Object.getOwnPropertySymbols,gtr=Object.prototype.hasOwnProperty,ytr=Object.prototype.propertyIsEnumerable,Ttr=(e,t)=>{var r={};for(var n in e)gtr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&YSe)for(var n of YSe(e))t.indexOf(n)<0&&ytr.call(e,n)&&(r[n]=e[n]);return r};function Lp(e,t,r={}){const n=r,{window:i=FL}=n,o=Ttr(n,["window"]);let s;const l=KSe(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>wp(e),p=>{c(),l.value&&i&&p&&(s=new ResizeObserver(t),s.observe(p,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return bN(d),{isSupported:l,stop:d}}var $Se=Object.getOwnPropertySymbols,vtr=Object.prototype.hasOwnProperty,Qtr=Object.prototype.propertyIsEnumerable,btr=(e,t)=>{var r={};for(var n in e)vtr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$Se)for(var n of $Se(e))t.indexOf(n)<0&&Qtr.call(e,n)&&(r[n]=e[n]);return r};function xtr(e,t,r={}){const n=r,{window:i=FL}=n,o=btr(n,["window"]);let s;const l=KSe(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>wp(e),p=>{c(),l.value&&i&&p&&(s=new MutationObserver(t),s.observe(p,o))},{immediate:!0}),d=()=>{c(),u()};return bN(d),{isSupported:l,stop:d}}var eke;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(eke||(eke={}));var _tr=Object.defineProperty,tke=Object.getOwnPropertySymbols,wtr=Object.prototype.hasOwnProperty,Ltr=Object.prototype.propertyIsEnumerable,rke=(e,t,r)=>t in e?_tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Str=(e,t)=>{for(var r in t||(t={}))wtr.call(t,r)&&rke(e,r,t[r]);if(tke)for(var r of tke(t))Ltr.call(t,r)&&rke(e,r,t[r]);return e};Str({linear:dtr},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function ktr({window:e=FL}={}){if(!e)return a.ref(!1);const t=a.ref(e.document.hasFocus());return H0(e,"blur",()=>{t.value=!1}),H0(e,"focus",()=>{t.value=!0}),t}const Mtr=()=>Bs&&/firefox/i.test(window.navigator.userAgent),_$=e=>{let t,r;return e.type==="touchend"?(r=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):e.type.startsWith("touch")?(r=e.touches[0].clientY,t=e.touches[0].clientX):(r=e.clientY,t=e.clientX),{clientX:t,clientY:r}};/**
1490
1490
  * @vue/shared v3.4.15
1491
1491
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
1492
1492
  * @license MIT
@@ -4716,7 +4716,7 @@ void main() {
4716
4716
  `)!==-1&&(v=v.replace(/\r\n/g,`
4717
4717
  `)),v.indexOf(`\\
4718
4718
  `)!==-1&&(v=v.replace(/\\\n/g,""));for(var b=v.split(`
4719
- `),L="",w="",k=0,C=[],A=typeof"".trimLeft=="function",O=0,N=b.length;O<N;O++)if(L=b[O],L=A?L.trimLeft():L.trim(),k=L.length,k!==0&&(w=L.charAt(0),w!=="#"))if(w==="v"){var I=L.split(/\s+/);switch(I[0]){case"v":_.vertices.push(parseFloat(I[1]),parseFloat(I[2]),parseFloat(I[3])),7<=I.length?_.colors.push(parseFloat(I[4]),parseFloat(I[5]),parseFloat(I[6])):_.colors.push(void 0,void 0,void 0);break;case"vn":_.normals.push(parseFloat(I[1]),parseFloat(I[2]),parseFloat(I[3]));break;case"vt":_.uvs.push(parseFloat(I[1]),parseFloat(I[2]))}}else if(w==="f"){for(var B,F=L.substr(1).trim(),j=F.split(/\s+/),G=[],P=0,Z=j.length;P<Z;P++)if(B=j[P],0<B.length){var K=B.split("/");G.push(K)}for(var U=G[0],X=1,ee=G.length-1;X<ee;X++){var oe=G[X],he=G[X+1];_.addFace(U[0],oe[0],he[0],U[1],oe[1],he[1],U[2],oe[2],he[2])}}else if(w==="l"){var me=L.substring(1).trim().split(" "),ie=[],be=[];if(L.indexOf("/")===-1)ie=me;else for(var re,ue=0,ne=me.length;ue<ne;ue++)re=me[ue].split("/"),re[0]!==""&&ie.push(re[0]),re[1]!==""&&be.push(re[1]);_.addLineGeometry(ie,be)}else if(w==="p"){var ye=L.substr(1).trim(),_e=ye.split(" ");_.addPointGeometry(_e)}else if((C=s.exec(L))!==null){var Ie=(" "+C[0].substr(1).trim()).substr(1);_.startObject(Ie)}else if(c.test(L))_.object.startMaterial(L.substring(7).trim(),_.materialLibraries);else if(l.test(L))_.materialLibraries.push(L.substring(7).trim());else if(u.test(L))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(w==="s"){if(C=L.split(" "),1<C.length){var qe=C[1].trim().toLowerCase();_.object.smooth=qe!=="0"&&qe!=="off"}else _.object.smooth=!0;var Ge=_.object.currentMaterial();Ge&&(Ge.smooth=_.object.smooth)}else{if(L==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+L+'"')}_.finalize();var et=new o.Group;et.materialLibraries=[].concat(_.materialLibraries);var Ve=_.objects.length!==1||_.objects[0].geometry.vertices.length!==0;if(Ve==!0)for(var Ne=0,it=_.objects.length;Ne<it;Ne++){var Be=_.objects[Ne],pt=Be.geometry,yt=Be.materials,ct=pt.type==="Line",xe=pt.type==="Points",Ue=!1;if(pt.vertices.length!==0){var $e=new o.BufferGeometry;$e.setAttribute("position",new o.Float32BufferAttribute(pt.vertices,3)),0<pt.normals.length&&$e.setAttribute("normal",new o.Float32BufferAttribute(pt.normals,3)),0<pt.colors.length&&(Ue=!0,$e.setAttribute("color",new o.Float32BufferAttribute(pt.colors,3))),pt.hasUVIndices===!0&&$e.setAttribute("uv",new o.Float32BufferAttribute(pt.uvs,2));for(var at=[],Ht=0,Vt=yt.length;Ht<Vt;Ht++){var Dt=yt[Ht],Gt=Dt.name+"_"+Dt.smooth+"_"+Ue,Je=_.materials[Gt];if(this.materials!==null){if(Je=this.materials.create(Dt.name),ct&&Je&&!(Je instanceof o.LineBasicMaterial)){var ft=new o.LineBasicMaterial;o.Material.prototype.copy.call(ft,Je),ft.color.copy(Je.color),Je=ft}else if(xe&&Je&&!(Je instanceof o.PointsMaterial)){var St=new o.PointsMaterial({size:10,sizeAttenuation:!1});o.Material.prototype.copy.call(St,Je),St.color.copy(Je.color),St.map=Je.map,Je=St}}Je===void 0&&(Je=ct?new o.LineBasicMaterial:xe?new o.PointsMaterial({size:1,sizeAttenuation:!1}):new o.MeshPhongMaterial,Je.name=Dt.name,Je.flatShading=!Dt.smooth,Je.vertexColors=Ue,_.materials[Gt]=Je),at.push(Je)}var Wt=void 0;if(1<at.length){for(var Jt,Pt=0,rt=yt.length;Pt<rt;Pt++)Jt=yt[Pt],$e.addGroup(Jt.groupStart,Jt.groupCount,Pt);Wt=ct?new o.LineSegments($e,at):xe?new o.Points($e,at):new o.Mesh($e,at)}else Wt=ct?new o.LineSegments($e,at[0]):xe?new o.Points($e,at[0]):new o.Mesh($e,at[0]);Wt.name=Be.name,et.add(Wt)}}else if(0<_.vertices.length){var Et=new o.PointsMaterial({size:1,sizeAttenuation:!1}),kt=new o.BufferGeometry;kt.setAttribute("position",new o.Float32BufferAttribute(_.vertices,3)),0<_.colors.length&&_.colors[0]!==void 0&&(kt.setAttribute("color",new o.Float32BufferAttribute(_.colors,3)),Et.vertexColors=!0);var or=new o.Points(kt,Et);et.add(or)}return et}}},function(r,n,i){var o=i(14).JSONLoader;n.PrimitivesLoader=function(){var s=0;this.crossOrigin="Anonymous";var l=new o,c=[];this.load=(d,p,h,f)=>{if(20>s){++s,l.crossOrigin=this.crossOrigin;var m=new u(p,this),g=new u(f,this);l.load(d,m,h,g)}else c.push({url:d,onLoad:p,onProgress:h,onError:f})},this.loadFromWaitingList=()=>{var d=c.shift();d&&this.load(d.url,d.onLoad,d.onProgress,d.onError)};var u=function(d,p){return function(){--s,d(...arguments),p.loadFromWaitingList()}};this.parse=d=>l.parse(d)}},function(r,n,i){i(3);var o=i(36).GLTFLoader,s=function(){var l=this;this.parseGLTFObjects=(c,u,d,p)=>{var h=u;if(d!==0){if(c.type!=="Object3D"){var f;if(c.type==="Mesh"?f=new(i(2)).Geometry:c.type==="LineSegments"?f=new(i(20)).Lines:c.type==="Points"&&(f=new(i(17)).Pointset),f){var m=!1,g=!1;c.geometry&&c.geometry.morphAttributes&&(m=!!c.geometry.morphAttributes.position,g=!!c.geometry.morphAttributes.color),f.setMesh(c.clone(),m,g),u.addZincObject(f),f.groupName=f.morph.name,f.morph.matrixAutoUpdate=!0,p!=null&&typeof p=="function"&&p(f)}}else if(c.name!==""&&(u&&(h=u.findOrCreateChildFromPath(c.name)),h)){var T=h.getGroup();T.position.copy(c.position),T.rotation.copy(c.rotation),T.quaternion.copy(c.quaternion),T.matrixAutoUpdate=!0}}d++,c.children.forEach(y=>{l.parseGLTFObjects(y,h,d,p)})},this.setCamera=c=>{c.viewAll();var u=c.getZincCameraControls(),d=u.getCurrentViewport();u.addViewport("default",d),u.setDefaultViewport("default")},this.load=(c,u,d,p,h)=>{var f=d.substring(0,d.lastIndexOf("/")+1),m=d.substring(d.lastIndexOf("/")+1,d.length),g=new o().setPath(f);g.load(m,function(T){console.log(T),l.parseGLTFObjects(T.scene,u,0,p),l.setCamera(c),h!=null&&typeof h=="function"&&h()})}};n.GLTFToZincJSLoader=s},function(r,n){r.exports=n8r},function(r,n,i){var o=i(38).GLTFExporter,s=function(l){var c=l;this.exportGLTF=u=>{var d=c.getRootRegion(),p=d.getAllObjects(!0),h=[];p.forEach(g=>{g.animationClip&&h.push({clip:g.animationClip[0],mesh:g.morph})});var f=new o,m={binary:u,animations:h};return new Promise(g=>{f.parse(c.getThreeJSScene(),function(T){g(T)},m)})}};n.SceneExporter=s},function(r,n,i){i.r(n),i.d(n,"GLTFExporter",function(){return s});var o=i(3);class s{constructor(){this.pluginCallbacks=[],this.register(function(I){return new C(I)}),this.register(function(I){return new A(I)}),this.register(function(I){return new O(I)})}register(I){return this.pluginCallbacks.indexOf(I)===-1&&this.pluginCallbacks.push(I),this}unregister(I){return this.pluginCallbacks.indexOf(I)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(I),1),this}parse(I,B,F){for(var j=new k,G=[],P=0,Z=this.pluginCallbacks.length;P<Z;P++)G.push(this.pluginCallbacks[P](j));j.setPlugins(G),j.write(I,B,F)}}var l={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},c={};c[o.NearestFilter]=l.NEAREST,c[o.NearestMipmapNearestFilter]=l.NEAREST_MIPMAP_NEAREST,c[o.NearestMipmapLinearFilter]=l.NEAREST_MIPMAP_LINEAR,c[o.LinearFilter]=l.LINEAR,c[o.LinearMipmapNearestFilter]=l.LINEAR_MIPMAP_NEAREST,c[o.LinearMipmapLinearFilter]=l.LINEAR_MIPMAP_LINEAR,c[o.ClampToEdgeWrapping]=l.CLAMP_TO_EDGE,c[o.RepeatWrapping]=l.REPEAT,c[o.MirroredRepeatWrapping]=l.MIRRORED_REPEAT;var u={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},d=12,p=1179937895,h=2,f=8,m=1313821514,g=5130562;function T(N,I){return N.length===I.length&&N.every(function(B,F){return B===I[F]})}function y(N){if(window.TextEncoder!==void 0)return new TextEncoder().encode(N).buffer;for(var I,B=new Uint8Array(new ArrayBuffer(N.length)),F=0,j=N.length;F<j;F++)I=N.charCodeAt(F),B[F]=255<I?32:I;return B.buffer}function v(N){return T(N.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function _(N,I,B){for(var F={min:Array(N.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(N.itemSize).fill(Number.NEGATIVE_INFINITY)},j=I;j<I+B;j++)for(var G,P=0;P<N.itemSize;P++)G=void 0,4<N.itemSize?G=N.array[j*N.itemSize+P]:P===0?G=N.getX(j):P===1?G=N.getY(j):P===2?G=N.getZ(j):P==3&&(G=N.getW(j)),F.min[P]=Math.min(F.min[P],G),F.max[P]=Math.max(F.max[P],G);return F}function b(N){return 4*Math.ceil(N/4)}function L(N){var I=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,B=b(N.byteLength);if(B!==N.byteLength){var F=new Uint8Array(B);if(F.set(new Uint8Array(N)),I!==0)for(var j=N.byteLength;j<B;j++)F[j]=I;return F.buffer}return N}var w=null;class k{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(I){this.plugins=I}write(I,B,F){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},F),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(I);var j=this;Promise.all(this.pending).then(function(){var G=j.buffers,P=j.json,Z=j.options,K=j.extensionsUsed,U=new Blob(G,{type:"application/octet-stream"}),X=Object.keys(K);if(0<X.length&&(P.extensionsUsed=X),P.buffers&&0<P.buffers.length&&(P.buffers[0].byteLength=U.size),Z.binary===!0){var ee=new window.FileReader;ee.readAsArrayBuffer(U),ee.onloadend=function(){var he=L(ee.result),me=new DataView(new ArrayBuffer(f));me.setUint32(0,he.byteLength,!0),me.setUint32(4,g,!0);var ie=L(y(JSON.stringify(P)),32),be=new DataView(new ArrayBuffer(f));be.setUint32(0,ie.byteLength,!0),be.setUint32(4,m,!0);var re=new ArrayBuffer(d),ue=new DataView(re);ue.setUint32(0,p,!0),ue.setUint32(4,h,!0);var ne=d+be.byteLength+ie.byteLength+me.byteLength+he.byteLength;ue.setUint32(8,ne,!0);var ye=new Blob([re,be,ie,me,he],{type:"application/octet-stream"}),_e=new window.FileReader;_e.readAsArrayBuffer(ye),_e.onloadend=function(){B(_e.result)}}}else if(P.buffers&&0<P.buffers.length){var oe=new window.FileReader;oe.readAsDataURL(U),oe.onloadend=function(){var he=oe.result;P.buffers[0].uri=he,B(P)}}else B(P)})}serializeUserData(I,B){if(!(I.userData&&I.userData.isZincObject)&&Object.keys(I.userData).length!==0){var F=this.options,j=this.extensionsUsed;try{var G=JSON.parse(JSON.stringify(I.userData));if(F.includeCustomExtensions&&G.gltfExtensions){for(var P in B.extensions===void 0&&(B.extensions={}),G.gltfExtensions)B.extensions[P]=G.gltfExtensions[P],j[P]=!0;delete G.gltfExtensions}0<Object.keys(G).length&&(B.extras=G)}catch(Z){console.warn("THREE.GLTFExporter: userData of '"+I.name+"' won't be serialized because of JSON.stringify error - "+Z.message)}}}getUID(I){return this.uids.has(I)||this.uids.set(I,this.uid++),this.uids.get(I)}isNormalizedNormalAttribute(I){var B=this.cache;if(B.attributesNormalized.has(I))return!1;for(var F=new o.Vector3,j=0,G=I.count;j<G;j++)if(5e-4<Math.abs(F.fromBufferAttribute(I,j).length()-1))return!1;return!0}createNormalizedNormalAttribute(I){var B=this.cache;if(B.attributesNormalized.has(I))return B.attributesNormalized.get(I);for(var F=I.clone(),j=new o.Vector3,G=0,P=F.count;G<P;G++)j.fromBufferAttribute(F,G),j.x===0&&j.y===0&&j.z===0?j.setX(1):j.normalize(),F.setXYZ(G,j.x,j.y,j.z);return B.attributesNormalized.set(I,F),F}applyTextureTransform(I,B){var F=!1,j={};(B.offset.x!==0||B.offset.y!==0)&&(j.offset=B.offset.toArray(),F=!0),B.rotation!==0&&(j.rotation=B.rotation,F=!0),(B.repeat.x!==1||B.repeat.y!==1)&&(j.scale=B.repeat.toArray(),F=!0),F&&(I.extensions=I.extensions||{},I.extensions.KHR_texture_transform=j,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(I){var B=this.json,F=this.buffers;return B.buffers||(B.buffers=[{byteLength:0}]),F.push(I),0}processBufferView(I,B,F,j,G){var P=this.json;P.bufferViews||(P.bufferViews=[]);for(var Z=B===l.UNSIGNED_BYTE?1:B===l.UNSIGNED_SHORT?2:4,K=b(j*I.itemSize*Z),U=new DataView(new ArrayBuffer(K)),X=0,ee=F;ee<F+j;ee++)for(var oe,he=0;he<I.itemSize;he++)oe=void 0,4<I.itemSize?oe=I.array[ee*I.itemSize+he]:he===0?oe=I.getX(ee):he===1?oe=I.getY(ee):he===2?oe=I.getZ(ee):he==3&&(oe=I.getW(ee)),B===l.FLOAT?U.setFloat32(X,oe,!0):B===l.UNSIGNED_INT?U.setUint32(X,oe,!0):B===l.UNSIGNED_SHORT?U.setUint16(X,oe,!0):B===l.UNSIGNED_BYTE&&U.setUint8(X,oe),X+=Z;var me={buffer:this.processBuffer(U.buffer),byteOffset:this.byteOffset,byteLength:K};G!==void 0&&(me.target=G),G===l.ARRAY_BUFFER&&(me.byteStride=I.itemSize*Z),this.byteOffset+=K,P.bufferViews.push(me);var ie={id:P.bufferViews.length-1,byteLength:0};return ie}processBufferViewImage(I){var B=this,F=B.json;return F.bufferViews||(F.bufferViews=[]),new Promise(function(j){var G=new window.FileReader;G.readAsArrayBuffer(I),G.onloadend=function(){var P=L(G.result),Z={buffer:B.processBuffer(P),byteOffset:B.byteOffset,byteLength:P.byteLength};B.byteOffset+=P.byteLength,j(F.bufferViews.push(Z)-1)}})}processAccessor(I,B,F,j){var G,P=this.options,Z=this.json;if(I.array.constructor===Float32Array)G=l.FLOAT;else if(I.array.constructor===Uint32Array)G=l.UNSIGNED_INT;else if(I.array.constructor===Uint16Array)G=l.UNSIGNED_SHORT;else if(I.array.constructor===Uint8Array)G=l.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(F===void 0&&(F=0),j===void 0&&(j=I.count),P.truncateDrawRange&&B!==void 0&&B.index===null){var K=F+j,U=B.drawRange.count===1/0?I.count:B.drawRange.start+B.drawRange.count;F=Math.max(F,B.drawRange.start),j=Math.min(K,U)-F,0>j&&(j=0)}if(j===0)return null;var X,ee=_(I,F,j);B!==void 0&&(X=I===B.index?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER);var oe=this.processBufferView(I,G,F,j,X),he={bufferView:oe.id,byteOffset:oe.byteOffset,componentType:G,count:j,max:ee.max,min:ee.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[I.itemSize]};return I.normalized===!0&&(he.normalized=!0),Z.accessors||(Z.accessors=[]),Z.accessors.push(he)-1}processImage(I,B,F){var j=this,G=j.cache,P=j.json,Z=j.options,K=j.pending;G.images.has(I)||G.images.set(I,{});var U=G.images.get(I),X=B===o.RGBAFormat?"image/png":"image/jpeg",ee=X+":flipY/"+F.toString();if(U[ee]!==void 0)return U[ee];P.images||(P.images=[]);var oe={mimeType:X};if(Z.embedImages){var he=w=w||document.createElement("canvas");he.width=Math.min(I.width,Z.maxTextureSize),he.height=Math.min(I.height,Z.maxTextureSize);var me=he.getContext("2d");if(F===!0&&(me.translate(0,he.height),me.scale(1,-1)),typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&I instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&I instanceof ImageBitmap)me.drawImage(I,0,0,he.width,he.height);else{B!==o.RGBAFormat&&B!==o.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(I.width>Z.maxTextureSize||I.height>Z.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",I);var ie=new Uint8ClampedArray(4*(I.height*I.width));if(B===o.RGBAFormat)for(var be=0;be<ie.length;be+=4)ie[be+0]=I.data[be+0],ie[be+1]=I.data[be+1],ie[be+2]=I.data[be+2],ie[be+3]=I.data[be+3];else for(var re=0,ue=0;re<ie.length;re+=4,ue+=3)ie[re+0]=I.data[ue+0],ie[re+1]=I.data[ue+1],ie[re+2]=I.data[ue+2],ie[re+3]=255;me.putImageData(new ImageData(ie,I.width,I.height),0,0)}Z.binary===!0?K.push(new Promise(function(ye){he.toBlob(function(_e){j.processBufferViewImage(_e).then(function(Ie){oe.bufferView=Ie,ye()})},X)})):oe.uri=he.toDataURL(X)}else oe.uri=I.src;var ne=P.images.push(oe)-1;return U[ee]=ne,ne}processSampler(I){var B=this.json;B.samplers||(B.samplers=[]);var F={magFilter:c[I.magFilter],minFilter:c[I.minFilter],wrapS:c[I.wrapS],wrapT:c[I.wrapT]};return B.samplers.push(F)-1}processTexture(I){var B=this.cache,F=this.json;if(B.textures.has(I))return B.textures.get(I);F.textures||(F.textures=[]);var j={sampler:this.processSampler(I),source:this.processImage(I.image,I.format,I.flipY)};I.name&&(j.name=I.name),this._invokeAll(function(P){P.writeTexture&&P.writeTexture(I,j)});var G=F.textures.push(j)-1;return B.textures.set(I,G),G}processMaterial(I){var B=this.cache,F=this.json;if(B.materials.has(I))return B.materials.get(I);if(I.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;F.materials||(F.materials=[]);var j={pbrMetallicRoughness:{}};I.isMeshStandardMaterial!==!0&&I.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var G=I.color.toArray().concat([I.opacity]);if(T(G,[1,1,1,1])||(j.pbrMetallicRoughness.baseColorFactor=G),I.isMeshStandardMaterial?(j.pbrMetallicRoughness.metallicFactor=I.metalness,j.pbrMetallicRoughness.roughnessFactor=I.roughness):(j.pbrMetallicRoughness.metallicFactor=.5,j.pbrMetallicRoughness.roughnessFactor=.5),I.metalnessMap||I.roughnessMap)if(I.metalnessMap===I.roughnessMap){var P={index:this.processTexture(I.metalnessMap)};this.applyTextureTransform(P,I.metalnessMap),j.pbrMetallicRoughness.metallicRoughnessTexture=P}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(I.map){var Z={index:this.processTexture(I.map)};this.applyTextureTransform(Z,I.map),j.pbrMetallicRoughness.baseColorTexture=Z}if(I.emissive){var K=I.emissive.clone().multiplyScalar(I.emissiveIntensity),U=Math.max(K.r,K.g,K.b);if(1<U&&(K.multiplyScalar(1/U),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<U&&(j.emissiveFactor=K.toArray()),I.emissiveMap){var X={index:this.processTexture(I.emissiveMap)};this.applyTextureTransform(X,I.emissiveMap),j.emissiveTexture=X}}if(I.normalMap){var ee={index:this.processTexture(I.normalMap)};I.normalScale&&I.normalScale.x!==-1&&(I.normalScale.x!==I.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),ee.scale=I.normalScale.x),this.applyTextureTransform(ee,I.normalMap),j.normalTexture=ee}if(I.aoMap){var oe={index:this.processTexture(I.aoMap),texCoord:1};I.aoMapIntensity!==1&&(oe.strength=I.aoMapIntensity),this.applyTextureTransform(oe,I.aoMap),j.occlusionTexture=oe}I.transparent?j.alphaMode="BLEND":0<I.alphaTest&&(j.alphaMode="MASK",j.alphaCutoff=I.alphaTest),I.side===o.DoubleSide&&(j.doubleSided=!0),I.name!==""&&(j.name=I.name),this.serializeUserData(I,j),this._invokeAll(function(me){me.writeMaterial&&me.writeMaterial(I,j)});var he=F.materials.push(j)-1;return B.materials.set(I,he),he}processMesh(I){var B=this.cache,F=this.json,j=[I.geometry.uuid];if(Array.isArray(I.material))for(var G=0,P=I.material.length;G<P;G++)j.push(I.material[G].uuid);else j.push(I.material.uuid);var Z=j.join(":");if(B.meshes.has(Z))return B.meshes.get(Z);var K,U=I.geometry;if(K=I.isLineSegments?l.LINES:I.isLineLoop?l.LINE_LOOP:I.isLine?l.LINE_STRIP:I.isPoints?l.POINTS:I.material.wireframe?l.LINES:l.TRIANGLES,U.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var X={},ee={},oe=[],he=[],me={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},ie=U.getAttribute("normal");ie===void 0||this.isNormalizedNormalAttribute(ie)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),U.setAttribute("normal",this.createNormalizedNormalAttribute(ie)));var be=null;for(var re in U.attributes)if(re.substr(0,5)!=="morph"){var ue=U.attributes[re];re=me[re]||re.toUpperCase();var ne=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(ne.test(re)||(re="_"+re),B.attributes.has(this.getUID(ue))){ee[re]=B.attributes.get(this.getUID(ue));continue}be=null;var ye=ue.array;re!=="JOINTS_0"||ye instanceof Uint16Array||ye instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),be=new o.BufferAttribute(new Uint16Array(ye),ue.itemSize,ue.normalized));var _e=this.processAccessor(be||ue,U);_e!==null&&(ee[re]=_e,B.attributes.set(this.getUID(ue),_e))}if(ie!==void 0&&U.setAttribute("normal",ie),Object.keys(ee).length===0)return null;if(I.morphTargetInfluences!==void 0&&0<I.morphTargetInfluences.length){var Ie=[],qe=[],Ge={};if(I.morphTargetDictionary!==void 0)for(var et in I.morphTargetDictionary)Ge[I.morphTargetDictionary[et]]=et;for(var Ve=0;Ve<I.morphTargetInfluences.length;++Ve){var Ne={},it=!1;for(var Be in U.morphAttributes){if(Be!="position"&&Be!=="normal"&&Be!=="color"){it||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),it=!0);continue}var pt=U.morphAttributes[Be][Ve],yt=Be.toUpperCase();me[Be]&&(yt=me[Be]);var ct=U.attributes[Be];if(B.attributes.has(this.getUID(pt))){Ne[yt]=B.attributes.get(this.getUID(pt));continue}var xe=ct.clone();if(!U.morphTargetsRelative)if(ct)for(var Ue=0,$e=pt.count;Ue<$e;Ue++)ct.count>Ue&&xe.setXYZ(Ue,pt.getX(Ue)-ct.getX(Ue),pt.getY(Ue)-ct.getY(Ue),pt.getZ(Ue)-ct.getZ(Ue));else for(var at=0,Ht=pt.count;at<Ht;at++)xe.setXYZ(at,0,0,0);Ne[yt]=this.processAccessor(xe,U),B.attributes.set(this.getUID(ct),Ne[yt])}he.push(Ne),Ie.push(I.morphTargetInfluences[Ve]),I.morphTargetDictionary!==void 0&&qe.push(Ge[Ve])}X.weights=Ie,0<qe.length&&(X.extras={},X.extras.targetNames=qe)}var Vt=Array.isArray(I.material);if(Vt&&U.groups.length===0)return null;for(var Dt,Gt=Vt?I.material:[I.material],Je=Vt?U.groups:[{materialIndex:0,start:void 0,count:void 0}],ft=0,St=Je.length;ft<St;ft++){if(Dt={mode:K,attributes:ee},this.serializeUserData(U,Dt),0<he.length&&(Dt.targets=he),U.index!==null){var Wt=this.getUID(U.index);(Je[ft].start!==void 0||Je[ft].count!==void 0)&&(Wt+=":"+Je[ft].start+":"+Je[ft].count),B.attributes.has(Wt)?Dt.indices=B.attributes.get(Wt):(Dt.indices=this.processAccessor(U.index,U,Je[ft].start,Je[ft].count),B.attributes.set(Wt,Dt.indices)),Dt.indices===null&&delete Dt.indices}var Jt=this.processMaterial(Gt[Je[ft].materialIndex]);Jt!==null&&(Dt.material=Jt),oe.push(Dt)}X.primitives=oe,F.meshes||(F.meshes=[]),this._invokeAll(function(rt){rt.writeMesh&&rt.writeMesh(I,X)});var Pt=F.meshes.push(X)-1;return B.meshes.set(Z,Pt),Pt}processCamera(I){var B=this.json;B.cameras||(B.cameras=[]);var F=I.isOrthographicCamera,j={type:F?"orthographic":"perspective"};return F?j.orthographic={xmag:2*I.right,ymag:2*I.top,zfar:0>=I.far?.001:I.far,znear:0>I.near?0:I.near}:j.perspective={aspectRatio:I.aspect,yfov:o.MathUtils.degToRad(I.fov),zfar:0>=I.far?.001:I.far,znear:0>I.near?0:I.near},I.name!==""&&(j.name=I.type),B.cameras.push(j)-1}processAnimation(I,B){var F=this.json,j=this.nodeMap;F.animations||(F.animations=[]),I=s.Utils.mergeMorphTargetTracks(I.clone(),B);for(var G=I.tracks,P=[],Z=[],K=0;K<G.length;++K){var U=G[K],X=o.PropertyBinding.parseTrackName(U.name),ee=o.PropertyBinding.findNode(B,X.nodeName),oe=u[X.propertyName];if(X.objectName==="bones"&&(ee.isSkinnedMesh===!0?ee=ee.skeleton.getBoneByName(X.objectIndex):ee=void 0),!ee||!oe)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',U.name),null;var he=U.values.length/U.times.length;oe===u.morphTargetInfluences&&(he/=ee.morphTargetInfluences.length);var me=void 0;U.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(me="CUBICSPLINE",he/=3):U.getInterpolation()===o.InterpolateDiscrete?me="STEP":me="LINEAR",Z.push({input:this.processAccessor(new o.BufferAttribute(U.times,1)),output:this.processAccessor(new o.BufferAttribute(U.values,he)),interpolation:me}),P.push({sampler:Z.length-1,target:{node:j.get(ee),path:oe}})}return F.animations.push({name:I.name||"clip_"+F.animations.length,samplers:Z,channels:P}),F.animations.length-1}processSkin(I){var B=this.json,F=this.nodeMap,j=B.nodes[F.get(I)],G=I.skeleton;if(G===void 0)return null;var P=I.skeleton.bones[0];if(P===void 0)return null;for(var Z=[],K=new Float32Array(16*G.bones.length),U=new o.Matrix4,X=0;X<G.bones.length;++X)Z.push(F.get(G.bones[X])),U.copy(G.boneInverses[X]),U.multiply(I.bindMatrix).toArray(K,16*X);B.skins===void 0&&(B.skins=[]),B.skins.push({inverseBindMatrices:this.processAccessor(new o.BufferAttribute(K,16)),joints:Z,skeleton:F.get(P)});var ee=j.skin=B.skins.length-1;return ee}processNode(I){var B=this.json,F=this.options,j=this.nodeMap;B.nodes||(B.nodes=[]);var G={};if(F.trs){var P=I.quaternion.toArray(),Z=I.position.toArray(),K=I.scale.toArray();T(P,[0,0,0,1])||(G.rotation=P),T(Z,[0,0,0])||(G.translation=Z),T(K,[1,1,1])||(G.scale=K)}else I.matrixAutoUpdate&&I.updateMatrix(),v(I.matrix)===!1&&(G.matrix=I.matrix.elements);if(I.name!==""&&(G.name=I.name+""),this.serializeUserData(I,G),I.isMesh||I.isLine||I.isPoints){var U=this.processMesh(I);U!==null&&(G.mesh=U)}else I.isCamera&&(G.camera=this.processCamera(I));if(I.isSkinnedMesh&&this.skins.push(I),0<I.children.length){for(var X,ee=[],oe=0,he=I.children.length;oe<he;oe++)if(X=I.children[oe],X.visible||F.onlyVisible===!1){var me=this.processNode(X);me!==null&&ee.push(me)}0<ee.length&&(G.children=ee)}this._invokeAll(function(be){be.writeNode&&be.writeNode(I,G)});var ie=B.nodes.push(G)-1;return j.set(I,ie),ie}processScene(I){var B=this.json,F=this.options;B.scenes||(B.scenes=[],B.scene=0);var j={};I.name!==""&&(j.name=I.name),B.scenes.push(j);for(var G,P=[],Z=0,K=I.children.length;Z<K;Z++)if(G=I.children[Z],G.visible||F.onlyVisible===!1){var U=this.processNode(G);U!==null&&P.push(U)}0<P.length&&(j.nodes=P),this.serializeUserData(I,j)}processObjects(I){var B=new o.Scene;B.name="AuxScene";for(var F=0;F<I.length;F++)B.children.push(I[F]);this.processScene(B)}processInput(I){var B=this.options;I=I instanceof Array?I:[I],this._invokeAll(function(Z){Z.beforeParse&&Z.beforeParse(I)});for(var F=[],j=0;j<I.length;j++)I[j]instanceof o.Scene?this.processScene(I[j]):F.push(I[j]);0<F.length&&this.processObjects(F);for(var G=0;G<this.skins.length;++G)this.processSkin(this.skins[G]);for(var P=0;P<B.animations.length;++P)this.processAnimation(B.animations[P].clip,B.animations[P].mesh);this._invokeAll(function(Z){Z.afterParse&&Z.afterParse(I)})}_invokeAll(I){for(var B=0,F=this.plugins.length;B<F;B++)I(this.plugins[B])}}class C{constructor(I){this.writer=I,this.name="KHR_lights_punctual"}writeNode(I,B){if(I.isLight){if(!I.isDirectionalLight&&!I.isPointLight&&!I.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",I);var F=this.writer,j=F.json,G=F.extensionsUsed,P={};I.name&&(P.name=I.name),P.color=I.color.toArray(),P.intensity=I.intensity,I.isDirectionalLight?P.type="directional":I.isPointLight?(P.type="point",0<I.distance&&(P.range=I.distance)):I.isSpotLight&&(P.type="spot",0<I.distance&&(P.range=I.distance),P.spot={},P.spot.innerConeAngle=-1*((I.penumbra-1)*I.angle),P.spot.outerConeAngle=I.angle),I.decay!==void 0&&I.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),I.target&&(I.target.parent!==I||I.target.position.x!==0||I.target.position.y!==0||I.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),G[this.name]||(j.extensions=j.extensions||{},j.extensions[this.name]={lights:[]},G[this.name]=!0);var Z=j.extensions[this.name].lights;Z.push(P),B.extensions=B.extensions||{},B.extensions[this.name]={light:Z.length-1}}}}class A{constructor(I){this.writer=I,this.name="KHR_materials_unlit"}writeMaterial(I,B){if(I.isMeshBasicMaterial){var F=this.writer,j=F.extensionsUsed;B.extensions=B.extensions||{},B.extensions[this.name]={},j[this.name]=!0,B.pbrMetallicRoughness.metallicFactor=0,B.pbrMetallicRoughness.roughnessFactor=.9}}}class O{constructor(I){this.writer=I,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(I,B){if(I.isGLTFSpecularGlossinessMaterial){var F=this.writer,j=F.extensionsUsed,G={};B.pbrMetallicRoughness.baseColorFactor&&(G.diffuseFactor=B.pbrMetallicRoughness.baseColorFactor);var P=[1,1,1];if(I.specular.toArray(P,0),G.specularFactor=P,G.glossinessFactor=I.glossiness,B.pbrMetallicRoughness.baseColorTexture&&(G.diffuseTexture=B.pbrMetallicRoughness.baseColorTexture),I.specularMap){var Z={index:F.processTexture(I.specularMap)};F.applyTextureTransform(Z,I.specularMap),G.specularGlossinessTexture=Z}B.extensions=B.extensions||{},B.extensions[this.name]=G,j[this.name]=!0}}}s.Utils={insertKeyframe:function(N,I){var B,F=.001,j=N.getValueSize(),G=new N.TimeBufferType(N.times.length+1),P=new N.ValueBufferType(N.values.length+j),Z=N.createInterpolant(new N.ValueBufferType(j));if(N.times.length===0){G[0]=I;for(var K=0;K<j;K++)P[K]=0;B=0}else if(I<N.times[0]){if(Math.abs(N.times[0]-I)<F)return 0;G[0]=I,G.set(N.times,1),P.set(Z.evaluate(I),0),P.set(N.values,j),B=0}else if(I>N.times[N.times.length-1]){if(Math.abs(N.times[N.times.length-1]-I)<F)return N.times.length-1;G[G.length-1]=I,G.set(N.times,0),P.set(N.values,0),P.set(Z.evaluate(I),N.values.length),B=G.length-1}else for(var U=0;U<N.times.length;U++){if(Math.abs(N.times[U]-I)<F)return U;if(N.times[U]<I&&N.times[U+1]>I){G.set(N.times.slice(0,U+1),0),G[U+1]=I,G.set(N.times.slice(U+1),U+2),P.set(N.values.slice(0,(U+1)*j),0),P.set(Z.evaluate(I),(U+1)*j),P.set(N.values.slice((U+1)*j),(U+2)*j),B=U+1;break}}return N.times=G,N.values=P,B},mergeMorphTargetTracks:function(N,I){for(var B=[],F={},j=N.tracks,G=0;G<j.length;++G){var P=j[G],Z=o.PropertyBinding.parseTrackName(P.name),K=o.PropertyBinding.findNode(I,Z.nodeName);if(Z.propertyName!=="morphTargetInfluences"||Z.propertyIndex===void 0){B.push(P);continue}if(P.createInterpolant!==P.InterpolantFactoryMethodDiscrete&&P.createInterpolant!==P.InterpolantFactoryMethodLinear){if(P.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),P=P.clone(),P.setInterpolation(o.InterpolateLinear)}var U=K.morphTargetInfluences.length,X=K.morphTargetDictionary[Z.propertyIndex];if(X===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+Z.propertyIndex);var ee=void 0;if(F[K.uuid]===void 0){ee=P.clone();for(var oe=new ee.ValueBufferType(U*ee.times.length),he=0;he<ee.times.length;he++)oe[he*U+X]=ee.values[he];ee.name=(Z.nodeName||"")+".morphTargetInfluences",ee.values=oe,F[K.uuid]=ee,B.push(ee);continue}var me=P.createInterpolant(new P.ValueBufferType(1));ee=F[K.uuid];for(var ie=0;ie<ee.times.length;ie++)ee.values[ie*U+X]=me.evaluate(ee.times[ie]);for(var be,re=0;re<P.times.length;re++)be=this.insertKeyframe(ee,P.times[re]),ee.values[be*U+X]=P.values[re]}return N.tracks=B,N}}},function(r,n,i){var o=i(3),s=i(4).resolveURL,l=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var y=this;this.setFromObject=v=>{var{nearPlane:_,farPlane:b,eyePosition:L,targetPosition:w,upVector:k}=v;y.nearPlane=_,y.farPlane=b,y.eyePosition=L,y.targetPosition=w,y.upVector=k}},c=function(y,v,_,b){var L={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},w={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},k={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},C={};C.MAIN=w.ROTATE,C.AUXILIARY=w.ZOOM,C.SECONDARY=w.PAN,this.cameraObject=y,this.domElement=v===void 0?document:v,this.renderer=_,this.scene=b,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50;var A=6e3,O=!0,N=0,I=void 0,B=void 0,F=!1,j=500,G=void 0,P="default",Z=L.DEFAULT,K=void 0,U=void 0,X=void 0,ee=0,oe=k.FREE;this._state=w.NONE;var he;this.targetTouchId=-1;var me=void 0,ie=new o.Vector3,be=new o.Vector3,re=new o.Vector3,ue=new o.Vector3,ne=new o.Vector3,ye=new o.Vector3,_e=new o.Vector3,Ie=new o.Vector3,qe=new o.Sphere,Ge=new o.Vector3,et=void 0,Ve=0,Ne={default:new l};Ne.default.nearPlane=.1,Ne.default.farPlane=2e3,Ne.default.eyePosition=[0,0,0],Ne.default.targetPosition=[0,0,-1],Ne.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new o.Vector3(...Ne.default.targetPosition)),this.calculateMaxAllowedDistance=rt=>{var Et=rt.getBoundingBox();if(Et){Et.getBoundingSphere(qe),Ve=6*qe.radius;var kt=0;this.cameraObject&&(kt=this.cameraObject.position.distanceTo(qe.center)),Ve=kt>Ve?kt:Ve}else Ve=0},this.addViewport=(rt,Et)=>{rt&&Et&&(Ne[rt]=Et)},this.setDefaultViewport=rt=>!!(rt&&rt in Ne)&&(P=rt,!0),this.getDefaultViewport=()=>P,this.getViewportOfName=rt=>Ne[rt],this.setCurrentViewport=rt=>rt in Ne&&(this.setCurrentCameraSettings(Ne[rt]),!0),this.setRotationMode=rt=>{switch(rt){case"none":oe=k.NONE;break;case"horizontal":oe=k.HORIZONTAL;break;case"vertical":oe=k.VERTICAL;break;case"free":default:oe=k.FREE}},this.onResize=()=>{me&&(me=void 0),et&&et.setCurrentCameraSettings(this.cameraObject,Ne[P])},this.getNDCFromDocumentCoords=(rt,Et,kt)=>{Vt(!1);var or=kt||new o.Vector2,$t=2*((rt-me.left)/me.width)-1,wt=2*-((Et-me.top)/me.height)+1;return or.set($t,wt)},this.getRelativeCoordsFromNDC=(rt,Et,kt)=>{Vt(!1);var or=kt||new o.Vector2;return or.x=(rt+1)*me.width/2,or.y=(1-Et)*me.height/2,or},this.setMouseButtonAction=(rt,Et)=>{C[rt]=w[Et]};var it=()=>{if(0<Ve){var rt=Ge.distanceTo(qe.center);return Ve>rt||this.cameraObject.position.distanceTo(qe.center)>rt}return!0},Be=rt=>{Ge.copy(this.cameraObject.position).add(rt),it()&&(this.cameraObject.target.add(rt),this.cameraObject.position.add(rt),this.updateDirectionalLight())},pt=rt=>{Vt(!1);var Et;if(Z===L.DEFAULT&&(Et=this.scene.getNormalisedMinimapCoordinates(this.renderer,rt)),!Et)rt.button==0?rt.ctrlKey?this._state=C.AUXILIARY:rt.shiftKey?this._state=C.SECONDARY:this._state=C.MAIN:rt.button==1?(rt.preventDefault(),this._state=C.AUXILIARY):rt.button==2&&(this._state=C.SECONDARY),this.pointer_x=rt.clientX-me.left,this.pointer_y=rt.clientY-me.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{Z=L.MINIMAP;var kt=this.scene.getMinimapDiffFromNormalised(Et.x,Et.y);Be(kt)}},yt=rt=>{if(Vt(!1),this.pointer_x=rt.clientX-me.left,this.pointer_y=rt.clientY-me.top,Z===L.MINIMAP){var Et=this.scene.getNormalisedMinimapCoordinates(this.renderer,rt);if(Et){var kt=this.scene.getMinimapDiffFromNormalised(Et.x,Et.y);Be(kt)}}else this._state===w.NONE&&he!==void 0&&he.move(this,rt.clientX,rt.clientY,this.renderer)},ct=rt=>{this._state=w.NONE,Z==L.MINIMAP&&(Z=L.DEFAULT),he!==void 0&&this.pointer_x_start==rt.clientX-me.left&&this.pointer_y_start==rt.clientY-me.top&&he.pick(this,rt.clientX,rt.clientY,this.renderer)},xe=()=>{this._state=w.NONE},Ue=rt=>{Vt(!1);var Et=rt.touches.length;if(Et==1)this._state=w.TOUCH_ROTATE,this.pointer_x=rt.touches[0].clientX-me.left,this.pointer_y=rt.touches[0].clientY-me.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else if(Et==2){this._state=w.TOUCH_ZOOM;var kt=rt.touches[0].clientX-rt.touches[1].clientX,or=rt.touches[0].clientY-rt.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(kt*kt+or*or)}else Et==3&&(this._state=w.TOUCH_PAN,this.targetTouchId=rt.touches[0].identifier,this.pointer_x=rt.touches[0].clientX-me.left,this.pointer_y=rt.touches[0].clientY-me.top,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y)},$e=rt=>{rt.preventDefault(),rt.stopPropagation();var Et=rt.touches.length;if(Et==1)this.pointer_x=rt.touches[0].clientX-me.left,this.pointer_y=rt.touches[0].clientY-me.top;else if(Et==2){if(this._state===w.TOUCH_ZOOM){var kt=rt.touches[0].clientX-rt.touches[1].clientX,or=rt.touches[0].clientY-rt.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(kt*kt+or*or)}}else if(Et==3&&this._state===w.TOUCH_PAN)for(var $t=0;3>$t;$t++)rt.touches[$t].identifier==this.targetTouchId&&(this.pointer_x=rt.touches[0].clientX-me.left,this.pointer_y=rt.touches[0].clientY-me.top)},at=rt=>{var Et=rt.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=w.NONE,Et==1&&he!==void 0&&this.pointer_x_start==rt.touches[0].clientX-me.left&&this.pointer_y_start==rt.touches[0].clientY-me.top&&he.pick(this.cameraObject,rt.touches[0].clientX,rt.touches[0].clientY,this.renderer)},Ht=()=>{Vt(!0)},Vt=rt=>{if(rt||me===void 0){var Et=new IntersectionObserver(kt=>{for(var or of kt)me=or.boundingClientRect;Et.disconnect()});Et.observe(this.domElement)}},Dt=rt=>{Vt(!1),this._state=w.SCROLL;var Et=0;0<rt.deltaY?Et=this.scrollRate:0>rt.deltaY&&(Et=-1*this.scrollRate),ee+=Et,rt.preventDefault(),rt.stopImmediatePropagation()},Gt=()=>{if(typeof this.cameraObject<"u"){var rt=me.height,Et=this.cameraObject.position.distanceTo(this.cameraObject.target),kt=0;this.cameraObject.far>this.cameraObject.near&&Et>=this.cameraObject.near&&Et<=this.cameraObject.far&&(kt=(Et-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),be.set(this.previous_pointer_x,rt-this.previous_pointer_y,0),re.set(this.previous_pointer_x,rt-this.previous_pointer_y,1),ue.set(this.pointer_x,rt-this.pointer_y,0),ne.set(this.pointer_x,rt-this.pointer_y,1),be.unproject(this.cameraObject),re.unproject(this.cameraObject),ue.unproject(this.cameraObject),ne.unproject(this.cameraObject),ue.sub(be).multiplyScalar(1-kt),ne.sub(re).multiplyScalar(kt),ue.add(ne).multiplyScalar(-.002),Be(ue)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(rt,Et)=>{rt.normalize(),_e.copy(this.cameraObject.position).sub(this.cameraObject.target),Ie.copy(_e),_e.normalize(),.8<Math.abs(_e.dot(rt))&&_e.copy(this.cameraObject.up),be.crossVectors(rt,_e).normalize(),re.crossVectors(rt,be);var kt=rt.dot(Ie),or=be.dot(Ie),$t=re.dot(Ie),wt=rt.dot(this.cameraObject.up),je=be.dot(this.cameraObject.up),ke=re.dot(this.cameraObject.up),Oe=Math.cos(Et),Ye=Math.sin(Et);return ue.set(Oe*be.x+Ye*re.x,Oe*be.y+Ye*re.y,Oe*be.z+Ye*re.z),ne.set(Oe*re.x-Ye*be.x,Oe*re.y-Ye*be.y,Oe*re.z-Ye*be.z),_e.copy(this.cameraObject.target),_e.x=_e.x+rt.x*kt+ue.x*or+ne.x*$t,_e.y=_e.y+rt.y*kt+ue.y*or+ne.y*$t,_e.z=_e.z+rt.z*kt+ue.z*or+ne.z*$t,ie.set(rt.x*wt+ue.x*je+ne.x*ke,rt.y*wt+ue.y*je+ne.y*ke,rt.z*wt+ue.z*je+ne.z*ke),{position:_e,up:ie}},this.rotateAboutLookAtpoint=(rt,Et)=>{var kt=this.getVectorsFromRotateAboutLookAtPoints(rt,Et);this.cameraObject.position.copy(kt.position),this.updateDirectionalLight(),this.cameraObject.up.copy(kt.up)};var Je=()=>{if(typeof this.cameraObject<"u"){var rt=me.width,Et=me.height;if(0<rt&&0<Et){var kt=.25*(rt+Et),or=0,$t=0;(oe===k.FREE||oe===k.HORIZONTAL)&&(or=this.pointer_x-this.previous_pointer_x),(oe===k.FREE||oe===k.VERTICAL)&&($t=this.previous_pointer_y-this.pointer_y);var wt=Math.sqrt(or*or+$t*$t);if(0<wt){var je=1*-$t/wt,ke=1*or/wt;oe===k.FREE&&je*(this.pointer_x-.5*(rt-1))+ke*(.5*(Et-1)-this.pointer_y);var Oe=Math.acos(0/kt)-.5*Math.PI,Ye=this.tumble_rate*wt/kt;ie.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),be.copy(this.cameraObject.up).normalize(),re.copy(be).cross(ie).normalize().multiplyScalar(je),be.multiplyScalar(ke),ye.addVectors(re,be).multiplyScalar(Math.cos(Oe)),ie.multiplyScalar(Math.sin(Oe)),ye.add(ie),this.rotateAboutLookAtpoint(ye,-Ye)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},ft=()=>{var rt=0;return this._state===w.ZOOM?rt=this.previous_pointer_y-this.pointer_y:this._state===w.SCROLL?rt=ee:(rt=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),rt};this.changeZoomByScrollRateUnit=rt=>{var Et=rt*this.scrollRate;this.changeZoomByValue(Et)},this.changeZoomByValue=rt=>{if(typeof this.cameraObject<"u"){me.width;var Et=me.height,kt=this.cameraObject.position.clone();kt.sub(this.cameraObject.target);var or=kt.length(),$t=1.5*rt/Et;if(.01<or+$t*or&&(kt.normalize(),Ge.copy(this.cameraObject.position),Ge.x+=kt.x*$t*or,Ge.y+=kt.y*$t*or,Ge.z+=kt.z*$t*or,it())){this.cameraObject.position.copy(Ge),this.updateDirectionalLight();var wt=1e-5;if(wt*this.cameraObject.far<this.cameraObject.near+$t*or+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=$t*or,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=$t*or,this.cameraObject.far+=$t*or));else{if(this.near_plane_fly_debt==0){var je=this.cameraObject.near-wt*this.cameraObject.far;this.cameraObject.near=wt*this.cameraObject.far,this.cameraObject.far-=je,this.near_plane_fly_debt-=wt*this.cameraObject.far}this.near_plane_fly_debt+=$t*or}}}};var St=()=>{var rt=ft();this.changeZoomByValue(rt),this._state===w.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),this._state===w.SCROLL&&(ee=0,this._state=w.NONE)};this.setDirectionalLight=rt=>{this.directionalLight=rt},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){O=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",pt,!1),this.domElement.addEventListener("mousemove",yt,!1),this.domElement.addEventListener("mouseup",ct,!1),this.domElement.addEventListener("mouseleave",xe,!1),this.domElement.addEventListener("touchstart",Ue,!1),this.domElement.addEventListener("touchmove",$e,!1),this.domElement.addEventListener("touchend",at,!1),this.domElement.addEventListener("wheel",Dt,!1),this.domElement.addEventListener("contextmenu",rt=>{rt.preventDefault()},!1),this.domElement.addEventListener("mouseenter",Ht,!1))},this.disable=function(){O=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",pt,!1),this.domElement.removeEventListener("mousemove",yt,!1),this.domElement.removeEventListener("mouseup",ct,!1),this.domElement.removeEventListener("mouseleave",xe,!1),this.domElement.removeEventListener("touchstart",Ue,!1),this.domElement.removeEventListener("touchmove",$e,!1),this.domElement.removeEventListener("touchend",at,!1),this.domElement.removeEventListener("wheel",Dt,!1),this.domElement.removeEventListener("mouseenter",Ht,!1),this.domElement.removeEventListener("contextmenu",rt=>{rt.preventDefault()},!1))},this.loadPath=rt=>{I=rt.CameraPath,B=rt.NumberOfPoints},this.loadPathURL=(rt,Et)=>{var kt=new XMLHttpRequest;kt.onreadystatechange=()=>{if(kt.readyState==4&&kt.status==200){var $t=JSON.parse(kt.responseText);this.loadPath($t),Et!=null&&typeof Et=="function"&&Et()}};var or=s(rt);kt.open("GET",or,!0),kt.send()},this.setPathDuration=rt=>{A=rt,K&&K.setDuration(A),U&&U.setDuration(A)},this.getPlayRate=()=>j,this.setPlayRate=rt=>{j=rt};var Wt=rt=>{var Et=N+rt;Et>A&&(Et-=A),N=Et};this.getTime=()=>N,this.setTime=rt=>{N=rt>A?A:0>rt?0:rt},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2<B){var rt=N/A*(B-1),Et=Math.floor(rt),kt=Math.ceil(rt);return Et==kt?Et==B-1?[Et-1,kt,0]:[Et,kt+1,1]:[Et,kt,1-(rt-Et)]}return B==1?[0,0,0]:void 0},this.setCurrentTimeFrame=rt=>{2<B&&(N=A*rt/(B-1),0>N&&(N=0),N>A&&(N=A))};var Jt=rt=>{if(Z===L.PATH&&(Wt(rt),I)){for(var Et=this.getCurrentTimeFrame(),kt=Et[0],or=Et[1],$t=Et[2],wt=[I[3*kt],I[3*kt+1],I[3*kt+2]],je=[I[3*or],I[3*or+1],I[3*or+2]],ke=[],Oe=0;Oe<wt.length;Oe++)ke.push($t*wt[Oe]+(1-$t)*je[Oe]);this.cameraObject.position.set(ke[0],ke[1],ke[2]),this.cameraObject.target.set(je[0],je[1],je[2]),G&&this.cameraObject.lookAt(this.cameraObject.target),F&&(this.directionalLight.position.set(ke[0],ke[1],ke[2]),this.directionalLight.target.position.set(je[0],je[1],je[2]))}};this.calculatePathNow=()=>{Jt(0)};var Pt=()=>{this._state===w.ROTATE||this._state===w.TOUCH_ROTATE?Je():this._state===w.PAN||this._state===w.TOUCH_PAN?(Gt(),et.triggerCallback()):(this._state===w.ZOOM||this._state===w.TOUCH_ZOOM||this._state===w.SCROLL)&&(et.zoom(ft()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,this._state===w.SCROLL&&(this._state=w.NONE),ee=0,et.triggerCallback())};this.update=rt=>{var Et=rt*j,kt=O;Z===L.PATH?Jt(Et):Z===L.SMOOTH_CAMERA_TRANSITION&&K?(K.update(Et),K.isTransitionCompleted()&&(Z=L.DEFAULT),kt=!1):Z===L.ROTATE_CAMERA_TRANSITION&&U?(U.update(Et),U.isTransitionCompleted()&&(Z=L.DEFAULT),kt=!1):Z===L.AUTO_TUMBLE&&X?X.update(Et):Z===L.SYNC_CONTROL&&et&&(Pt(),kt=!1),kt&&(this._state===w.ROTATE||this._state===w.TOUCH_ROTATE?Je():this._state===w.PAN||this._state===w.TOUCH_PAN?Gt():(this._state===w.ZOOM||this._state===w.TOUCH_ZOOM||this._state===w.SCROLL)&&St(),this._state!==w.NONE&&Z===L.AUTO_TUMBLE&&X&&X.stopOnCameraInput,this._state===w.SCROLL&&(this._state=w.NONE)),G?G.update():this.cameraObject.lookAt(this.cameraObject.target)},this.playPath=()=>{Z=L.PATH},this.stopPath=()=>{Z=L.DEFAULT},this.isPlayingPath=()=>Z===L.PATH,this.enableDirectionalLightUpdateWithPath=rt=>{F=rt},this.enableDeviceOrientation=()=>{G||(G=new g(this.cameraObject))},this.disableDeviceOrientation=()=>{G&&(G.dispose(),G=void 0)},this.isDeviceOrientationEnabled=()=>!!G,this.resetView=()=>{var rt=Ne[P];this.cameraObject.near=rt.nearPlane,this.cameraObject.far=rt.farPlane,this.cameraObject.position.set(rt.eyePosition[0],rt.eyePosition[1],rt.eyePosition[2]),this.cameraObject.target.set(rt.targetPosition[0],rt.targetPosition[1],rt.targetPosition[2]),this.cameraObject.up.set(rt.upVector[0],rt.upVector[1],rt.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=rt=>{rt.nearPlane&&(this.cameraObject.near=rt.nearPlane),rt.farPlane&&(this.cameraObject.far=rt.farPlane),rt.eyePosition&&this.cameraObject.position.set(rt.eyePosition[0],rt.eyePosition[1],rt.eyePosition[2]),rt.targetPosition&&this.cameraObject.target.set(rt.targetPosition[0],rt.targetPosition[1],rt.targetPosition[2]),rt.upVector&&this.cameraObject.up.set(rt.upVector[0],rt.upVector[1],rt.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.getViewportFromCentreAndRadius=(rt,Et,kt,or,$t,wt)=>{var je=this.cameraObject.position.x-this.cameraObject.target.x,ke=this.cameraObject.position.y-this.cameraObject.target.y,Oe=this.cameraObject.position.z-this.cameraObject.target.z,Ye=1/Math.sqrt(je*je+ke*ke+Oe*Oe);je*=Ye,ke*=Ye,Oe*=Ye;var ve=or/Math.tan($t*Math.PI/360),Ae=[rt+je*ve,Et+ke*ve,kt+Oe*ve],Re=0,Se=.95;Re=wt>Se*ve?(1-Se)*ve:ve-wt;var ge=new l;return ge.nearPlane=Re,ge.farPlane=ve+wt,ge.eyePosition=Ae,ge.targetPosition=[rt,Et,kt],ge.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],ge},this.getCurrentViewport=()=>{var rt=new l;return rt.nearPlane=this.cameraObject.near,rt.farPlane=this.cameraObject.far,rt.eyePosition[0]=this.cameraObject.position.x,rt.eyePosition[1]=this.cameraObject.position.y,rt.eyePosition[2]=this.cameraObject.position.z,rt.targetPosition[0]=this.cameraObject.target.x,rt.targetPosition[1]=this.cameraObject.target.y,rt.targetPosition[2]=this.cameraObject.target.z,rt.upVector[0]=this.cameraObject.up.x,rt.upVector[1]=this.cameraObject.up.y,rt.upVector[2]=this.cameraObject.up.z,rt},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(rt,Et,kt)=>{U==null&&(K=new u(rt,Et,this,kt))},this.rotateCameraTransition=(rt,Et,kt)=>{K==null&&(U=new d(rt,Et,this,kt))},this.enableCameraTransition=()=>{K&&(Z=L.SMOOTH_CAMERA_TRANSITION),U&&(Z=L.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{Z=L.DEFAULT},this.stopCameraTransition=()=>{Z=L.DEFAULT,K=void 0,U=void 0},this.isTransitioningCamera=()=>Z===L.SMOOTH_CAMERA_TRANSITION||Z===L.ROTATE_CAMERA_TRANSITION,this.autoTumble=(rt,Et,kt)=>{X=new h(rt,Et,kt,this)},this.enableAutoTumble=()=>{Z=L.AUTO_TUMBLE},this.stopAutoTumble=()=>{Z=L.DEFAULT,X=void 0},this.updateAutoTumble=()=>{X&&(X.requireUpdate=!0)},this.isAutoTumble=()=>Z===L.AUTO_TUMBLE,this.enableRaycaster=(rt,Et,kt)=>{he==null&&(he=new p(rt,this.scene,Et,kt,this.renderer))},this.disableRaycaster=()=>{he.disable(),he=void 0},this.isSyncControl=()=>currentMpde===L.SYNC_CONTROL,this.enableSyncControl=()=>(Z=L.SYNC_CONTROL,et||(et=new T),et.setCurrentCameraSettings(this.cameraObject,Ne[P]),et),this.disableSyncControl=()=>{Z=L.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},u=function(y,v,_,b){var L=y.eyePosition,w=y.targetPosition,k=y.upVector,C=v.eyePosition,A=v.targetPosition,O=v.upVector,N=_,I=b,B=0,F=!1;N.near=Math.min(y.nearPlane,v.nearPlane),N.far=Math.max(y.farPlane,v.farPlane),N.cameraObject.up.set(v.upVector[0],v.upVector[1],v.upVector[2]),this.setDuration=P=>{I=P};var j=P=>{var Z=B+P;Z>I&&(Z=I),B=Z},G=()=>{var P=B/I,Z=[L[0]*(1-P)+C[0]*P,L[1]*(1-P)+C[1]*P,L[2]*(1-P)+C[2]*P],K=[w[0]*(1-P)+A[0]*P,w[1]*(1-P)+A[1]*P,w[2]*(1-P)+A[2]*P];k[0]*(1-P)+O[0]*P,k[1]*(1-P)+O[1]*P,k[2]*(1-P)+O[2]*P,N.cameraObject.position.set(Z[0],Z[1],Z[2]),N.cameraObject.target.set(K[0],K[1],K[2])};this.update=P=>{this.enabled===!1||(j(P),G(),B==I&&(F=!0))},this.isTransitionCompleted=()=>F},d=function(y,v,_,b){var L=b,w=0,k=!1;this.setDuration=A=>{L=A};var C=A=>{var O=w,N=w+A;N>L&&(N=L),w=N;var I=w-O,B=I/L;_.rotateAboutLookAtpoint(y,B*v)};this.update=A=>{this.enabled===!1||(C(A),w==L&&(k=!0))},this.isTransitionCompleted=()=>k},p=function(y,v,_,b,L){var w=y,k=L,C=_,A=b,O=new o.Raycaster;O.params.Line.threshold=.1,O.params.Points.threshold=.1;var N=new o.Vector2,I=!1,B=new Date,F=!1,j=0,G=[],P={zincCamera:void 0,x:-1,y:-1};this.enable=()=>{enable=!0},this.disable=()=>{enable=!1};var Z=(X,ee,oe)=>{if(X.getNDCFromDocumentCoords(ee,oe,N),v!==w){var he=w.getThreeJSScene();k.render(he,X.cameraObject)}O.setFromCamera(N,X.cameraObject);var me=w.getPickableThreeJSObjects();return G.length=0,O.intersectObjects(me,!0,G)};this.pick=(X,ee,oe)=>{k&&w&&X&&C&&(Z(X,ee,oe),C(G,ee,oe))};var K=(X,ee,oe)=>{if(k&&w&&X&&A){if(Z(X,ee,oe),B.setTime(Date.now()),G.length===0){if(F)return;F=!0}else F=!1;A(G,ee,oe)}};this.move=(X,ee,oe)=>{k&&w&&X&&A&&(w.displayMarkers?K(X,ee,oe):(P.zincCamera=X,P.x=ee,P.y=oe,!I&&(j=B?Date.now()-B.getTime():250,250<=j?K(X,ee,oe):(I=!0,setTimeout(U(P),j)))))};var U=X=>function(){I=!1,K(X.zincCamera,X.x,X.y)}},h=function(y,v,_,b){var L=new o.Vector3,w=b;this.stopOnCameraInput=_,this.requireUpdate=!0;var k=new o.Vector3,C=new o.Vector3,A=O=>{var N=Math.sqrt(O[0]*O[0]+O[1]*O[1]),I=4*Math.abs(O[0]),B=4*Math.abs(O[1]),F=.25*(I+B),j=-O[1]/N,G=O[0]/N,P=j*O[0]+G*-O[1];P>F?P=F:P<-F&&(P=-F);var Z=Math.acos(P/F)-.5*Math.PI;L.copy(w.cameraObject.position).sub(w.cameraObject.target).normalize(),k.copy(w.cameraObject.up).normalize(),C.crossVectors(k,L).normalize().multiplyScalar(j),k.multiplyScalar(G),k.add(C).multiplyScalar(Math.cos(Z)),L.multiplyScalar(Math.sin(Z)).add(k)};this.update=O=>{this.enabled===!1||(this.requireUpdate&&(A(y),this.requireUpdate=!1),w.rotateAboutLookAtpoint(L,-v*O/1e3))}},f=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new o.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new o.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(f.prototype,{update:(()=>{var y,v,_,b,L,w,k=new o.Matrix4,C=new o.Matrix4;return function(A){var O=y!==A.focus||v!==A.fov||_!==A.aspect*this.aspect||b!==A.near||L!==A.far||w!==A.zoom;if(O){y=A.focus,v=A.fov,_=A.aspect*this.aspect,b=A.near,L=A.far,w=A.zoom;var N,I,B=A.projectionMatrix.clone(),F=.064/2,j=F*b/y,G=b*Math.tan(.5*(o.Math.DEG2RAD*v))/A.zoom;C.elements[12]=-F,k.elements[12]=F,N=-G*_+j,I=G*_+j,B.elements[0]=2*b/(I-N),B.elements[8]=(I+N)/(I-N),this.cameraL.projectionMatrix.copy(B),N=-G*_-j,I=G*_-j,B.elements[0]=2*b/(I-N),B.elements[8]=(I+N)/(I-N),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(A.matrixWorld).multiply(C),this.cameraR.matrixWorld.copy(A.matrixWorld).multiply(k)}})()});var m=function(y){var v=new f;v.aspect=.5,this.setSize=(_,b)=>{y.setSize(_,b)},this.render=(_,b)=>{_.updateMatrixWorld(),b.parent===null&&b.updateMatrixWorld(),v.update(b);var L=y.getSize();y.setScissorTest(!0),y.clear(),y.setScissor(0,0,L.width/2,L.height),y.setViewport(0,0,L.width/2,L.height),y.render(_,v.cameraL),y.setScissor(L.width/2,0,L.width/2,L.height),y.setViewport(L.width/2,0,L.width/2,L.height),y.render(_,v.cameraR),y.setScissorTest(!1)}},g=function(y){var v=this;this.object=y,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var _=w=>{v.deviceOrientation=w},b=()=>{typeof window<"u"&&(v.screenOrientation=window.orientation||0)},L=(()=>{var w=new o.Vector3(0,0,1),k=new o.Euler,C=new o.Quaternion,A=new o.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(O,N,I,B,F)=>{var j=new o.Vector3(0,0,1);j.subVectors(O.target,O.position),k.set(I,N,-B,"YXZ");var G=new o.Quaternion;G.setFromEuler(k),G.multiply(A),G.multiply(C.setFromAxisAngle(w,-F)),j.applyQuaternion(G),j.addVectors(O.position,j),O.lookAt(j)}})();this.connect=()=>{b(),typeof window<"u"&&(window.addEventListener("orientationchange",b,!1),window.addEventListener("deviceorientation",_,!1)),v.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",b,!1),window.removeEventListener("deviceorientation",_,!1)),v.enabled=!1},this.update=()=>{if(v.enabled!==!1){var w=v.deviceOrientation.alpha?o.Math.degToRad(v.deviceOrientation.alpha):0,k=v.deviceOrientation.beta?o.Math.degToRad(v.deviceOrientation.beta):0,C=v.deviceOrientation.gamma?o.Math.degToRad(v.deviceOrientation.gamma):0,A=v.screenOrientation?o.Math.degToRad(v.screenOrientation):0;L(v.object,w,k,C,A)}},this.dispose=function(){this.disconnect()},this.connect()},T=function(){var y=void 0,v=void 0,_=void 0,b=new o.Vector3,L=new o.Vector3,w=new o.Vector3,k=new o.Vector3,C=void 0;this.setCurrentCameraSettings=(A,O)=>{y=A.clone(),v=A,_=O,y.near=_.nearPlane,_.farPlane&&(y.far=_.farPlane),_.eyePosition&&y.position.set(_.eyePosition[0],_.eyePosition[1],_.eyePosition[2]),_.upVector&&y.up.set(_.upVector[0],_.upVector[1],_.upVector[2]),_.targetPosition&&(y.target=new o.Vector3(_.targetPosition[0],_.targetPosition[1],_.targetPosition[2]),y.lookAt(y.target)),y.updateProjectionMatrix(),b.copy(y.position).project(y),L.copy(y.target).project(y)},this.getCurrentPosition=()=>(L.copy(v.target).project(y),[L.x,L.y]),this.zoom=A=>{var O=Math.max(v.zoom-.002*A,1);v.zoom=O,v.updateProjectionMatrix()},this.zoomToBox=(A,O)=>{A.getCenter(w),w.project(y),this.setCenterZoom([w.x,w.y],O)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:v.zoom}),this.setCenterZoom=(A,O)=>{w.set(A[0],A[1],L.z).unproject(y),k.copy(w).sub(v.target),v.target.copy(w),v.lookAt(v.target),v.position.add(k),v.zoom=O,v.updateProjectionMatrix()},this.setEventCallback=A=>{(A===void 0||typeof A=="function")&&(C=A)},this.triggerCallback=()=>{C!==void 0&&typeof C=="function"&&C()}};n.Viewport=l,n.CameraControls=c,n.SmoothCameraTransition=u,n.RotateCameraTransition=d,n.RayCaster=p,n.CameraAutoTumble=h,n.StereoEffect=m,n.NDCCameraControl=T},function(r,n,i){var{Group:o,Matrix4:s}=i(3),l=0,c=function(){return"re"+l++},u=function(d){var p=d,h=new o;h.matrixAutoUpdate=!1,h.userData=this;var f=[],m="",g=[],T=new s,y=3e3;T.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=c(),this.hideAllPrimitives=()=>{f.forEach(v=>v.hideAllPrimitives()),g.forEach(v=>v.setVisibility(!1))},this.showAllPrimitives=()=>{f.forEach(v=>v.showAllPrimitives()),g.forEach(v=>v.setVisibility(!0))},this.setVisibility=v=>{h.visible=v},this.getVisibility=()=>h.visible,this.getGroup=()=>h,this.setTransformation=v=>{T.set(...v),h.matrix.copy(T),h.updateMatrixWorld()},this.setName=v=>{v&&v!==""&&(m=v)},this.getName=()=>m,this.getParent=()=>p,this.getFullSeparatedPath=()=>{var v=[];if(m!==""){v.push(m);for(var _,b=p;b!==void 0;)_=b.getName(),_!==""&&v.unshift(_),b=b.getParent()}return v},this.getFullPath=()=>{var v=this.getFullSeparatedPath();if(0<v.length){var _=v.shift();return v.forEach(b=>{_=_.concat("/",b)}),_}return""},this.createChild=v=>{var _=new u(this);return _.setName(v),f.push(_),h.add(_.getGroup()),_},this.getChildWithName=v=>{if(v){for(var _=v.toLowerCase(),b=0;b<f.length;b++)if(f[b].getName().toLowerCase()===_)return f[b]}},this.findChildFromSeparatedPath=v=>{if(v&&0<v.length&&v[0]===""&&v.shift(),v&&0<v.length){var _=this.getChildWithName(v[0]);return _?(v.shift(),_.findChildFromSeparatedPath(v)):void 0}return this},this.findChildFromPath=v=>{var _=v.split("/");return this.findChildFromSeparatedPath(_)},this.createChildFromSeparatedPath=v=>{if(0<v.length&&v[0]===""&&v.shift(),0<v.length){var _=this.getChildWithName(v[0]);return _||(_=this.createChild(v[0])),v.shift(),_.createChildFromSeparatedPath(v)}return this},this.createChildFromPath=v=>{var _=v.split("/");return this.createChildFromSeparatedPath(_)},this.findOrCreateChildFromPath=v=>{var _=this.findChildFromPath(v);return _||(_=this.createChildFromPath(v)),_},this.addZincObject=v=>{v&&(v.setRegion(this),h.add(v.morph),g.push(v),this.pickableUpdateRequired=!0)},this.removeZincObject=v=>{for(var _=0;_<g.length;_++)if(v===g[_])return h.remove(v.morph),g.splice(_,1),void v.dispose()},this.checkPickableUpdateRequred=v=>{if(this.pickableUpdateRequired)return!0;if(v){for(var _=!1,b=0;b<f.length;b++)if(_=f[b].checkPickableUpdateRequred(v),_)return!0}return!1},this.getPickableThreeJSObjects=(v,_)=>(g.forEach(b=>{if(b.morph&&b.morph.visible){var L=b.marker;L&&L.isEnabled()&&v.push(L.morph),v.push(b.morph)}}),_&&f.forEach(b=>{b.getPickableThreeJSObjects(v,_)}),this.pickableUpdateRequired=!1,v),this.setDuration=v=>{y=v,g.forEach(_=>_.setDuration(v)),f.forEach(_=>_.setDuration(v))},this.getDuration=()=>y,this.getBoundingBox=v=>{var _,b;return g.forEach(L=>{b=L.getBoundingBox(),b&&(_==null?_=b.clone():_.union(b))}),v&&f.forEach(L=>{b=L.getBoundingBox(v),b&&(_==null?_=b.clone():_.union(b))}),_},this.clear=v=>{v&&f.forEach(_=>_.clear(v)),g.forEach(_=>{h.remove(_.morph),_.dispose()}),f=[],g=[]},this.objectIsInRegion=(v,_)=>{for(var b=0;b<g.length;b++)if(v===g[b])return!0;if(_){for(var L=0;L<f.length;L++)if(f[L].objectIsInRegion(v,_))return!0}return!1},this.forEachGeometry=(v,_)=>{g.forEach(b=>{b.isGeometry&&v(b)}),_&&f.forEach(b=>b.forEachGeometry(v,_))},this.forEachGlyphset=(v,_)=>{g.forEach(b=>{b.isGlyphset&&v(b)}),_&&f.forEach(b=>b.forEachGlyphset(v,_))},this.forEachPointset=(v,_)=>{g.forEach(b=>{b.isPointset&&v(b)}),_&&f.forEach(b=>b.forEachPointset(v,_))},this.forEachLine=(v,_)=>{g.forEach(b=>{b.isLines&&v(b)}),_&&f.forEach(b=>b.forEachLine(v,_))},this.findObjectsWithAnatomicalId=(v,_)=>(g.forEach(b=>{b.anatomicalId===v&&objectsArray.push(b)}),_&&f.forEach(b=>{var L=b.findObjectsWithAnatomicalId(v,_);objectsArray.push(...L)}),objectsArray),this.findObjectsWithGroupName=(v,_)=>{var b=[];return g.forEach(L=>{var w=L.groupName?L.groupName.toLowerCase():L.groupName,k=v&&v.toLowerCase();w===k&&b.push(L)}),_&&f.forEach(L=>{var w=L.findObjectsWithGroupName(v,_);b.push(...w)}),b},this.findGeometriesWithGroupName=(v,_)=>{var b=this.findObjectsWithGroupName(v,_),L=b.filter(w=>w.isGeometry);return L},this.findPointsetsWithGroupName=(v,_)=>{var b=this.findObjectsWithGroupName(v,_),L=b.filter(w=>w.isPointset);return L},this.findGlyphsetsWithGroupName=(v,_)=>{var b=this.findObjectsWithGroupName(v,_),L=b.filter(w=>w.isGlyphset);return L},this.findLinesWithGroupName=(v,_)=>{var b=this.findObjectsWithGroupName(v,_),L=b.filter(w=>w.isLines);return L},this.getAllObjects=v=>{var _=[...g];return v&&f.forEach(b=>{var L=b.getAllObjects(v);_.push(...L)}),_},this.getChildRegions=v=>{var _=[...f];return v&&f.forEach(b=>{var L=b.getChildRegions(v);_.push(...L)}),_},this.getCurrentTime=()=>{if(g[0]!=null)return g[0].getCurrentTime();for(var v,_=0;_<f.length;_++)if(v=f[_].getCurrentTime(),v!==-1)return v;return-1},this.setMorphTime=(v,_)=>{g.forEach(b=>{b.setMorphTime(v)}),_&&f.forEach(b=>{b.setMorphTime(v)})},this.isTimeVarying=()=>{for(var v=0;v<g.length;v++)if(g[v].isTimeVarying())return!0;for(var _=0;_<f.length;_++)if(f[_].isTimeVarying())return!0;return!1},this.renderGeometries=(v,_,b,L,w)=>{var k=this.getAllObjects(w);if(k.forEach(O=>{O.render(v*_,b,L)}),L&&L.displayMarkers&&b===!1&&0<L.markerDepths.length){var C=Math.min(...L.markerDepths),A=Math.max(...L.markerDepths);k.forEach(O=>{O.processMarkerVisual(C,A,L)})}}};n.Region=u},function(r,n,i){var o=i(3);n.Minimap=function(s){var l=s;this.camera=new o.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var c=new o.BufferGeometry,u=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),d=new o.BufferAttribute(u,3);c.setAttribute("position",d);var p=new o.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new o.Mesh(c,p);var h=new o.Box3,f=new o.Vector3;this.getDiffFromNormalised=(g,T)=>{h.setFromBufferAttribute(d).getCenter(f);var y=f.clone().project(this.camera),v=new o.Vector3(g,T,y.z).unproject(this.camera);return v.sub(f)};var m=(g,T)=>{l.camera.near&&(this.camera.near=l.camera.near),T.farPlane&&(this.camera.far=T.farPlane),T.eyePosition&&this.camera.position.set(T.eyePosition[0],T.eyePosition[1],T.eyePosition[2]),T.upVector&&this.camera.up.set(T.upVector[0],T.upVector[1],T.upVector[2]),T.targetPosition&&this.camera.lookAt(new o.Vector3(T.targetPosition[0],T.targetPosition[1],T.targetPosition[2])),this.camera.zoom=1/g,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var g=new o.Vector3().copy(l.camera.target).project(l.camera),T=new o.Vector3(-1,-1,g.z).unproject(l.camera),y=new o.Vector3(1,-1,g.z).unproject(l.camera),v=new o.Vector3(1,1,g.z).unproject(l.camera),_=new o.Vector3(-1,1,g.z).unproject(l.camera);d.copyVector3sArray([T,y,v,v,_,T]),d.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var g=l.getZincCameraControls(),T=l.getBoundingBox();if(T){var y=T.min.distanceTo(T.max),v=y/2,_=(T.min.x+T.max.x)/2,b=(T.min.y+T.max.y)/2,L=(T.min.z+T.max.z)/2,w=g.getViewportFromCentreAndRadius(_,b,L,v,40,v*4);m(y,w)}}}},function(r,n,i){var o=i(3),s=i(43)(o),l=i(2).Geometry,c=i(44),u=i(45).default,d=o.BufferGeometryLoader,p=function(h){var f;h&&h.isGeometry&&(f=h);var m=void 0,g=void 0,T=!1,y=void 0,v=k=>{var C=f.morph.material.clone();C.morphTargets=!1;var A=new l,O=new d,N=O.parse(k),I=new o.Mesh(N.geometry,C);return A.geometry=I.geometry,A.morph=I,A.morph.userData=A,A},_=k=>{switch(k.data.action){case"message":console.log(k.data.message);break;case"result":var C=new p(v(k.data.object));y&&y(C),y=void 0,T=!1;break;default:throw"Cannot handle specified action."}},b=k=>{if(c!==void 0&&(g=c(46)),!g)m=new(i(47)).GeometryCSGInternal(k);else if(k&&k.isGeometry){var C=k.morph,A=C.geometry.clone().applyMatrix(C.matrix).toJSON();g.addEventListener("message",function(O){_(O)}),g.postMessage({action:"initialise",object:A})}};this.getHostGeometry=()=>{var k=new s(f.morph);return new L(k)},this.getGeometry=()=>f;var L=k=>{var C=f.morph.material.clone();C.morphTargets=!1;var A=k.toMesh(C),O=new l;return O.geometry=A.geometry,O.morph=A,O.morph.userData=O,O};this.setCSG=k=>{m.setCSG(k)};var w=(k,C,A,O)=>{if(T)O("On progress");else{var N=k.morph,I=N.geometry.clone().applyMatrix(N.matrix).toJSON();y=A,T=!0,g.postMessage({action:C,object:I})}};this.intersect=k=>new u((C,A)=>{if(g)w(k,"intersect",C,A);else{var O=m.intersect(k),N=new p(L(O));N.setCSG(O),C(N)}}),this.subtract=k=>new u((C,A)=>{if(g)w(k,"intersect",C,A);else{var O=m.subtract(k),N=new p(L(O));N.setCSG(O),C(N)}}),this.union=k=>new u((C,A)=>{if(g)w(k,"intersect",C,A);else{var O=m.union(k),N=new p(L(O));N.setCSG(O),C(N)}}),this.terminateWorker=()=>{g&&g.terminate()},b(h)};n.GeometryCSG=p},function(r,n,i){var o=1e-5,s=0,l=1,c=2,u=3;r.exports=function(d){var p=function(h){var f,m,g,T,y,v,_,b=[];if(h.isBufferGeometry&&(h=new d.Geometry().fromBufferGeometry(h)),h instanceof d.Geometry)this.matrix=new d.Matrix4;else if(h.isMesh)h.updateMatrix(),this.matrix=h.matrix.clone(),h=h.geometry,h.isBufferGeometry&&(h=new d.Geometry().fromBufferGeometry(h)),h.mergeVertices(),h.computeVertexNormals(!1);else{if(h instanceof p.Node)return this.tree=h,this.matrix=new d.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(f=0,m=h.faces.length;f<m;f++)g=h.faces[f],y=h.faceVertexUvs[0][f],_=new p.Polygon,g instanceof d.Face3?(T=h.vertices[g.a],v=y?new d.Vector2(y[0].x,y[0].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[0],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.b],v=y?new d.Vector2(y[1].x,y[1].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[2],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.c],v=y?new d.Vector2(y[2].x,y[2].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[2],v),T.applyMatrix4(this.matrix),_.vertices.push(T)):(d.Face4,T=h.vertices[g.a],v=y?new d.Vector2(y[0].x,y[0].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[0],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.b],v=y?new d.Vector2(y[1].x,y[1].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[1],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.c],v=y?new d.Vector2(y[2].x,y[2].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[2],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.d],v=y?new d.Vector2(y[3].x,y[3].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[3],v),T.applyMatrix4(this.matrix),_.vertices.push(T)),_.calculateProperties(),b.push(_);this.tree=new p.Node(b)};return p.prototype.subtract=function(h){var f=this.tree.clone(),m=h.tree.clone();return f.invert(),f.clipTo(m),m.clipTo(f),m.invert(),m.clipTo(f),m.invert(),f.build(m.allPolygons()),f.invert(),f=new p(f),f.matrix=this.matrix,f},p.prototype.union=function(h){var f=this.tree.clone(),m=h.tree.clone();return f.clipTo(m),m.clipTo(f),m.invert(),m.clipTo(f),m.invert(),f.build(m.allPolygons()),f=new p(f),f.matrix=this.matrix,f},p.prototype.intersect=function(h){var f=this.tree.clone(),m=h.tree.clone();return f.invert(),m.clipTo(f),m.invert(),f.clipTo(m),m.clipTo(f),f.build(m.allPolygons()),f.invert(),f=new p(f),f.matrix=this.matrix,f},p.prototype.toGeometry=function(){var h,f,m,g,T,y,v,_,b,L,w=new d.Matrix4().getInverse(this.matrix),k=new d.Geometry,C=this.tree.allPolygons(),A=C.length,O={};for(h=0;h<A;h++)for(m=C[h],g=m.vertices.length,f=2;f<g;f++)L=[],_=m.vertices[0],L.push(new d.Vector2(_.uv.x,_.uv.y)),_=new d.Vector3(_.x,_.y,_.z),_.applyMatrix4(w),typeof O[_.x+","+_.y+","+_.z]>"u"?(k.vertices.push(_),T=O[_.x+","+_.y+","+_.z]=k.vertices.length-1):T=O[_.x+","+_.y+","+_.z],_=m.vertices[f-1],L.push(new d.Vector2(_.uv.x,_.uv.y)),_=new d.Vector3(_.x,_.y,_.z),_.applyMatrix4(w),typeof O[_.x+","+_.y+","+_.z]>"u"?(k.vertices.push(_),y=O[_.x+","+_.y+","+_.z]=k.vertices.length-1):y=O[_.x+","+_.y+","+_.z],_=m.vertices[f],L.push(new d.Vector2(_.uv.x,_.uv.y)),_=new d.Vector3(_.x,_.y,_.z),_.applyMatrix4(w),typeof O[_.x+","+_.y+","+_.z]>"u"?(k.vertices.push(_),v=O[_.x+","+_.y+","+_.z]=k.vertices.length-1):v=O[_.x+","+_.y+","+_.z],b=new d.Face3(T,y,v,new d.Vector3(m.normal.x,m.normal.y,m.normal.z)),k.faces.push(b),k.faceVertexUvs[0].push(L);return k},p.prototype.toBufferGeometry=function(){var h=this.toGeometry(),f=new d.BufferGeometry().fromGeometry(h);return f},p.prototype.toMesh=function(h){var f=this.toBufferGeometry(),m=new d.Mesh(f,h);return m.position.setFromMatrixPosition(this.matrix),m.rotation.setFromRotationMatrix(this.matrix),m},p.Polygon=function(h){h instanceof Array||(h=[]),this.vertices=h,0<h.length?this.calculateProperties():this.normal=this.w=void 0},p.Polygon.prototype.calculateProperties=function(){var h=this.vertices[0],f=this.vertices[1],m=this.vertices[2];return this.normal=f.clone().subtract(h).cross(m.clone().subtract(h)).normalize(),this.w=this.normal.clone().dot(h),this},p.Polygon.prototype.clone=function(){var h,f,m=new p.Polygon;for(h=0,f=this.vertices.length;h<f;h++)m.vertices.push(this.vertices[h].clone());return m.calculateProperties(),m},p.Polygon.prototype.flip=function(){var h,f=[];for(this.normal.multiplyScalar(-1),this.w*=-1,h=this.vertices.length-1;0<=h;h--)f.push(this.vertices[h]);return this.vertices=f,this},p.Polygon.prototype.classifyVertex=function(h){var f=this.normal.dot(h)-this.w;return f<-o?c:f>o?l:s},p.Polygon.prototype.classifySide=function(h){var f,m,g,T=0,y=0,v=h.vertices.length;for(f=0;f<v;f++)m=h.vertices[f],g=this.classifyVertex(m),g===l?T++:g===c&&y++;return 0<T&&y===0?l:T===0&&0<y?c:T===0&&y===0?s:u},p.Polygon.prototype.splitPolygon=function(h,f,m,g,T){var y=this.classifySide(h);if(y===s)(0<this.normal.dot(h.normal)?f:m).push(h);else if(y===l)g.push(h);else if(y===c)T.push(h);else{var v,_,b,L,w,k,C,A,O,N=[],I=[];for(_=0,v=h.vertices.length;_<v;_++)b=(_+1)%v,k=h.vertices[_],C=h.vertices[b],L=this.classifyVertex(k),w=this.classifyVertex(C),L!=c&&N.push(k),L!=l&&I.push(k),(L|w)===u&&(A=(this.w-this.normal.dot(k))/this.normal.dot(C.clone().subtract(k)),O=k.interpolate(C,A),N.push(O),I.push(O));3<=N.length&&g.push(new p.Polygon(N).calculateProperties()),3<=I.length&&T.push(new p.Polygon(I).calculateProperties())}},p.Vertex=function(h,f,m,g,T){this.x=h,this.y=f,this.z=m,this.normal=g||new d.Vector3,this.uv=T||new d.Vector2},p.Vertex.prototype.clone=function(){return new p.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},p.Vertex.prototype.add=function(h){return this.x+=h.x,this.y+=h.y,this.z+=h.z,this},p.Vertex.prototype.subtract=function(h){return this.x-=h.x,this.y-=h.y,this.z-=h.z,this},p.Vertex.prototype.multiplyScalar=function(h){return this.x*=h,this.y*=h,this.z*=h,this},p.Vertex.prototype.cross=function(h){var f=this.x,m=this.y,g=this.z;return this.x=m*h.z-g*h.y,this.y=g*h.x-f*h.z,this.z=f*h.y-m*h.x,this},p.Vertex.prototype.normalize=function(){var h=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=h,this.y/=h,this.z/=h,this},p.Vertex.prototype.dot=function(h){return this.x*h.x+this.y*h.y+this.z*h.z},p.Vertex.prototype.lerp=function(h,f){return this.add(h.clone().subtract(this).multiplyScalar(f)),this.normal.add(h.normal.clone().sub(this.normal).multiplyScalar(f)),this.uv.add(h.uv.clone().sub(this.uv).multiplyScalar(f)),this},p.Vertex.prototype.interpolate=function(h,f){return this.clone().lerp(h,f)},p.Vertex.prototype.applyMatrix4=function(h){var f=this.x,m=this.y,g=this.z,T=h.elements;return this.x=T[0]*f+T[4]*m+T[8]*g+T[12],this.y=T[1]*f+T[5]*m+T[9]*g+T[13],this.z=T[2]*f+T[6]*m+T[10]*g+T[14],this},p.Node=function(h){var f,m,g=[],T=[];if(this.polygons=[],this.front=this.back=void 0,h instanceof Array&&h.length!==0){for(this.divider=h[0].clone(),f=0,m=h.length;f<m;f++)this.divider.splitPolygon(h[f],this.polygons,this.polygons,g,T);0<g.length&&(this.front=new p.Node(g)),0<T.length&&(this.back=new p.Node(T))}},p.Node.isConvex=function(h){var f,m;for(f=0;f<h.length;f++)for(m=0;m<h.length;m++)if(f!==m&&h[f].classifySide(h[m])!==c)return!1;return!0},p.Node.prototype.build=function(h){var f,m,g=[],T=[];for(this.divider||(this.divider=h[0].clone()),f=0,m=h.length;f<m;f++)this.divider.splitPolygon(h[f],this.polygons,this.polygons,g,T);0<g.length&&(!this.front&&(this.front=new p.Node),this.front.build(g)),0<T.length&&(!this.back&&(this.back=new p.Node),this.back.build(T))},p.Node.prototype.allPolygons=function(){var h=this.polygons.slice();return this.front&&(h=h.concat(this.front.allPolygons())),this.back&&(h=h.concat(this.back.allPolygons())),h},p.Node.prototype.clone=function(){var h=new p.Node;return h.divider=this.divider.clone(),h.polygons=this.polygons.map(function(f){return f.clone()}),h.front=this.front&&this.front.clone(),h.back=this.back&&this.back.clone(),h},p.Node.prototype.invert=function(){var h,f,m;for(h=0,f=this.polygons.length;h<f;h++)this.polygons[h].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),m=this.front,this.front=this.back,this.back=m,this},p.Node.prototype.clipPolygons=function(h){var f,m,g,T;if(!this.divider)return h.slice();for(g=[],T=[],f=0,m=h.length;f<m;f++)this.divider.splitPolygon(h[f],g,T,g,T);return this.front&&(g=this.front.clipPolygons(g)),T=this.back?this.back.clipPolygons(T):[],g.concat(T)},p.Node.prototype.clipTo=function(h){this.polygons=h.clipPolygons(this.polygons),this.front&&this.front.clipTo(h),this.back&&this.back.clipTo(h)},p}},function(r,n){r.exports=i8r()},function(r,n){r.exports=h8r},function(r,n,i){var o=i(2).Geometry,s=i(3),l=s.BufferGeometryLoader;r.exports=function(c){var u=void 0,d=function(g){var T=new l,y=T.parse(g),v=new s.MeshPhongMaterial,_=new s.Mesh(y.geometry,v),b=new o;return b.morph=_,b},p=function(g){var T=d(g);u=new(i(47)).GeometryCSGInternal(T),c.postMessage({action:"message",message:"Initialised"})},h=function(g){if(u){var T=d(g),y=u.intersect(T),v=y.toBufferGeometry().toJSON();c.postMessage({action:"result",object:v})}},f=function(g){if(u){var T=d(g),y=u.subtract(T),v=y.toBufferGeometry().toJSON();c.postMessage({action:"result",object:v})}},m=function(g){if(u){var T=d(g),y=u.union(T),v=y.toBufferGeometry().toJSON();c.postMessage({action:"result",object:v})}};c.addEventListener("message",function(g){switch(g.data.action){case"initialise":p(g.data.object);break;case"intersect":h(g.data.object);break;case"subtract":f(g.data.object);break;case"union":m(g.data.object);break;default:throw"Cannot handle specified action."}})}},function(r,n,i){var o=i(3),s=i(43)(o);i(2).Geometry,i(42).GeometryCSG;var l=function(c){var u;c&&c.isGeometry&&(u=c);var d;this.setGeometry=h=>{h&&h.isGeometry&&(u=h),d=void 0},this.setCSG=h=>{d=h};var p=h=>{if(u&&u.morph&&h&&h.morph){d===void 0&&(d=new s(u.morph));var f=new s(h.morph);return f}};this.intersect=h=>{var f=p(h);return d&&f?d.intersect(f):void 0},this.subtract=h=>{var f=p(h);return d&&f?d.subtract(f):void 0},this.union=h=>{var f=p(h);return d&&f?d.union(f):void 0}};n.GeometryCSGInternal=l},function(r,n,i){var o=i(3),s=i(43)(o);i(13).Glyphset;var l=function(c){var u;c&&c.isGlyphset&&(u=c);var d=[];this.setGlyphset=f=>{f&&f.isGlyphset&&(u=f),hostCSG=void 0},this.getGlyphset=()=>u;var p=()=>f=>{var m=f.getMesh(),g=f.getLabel();if(m){var T=new s(m.geometry.clone().applyMatrix(m.matrix)),y=[];y.csg=T,y.label=g,m.material&&(y.material=m.material.clone()),d.push(y)}},h=f=>{if(u&&f&&f.morph){d.length==0&&u.forEachGlyph(p());var m=new s(f.morph);return m}};this.intersect=f=>{var m=h(f);if(0<d.length&&m){for(var g=new(i(13)).Glyphset,T=0;T<d.length;T++){var y=d[T],v=y.csg.intersect(m),_=v.toMesh();if(_&&_.geometry&&0<_.geometry.vertices.length){y.material&&(_.material=y.material,_.material.side=o.DoubleSide,_.material.clippingPlanes=null);var b=g.addMeshAsGlyph(_,T+1);b.setLabel(y.label)}}var L=new l(g);return L}}};n.GlyphsetCSG=l}])})})(hEe);var Uv=hEe.exports;const zB=Ucr(Uv),ZVe={isWebGLAvailable:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var e=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&e.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(e){var t={1:"WebGL",2:"WebGL 2"},r={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},n='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',i=document.createElement("div");return i.id="webglmessage",i.style.fontFamily="monospace",i.style.fontSize="20px",i.style.fontWeight="normal",i.style.textAlign="center",i.style.background="#fff",i.style.color="#000",i.style.padding="1.5em",i.style.width="400px",i.style.margin="5em auto 0",r[e]?n=n.replace("$0","graphics card"):n=n.replace("$0","browser"),n=n.replace("$1",t[e]),i.innerHTML=n,i}},lne={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},D2=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};D2.prototype.setName=function(e){if(e&&this.instanceName!==e){this.instanceName=e;const t=this.onChangedCallbacks.slice();for(let r=0;r<t.length;r++)t[r](this,lne.NAME_CHANGED)}},D2.prototype.settingsChanged=function(){const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,lne.SETTINGS_CHANGED)},D2.prototype.exportSettings=function(){const e={};return e.dialog=this.typeName,e.name=this.instanceName,e},D2.prototype.importSettings=function(e){return e.dialog==this.typeName?(this.setName(e.name),!0):!1},D2.prototype.publishChanges=function(e,t,r){for(let n=0;n<this.eventNotifiers.length;n++)this.eventNotifiers[n].publish(this,t,e,r)},D2.prototype.getName=function(){return this.instanceName},D2.prototype.destroy=function(){const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,lne.DESTROYED);delete this},D2.prototype.addChangedCallback=function(e){this.onChangedCallbacks.includes(e)==!1&&this.onChangedCallbacks.push(e)},D2.prototype.removeChangedCallback=function(e){const t=this.onChangedCallbacks.indexOf(e);t>-1&&this.onChangedCallbacks.splice(t,1)},D2.prototype.addNotifier=function(e){this.eventNotifiers.push(e)};const ak={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},f8r=function(e,t,r){this.eventType=e,this.identifiers=t,this.zincObjects=r},m8r=function(e,t,r){this.targetedID=[];const n=e,i=t;this.targetEventType=r;const o=this;r===void 0&&(this.targetEventType=ak.ALL),this.getEventType=function(){return r},this.notify=function(s,l,c,u){if(s!==n&&(o.targetEventType===ak.ALL||o.targetEventType===l)){const d=new f8r(l,c,u);i(d)}}},g8r=function(){const e=[];this.publish=function(t,r,n,i){for(let o=0;o<e.length;o++)e[o].notify(t,r,n,i)},this.subscribe=function(t,r,n){if(typeof r=="function"){const i=new m8r(t,r,n);return e.push(i),i}},this.unsubscribe=function(t){for(let r=0;r<e.length;r++)if(t===e[r]){e.splice(r,1);return}}},y8r=function(){let e=[],t=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const r=[],n=[],i=this,o=function(c,u){if(c.length==0&&u.length==0)return!1;for(let d=0;d<c.length;d++){let p=!1;for(let h=0;h<u.length;h++)c[d]===u[h]&&(p=!0);if(!p)return!0}for(let d=0;d<u.length;d++){let p=!1;for(let h=0;h<c.length;h++)u[d]===c[h]&&(p=!0);if(!p)return!0}return!1},s=function(c,u){if(r.length=0,u.length==0)return c;for(let d=0;d<c.length;d++){let p=!1;for(let h=0;h<u.length;h++)c[d]===u[h]&&(p=!0);p||r.push(c[d])}return r};this.setHighlighted=function(c){const u=[...e];i.resetHighlighted();const d=s(c,t),p=l(d);for(let h=0;h<p.length;h++)p[h]&&p[h].material&&p[h].material.emissive&&p[h].material.emissive.setRGB(...i.highlightColour);return e=d,o(e,u)},this.setSelected=function(c){const u=[...t];s(e,c),i.resetHighlighted(),i.resetSelected();const d=l(c);for(let p=0;p<d.length;p++)d[p]&&d[p].material&&d[p].material.emissive&&d[p].material.emissive.setRGB(...i.selectColour);return t=c,o(t,u)};const l=function(c){n.length=0;for(let u=0;u<c.length;u++)c[u].material&&n.push(c[u]);return n};this.resetHighlighted=function(){const c=l(e);for(let u=0;u<c.length;u++)c[u]&&c[u].material&&(c[u].material.emissive&&c[u].material.emissive.setRGB(...i.originalColour),c[u].material.depthFunc&&(c[u].material.depthFunc=Uv.THREE.LessEqualDepth));e=[]},this.resetSelected=function(){const c=l(t);for(let u=0;u<c.length;u++)c[u]&&c[u].material&&(c[u].material.emissive&&c[u].material.emissive.setRGB(...i.originalColour),c[u].material.depthFunc&&(c[u].material.depthFunc=Uv.THREE.LessEqualDepth));t=[]},this.getSelected=function(){return t},this.reset=function(){i.resetSelected(),i.resetHighlighted()}},cne=zB.THREE,T8r=function(){const e=document.createElement("div");let t;if(e.style.height="100%",ZVe.isWebGLAvailable())t=new zB.Renderer(e,window),zB.defaultMaterialColor=16777116,t.initialiseVisualisation(),t.playAnimation=!1;else{const r=ZVe.getWebGLErrorMessage();e.appendChild(r)}return{Zinc:zB,renderer:t,container:e}},ts=function(){D2.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new y8r,this.zincRenderer=null,this.selectedScreenCoordinates=new cne.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0};ts.prototype=Object.create(D2.prototype),ts.prototype.getIntersectedObject=function(e){if(e){const t=e.map(n=>{if(n&&n.object&&n.object.userData){if(n.object.userData.isMarker)return 1;if(n.object.name&&n.object.userData.isZincObject)return 2}return 0});let r=t.indexOf(1);return r=r>-1?r:t.indexOf(2),e[r]}},ts.prototype.getAnnotationsFromObjects=function(e){const t=[];for(var r=0;r<e.length;r++){const n=e[r].userData;let i;if(n)if(n.isGlyph||n.isGlyphset){let o=n;n.isGlyph&&(o=n.getGlyphset()),i=o.userData?o.userData.annotation:void 0,i&&i.data&&(e[r].name&&e[r].name!=""?i.data.id=e[r].name:i.data.id=o.groupName)}else i=n.userData?n.userData.annotation:void 0,i&&i.data&&(i.data.id=e[r].name);i&&t.push(i)}return t},ts.prototype.setHighlightedByObjects=function(e,t,r){const n=this.graphicsHighlight.setHighlighted(e),i=this.objectsToZincObjects(e);if(r){let o=ak.MOVE;n&&(o=ak.HIGHLIGHTED);const s=this.getAnnotationsFromObjects(e);s.length>0&&(s[0].coords=t),this.publishChanges(s,o,i)}return n},ts.prototype.setHighlightedByZincObjects=function(e,t,r){let n=[];return e&&e.forEach(i=>{i&&i.morph&&n.push(i.morph)}),this.setHighlightedByObjects(n,t,r)},ts.prototype.setupLiveCoordinates=function(e){if(this.liveUpdatesObjects=e,e&&e.length>0){const t=this.scene.getBoundingBoxOfZincObjects(e);let r=new cne.Vector3;t.getCenter(r),this.selectedCenter==null?this.selectedCenter=r:this.selectedCenter.copy(r)}else this.selectedCenter=void 0},ts.prototype.objectsToZincObjects=function(e){const t=[];for(let r=0;r<e.length;r++){let n=e[r].userData;if(n)if(n.isGlyph||n.isGlyphset){let i=n;n.isGlyph&&(i=n.getGlyphset()),t.push(i)}else t.push(n)}return t},ts.prototype.setSelectedByObjects=function(e,t,r){const n=this.graphicsHighlight.setSelected(e);if(n){const i=this.objectsToZincObjects(e);if(this.setupLiveCoordinates(i),r){const o=ak.SELECTED,s=this.getAnnotationsFromObjects(e);s.length>0&&(s[0].coords=t),this.publishChanges(s,o,i)}}return n},ts.prototype.setSelectedByZincObjects=function(e,t,r){let n=[];return e&&e.forEach(i=>{i&&i.morph&&n.push(i.morph)}),this.setSelectedByObjects(n,t,r)};const v8r=function(e){return function(t){e.push(t.getMesh())}};ts.prototype.findObjectsByGroupName=function(e){const t=this.scene.findGeometriesWithGroupName(e),r=[];for(let i=0;i<t.length;i++)r.push(t[i].morph);const n=this.scene.findGlyphsetsWithGroupName(e);for(let i=0;i<n.length;i++)n[i].forEachGlyph(v8r(r));return r},ts.prototype.setHighlightedByGroupName=function(e,t){const r=this.findObjectsByGroupName(e);return this.setHighlightedByObjects(r,void 0,t)},ts.prototype.setSelectedByGroupName=function(e,t){const r=this.findObjectsByGroupName(e);return this.setSelectedByObjects(r,void 0,t)},ts.prototype.changeBackgroundColour=function(e){const t=new cne.Color(e);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(t,1)},ts.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},ts.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},ts.prototype.playAnimation=function(e){this.zincRenderer&&(this.zincRenderer.playAnimation=e)},ts.prototype.setPlayRate=function(e){this.zincRenderer&&this.zincRenderer.setPlayRate(e)},ts.prototype.getPlayRate=function(e){return this.zincRenderer?this.zincRenderer.getPlayRate():0},ts.prototype.initialiseRenderer=function(e){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let t=T8r();this.Zinc=t.Zinc,this.zincRenderer=t.renderer,this.rendererContainer=t.container}e&&(this.displayArea=e,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},ts.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),D2.prototype.destroy.call(this)};const Q8r=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},b8r=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.currentTime=0,this.timeVarying=!1},WVe=function(e){ts.call(this);const t=this;let r;this.sceneData=new b8r;const n=new Array,i=new Array,o=new Array;let s;const l=e;this.NDCCameraControl=void 0,t.typeName="Organ Viewer",this.currentTime=0,this.getSceneData=function(){return t.sceneData},this.updateTime=function(b){let L=6e3;t.scene&&(L=t.scene.getDuration());const w=b/100*L;t.sceneData.nerveMapIsActive||t.scene&&t.scene.setMorphsTime(w),t.sceneData.currentTime=b,t.currentTime=b};const c=function(){let b=3e3;t.scene&&(b=t.scene.getDuration());const L=t.zincRenderer.getCurrentTime();for(let w=0;w<n.length;w++)n[w](L);!t.sceneData.nerveMapIsActive&&r&&r.setMorphsTime(L),t.sceneData.nerveMap&&t.sceneData.nerveMap.additionalReader&&t.sceneData.nerveMap.additionalReader.setTime(L/b),t.sceneData.currentTime=L/b*100,t.currentTime=L/b*100};this.getCurrentTime=function(){return t.sceneData.currentTime},this.toggleSyncControl=(b,L)=>{let w=this.scene.getZincCameraControls();b?(w.resetView(),this.NDCCameraControl=w.enableSyncControl(),w.setRotationMode(L)):(w.disableSyncControl(),this.NDCCameraControl=void 0,w.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=b=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(b,2)},this.setSyncControlCallback=b=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(b)},this.setSyncControlCenterZoom=(b,L)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(b,L)};const u=function(){if(t.zincRenderer.playAnimation&&t.liveUpdatesObjects&&t.setupLiveCoordinates(t.liveUpdatesObjects),t.selectedCenter){const b=new Uv.THREE.Vector3;b.copy(t.selectedCenter);const L=t.scene.vectorToScreenXY(b);t.selectedScreenCoordinates.x=L.x,t.selectedScreenCoordinates.y=L.y}},d=function(){return function(){c()}},p=function(){return function(){u()}};this.addTimeChangedCallback=function(b){n.push(b)},this.setTexturePos=function(b){t.sceneData.nerveMap&&t.sceneData.nerveMap.additionalReader&&t.sceneData.nerveMap.additionalReader.setSliderPos(b)},this.addSceneChangedCallback=function(b){i.push(b)},this.addOrganPartAddedCallback=function(b){o.push(b)},this.setFinishDownloadCallback=function(b){s=b},this.unsetFinishDownloadCallback=function(){s=void 0},this.getNamedObjectsToScreenCoordinates=function(b,L){const w=new Uv.THREE.Vector3;w.setFromMatrixPosition(obj.matrixWorld);const k=width/2,C=height/2;return w.project(L),w.x=w.x*k+k,w.y=-(w.y*C)+C,w};const h=function(b){let L,w;if(b!==void 0){let k=!1;b.object.userData&&b.object.userData.isMarker?(k=!0,w=b.object.userData.parent.morph):w=b.object;try{w.userData.userData.annotation.data.lastActionOnMarker=k}finally{}if(w)if(w.name)L=w.name;else{const C=t.getAnnotationsFromObjects([w]);C&&C[0]&&(L=C[0].data.group)}}return{id:L,object:w}},f=function(){return function(b,L,w){const k=t.getIntersectedObject(b),C=h(k),A={x:L,y:w};if(C.id){C.object.userData.isGlyph?C.object.name?t.setSelectedByObjects([C.object],A,!0):t.setSelectedByZincObjects(C.object.userData.getGlyphset(),A,!0):t.setSelectedByObjects([C.object],A,!0);return}else t.setSelectedByObjects([],A,!0)}},m=function(){return function(b,L,w){const k=t.getIntersectedObject(b),C=h(k),A={x:L,y:w};if(C.id){t.displayArea.style.cursor="pointer",t.setHighlightedByObjects([C.object],A,!0);return}else t.displayArea.style.cursor="auto",t.setHighlightedByObjects([],A,!0)}},g=function(b,L,w,k){if(k=="all"||k=="geometries"){const C=b.findGeometriesWithGroupName(L);for(let A=0;A<C.length;A++)C[A].setVisibility(w)}if(k=="all"||k=="glyphsets"){const C=b.findGlyphsetsWithGroupName(L);for(let A=0;A<C.length;A++)C[A].setVisibility(w)}if(k=="all"||k=="pointsets"){const C=b.findPointsetsWithGroupName(L);for(let A=0;A<C.length;A++)C[A].setVisibility(w)}if(k=="all"||k=="lines"){const C=b.findLinesWithGroupName(L);for(let A=0;A<C.length;A++)C[A].setVisibility(w)}};this.changeGeometriesVisibility=function(b,L){g(t.scene,b,L,"geometries")},this.changeGlyphsetsVisibility=function(b,L){g(t.scene,b,L,"glyphsets")},this.changeLinesVisibility=function(b,L){g(t.scene,b,L,"lines")},this.changePointsetsVisibility=function(b,L){g(t.scene,b,L,"pointsets")},this.changeOrganPartsVisibility=function(b,L,w){let k="all";w!==void 0&&(k=w),g(t.scene,b,L,k)},this.changeOrganPartsVisibilityCallback=function(b){return function(L){t.changeOrganPartsVisibility(b,L)}},this.changeBackgroundColour=function(b){const L=new Uv.THREE.Color(b);t.zincRenderer&&t.zincRenderer.getThreeJSRenderer().setClearColor(L,1)};const T=function(b,L,w,k){for(let O=0;O<o.length;O++)o[O](k,t.scene.isTimeVarying());w&&l.setGeometryColour(k,b,L);const C=new Q8r,A=k.region.getFullPath();C.data={species:t.sceneData.currentSpecies,system:b,part:L,group:k.groupName,region:A,uuid:k.uuid,lastActionOnMarker:!1},k.userData.annotation=C},y=function(b,L,w){return function(k){T(b,L,w,k)}},v=function(){return function(){t.settingsChanged(),t.sceneData.timeVarying=t.scene.isTimeVarying(),s&&s()}};this.updateFieldvisibility=function(b,L){for(let w=0;w<b.length;w++)if(L!=w){const k=b[w].PartName;t.changeOrganPartsVisibility(k,!1)}if(L>-1){const w=b[L].PartName;if(t.scene.findGeometriesWithGroupName(w).length>0||t.scene.findGlyphsetsWithGroupName(w).length>0)t.changeOrganPartsVisibility(w,!0);else{const k=getOrganDetails(b[L].SystemName,w);k!=null&&t.scene.loadMetadataURL(l.getOrgansDirectoryPrefix()+"/"+k.meta)}}},this.getAvailableSpecies=function(b,L,w){const k=new Array;k.push("none");const C=Object.keys(organsFileMap);for(index in C){const A=C[index];A!=b&&organsFileMap[A].hasOwnProperty(L)&&organsFileMap[A][L].hasOwnProperty(w)&&k.push(A)}return k};const _=function(b,L,w,k){t.sceneData.nerveMapIsActive=!1,t.sceneData.nerveMap=void 0,t.sceneData.metaURL="",t.sceneData.viewURL="",t.sceneData.currentSpecies=b,t.sceneData.currentSystem=L,t.sceneData.currentPart=w,t.sceneData.currentTime=0,t.sceneData.timeVarying=!1,t.currentTime=0;let C="";b&&(C=b+"/"),L&&(C=L+"/"),w&&(C=w),t.sceneData.currentName=C};this.loadOrgansFromURL=function(b,L,w,k,C,A){if(t.zincRenderer&&k&&t.sceneData.metaURL!==b){_(L,w,k);const O=t.sceneData.currentName;let N=t.zincRenderer.getSceneByName(O);N?A&&N.clearAll():N=t.zincRenderer.createScene(O);for(let B=0;B<i.length;B++)i[B](t.sceneData);C&&C!=""?(t.sceneData.viewURL=C,N.loadViewURL(t.sceneData.viewURL)):t.sceneData.viewURL=void 0,t.sceneData.metaURL=b,N.loadMetadataURL(b,y(w,k,!1),v()),t.scene=N,t.zincRenderer.setCurrentScene(N),t.graphicsHighlight.reset();const I=N.getZincCameraControls();I.enableRaycaster(N,f(),m()),I.setMouseButtonAction("AUXILIARY","ZOOM"),I.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(b,L,w){if(t.zincRenderer&&L&&t.sceneData.metaURL!==b){_(void 0,void 0,L);const k=t.sceneData.currentName;let C=t.zincRenderer.getSceneByName(k);C?w&&C.clearAll():C=t.zincRenderer.createScene(k);for(let O=0;O<i.length;O++)i[O](t.sceneData);t.sceneData.viewURL=void 0,t.sceneData.metaURL=b,C.loadGLTF(b,y(void 0,L,!1),v()),t.scene=C,t.zincRenderer.setCurrentScene(C),t.graphicsHighlight.reset();const A=C.getZincCameraControls();A.enableRaycaster(C,f(),m()),A.setMouseButtonAction("AUXILIARY","ZOOM"),A.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(b){const L=t.graphicsHighlight.getSelected();L&&L[0]&&L[0].userData&&t.scene.alignObjectToCameraView(L[0].userData,b)},this.exportSettings=function(){const b={};return b.name=t.instanceName,t.sceneData.currentSystem&&(b.system=t.sceneData.currentSystem),t.sceneData.currentSpecies&&(b.species=t.sceneData.currentSpecies),t.sceneData.currentPart&&(b.part=t.sceneData.currentPart),b.metaURL=t.sceneData.metaURL,t.sceneData.viewURL&&(b.viewURL=t.sceneData.viewURL),b.dialog="Organ Viewer",b},this.importSettings=function(b){return b&&b.dialog==this.typeName?(t.setName(b.name),b.metaURL!==void 0&&b.metaURL!=""?t.loadOrgansFromURL(b.metaURL,b.species,b.system,b.part,b.viewURL,!0):t.loadOrgans(b.species,b.system,b.part),!0):!1},function(){t.initialiseRenderer(void 0),t.zincRenderer&&(t.zincRenderer.addPreRenderCallbackFunction(d()),t.zincRenderer.addPostRenderCallbackFunction(p()))}()};WVe.prototype=Object.create(ts.prototype);const x8r={name:"ScaffoldVuer",components:{Button:YN,Col:oS,Loading:ZCe,Option:kee,Popover:aR,Row:WT,Select:See,Slider:XT,TabPane:DCe,Tabs:BCe,MapSvgIcon:Wb,MapSvgSpriteColor:BC,PrimitiveControls:JCe,ScaffoldTooltip:rEe,TreeControls:tEe,ElIconWarningFilled:Xke,ElIconArrowDown:ON,ElIconArrowLeft:HN},props:{url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerLabels:{type:Array,default:function(){return[]}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url}},data:function(){return{currentTime:0,timeVarying:void 0,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],inHelp:!1,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:[],viewingMode:"Exploration",viewingModes:["Annotation","Exploration"],openMapRef:void 0,backgroundIconRef:void 0}},watch:{format:{handler:function(e){this.fileFormat=e},immediate:!0},url:{handler:function(e){(this.state===void 0||this.state.url===void 0)&&this.setURL(e)},immediate:!0},region:{handler:function(e){this.state||this.viewURL||this.setFocusedRegion(e)},immediate:!0},state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0},viewURL:{handler:function(e){this.updateViewURL(e)},immediate:!0},helpMode:function(e){this.setHelpMode(e)},displayMarkers:function(e){this.$module.scene.displayMarkers=e,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(e){this.$module.scene.displayMinimap=e},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(e){this.toggleRendering(e)},markerLabels:function(e){this.previousMarkerLabels.forEach(t=>{this.setMarkerModeForObjectsWithName(t,"off")}),e.forEach(t=>{this.setMarkerModeForObjectsWithName(t,"on")}),this.previousMarkerLabels=e}},beforeCreate:function(){this.$module=new WVe,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new t3r},created:function(){this.timeVarying=a.toRef(this.$module.sceneData,"timeVarying")},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.treeControls.setModule(this.$module);let e=new g8r;e.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(e),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeDestroy:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},methods:{addZincObject:function(e){this.$module.scene&&(this.$module.scene.addZincObject(e),this.zincObjectAdded(e),this.$refs.treeControls&&this.$refs.treeControls.zincObjectAdded(e))},zincObjectAdded:function(e){this.loading=!1,this.$_searchIndex.addZincObject(e,e.uuid),this.$emit("zinc-object-added",e)},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(e=>{this.$_searchIndex.addRegion(e,e.uuid)})},backgroundChangeCallback:function(e){this.currentBackground=e,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let e=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),t=document.createElement("a");document.body.append(t),this.captureFilename?t.download=this.captureFilename:t.download="screenshot.png",t.href=e,t.click(),t.remove()},captureScreenshot:function(e){this.captureFilename=e,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.treeControls&&this.$refs.treeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},formatTooltip(e){if(this.timeMax>=1e3&&e){let t=(e%6e4/1e3).toFixed(2)+"s";return(e>6e4?(e/6e4).toFixed(0)+"m ":"")+t}return e?e.toFixed(2)+" ms":"0 ms"},fitWindow:function(){this.$module.scene&&this.$module.scene.viewAll()},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(e){this.currentSpeed=e,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(e){let t=[];return e&&e!=""&&this.$module.scene&&(t=this.$module.scene.findObjectsWithGroupName(e)),t},viewRegion:function(e){const t=this.$module.scene.getRootRegion(),r=Array.isArray(e)?e:[e],n=$T(t,r,"",!0);let i=this.$module.scene.getBoundingBoxOfZincObjects(n);if(i){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(i);else{const o=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(i),this.$module.scene.camera.far=this.$module.scene.camera.near+o,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(e){e&&(this.isReady?this.viewRegion(e):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:e})))},updateViewURL:function(e){if(e)if(this.isReady){const t=new URL(e,this.url);this.$module.scene.loadViewURL(t)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:e}))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let e=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,e.enableAutoTumble(),e.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},eventNotifierCallback:function(e){const t=[];let r=[];if((e.eventType==1||e.eventType==2)&&(e.identifiers.forEach(n=>{if(n){let i=n.data.id?n.data.id:n.data.group;t.push(i)}}),r=e.zincObjects),e.eventType==1)this.$refs.treeControls&&(t.length>0?this.$refs.treeControls.updateActiveUI(r):(this.hideRegionTooltip(),this.$refs.treeControls.removeActive(!0))),this.viewingMode==="Annotation"&&this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0),this.$emit("scaffold-selected",e.identifiers);else if(e.eventType==2){if(this.selectedObjects.length===0){if(this.hideRegionTooltip(),this.$refs.treeControls&&(t.length>0?this.$refs.treeControls.updateHoverUI(r):this.$refs.treeControls.removeHover(!0)),e.identifiers.length>0&&e.identifiers[0]){let n=e.identifiers[0].data.id?e.identifiers[0].data.id:e.identifiers[0].data.group;e.identifiers[0].coords&&(this.tData.active=!1,this.tData.visible=!0,this.tData.label=n,e.identifiers[0].data.region?this.tData.region=e.identifiers[0].data.region:this.tData.region=void 0,this.tData.x=e.identifiers[0].coords.x,this.tData.y=e.identifiers[0].coords.y)}this.$emit("scaffold-highlighted",e.identifiers)}}else if(e.eventType==3&&e.identifiers.length>0&&e.identifiers[0]&&e.identifiers[0].coords){const n=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=e.identifiers[0].coords.x-n.left,this.tData.y=e.identifiers[0].coords.y-n.top}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(e){let t=e/this.timeMax*100;t!=this.currentTime&&(this.$module.updateTime(t),console.log(this.currentTime))},objectSelected:function(e,t){this.selectedObjects=e,this.selectedObjects&&this.selectedObjects.length>0&&this.$refs.primitiveControls.setObject(this.selectedObjects[0]),this.$module.setSelectedByZincObjects(e,void 0,t)},objectHovered:function(e,t){this.hoveredObjects=e,this.$module.setHighlightedByZincObjects(e,void 0,t)},changeActiveByName:function(e,t,r){const n=Array.isArray(e);if(e===void 0||n&&e.length===0)this.$refs.treeControls.removeActive(r);else{let i=e;n||(i=[i]),this.$refs.treeControls.changeActiveByNames(i,t,r)}},changeHighlightedByName:function(e,t,r){const n=Array.isArray(e);if(e===void 0||n&&e.length===0)this.$refs.treeControls.removeHover(r);else{let i=e;n||(i=[i]),this.$refs.treeControls.changeHoverByNames(i,t,r)}},play:function(e){this.$module.playAnimation(e),this.isPlaying=e},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisibilities.forEach(t=>{t.value=!0})):(this.inHelp=!1,this.hoverVisibilities.forEach(t=>{t.value=!1}))},displayTooltipOfObjectsCallback:function(e,t,r,n,i){const o=this;return function(){o.$module.zincRenderer.removePostRenderCallbackFunction(o.$_regionTooltipCallback),o.$_regionTooltipCallback=void 0,o.displayTooltipOfObjects(e,t,r,n,i)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(e,t,r,n,i){if(t.length>0){let o=t[0].getClosestVertexDOMElementCoords(this.$module.scene);if(o)return o.inView?(e.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=e,this.tData.x=o.position.x,this.tData.y=o.position.y,this.tData.region=r,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),i&&(this.$module.setupLiveCoordinates(t),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),n&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(e,t,r,n,i)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(e,t,r,n,i){return e&&t&&t.length>0&&this.$module.scene?this.displayTooltipOfObjects(e,t,r,n,i):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(e,t,r){if(e&&this.$module.scene){const n=this.$module.scene.getRootRegion(),i=$T(n,[e],"",!0);let o;return i&&i.length>0&&(o=i[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(e,i,o,t,r)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(e,t,r){if(this.$module.scene){const n=eEe(this.$module.scene,e);if(n&&n.objects.length>0)return this.showRegionTooltipWithObjects(n.label,n.objects,n.regionPath,t,r)}return this.hideRegionTooltip(),!1},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(e,t){if(e&&this.$module.scene){const r=this.$module.scene.getRootRegion();$T(r,[e],"",!0).forEach(n=>n.setMarkerMode(t))}},setMarkerModeWithAnnotations:function(e,t){if(this.$module.scene){const r=eEe(this.$module.scene,e);r&&r.objects.length>0&&r.objects.forEach(n=>n.setMarkerMode(t))}},showHelpText:function(e){this.inHelp||(this.helpTextWait=setTimeout(()=>{this.hoverVisibilities[e].value=!0},500))},hideHelpText:function(e){this.inHelp||(this.hoverVisibilities[e].value=!1,clearTimeout(this.helpTextWait))},search:function(e,t){if(this.$_searchIndex){if(e===void 0||e===""||Array.isArray(e)&&e.length===0)return this.objectSelected([],!0),!1;{const r=this.$_searchIndex.searchAndProcessResult(e),n=r.zincObjects;if(n.length>0){if(this.objectSelected(n,!0),t)for(let i=0;i<n.length;i++)n[i]&&n[i].groupName&&this.showRegionTooltipWithObjects(r.label,n,r.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(e){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(e)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(e=>{this.$module.scene.minimapScissor[e]=this.minimapSettings[e]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let e=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const t in e)this.timeStamps[e[t]]=t;this.timeMax=this.$module.scene.getDuration()},setURLFinishCallback:function(e){return()=>{if(e){if(e.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(e.viewport);else if(e.viewURL&&e.viewURL!==""){const t=new URL(e.viewURL,this.url);this.$module.scene.loadViewURL(t)}else e.region&&e.region!==""&&this.viewRegion(e.region);e.visibility&&this.$nextTick(()=>{this.$refs.treeControls.setState(e.visibility)})}this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this.isReady=!0}},getState:function(){let e={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0};if(this.$refs.treeControls&&(e.visibility=this.$refs.treeControls.getState()),this.$module.scene){let t=this.$module.scene.getZincCameraControls();e.viewport=t.getCurrentViewport()}return e},setState:function(e){e&&(e.url&&e.url!==this._currentURL?this.setURLAndState(e.url,{fileFormat:e.fileFormat,viewport:e.viewport,visibility:e.visibility}):(e.viewport||e.visibility)&&(this.isReady&&this.$module.scene?(e.viewport&&this.$module.scene.getZincCameraControls().setCurrentCameraSettings(e.viewport),e.visibility&&this.$refs.treeControls.setState(e.visibility)):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:e.viewport,visibility:e.visibility}))))},exportGLTF:function(e){return this.$module.scene.exportGLTF(e)},setURLAndState:function(e,t){if(e!=this._currentURL){t&&t.format&&(this.fileFormat=t.format);let r=t&&t.viewport?t.viewport:void 0,n=t&&t.visibility?t.visibility:void 0;this._currentURL=e,this.$refs.treeControls&&this.$refs.treeControls.clear(),this.loading=!0,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:r,region:this.region,viewURL:this.viewURL,visibility:n})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(e,"scene",!0):this.$module.loadOrgansFromURL(e,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor())}},setURL:function(e){this.setURLAndState(e,void 0)},drawerToggled:function(e){this.drawerOpen=e,this.adjustLayout()},adjustLayout:function(){let e=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=e<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""},toggleRendering:function(e){this.$module.zincRenderer&&(e?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const e=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",e)},toggleSyncControl:function(e,t){this.$module.toggleSyncControl(e,t),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){this.markerLabels.forEach(e=>{this.setMarkerModeForObjectsWithName(e,"on")})}}},une=e=>(a.pushScopeId("data-v-958eb79e"),e=e(),a.popScopeId(),e),_8r={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},w8r=une(()=>a.createElementVNode("span",{class:"message-text"},"Beta",-1)),L8r=une(()=>a.createElementVNode("span",{class:"message-text"},"What's new?",-1)),S8r={class:"primitive-controls-box"},k8r={class:"animation-data"},M8r={class:"purple"},C8r={class:"animation-data"},E8r={class:"purple"},A8r={class:"animation-data"},O8r={class:"bottom-right-control"},H8r=une(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),V8r=["onClick"];function I8r(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=rEe,c=Xke,u=ja,d=aR,p=tEe,h=JCe,f=a.resolveComponent("map-svg-icon"),m=XT,g=WT,T=DCe,y=kee,v=See,_=BCe,b=YN,L=oS,w=hR;return a.withDirectives((a.openBlock(),a.createElementBlock("div",_8r,[a.createVNode(s),a.createVNode(l,{label:e.tData.label,region:e.tData.region,visible:e.tData.visible,x:e.tData.x,y:e.tData.y,annotationDisplay:e.viewingMode==="Annotation"&&e.tData.active===!0},null,8,["label","region","visible","x","y","annotationDisplay"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:t[0]||(t[0]=a.withKeys((...k)=>o.backgroundChangeCallback&&o.backgroundChangeCallback(...k),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[r.displayWarning?(a.openBlock(),a.createBlock(d,{key:0,ref:"warningPopover",visible:e.hoverVisibilities[6].value,content:r.warningMessage,placement:"right",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[r.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:t[1]||(t[1]=k=>o.showHelpText(6)),onMouseout:t[2]||(t[2]=k=>o.hideHelpText(6))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),w8r],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),r.displayLatestChanges?(a.openBlock(),a.createBlock(d,{key:1,visible:e.hoverVisibilities[7].value,content:r.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[r.displayLatestChanges&&r.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:t[3]||(t[3]=k=>o.showHelpText(7)),onMouseout:t[4]||(t[4]=k=>o.hideHelpText(7))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),L8r],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(d,{visible:e.hoverVisibilities[5].value,content:"Change region visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"treeControls","help-mode":r.helpMode,isReady:e.isReady,"show-colour-picker":r.showColourPicker,onObjectSelected:o.objectSelected,onObjectHovered:o.objectHovered,onDrawerToggled:o.drawerToggled},null,8,["help-mode","isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",S8r,[a.createVNode(h,{ref:"primitiveControls"},null,512)]),e.timeVarying?(a.openBlock(),a.createBlock(d,{key:2,ref:"sliderPopover",visible:e.hoverVisibilities[4].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[e.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[e.minimisedSlider?"minimised":"",e.sliderPosition]])},[a.createVNode(_,{type:"card"},{default:a.withCtx(()=>[a.createVNode(T,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(g,{class:"tab-content"},{default:a.withCtx(()=>[e.isPlaying?(a.openBlock(),a.createBlock(f,{key:0,icon:"pause",class:"icon-button video-button",onClick:t[5]||(t[5]=k=>o.play(!1))})):(a.openBlock(),a.createBlock(f,{key:1,icon:"play",class:"video-button icon-button",onClick:t[6]||(t[6]=k=>o.play(!0))})),a.createVNode(m,{min:0,max:e.timeMax,"model-value":e.currentTime/100*e.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":o.formatTooltip,marks:e.timeStamps,onInput:t[7]||(t[7]=k=>o.timeChange(k))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(T,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(g,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",k8r,[a.createTextVNode(" Original duration: "),a.createElementVNode("div",M8r,a.toDisplayString(e.orginalDuration),1)]),a.createElementVNode("div",C8r,[a.createTextVNode(" Animation duration: "),a.createElementVNode("div",E8r,a.toDisplayString(e.animateDuration),1)]),a.createElementVNode("div",A8r,[a.createTextVNode(" Playback speed "),a.createVNode(v,{teleported:!0,"model-value":e.currentSpeed,placeholder:"Select",class:"select-box","popper-class":"scaffold_viewer_dropdown",onChange:t[8]||(t[8]=k=>o.speedChanged(k))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.playSpeed,k=>(a.openBlock(),a.createBlock(y,{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",O8r,[a.createVNode(d,{visible:e.hoverVisibilities[0].value,content:"Zoom in",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable"},{reference:a.withCtx(()=>[a.createVNode(f,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[9]||(t[9]=k=>o.zoomIn()),onMouseover:t[10]||(t[10]=k=>o.showHelpText(0)),onMouseout:t[11]||(t[11]=k=>o.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(d,{visible:e.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable"},{reference:a.withCtx(()=>[a.createVNode(f,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[12]||(t[12]=k=>o.zoomOut()),onMouseover:t[13]||(t[13]=k=>o.showHelpText(1)),onMouseout:t[14]||(t[14]=k=>o.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(d,{visible:e.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper non-selectable"},{reference:a.withCtx(()=>[a.createVNode(f,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[15]||(t[15]=k=>o.fitWindow()),onMouseover:t[16]||(t[16]=k=>o.showHelpText(2)),onMouseout:t[17]||(t[17]=k=>o.hideHelpText(2))})]),default:a.withCtx(()=>[H8r]),_:1},8,["visible"])]),e.openMapRef?(a.openBlock(),a.createBlock(d,{key:3,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.openMapOptions,k=>(a.openBlock(),a.createBlock(g,{key:k.key},{default:a.withCtx(()=>[a.createVNode(b,{type:"primary",plain:"",onClick:C=>e.$emit("open-map",k.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(k.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(g,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(g,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(v,{teleported:!1,modelValue:e.viewingMode,"onUpdate:modelValue":t[18]||(t[18]=k=>e.viewingMode=k),placeholder:"Select",class:"select-box viewing-mode","popper-class":"scaffold_viewer_dropdown"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.viewingModes,k=>(a.openBlock(),a.createBlock(y,{key:k,label:k,value:k},{default:a.withCtx(()=>[a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(L,{span:12},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(k),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a.createVNode(g,{class:"backgroundSpacer"}),a.createVNode(g,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode(" Change background ")]),_:1}),a.createVNode(g,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.availableBackground,k=>(a.openBlock(),a.createElementBlock("div",{key:k,class:a.normalizeClass(["backgroundChoice",k,k==e.currentBackground?"active":""]),onClick:C=>o.backgroundChangeCallback(k)},null,10,V8r))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(d,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:a.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(a.openBlock(),a.createBlock(f,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[19]||(t[19]=k=>o.showHelpText(8)),onMouseout:t[20]||(t[20]=k=>o.hideHelpText(8))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(d,{visible:e.hoverVisibilities[3].value,content:"Change background color",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:a.withCtx(()=>[a.createVNode(f,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[21]||(t[21]=k=>o.showHelpText(3)),onMouseout:t[22]||(t[22]=k=>o.hideHelpText(3))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,r.displayUI&&!e.isTransitioning]])])),[[w,e.loading]])}const P8r={name:"Scaffold",mixins:[ay],components:{ScaffoldVuer:YT(x8r,[["render",I8r],["__scopeId","data-v-958eb79e"]])},methods:{onResize:function(){this.scaffoldCamera.onResize()},getState:function(){return this.$refs.scaffold.getState()},search:function(e){const t=e.replace(/(^"|"$)/g,"");return this.$refs.scaffold.search(t,!0)},searchSuggestions:function(e,t){if(e===""||!this.$refs.scaffold)return t;this.$refs.scaffold.fetchSuggestions(e).forEach(n=>{n.suggestion&&t.push(n.suggestion)})},handleSyncPanZoomEvent:function(e){if(!this.mouseHovered&&e.type!==this.entry.type){const t=e.payload.origin,r=e.payload.size,n=[t[0]+r[0]/2,t[1]+r[1]/2],i=[(n[0]-.5)*2,(.5-n[1])*2],o=1/Math.max(r[0],r[1]);this.$refs.scaffold.$module.setSyncControlCenterZoom(i,o)}},displayTooltip:function(e){let t;e&&(t=e.name),t?this.$refs.scaffold.search(t,!0):this.$refs.scaffold.hideRegionTooltip()},zoomToFeatures:function(e,t){let r;Array.isArray(e)?r=e:r=[e.name],t&&this.$refs.scaffold.changeActiveByName(r,"",!1),this.$refs.scaffold.viewRegion(r)},highlightFeatures:function(e){let t;Array.isArray(e)?t=e:t=[e.name],this.$refs.scaffold.changeHighlightedByName(t,"",!1)},scaffoldIsReady:function(){if(this.scaffoldLoaded=!0,this.$refs.scaffold.$module.graphicsHighlight.highlightColour=[1,0,1],this.isVisible()){let e="free";this.entry.rotation&&(e=this.entry.rotation),this.$refs.scaffold.toggleSyncControl(this.splitFlowStore.globalCallback,e),this.splitFlowStore.syncMode&&this.$refs.scaffold.fitWindow()}},requestSynchronisedEvent:function(e){if(this.scaffoldLoaded){let t="free";this.entry.rotation&&(t=this.entry.rotation),this.$refs.scaffold.toggleSyncControl(e,t)}},scaffoldHighlighted:function(e,t){const r={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0};t&&t[0]&&(r.internalName=t[0].data.id,r.eventType="highlighted"),this.$emit("resource-selected",r)},scaffoldNavigated:function(e,t){if(this.mouseHovered){const r={paneIndex:this.entry.id,eventType:"panZoom",payload:t,type:e};this.$emit("resource-selected",r)}},updateWithViewUrl:function(e){this.$refs.scaffold.updateViewURL(e)}},computed:{warningMessage:function(){return this.entry.isBodyScaffold?"This map displays the anatomical location and connectivity of nerves, through which the neuron populations from the ApiNATOMY models available in SCKAN can be routed.":"Under active development"},markerLabels:function(){return this.settingsStore.facetLabels}},data:function(){return{apiLocation:process.env.VUE_APP_API_LOCATION,scaffoldCamera:void 0,scaffoldLoaded:!1}},mounted:function(){this.scaffoldCamera=this.$refs.scaffold.$module.scene.getZincCameraControls(),Xo.on("startHelp",()=>{this.startHelp()})}};function N8r(e,t,r,n,i,o){const s=a.resolveComponent("ScaffoldVuer");return a.openBlock(),a.createBlock(s,{state:e.entry.state,url:e.entry.resource,region:e.entry.region,onScaffoldSelected:t[0]||(t[0]=l=>e.resourceSelected(e.entry.type,l,!0)),onScaffoldHighlighted:t[1]||(t[1]=l=>o.scaffoldHighlighted(e.entry.type,l)),onScaffoldNavigated:t[2]||(t[2]=l=>o.scaffoldNavigated(e.entry.type,l)),onOnReady:o.scaffoldIsReady,onOpenMap:e.openMap,ref:"scaffold","background-toggle":!0,traditional:!0,"help-mode":e.helpMode,render:e.visible,"display-latest-message":!0,"warning-message":o.warningMessage,"display-minimap":!1,"display-markers":!1,enableOpenMapUI:!0,"view-u-r-l":e.entry.viewUrl,markerLabels:o.markerLabels,flatmapAPI:e.flatmapAPI},null,8,["state","url","region","onOnReady","onOpenMap","help-mode","render","warning-message","view-u-r-l","markerLabels","flatmapAPI"])}const R8r=Gl(P8r,[["render",N8r],["__scopeId","data-v-4a090bca"]]),Wp=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var KVe;const Ml=typeof window<"u",B8r=e=>typeof e=="string",XVe=()=>{},D8r=Ml&&((KVe=window==null?void 0:window.navigator)==null?void 0:KVe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function JVe(e){return typeof e=="function"?e():a.unref(e)}function F8r(e){return e}function jB(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function z8r(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function Kp(e){var t;const r=JVe(e);return(t=r==null?void 0:r.$el)!=null?t:r}const UB=Ml?window:void 0;function J5(...e){let t,r,n,i;if(B8r(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=UB):[t,r,n,i]=e,!t)return XVe;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,p,h,f)=>(d.addEventListener(p,h,f),()=>d.removeEventListener(p,h,f)),c=a.watch(()=>[Kp(t),JVe(i)],([d,p])=>{s(),d&&o.push(...r.flatMap(h=>n.map(f=>l(d,h,f,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return jB(u),u}let YVe=!1;function j8r(e,t,r={}){const{window:n=UB,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;D8r&&!YVe&&(YVe=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",XVe)));let l=!0;const c=d=>i.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(h=>h===d.target||d.composedPath().includes(h));{const h=Kp(p);return h&&(d.target===h||d.composedPath().includes(h))}}),u=[J5(n,"click",d=>{const p=Kp(e);if(!(!p||p===d.target||d.composedPath().includes(p))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),J5(n,"pointerdown",d=>{const p=Kp(e);p&&(l=!d.composedPath().includes(p)&&!c(d))},{passive:!0}),s&&J5(n,"blur",d=>{var p;const h=Kp(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function $Ve(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),z8r(n,t),r}const eIe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},tIe="__vueuse_ssr_handlers__";eIe[tIe]=eIe[tIe]||{};var rIe=Object.getOwnPropertySymbols,U8r=Object.prototype.hasOwnProperty,G8r=Object.prototype.propertyIsEnumerable,q8r=(e,t)=>{var r={};for(var n in e)U8r.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rIe)for(var n of rIe(e))t.indexOf(n)<0&&G8r.call(e,n)&&(r[n]=e[n]);return r};function Xp(e,t,r={}){const n=r,{window:i=UB}=n,o=q8r(n,["window"]);let s;const l=$Ve(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>Kp(e),p=>{c(),l.value&&i&&p&&(s=new ResizeObserver(t),s.observe(p,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return jB(d),{isSupported:l,stop:d}}var nIe=Object.getOwnPropertySymbols,Z8r=Object.prototype.hasOwnProperty,W8r=Object.prototype.propertyIsEnumerable,K8r=(e,t)=>{var r={};for(var n in e)Z8r.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nIe)for(var n of nIe(e))t.indexOf(n)<0&&W8r.call(e,n)&&(r[n]=e[n]);return r};function X8r(e,t,r={}){const n=r,{window:i=UB}=n,o=K8r(n,["window"]);let s;const l=$Ve(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>Kp(e),p=>{c(),l.value&&i&&p&&(s=new MutationObserver(t),s.observe(p,o))},{immediate:!0}),d=()=>{c(),u()};return jB(d),{isSupported:l,stop:d}}var iIe;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(iIe||(iIe={}));var J8r=Object.defineProperty,oIe=Object.getOwnPropertySymbols,Y8r=Object.prototype.hasOwnProperty,$8r=Object.prototype.propertyIsEnumerable,aIe=(e,t,r)=>t in e?J8r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,emr=(e,t)=>{for(var r in t||(t={}))Y8r.call(t,r)&&aIe(e,r,t[r]);if(oIe)for(var r of oIe(t))$8r.call(t,r)&&aIe(e,r,t[r]);return e};emr({linear:F8r},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const tmr=()=>Ml&&/firefox/i.test(window.navigator.userAgent);/**
4719
+ `),L="",w="",k=0,C=[],A=typeof"".trimLeft=="function",O=0,N=b.length;O<N;O++)if(L=b[O],L=A?L.trimLeft():L.trim(),k=L.length,k!==0&&(w=L.charAt(0),w!=="#"))if(w==="v"){var I=L.split(/\s+/);switch(I[0]){case"v":_.vertices.push(parseFloat(I[1]),parseFloat(I[2]),parseFloat(I[3])),7<=I.length?_.colors.push(parseFloat(I[4]),parseFloat(I[5]),parseFloat(I[6])):_.colors.push(void 0,void 0,void 0);break;case"vn":_.normals.push(parseFloat(I[1]),parseFloat(I[2]),parseFloat(I[3]));break;case"vt":_.uvs.push(parseFloat(I[1]),parseFloat(I[2]))}}else if(w==="f"){for(var B,F=L.substr(1).trim(),j=F.split(/\s+/),G=[],P=0,Z=j.length;P<Z;P++)if(B=j[P],0<B.length){var K=B.split("/");G.push(K)}for(var U=G[0],X=1,ee=G.length-1;X<ee;X++){var oe=G[X],he=G[X+1];_.addFace(U[0],oe[0],he[0],U[1],oe[1],he[1],U[2],oe[2],he[2])}}else if(w==="l"){var me=L.substring(1).trim().split(" "),ie=[],be=[];if(L.indexOf("/")===-1)ie=me;else for(var re,ue=0,ne=me.length;ue<ne;ue++)re=me[ue].split("/"),re[0]!==""&&ie.push(re[0]),re[1]!==""&&be.push(re[1]);_.addLineGeometry(ie,be)}else if(w==="p"){var ye=L.substr(1).trim(),_e=ye.split(" ");_.addPointGeometry(_e)}else if((C=s.exec(L))!==null){var Ie=(" "+C[0].substr(1).trim()).substr(1);_.startObject(Ie)}else if(c.test(L))_.object.startMaterial(L.substring(7).trim(),_.materialLibraries);else if(l.test(L))_.materialLibraries.push(L.substring(7).trim());else if(u.test(L))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(w==="s"){if(C=L.split(" "),1<C.length){var qe=C[1].trim().toLowerCase();_.object.smooth=qe!=="0"&&qe!=="off"}else _.object.smooth=!0;var Ge=_.object.currentMaterial();Ge&&(Ge.smooth=_.object.smooth)}else{if(L==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+L+'"')}_.finalize();var et=new o.Group;et.materialLibraries=[].concat(_.materialLibraries);var Ve=_.objects.length!==1||_.objects[0].geometry.vertices.length!==0;if(Ve==!0)for(var Ne=0,it=_.objects.length;Ne<it;Ne++){var Be=_.objects[Ne],pt=Be.geometry,yt=Be.materials,ct=pt.type==="Line",xe=pt.type==="Points",Ue=!1;if(pt.vertices.length!==0){var $e=new o.BufferGeometry;$e.setAttribute("position",new o.Float32BufferAttribute(pt.vertices,3)),0<pt.normals.length&&$e.setAttribute("normal",new o.Float32BufferAttribute(pt.normals,3)),0<pt.colors.length&&(Ue=!0,$e.setAttribute("color",new o.Float32BufferAttribute(pt.colors,3))),pt.hasUVIndices===!0&&$e.setAttribute("uv",new o.Float32BufferAttribute(pt.uvs,2));for(var at=[],Ht=0,Vt=yt.length;Ht<Vt;Ht++){var Dt=yt[Ht],Gt=Dt.name+"_"+Dt.smooth+"_"+Ue,Je=_.materials[Gt];if(this.materials!==null){if(Je=this.materials.create(Dt.name),ct&&Je&&!(Je instanceof o.LineBasicMaterial)){var ft=new o.LineBasicMaterial;o.Material.prototype.copy.call(ft,Je),ft.color.copy(Je.color),Je=ft}else if(xe&&Je&&!(Je instanceof o.PointsMaterial)){var St=new o.PointsMaterial({size:10,sizeAttenuation:!1});o.Material.prototype.copy.call(St,Je),St.color.copy(Je.color),St.map=Je.map,Je=St}}Je===void 0&&(Je=ct?new o.LineBasicMaterial:xe?new o.PointsMaterial({size:1,sizeAttenuation:!1}):new o.MeshPhongMaterial,Je.name=Dt.name,Je.flatShading=!Dt.smooth,Je.vertexColors=Ue,_.materials[Gt]=Je),at.push(Je)}var Wt=void 0;if(1<at.length){for(var Jt,Pt=0,rt=yt.length;Pt<rt;Pt++)Jt=yt[Pt],$e.addGroup(Jt.groupStart,Jt.groupCount,Pt);Wt=ct?new o.LineSegments($e,at):xe?new o.Points($e,at):new o.Mesh($e,at)}else Wt=ct?new o.LineSegments($e,at[0]):xe?new o.Points($e,at[0]):new o.Mesh($e,at[0]);Wt.name=Be.name,et.add(Wt)}}else if(0<_.vertices.length){var Et=new o.PointsMaterial({size:1,sizeAttenuation:!1}),kt=new o.BufferGeometry;kt.setAttribute("position",new o.Float32BufferAttribute(_.vertices,3)),0<_.colors.length&&_.colors[0]!==void 0&&(kt.setAttribute("color",new o.Float32BufferAttribute(_.colors,3)),Et.vertexColors=!0);var or=new o.Points(kt,Et);et.add(or)}return et}}},function(r,n,i){var o=i(14).JSONLoader;n.PrimitivesLoader=function(){var s=0;this.crossOrigin="Anonymous";var l=new o,c=[];this.load=(d,p,h,f)=>{if(20>s){++s,l.crossOrigin=this.crossOrigin;var m=new u(p,this),g=new u(f,this);l.load(d,m,h,g)}else c.push({url:d,onLoad:p,onProgress:h,onError:f})},this.loadFromWaitingList=()=>{var d=c.shift();d&&this.load(d.url,d.onLoad,d.onProgress,d.onError)};var u=function(d,p){return function(){--s,d(...arguments),p.loadFromWaitingList()}};this.parse=d=>l.parse(d)}},function(r,n,i){i(3);var o=i(36).GLTFLoader,s=function(){var l=this;this.parseGLTFObjects=(c,u,d,p)=>{var h=u;if(d!==0){if(c.type!=="Object3D"){var f;if(c.type==="Mesh"?f=new(i(2)).Geometry:c.type==="LineSegments"?f=new(i(20)).Lines:c.type==="Points"&&(f=new(i(17)).Pointset),f){var m=!1,g=!1;c.geometry&&c.geometry.morphAttributes&&(m=!!c.geometry.morphAttributes.position,g=!!c.geometry.morphAttributes.color),f.setMesh(c.clone(),m,g),u.addZincObject(f),f.groupName=f.morph.name,f.morph.matrixAutoUpdate=!0,p!=null&&typeof p=="function"&&p(f)}}else if(c.name!==""&&(u&&(h=u.findOrCreateChildFromPath(c.name)),h)){var T=h.getGroup();T.position.copy(c.position),T.rotation.copy(c.rotation),T.quaternion.copy(c.quaternion),T.matrixAutoUpdate=!0}}d++,c.children.forEach(y=>{l.parseGLTFObjects(y,h,d,p)})},this.setCamera=c=>{c.viewAll();var u=c.getZincCameraControls(),d=u.getCurrentViewport();u.addViewport("default",d),u.setDefaultViewport("default")},this.load=(c,u,d,p,h)=>{var f=d.substring(0,d.lastIndexOf("/")+1),m=d.substring(d.lastIndexOf("/")+1,d.length),g=new o().setPath(f);g.load(m,function(T){console.log(T),l.parseGLTFObjects(T.scene,u,0,p),l.setCamera(c),h!=null&&typeof h=="function"&&h()})}};n.GLTFToZincJSLoader=s},function(r,n){r.exports=n8r},function(r,n,i){var o=i(38).GLTFExporter,s=function(l){var c=l;this.exportGLTF=u=>{var d=c.getRootRegion(),p=d.getAllObjects(!0),h=[];p.forEach(g=>{g.animationClip&&h.push({clip:g.animationClip[0],mesh:g.morph})});var f=new o,m={binary:u,animations:h};return new Promise(g=>{f.parse(c.getThreeJSScene(),function(T){g(T)},m)})}};n.SceneExporter=s},function(r,n,i){i.r(n),i.d(n,"GLTFExporter",function(){return s});var o=i(3);class s{constructor(){this.pluginCallbacks=[],this.register(function(I){return new C(I)}),this.register(function(I){return new A(I)}),this.register(function(I){return new O(I)})}register(I){return this.pluginCallbacks.indexOf(I)===-1&&this.pluginCallbacks.push(I),this}unregister(I){return this.pluginCallbacks.indexOf(I)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(I),1),this}parse(I,B,F){for(var j=new k,G=[],P=0,Z=this.pluginCallbacks.length;P<Z;P++)G.push(this.pluginCallbacks[P](j));j.setPlugins(G),j.write(I,B,F)}}var l={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},c={};c[o.NearestFilter]=l.NEAREST,c[o.NearestMipmapNearestFilter]=l.NEAREST_MIPMAP_NEAREST,c[o.NearestMipmapLinearFilter]=l.NEAREST_MIPMAP_LINEAR,c[o.LinearFilter]=l.LINEAR,c[o.LinearMipmapNearestFilter]=l.LINEAR_MIPMAP_NEAREST,c[o.LinearMipmapLinearFilter]=l.LINEAR_MIPMAP_LINEAR,c[o.ClampToEdgeWrapping]=l.CLAMP_TO_EDGE,c[o.RepeatWrapping]=l.REPEAT,c[o.MirroredRepeatWrapping]=l.MIRRORED_REPEAT;var u={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},d=12,p=1179937895,h=2,f=8,m=1313821514,g=5130562;function T(N,I){return N.length===I.length&&N.every(function(B,F){return B===I[F]})}function y(N){if(window.TextEncoder!==void 0)return new TextEncoder().encode(N).buffer;for(var I,B=new Uint8Array(new ArrayBuffer(N.length)),F=0,j=N.length;F<j;F++)I=N.charCodeAt(F),B[F]=255<I?32:I;return B.buffer}function v(N){return T(N.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function _(N,I,B){for(var F={min:Array(N.itemSize).fill(Number.POSITIVE_INFINITY),max:Array(N.itemSize).fill(Number.NEGATIVE_INFINITY)},j=I;j<I+B;j++)for(var G,P=0;P<N.itemSize;P++)G=void 0,4<N.itemSize?G=N.array[j*N.itemSize+P]:P===0?G=N.getX(j):P===1?G=N.getY(j):P===2?G=N.getZ(j):P==3&&(G=N.getW(j)),F.min[P]=Math.min(F.min[P],G),F.max[P]=Math.max(F.max[P],G);return F}function b(N){return 4*Math.ceil(N/4)}function L(N){var I=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,B=b(N.byteLength);if(B!==N.byteLength){var F=new Uint8Array(B);if(F.set(new Uint8Array(N)),I!==0)for(var j=N.byteLength;j<B;j++)F[j]=I;return F.buffer}return N}var w=null;class k{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(I){this.plugins=I}write(I,B,F){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},F),0<this.options.animations.length&&(this.options.trs=!0),this.processInput(I);var j=this;Promise.all(this.pending).then(function(){var G=j.buffers,P=j.json,Z=j.options,K=j.extensionsUsed,U=new Blob(G,{type:"application/octet-stream"}),X=Object.keys(K);if(0<X.length&&(P.extensionsUsed=X),P.buffers&&0<P.buffers.length&&(P.buffers[0].byteLength=U.size),Z.binary===!0){var ee=new window.FileReader;ee.readAsArrayBuffer(U),ee.onloadend=function(){var he=L(ee.result),me=new DataView(new ArrayBuffer(f));me.setUint32(0,he.byteLength,!0),me.setUint32(4,g,!0);var ie=L(y(JSON.stringify(P)),32),be=new DataView(new ArrayBuffer(f));be.setUint32(0,ie.byteLength,!0),be.setUint32(4,m,!0);var re=new ArrayBuffer(d),ue=new DataView(re);ue.setUint32(0,p,!0),ue.setUint32(4,h,!0);var ne=d+be.byteLength+ie.byteLength+me.byteLength+he.byteLength;ue.setUint32(8,ne,!0);var ye=new Blob([re,be,ie,me,he],{type:"application/octet-stream"}),_e=new window.FileReader;_e.readAsArrayBuffer(ye),_e.onloadend=function(){B(_e.result)}}}else if(P.buffers&&0<P.buffers.length){var oe=new window.FileReader;oe.readAsDataURL(U),oe.onloadend=function(){var he=oe.result;P.buffers[0].uri=he,B(P)}}else B(P)})}serializeUserData(I,B){if(!(I.userData&&I.userData.isZincObject)&&Object.keys(I.userData).length!==0){var F=this.options,j=this.extensionsUsed;try{var G=JSON.parse(JSON.stringify(I.userData));if(F.includeCustomExtensions&&G.gltfExtensions){for(var P in B.extensions===void 0&&(B.extensions={}),G.gltfExtensions)B.extensions[P]=G.gltfExtensions[P],j[P]=!0;delete G.gltfExtensions}0<Object.keys(G).length&&(B.extras=G)}catch(Z){console.warn("THREE.GLTFExporter: userData of '"+I.name+"' won't be serialized because of JSON.stringify error - "+Z.message)}}}getUID(I){return this.uids.has(I)||this.uids.set(I,this.uid++),this.uids.get(I)}isNormalizedNormalAttribute(I){var B=this.cache;if(B.attributesNormalized.has(I))return!1;for(var F=new o.Vector3,j=0,G=I.count;j<G;j++)if(5e-4<Math.abs(F.fromBufferAttribute(I,j).length()-1))return!1;return!0}createNormalizedNormalAttribute(I){var B=this.cache;if(B.attributesNormalized.has(I))return B.attributesNormalized.get(I);for(var F=I.clone(),j=new o.Vector3,G=0,P=F.count;G<P;G++)j.fromBufferAttribute(F,G),j.x===0&&j.y===0&&j.z===0?j.setX(1):j.normalize(),F.setXYZ(G,j.x,j.y,j.z);return B.attributesNormalized.set(I,F),F}applyTextureTransform(I,B){var F=!1,j={};(B.offset.x!==0||B.offset.y!==0)&&(j.offset=B.offset.toArray(),F=!0),B.rotation!==0&&(j.rotation=B.rotation,F=!0),(B.repeat.x!==1||B.repeat.y!==1)&&(j.scale=B.repeat.toArray(),F=!0),F&&(I.extensions=I.extensions||{},I.extensions.KHR_texture_transform=j,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(I){var B=this.json,F=this.buffers;return B.buffers||(B.buffers=[{byteLength:0}]),F.push(I),0}processBufferView(I,B,F,j,G){var P=this.json;P.bufferViews||(P.bufferViews=[]);for(var Z=B===l.UNSIGNED_BYTE?1:B===l.UNSIGNED_SHORT?2:4,K=b(j*I.itemSize*Z),U=new DataView(new ArrayBuffer(K)),X=0,ee=F;ee<F+j;ee++)for(var oe,he=0;he<I.itemSize;he++)oe=void 0,4<I.itemSize?oe=I.array[ee*I.itemSize+he]:he===0?oe=I.getX(ee):he===1?oe=I.getY(ee):he===2?oe=I.getZ(ee):he==3&&(oe=I.getW(ee)),B===l.FLOAT?U.setFloat32(X,oe,!0):B===l.UNSIGNED_INT?U.setUint32(X,oe,!0):B===l.UNSIGNED_SHORT?U.setUint16(X,oe,!0):B===l.UNSIGNED_BYTE&&U.setUint8(X,oe),X+=Z;var me={buffer:this.processBuffer(U.buffer),byteOffset:this.byteOffset,byteLength:K};G!==void 0&&(me.target=G),G===l.ARRAY_BUFFER&&(me.byteStride=I.itemSize*Z),this.byteOffset+=K,P.bufferViews.push(me);var ie={id:P.bufferViews.length-1,byteLength:0};return ie}processBufferViewImage(I){var B=this,F=B.json;return F.bufferViews||(F.bufferViews=[]),new Promise(function(j){var G=new window.FileReader;G.readAsArrayBuffer(I),G.onloadend=function(){var P=L(G.result),Z={buffer:B.processBuffer(P),byteOffset:B.byteOffset,byteLength:P.byteLength};B.byteOffset+=P.byteLength,j(F.bufferViews.push(Z)-1)}})}processAccessor(I,B,F,j){var G,P=this.options,Z=this.json;if(I.array.constructor===Float32Array)G=l.FLOAT;else if(I.array.constructor===Uint32Array)G=l.UNSIGNED_INT;else if(I.array.constructor===Uint16Array)G=l.UNSIGNED_SHORT;else if(I.array.constructor===Uint8Array)G=l.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");if(F===void 0&&(F=0),j===void 0&&(j=I.count),P.truncateDrawRange&&B!==void 0&&B.index===null){var K=F+j,U=B.drawRange.count===1/0?I.count:B.drawRange.start+B.drawRange.count;F=Math.max(F,B.drawRange.start),j=Math.min(K,U)-F,0>j&&(j=0)}if(j===0)return null;var X,ee=_(I,F,j);B!==void 0&&(X=I===B.index?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER);var oe=this.processBufferView(I,G,F,j,X),he={bufferView:oe.id,byteOffset:oe.byteOffset,componentType:G,count:j,max:ee.max,min:ee.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[I.itemSize]};return I.normalized===!0&&(he.normalized=!0),Z.accessors||(Z.accessors=[]),Z.accessors.push(he)-1}processImage(I,B,F){var j=this,G=j.cache,P=j.json,Z=j.options,K=j.pending;G.images.has(I)||G.images.set(I,{});var U=G.images.get(I),X=B===o.RGBAFormat?"image/png":"image/jpeg",ee=X+":flipY/"+F.toString();if(U[ee]!==void 0)return U[ee];P.images||(P.images=[]);var oe={mimeType:X};if(Z.embedImages){var he=w=w||document.createElement("canvas");he.width=Math.min(I.width,Z.maxTextureSize),he.height=Math.min(I.height,Z.maxTextureSize);var me=he.getContext("2d");if(F===!0&&(me.translate(0,he.height),me.scale(1,-1)),typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&I instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&I instanceof ImageBitmap)me.drawImage(I,0,0,he.width,he.height);else{B!==o.RGBAFormat&&B!==o.RGBFormat&&console.error("GLTFExporter: Only RGB and RGBA formats are supported."),(I.width>Z.maxTextureSize||I.height>Z.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",I);var ie=new Uint8ClampedArray(4*(I.height*I.width));if(B===o.RGBAFormat)for(var be=0;be<ie.length;be+=4)ie[be+0]=I.data[be+0],ie[be+1]=I.data[be+1],ie[be+2]=I.data[be+2],ie[be+3]=I.data[be+3];else for(var re=0,ue=0;re<ie.length;re+=4,ue+=3)ie[re+0]=I.data[ue+0],ie[re+1]=I.data[ue+1],ie[re+2]=I.data[ue+2],ie[re+3]=255;me.putImageData(new ImageData(ie,I.width,I.height),0,0)}Z.binary===!0?K.push(new Promise(function(ye){he.toBlob(function(_e){j.processBufferViewImage(_e).then(function(Ie){oe.bufferView=Ie,ye()})},X)})):oe.uri=he.toDataURL(X)}else oe.uri=I.src;var ne=P.images.push(oe)-1;return U[ee]=ne,ne}processSampler(I){var B=this.json;B.samplers||(B.samplers=[]);var F={magFilter:c[I.magFilter],minFilter:c[I.minFilter],wrapS:c[I.wrapS],wrapT:c[I.wrapT]};return B.samplers.push(F)-1}processTexture(I){var B=this.cache,F=this.json;if(B.textures.has(I))return B.textures.get(I);F.textures||(F.textures=[]);var j={sampler:this.processSampler(I),source:this.processImage(I.image,I.format,I.flipY)};I.name&&(j.name=I.name),this._invokeAll(function(P){P.writeTexture&&P.writeTexture(I,j)});var G=F.textures.push(j)-1;return B.textures.set(I,G),G}processMaterial(I){var B=this.cache,F=this.json;if(B.materials.has(I))return B.materials.get(I);if(I.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;F.materials||(F.materials=[]);var j={pbrMetallicRoughness:{}};I.isMeshStandardMaterial!==!0&&I.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");var G=I.color.toArray().concat([I.opacity]);if(T(G,[1,1,1,1])||(j.pbrMetallicRoughness.baseColorFactor=G),I.isMeshStandardMaterial?(j.pbrMetallicRoughness.metallicFactor=I.metalness,j.pbrMetallicRoughness.roughnessFactor=I.roughness):(j.pbrMetallicRoughness.metallicFactor=.5,j.pbrMetallicRoughness.roughnessFactor=.5),I.metalnessMap||I.roughnessMap)if(I.metalnessMap===I.roughnessMap){var P={index:this.processTexture(I.metalnessMap)};this.applyTextureTransform(P,I.metalnessMap),j.pbrMetallicRoughness.metallicRoughnessTexture=P}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if(I.map){var Z={index:this.processTexture(I.map)};this.applyTextureTransform(Z,I.map),j.pbrMetallicRoughness.baseColorTexture=Z}if(I.emissive){var K=I.emissive.clone().multiplyScalar(I.emissiveIntensity),U=Math.max(K.r,K.g,K.b);if(1<U&&(K.multiplyScalar(1/U),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),0<U&&(j.emissiveFactor=K.toArray()),I.emissiveMap){var X={index:this.processTexture(I.emissiveMap)};this.applyTextureTransform(X,I.emissiveMap),j.emissiveTexture=X}}if(I.normalMap){var ee={index:this.processTexture(I.normalMap)};I.normalScale&&I.normalScale.x!==-1&&(I.normalScale.x!==I.normalScale.y&&console.warn("THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X."),ee.scale=I.normalScale.x),this.applyTextureTransform(ee,I.normalMap),j.normalTexture=ee}if(I.aoMap){var oe={index:this.processTexture(I.aoMap),texCoord:1};I.aoMapIntensity!==1&&(oe.strength=I.aoMapIntensity),this.applyTextureTransform(oe,I.aoMap),j.occlusionTexture=oe}I.transparent?j.alphaMode="BLEND":0<I.alphaTest&&(j.alphaMode="MASK",j.alphaCutoff=I.alphaTest),I.side===o.DoubleSide&&(j.doubleSided=!0),I.name!==""&&(j.name=I.name),this.serializeUserData(I,j),this._invokeAll(function(me){me.writeMaterial&&me.writeMaterial(I,j)});var he=F.materials.push(j)-1;return B.materials.set(I,he),he}processMesh(I){var B=this.cache,F=this.json,j=[I.geometry.uuid];if(Array.isArray(I.material))for(var G=0,P=I.material.length;G<P;G++)j.push(I.material[G].uuid);else j.push(I.material.uuid);var Z=j.join(":");if(B.meshes.has(Z))return B.meshes.get(Z);var K,U=I.geometry;if(K=I.isLineSegments?l.LINES:I.isLineLoop?l.LINE_LOOP:I.isLine?l.LINE_STRIP:I.isPoints?l.POINTS:I.material.wireframe?l.LINES:l.TRIANGLES,U.isBufferGeometry!==!0)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");var X={},ee={},oe=[],he=[],me={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},ie=U.getAttribute("normal");ie===void 0||this.isNormalizedNormalAttribute(ie)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),U.setAttribute("normal",this.createNormalizedNormalAttribute(ie)));var be=null;for(var re in U.attributes)if(re.substr(0,5)!=="morph"){var ue=U.attributes[re];re=me[re]||re.toUpperCase();var ne=/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;if(ne.test(re)||(re="_"+re),B.attributes.has(this.getUID(ue))){ee[re]=B.attributes.get(this.getUID(ue));continue}be=null;var ye=ue.array;re!=="JOINTS_0"||ye instanceof Uint16Array||ye instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),be=new o.BufferAttribute(new Uint16Array(ye),ue.itemSize,ue.normalized));var _e=this.processAccessor(be||ue,U);_e!==null&&(ee[re]=_e,B.attributes.set(this.getUID(ue),_e))}if(ie!==void 0&&U.setAttribute("normal",ie),Object.keys(ee).length===0)return null;if(I.morphTargetInfluences!==void 0&&0<I.morphTargetInfluences.length){var Ie=[],qe=[],Ge={};if(I.morphTargetDictionary!==void 0)for(var et in I.morphTargetDictionary)Ge[I.morphTargetDictionary[et]]=et;for(var Ve=0;Ve<I.morphTargetInfluences.length;++Ve){var Ne={},it=!1;for(var Be in U.morphAttributes){if(Be!="position"&&Be!=="normal"&&Be!=="color"){it||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),it=!0);continue}var pt=U.morphAttributes[Be][Ve],yt=Be.toUpperCase();me[Be]&&(yt=me[Be]);var ct=U.attributes[Be];if(B.attributes.has(this.getUID(pt))){Ne[yt]=B.attributes.get(this.getUID(pt));continue}var xe=ct.clone();if(!U.morphTargetsRelative)if(ct)for(var Ue=0,$e=pt.count;Ue<$e;Ue++)ct.count>Ue&&xe.setXYZ(Ue,pt.getX(Ue)-ct.getX(Ue),pt.getY(Ue)-ct.getY(Ue),pt.getZ(Ue)-ct.getZ(Ue));else for(var at=0,Ht=pt.count;at<Ht;at++)xe.setXYZ(at,0,0,0);Ne[yt]=this.processAccessor(xe,U),B.attributes.set(this.getUID(ct),Ne[yt])}he.push(Ne),Ie.push(I.morphTargetInfluences[Ve]),I.morphTargetDictionary!==void 0&&qe.push(Ge[Ve])}X.weights=Ie,0<qe.length&&(X.extras={},X.extras.targetNames=qe)}var Vt=Array.isArray(I.material);if(Vt&&U.groups.length===0)return null;for(var Dt,Gt=Vt?I.material:[I.material],Je=Vt?U.groups:[{materialIndex:0,start:void 0,count:void 0}],ft=0,St=Je.length;ft<St;ft++){if(Dt={mode:K,attributes:ee},this.serializeUserData(U,Dt),0<he.length&&(Dt.targets=he),U.index!==null){var Wt=this.getUID(U.index);(Je[ft].start!==void 0||Je[ft].count!==void 0)&&(Wt+=":"+Je[ft].start+":"+Je[ft].count),B.attributes.has(Wt)?Dt.indices=B.attributes.get(Wt):(Dt.indices=this.processAccessor(U.index,U,Je[ft].start,Je[ft].count),B.attributes.set(Wt,Dt.indices)),Dt.indices===null&&delete Dt.indices}var Jt=this.processMaterial(Gt[Je[ft].materialIndex]);Jt!==null&&(Dt.material=Jt),oe.push(Dt)}X.primitives=oe,F.meshes||(F.meshes=[]),this._invokeAll(function(rt){rt.writeMesh&&rt.writeMesh(I,X)});var Pt=F.meshes.push(X)-1;return B.meshes.set(Z,Pt),Pt}processCamera(I){var B=this.json;B.cameras||(B.cameras=[]);var F=I.isOrthographicCamera,j={type:F?"orthographic":"perspective"};return F?j.orthographic={xmag:2*I.right,ymag:2*I.top,zfar:0>=I.far?.001:I.far,znear:0>I.near?0:I.near}:j.perspective={aspectRatio:I.aspect,yfov:o.MathUtils.degToRad(I.fov),zfar:0>=I.far?.001:I.far,znear:0>I.near?0:I.near},I.name!==""&&(j.name=I.type),B.cameras.push(j)-1}processAnimation(I,B){var F=this.json,j=this.nodeMap;F.animations||(F.animations=[]),I=s.Utils.mergeMorphTargetTracks(I.clone(),B);for(var G=I.tracks,P=[],Z=[],K=0;K<G.length;++K){var U=G[K],X=o.PropertyBinding.parseTrackName(U.name),ee=o.PropertyBinding.findNode(B,X.nodeName),oe=u[X.propertyName];if(X.objectName==="bones"&&(ee.isSkinnedMesh===!0?ee=ee.skeleton.getBoneByName(X.objectIndex):ee=void 0),!ee||!oe)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',U.name),null;var he=U.values.length/U.times.length;oe===u.morphTargetInfluences&&(he/=ee.morphTargetInfluences.length);var me=void 0;U.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(me="CUBICSPLINE",he/=3):U.getInterpolation()===o.InterpolateDiscrete?me="STEP":me="LINEAR",Z.push({input:this.processAccessor(new o.BufferAttribute(U.times,1)),output:this.processAccessor(new o.BufferAttribute(U.values,he)),interpolation:me}),P.push({sampler:Z.length-1,target:{node:j.get(ee),path:oe}})}return F.animations.push({name:I.name||"clip_"+F.animations.length,samplers:Z,channels:P}),F.animations.length-1}processSkin(I){var B=this.json,F=this.nodeMap,j=B.nodes[F.get(I)],G=I.skeleton;if(G===void 0)return null;var P=I.skeleton.bones[0];if(P===void 0)return null;for(var Z=[],K=new Float32Array(16*G.bones.length),U=new o.Matrix4,X=0;X<G.bones.length;++X)Z.push(F.get(G.bones[X])),U.copy(G.boneInverses[X]),U.multiply(I.bindMatrix).toArray(K,16*X);B.skins===void 0&&(B.skins=[]),B.skins.push({inverseBindMatrices:this.processAccessor(new o.BufferAttribute(K,16)),joints:Z,skeleton:F.get(P)});var ee=j.skin=B.skins.length-1;return ee}processNode(I){var B=this.json,F=this.options,j=this.nodeMap;B.nodes||(B.nodes=[]);var G={};if(F.trs){var P=I.quaternion.toArray(),Z=I.position.toArray(),K=I.scale.toArray();T(P,[0,0,0,1])||(G.rotation=P),T(Z,[0,0,0])||(G.translation=Z),T(K,[1,1,1])||(G.scale=K)}else I.matrixAutoUpdate&&I.updateMatrix(),v(I.matrix)===!1&&(G.matrix=I.matrix.elements);if(I.name!==""&&(G.name=I.name+""),this.serializeUserData(I,G),I.isMesh||I.isLine||I.isPoints){var U=this.processMesh(I);U!==null&&(G.mesh=U)}else I.isCamera&&(G.camera=this.processCamera(I));if(I.isSkinnedMesh&&this.skins.push(I),0<I.children.length){for(var X,ee=[],oe=0,he=I.children.length;oe<he;oe++)if(X=I.children[oe],X.visible||F.onlyVisible===!1){var me=this.processNode(X);me!==null&&ee.push(me)}0<ee.length&&(G.children=ee)}this._invokeAll(function(be){be.writeNode&&be.writeNode(I,G)});var ie=B.nodes.push(G)-1;return j.set(I,ie),ie}processScene(I){var B=this.json,F=this.options;B.scenes||(B.scenes=[],B.scene=0);var j={};I.name!==""&&(j.name=I.name),B.scenes.push(j);for(var G,P=[],Z=0,K=I.children.length;Z<K;Z++)if(G=I.children[Z],G.visible||F.onlyVisible===!1){var U=this.processNode(G);U!==null&&P.push(U)}0<P.length&&(j.nodes=P),this.serializeUserData(I,j)}processObjects(I){var B=new o.Scene;B.name="AuxScene";for(var F=0;F<I.length;F++)B.children.push(I[F]);this.processScene(B)}processInput(I){var B=this.options;I=I instanceof Array?I:[I],this._invokeAll(function(Z){Z.beforeParse&&Z.beforeParse(I)});for(var F=[],j=0;j<I.length;j++)I[j]instanceof o.Scene?this.processScene(I[j]):F.push(I[j]);0<F.length&&this.processObjects(F);for(var G=0;G<this.skins.length;++G)this.processSkin(this.skins[G]);for(var P=0;P<B.animations.length;++P)this.processAnimation(B.animations[P].clip,B.animations[P].mesh);this._invokeAll(function(Z){Z.afterParse&&Z.afterParse(I)})}_invokeAll(I){for(var B=0,F=this.plugins.length;B<F;B++)I(this.plugins[B])}}class C{constructor(I){this.writer=I,this.name="KHR_lights_punctual"}writeNode(I,B){if(I.isLight){if(!I.isDirectionalLight&&!I.isPointLight&&!I.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",I);var F=this.writer,j=F.json,G=F.extensionsUsed,P={};I.name&&(P.name=I.name),P.color=I.color.toArray(),P.intensity=I.intensity,I.isDirectionalLight?P.type="directional":I.isPointLight?(P.type="point",0<I.distance&&(P.range=I.distance)):I.isSpotLight&&(P.type="spot",0<I.distance&&(P.range=I.distance),P.spot={},P.spot.innerConeAngle=-1*((I.penumbra-1)*I.angle),P.spot.outerConeAngle=I.angle),I.decay!==void 0&&I.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),I.target&&(I.target.parent!==I||I.target.position.x!==0||I.target.position.y!==0||I.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),G[this.name]||(j.extensions=j.extensions||{},j.extensions[this.name]={lights:[]},G[this.name]=!0);var Z=j.extensions[this.name].lights;Z.push(P),B.extensions=B.extensions||{},B.extensions[this.name]={light:Z.length-1}}}}class A{constructor(I){this.writer=I,this.name="KHR_materials_unlit"}writeMaterial(I,B){if(I.isMeshBasicMaterial){var F=this.writer,j=F.extensionsUsed;B.extensions=B.extensions||{},B.extensions[this.name]={},j[this.name]=!0,B.pbrMetallicRoughness.metallicFactor=0,B.pbrMetallicRoughness.roughnessFactor=.9}}}class O{constructor(I){this.writer=I,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(I,B){if(I.isGLTFSpecularGlossinessMaterial){var F=this.writer,j=F.extensionsUsed,G={};B.pbrMetallicRoughness.baseColorFactor&&(G.diffuseFactor=B.pbrMetallicRoughness.baseColorFactor);var P=[1,1,1];if(I.specular.toArray(P,0),G.specularFactor=P,G.glossinessFactor=I.glossiness,B.pbrMetallicRoughness.baseColorTexture&&(G.diffuseTexture=B.pbrMetallicRoughness.baseColorTexture),I.specularMap){var Z={index:F.processTexture(I.specularMap)};F.applyTextureTransform(Z,I.specularMap),G.specularGlossinessTexture=Z}B.extensions=B.extensions||{},B.extensions[this.name]=G,j[this.name]=!0}}}s.Utils={insertKeyframe:function(N,I){var B,F=.001,j=N.getValueSize(),G=new N.TimeBufferType(N.times.length+1),P=new N.ValueBufferType(N.values.length+j),Z=N.createInterpolant(new N.ValueBufferType(j));if(N.times.length===0){G[0]=I;for(var K=0;K<j;K++)P[K]=0;B=0}else if(I<N.times[0]){if(Math.abs(N.times[0]-I)<F)return 0;G[0]=I,G.set(N.times,1),P.set(Z.evaluate(I),0),P.set(N.values,j),B=0}else if(I>N.times[N.times.length-1]){if(Math.abs(N.times[N.times.length-1]-I)<F)return N.times.length-1;G[G.length-1]=I,G.set(N.times,0),P.set(N.values,0),P.set(Z.evaluate(I),N.values.length),B=G.length-1}else for(var U=0;U<N.times.length;U++){if(Math.abs(N.times[U]-I)<F)return U;if(N.times[U]<I&&N.times[U+1]>I){G.set(N.times.slice(0,U+1),0),G[U+1]=I,G.set(N.times.slice(U+1),U+2),P.set(N.values.slice(0,(U+1)*j),0),P.set(Z.evaluate(I),(U+1)*j),P.set(N.values.slice((U+1)*j),(U+2)*j),B=U+1;break}}return N.times=G,N.values=P,B},mergeMorphTargetTracks:function(N,I){for(var B=[],F={},j=N.tracks,G=0;G<j.length;++G){var P=j[G],Z=o.PropertyBinding.parseTrackName(P.name),K=o.PropertyBinding.findNode(I,Z.nodeName);if(Z.propertyName!=="morphTargetInfluences"||Z.propertyIndex===void 0){B.push(P);continue}if(P.createInterpolant!==P.InterpolantFactoryMethodDiscrete&&P.createInterpolant!==P.InterpolantFactoryMethodLinear){if(P.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),P=P.clone(),P.setInterpolation(o.InterpolateLinear)}var U=K.morphTargetInfluences.length,X=K.morphTargetDictionary[Z.propertyIndex];if(X===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+Z.propertyIndex);var ee=void 0;if(F[K.uuid]===void 0){ee=P.clone();for(var oe=new ee.ValueBufferType(U*ee.times.length),he=0;he<ee.times.length;he++)oe[he*U+X]=ee.values[he];ee.name=(Z.nodeName||"")+".morphTargetInfluences",ee.values=oe,F[K.uuid]=ee,B.push(ee);continue}var me=P.createInterpolant(new P.ValueBufferType(1));ee=F[K.uuid];for(var ie=0;ie<ee.times.length;ie++)ee.values[ie*U+X]=me.evaluate(ee.times[ie]);for(var be,re=0;re<P.times.length;re++)be=this.insertKeyframe(ee,P.times[re]),ee.values[be*U+X]=P.values[re]}return N.tracks=B,N}}},function(r,n,i){var o=i(3),s=i(4).resolveURL,l=function(){this.nearPlane=.168248,this.farPlane=6.82906,this.eyePosition=[.5,-2.86496,.5],this.targetPosition=[.5,.5,.5],this.upVector=[0,0,1];var y=this;this.setFromObject=v=>{var{nearPlane:_,farPlane:b,eyePosition:L,targetPosition:w,upVector:k}=v;y.nearPlane=_,y.farPlane=b,y.eyePosition=L,y.targetPosition=w,y.upVector=k}},c=function(y,v,_,b){var L={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},w={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6},k={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},C={};C.MAIN=w.ROTATE,C.AUXILIARY=w.ZOOM,C.SECONDARY=w.PAN,this.cameraObject=y,this.domElement=v===void 0?document:v,this.renderer=_,this.scene=b,this.tumble_rate=1.5,this.pointer_x=0,this.pointer_y=0,this.pointer_x_start=0,this.pointer_y_start=0,this.previous_pointer_x=0,this.previous_pointer_y=0,this.near_plane_fly_debt=0,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.directionalLight=0,this.scrollRate=50;var A=6e3,O=!0,N=0,I=void 0,B=void 0,F=!1,j=500,G=void 0,P="default",Z=L.DEFAULT,K=void 0,U=void 0,X=void 0,ee=0,oe=k.FREE;this._state=w.NONE;var he;this.targetTouchId=-1;var me=void 0,ie=new o.Vector3,be=new o.Vector3,re=new o.Vector3,ue=new o.Vector3,ne=new o.Vector3,ye=new o.Vector3,_e=new o.Vector3,Ie=new o.Vector3,qe=new o.Sphere,Ge=new o.Vector3,et=void 0,Ve=0,Ne={default:new l};Ne.default.nearPlane=.1,Ne.default.farPlane=2e3,Ne.default.eyePosition=[0,0,0],Ne.default.targetPosition=[0,0,-1],Ne.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new o.Vector3(...Ne.default.targetPosition)),this.calculateMaxAllowedDistance=rt=>{var Et=rt.getBoundingBox();if(Et){Et.getBoundingSphere(qe),Ve=6*qe.radius;var kt=0;this.cameraObject&&(kt=this.cameraObject.position.distanceTo(qe.center)),Ve=kt>Ve?kt:Ve}else Ve=0},this.addViewport=(rt,Et)=>{rt&&Et&&(Ne[rt]=Et)},this.setDefaultViewport=rt=>!!(rt&&rt in Ne)&&(P=rt,!0),this.getDefaultViewport=()=>P,this.getViewportOfName=rt=>Ne[rt],this.setCurrentViewport=rt=>rt in Ne&&(this.setCurrentCameraSettings(Ne[rt]),!0),this.setRotationMode=rt=>{switch(rt){case"none":oe=k.NONE;break;case"horizontal":oe=k.HORIZONTAL;break;case"vertical":oe=k.VERTICAL;break;case"free":default:oe=k.FREE}},this.onResize=()=>{me&&(me=void 0),et&&et.setCurrentCameraSettings(this.cameraObject,Ne[P])},this.getNDCFromDocumentCoords=(rt,Et,kt)=>{Vt(!1);var or=kt||new o.Vector2,$t=2*((rt-me.left)/me.width)-1,wt=2*-((Et-me.top)/me.height)+1;return or.set($t,wt)},this.getRelativeCoordsFromNDC=(rt,Et,kt)=>{Vt(!1);var or=kt||new o.Vector2;return or.x=(rt+1)*me.width/2,or.y=(1-Et)*me.height/2,or},this.setMouseButtonAction=(rt,Et)=>{C[rt]=w[Et]};var it=()=>{if(0<Ve){var rt=Ge.distanceTo(qe.center);return Ve>rt||this.cameraObject.position.distanceTo(qe.center)>rt}return!0},Be=rt=>{Ge.copy(this.cameraObject.position).add(rt),it()&&(this.cameraObject.target.add(rt),this.cameraObject.position.add(rt),this.updateDirectionalLight())},pt=rt=>{Vt(!1);var Et;if(Z===L.DEFAULT&&(Et=this.scene.getNormalisedMinimapCoordinates(this.renderer,rt)),!Et)rt.button==0?rt.ctrlKey?this._state=C.AUXILIARY:rt.shiftKey?this._state=C.SECONDARY:this._state=C.MAIN:rt.button==1?(rt.preventDefault(),this._state=C.AUXILIARY):rt.button==2&&(this._state=C.SECONDARY),this.pointer_x=rt.clientX-me.left,this.pointer_y=rt.clientY-me.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else{Z=L.MINIMAP;var kt=this.scene.getMinimapDiffFromNormalised(Et.x,Et.y);Be(kt)}},yt=rt=>{if(Vt(!1),this.pointer_x=rt.clientX-me.left,this.pointer_y=rt.clientY-me.top,Z===L.MINIMAP){var Et=this.scene.getNormalisedMinimapCoordinates(this.renderer,rt);if(Et){var kt=this.scene.getMinimapDiffFromNormalised(Et.x,Et.y);Be(kt)}}else this._state===w.NONE&&he!==void 0&&he.move(this,rt.clientX,rt.clientY,this.renderer)},ct=rt=>{this._state=w.NONE,Z==L.MINIMAP&&(Z=L.DEFAULT),he!==void 0&&this.pointer_x_start==rt.clientX-me.left&&this.pointer_y_start==rt.clientY-me.top&&he.pick(this,rt.clientX,rt.clientY,this.renderer)},xe=()=>{this._state=w.NONE},Ue=rt=>{Vt(!1);var Et=rt.touches.length;if(Et==1)this._state=w.TOUCH_ROTATE,this.pointer_x=rt.touches[0].clientX-me.left,this.pointer_y=rt.touches[0].clientY-me.top,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y;else if(Et==2){this._state=w.TOUCH_ZOOM;var kt=rt.touches[0].clientX-rt.touches[1].clientX,or=rt.touches[0].clientY-rt.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(kt*kt+or*or)}else Et==3&&(this._state=w.TOUCH_PAN,this.targetTouchId=rt.touches[0].identifier,this.pointer_x=rt.touches[0].clientX-me.left,this.pointer_y=rt.touches[0].clientY-me.top,this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y)},$e=rt=>{rt.preventDefault(),rt.stopPropagation();var Et=rt.touches.length;if(Et==1)this.pointer_x=rt.touches[0].clientX-me.left,this.pointer_y=rt.touches[0].clientY-me.top;else if(Et==2){if(this._state===w.TOUCH_ZOOM){var kt=rt.touches[0].clientX-rt.touches[1].clientX,or=rt.touches[0].clientY-rt.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(kt*kt+or*or)}}else if(Et==3&&this._state===w.TOUCH_PAN)for(var $t=0;3>$t;$t++)rt.touches[$t].identifier==this.targetTouchId&&(this.pointer_x=rt.touches[0].clientX-me.left,this.pointer_y=rt.touches[0].clientY-me.top)},at=rt=>{var Et=rt.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=w.NONE,Et==1&&he!==void 0&&this.pointer_x_start==rt.touches[0].clientX-me.left&&this.pointer_y_start==rt.touches[0].clientY-me.top&&he.pick(this.cameraObject,rt.touches[0].clientX,rt.touches[0].clientY,this.renderer)},Ht=()=>{Vt(!0)},Vt=rt=>{if(rt||me===void 0){var Et=new IntersectionObserver(kt=>{for(var or of kt)me=or.boundingClientRect;Et.disconnect()});Et.observe(this.domElement)}},Dt=rt=>{Vt(!1),this._state=w.SCROLL;var Et=0;0<rt.deltaY?Et=this.scrollRate:0>rt.deltaY&&(Et=-1*this.scrollRate),ee+=Et,rt.preventDefault(),rt.stopImmediatePropagation()},Gt=()=>{if(typeof this.cameraObject<"u"){var rt=me.height,Et=this.cameraObject.position.distanceTo(this.cameraObject.target),kt=0;this.cameraObject.far>this.cameraObject.near&&Et>=this.cameraObject.near&&Et<=this.cameraObject.far&&(kt=(Et-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),be.set(this.previous_pointer_x,rt-this.previous_pointer_y,0),re.set(this.previous_pointer_x,rt-this.previous_pointer_y,1),ue.set(this.pointer_x,rt-this.pointer_y,0),ne.set(this.pointer_x,rt-this.pointer_y,1),be.unproject(this.cameraObject),re.unproject(this.cameraObject),ue.unproject(this.cameraObject),ne.unproject(this.cameraObject),ue.sub(be).multiplyScalar(1-kt),ne.sub(re).multiplyScalar(kt),ue.add(ne).multiplyScalar(-.002),Be(ue)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(rt,Et)=>{rt.normalize(),_e.copy(this.cameraObject.position).sub(this.cameraObject.target),Ie.copy(_e),_e.normalize(),.8<Math.abs(_e.dot(rt))&&_e.copy(this.cameraObject.up),be.crossVectors(rt,_e).normalize(),re.crossVectors(rt,be);var kt=rt.dot(Ie),or=be.dot(Ie),$t=re.dot(Ie),wt=rt.dot(this.cameraObject.up),je=be.dot(this.cameraObject.up),ke=re.dot(this.cameraObject.up),Oe=Math.cos(Et),Ye=Math.sin(Et);return ue.set(Oe*be.x+Ye*re.x,Oe*be.y+Ye*re.y,Oe*be.z+Ye*re.z),ne.set(Oe*re.x-Ye*be.x,Oe*re.y-Ye*be.y,Oe*re.z-Ye*be.z),_e.copy(this.cameraObject.target),_e.x=_e.x+rt.x*kt+ue.x*or+ne.x*$t,_e.y=_e.y+rt.y*kt+ue.y*or+ne.y*$t,_e.z=_e.z+rt.z*kt+ue.z*or+ne.z*$t,ie.set(rt.x*wt+ue.x*je+ne.x*ke,rt.y*wt+ue.y*je+ne.y*ke,rt.z*wt+ue.z*je+ne.z*ke),{position:_e,up:ie}},this.rotateAboutLookAtpoint=(rt,Et)=>{var kt=this.getVectorsFromRotateAboutLookAtPoints(rt,Et);this.cameraObject.position.copy(kt.position),this.updateDirectionalLight(),this.cameraObject.up.copy(kt.up)};var Je=()=>{if(typeof this.cameraObject<"u"){var rt=me.width,Et=me.height;if(0<rt&&0<Et){var kt=.25*(rt+Et),or=0,$t=0;(oe===k.FREE||oe===k.HORIZONTAL)&&(or=this.pointer_x-this.previous_pointer_x),(oe===k.FREE||oe===k.VERTICAL)&&($t=this.previous_pointer_y-this.pointer_y);var wt=Math.sqrt(or*or+$t*$t);if(0<wt){var je=1*-$t/wt,ke=1*or/wt;oe===k.FREE&&je*(this.pointer_x-.5*(rt-1))+ke*(.5*(Et-1)-this.pointer_y);var Oe=Math.acos(0/kt)-.5*Math.PI,Ye=this.tumble_rate*wt/kt;ie.copy(this.cameraObject.position).sub(this.cameraObject.target).normalize(),be.copy(this.cameraObject.up).normalize(),re.copy(be).cross(ie).normalize().multiplyScalar(je),be.multiplyScalar(ke),ye.addVectors(re,be).multiplyScalar(Math.cos(Oe)),ie.multiplyScalar(Math.sin(Oe)),ye.add(ie),this.rotateAboutLookAtpoint(ye,-Ye)}}}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y},ft=()=>{var rt=0;return this._state===w.ZOOM?rt=this.previous_pointer_y-this.pointer_y:this._state===w.SCROLL?rt=ee:(rt=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),rt};this.changeZoomByScrollRateUnit=rt=>{var Et=rt*this.scrollRate;this.changeZoomByValue(Et)},this.changeZoomByValue=rt=>{if(typeof this.cameraObject<"u"){me.width;var Et=me.height,kt=this.cameraObject.position.clone();kt.sub(this.cameraObject.target);var or=kt.length(),$t=1.5*rt/Et;if(.01<or+$t*or&&(kt.normalize(),Ge.copy(this.cameraObject.position),Ge.x+=kt.x*$t*or,Ge.y+=kt.y*$t*or,Ge.z+=kt.z*$t*or,it())){this.cameraObject.position.copy(Ge),this.updateDirectionalLight();var wt=1e-5;if(wt*this.cameraObject.far<this.cameraObject.near+$t*or+this.near_plane_fly_debt)this.near_plane_fly_debt!=0&&(this.near_plane_fly_debt+=$t*or,0<this.near_plane_fly_debt?(this.cameraObject.near+=this.near_plane_fly_debt,this.cameraObject.far+=this.near_plane_fly_debt,this.near_plane_fly_debt=0):(this.cameraObject.near+=$t*or,this.cameraObject.far+=$t*or));else{if(this.near_plane_fly_debt==0){var je=this.cameraObject.near-wt*this.cameraObject.far;this.cameraObject.near=wt*this.cameraObject.far,this.cameraObject.far-=je,this.near_plane_fly_debt-=wt*this.cameraObject.far}this.near_plane_fly_debt+=$t*or}}}};var St=()=>{var rt=ft();this.changeZoomByValue(rt),this._state===w.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),this._state===w.SCROLL&&(ee=0,this._state=w.NONE)};this.setDirectionalLight=rt=>{this.directionalLight=rt},this.updateDirectionalLight=()=>{this.directionalLight!=0&&this.directionalLight.position.set(this.cameraObject.position.x,this.cameraObject.position.y,this.cameraObject.position.z)},this.enable=function(){O=!0,this.domElement&&this.domElement.addEventListener&&(this.domElement.addEventListener("mousedown",pt,!1),this.domElement.addEventListener("mousemove",yt,!1),this.domElement.addEventListener("mouseup",ct,!1),this.domElement.addEventListener("mouseleave",xe,!1),this.domElement.addEventListener("touchstart",Ue,!1),this.domElement.addEventListener("touchmove",$e,!1),this.domElement.addEventListener("touchend",at,!1),this.domElement.addEventListener("wheel",Dt,!1),this.domElement.addEventListener("contextmenu",rt=>{rt.preventDefault()},!1),this.domElement.addEventListener("mouseenter",Ht,!1))},this.disable=function(){O=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",pt,!1),this.domElement.removeEventListener("mousemove",yt,!1),this.domElement.removeEventListener("mouseup",ct,!1),this.domElement.removeEventListener("mouseleave",xe,!1),this.domElement.removeEventListener("touchstart",Ue,!1),this.domElement.removeEventListener("touchmove",$e,!1),this.domElement.removeEventListener("touchend",at,!1),this.domElement.removeEventListener("wheel",Dt,!1),this.domElement.removeEventListener("mouseenter",Ht,!1),this.domElement.removeEventListener("contextmenu",rt=>{rt.preventDefault()},!1))},this.loadPath=rt=>{I=rt.CameraPath,B=rt.NumberOfPoints},this.loadPathURL=(rt,Et)=>{var kt=new XMLHttpRequest;kt.onreadystatechange=()=>{if(kt.readyState==4&&kt.status==200){var $t=JSON.parse(kt.responseText);this.loadPath($t),Et!=null&&typeof Et=="function"&&Et()}};var or=s(rt);kt.open("GET",or,!0),kt.send()},this.setPathDuration=rt=>{A=rt,K&&K.setDuration(A),U&&U.setDuration(A)},this.getPlayRate=()=>j,this.setPlayRate=rt=>{j=rt};var Wt=rt=>{var Et=N+rt;Et>A&&(Et-=A),N=Et};this.getTime=()=>N,this.setTime=rt=>{N=rt>A?A:0>rt?0:rt},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2<B){var rt=N/A*(B-1),Et=Math.floor(rt),kt=Math.ceil(rt);return Et==kt?Et==B-1?[Et-1,kt,0]:[Et,kt+1,1]:[Et,kt,1-(rt-Et)]}return B==1?[0,0,0]:void 0},this.setCurrentTimeFrame=rt=>{2<B&&(N=A*rt/(B-1),0>N&&(N=0),N>A&&(N=A))};var Jt=rt=>{if(Z===L.PATH&&(Wt(rt),I)){for(var Et=this.getCurrentTimeFrame(),kt=Et[0],or=Et[1],$t=Et[2],wt=[I[3*kt],I[3*kt+1],I[3*kt+2]],je=[I[3*or],I[3*or+1],I[3*or+2]],ke=[],Oe=0;Oe<wt.length;Oe++)ke.push($t*wt[Oe]+(1-$t)*je[Oe]);this.cameraObject.position.set(ke[0],ke[1],ke[2]),this.cameraObject.target.set(je[0],je[1],je[2]),G&&this.cameraObject.lookAt(this.cameraObject.target),F&&(this.directionalLight.position.set(ke[0],ke[1],ke[2]),this.directionalLight.target.position.set(je[0],je[1],je[2]))}};this.calculatePathNow=()=>{Jt(0)};var Pt=()=>{this._state===w.ROTATE||this._state===w.TOUCH_ROTATE?Je():this._state===w.PAN||this._state===w.TOUCH_PAN?(Gt(),et.triggerCallback()):(this._state===w.ZOOM||this._state===w.TOUCH_ZOOM||this._state===w.SCROLL)&&(et.zoom(ft()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,this._state===w.SCROLL&&(this._state=w.NONE),ee=0,et.triggerCallback())};this.update=rt=>{var Et=rt*j,kt=O;Z===L.PATH?Jt(Et):Z===L.SMOOTH_CAMERA_TRANSITION&&K?(K.update(Et),K.isTransitionCompleted()&&(Z=L.DEFAULT),kt=!1):Z===L.ROTATE_CAMERA_TRANSITION&&U?(U.update(Et),U.isTransitionCompleted()&&(Z=L.DEFAULT),kt=!1):Z===L.AUTO_TUMBLE&&X?X.update(Et):Z===L.SYNC_CONTROL&&et&&(Pt(),kt=!1),kt&&(this._state===w.ROTATE||this._state===w.TOUCH_ROTATE?Je():this._state===w.PAN||this._state===w.TOUCH_PAN?Gt():(this._state===w.ZOOM||this._state===w.TOUCH_ZOOM||this._state===w.SCROLL)&&St(),this._state!==w.NONE&&Z===L.AUTO_TUMBLE&&X&&X.stopOnCameraInput,this._state===w.SCROLL&&(this._state=w.NONE)),G?G.update():this.cameraObject.lookAt(this.cameraObject.target)},this.playPath=()=>{Z=L.PATH},this.stopPath=()=>{Z=L.DEFAULT},this.isPlayingPath=()=>Z===L.PATH,this.enableDirectionalLightUpdateWithPath=rt=>{F=rt},this.enableDeviceOrientation=()=>{G||(G=new g(this.cameraObject))},this.disableDeviceOrientation=()=>{G&&(G.dispose(),G=void 0)},this.isDeviceOrientationEnabled=()=>!!G,this.resetView=()=>{var rt=Ne[P];this.cameraObject.near=rt.nearPlane,this.cameraObject.far=rt.farPlane,this.cameraObject.position.set(rt.eyePosition[0],rt.eyePosition[1],rt.eyePosition[2]),this.cameraObject.target.set(rt.targetPosition[0],rt.targetPosition[1],rt.targetPosition[2]),this.cameraObject.up.set(rt.upVector[0],rt.upVector[1],rt.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=rt=>{rt.nearPlane&&(this.cameraObject.near=rt.nearPlane),rt.farPlane&&(this.cameraObject.far=rt.farPlane),rt.eyePosition&&this.cameraObject.position.set(rt.eyePosition[0],rt.eyePosition[1],rt.eyePosition[2]),rt.targetPosition&&this.cameraObject.target.set(rt.targetPosition[0],rt.targetPosition[1],rt.targetPosition[2]),rt.upVector&&this.cameraObject.up.set(rt.upVector[0],rt.upVector[1],rt.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.getViewportFromCentreAndRadius=(rt,Et,kt,or,$t,wt)=>{var je=this.cameraObject.position.x-this.cameraObject.target.x,ke=this.cameraObject.position.y-this.cameraObject.target.y,Oe=this.cameraObject.position.z-this.cameraObject.target.z,Ye=1/Math.sqrt(je*je+ke*ke+Oe*Oe);je*=Ye,ke*=Ye,Oe*=Ye;var ve=or/Math.tan($t*Math.PI/360),Ae=[rt+je*ve,Et+ke*ve,kt+Oe*ve],Re=0,Se=.95;Re=wt>Se*ve?(1-Se)*ve:ve-wt;var ge=new l;return ge.nearPlane=Re,ge.farPlane=ve+wt,ge.eyePosition=Ae,ge.targetPosition=[rt,Et,kt],ge.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],ge},this.getCurrentViewport=()=>{var rt=new l;return rt.nearPlane=this.cameraObject.near,rt.farPlane=this.cameraObject.far,rt.eyePosition[0]=this.cameraObject.position.x,rt.eyePosition[1]=this.cameraObject.position.y,rt.eyePosition[2]=this.cameraObject.position.z,rt.targetPosition[0]=this.cameraObject.target.x,rt.targetPosition[1]=this.cameraObject.target.y,rt.targetPosition[2]=this.cameraObject.target.z,rt.upVector[0]=this.cameraObject.up.x,rt.upVector[1]=this.cameraObject.up.y,rt.upVector[2]=this.cameraObject.up.z,rt},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(rt,Et,kt)=>{U==null&&(K=new u(rt,Et,this,kt))},this.rotateCameraTransition=(rt,Et,kt)=>{K==null&&(U=new d(rt,Et,this,kt))},this.enableCameraTransition=()=>{K&&(Z=L.SMOOTH_CAMERA_TRANSITION),U&&(Z=L.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{Z=L.DEFAULT},this.stopCameraTransition=()=>{Z=L.DEFAULT,K=void 0,U=void 0},this.isTransitioningCamera=()=>Z===L.SMOOTH_CAMERA_TRANSITION||Z===L.ROTATE_CAMERA_TRANSITION,this.autoTumble=(rt,Et,kt)=>{X=new h(rt,Et,kt,this)},this.enableAutoTumble=()=>{Z=L.AUTO_TUMBLE},this.stopAutoTumble=()=>{Z=L.DEFAULT,X=void 0},this.updateAutoTumble=()=>{X&&(X.requireUpdate=!0)},this.isAutoTumble=()=>Z===L.AUTO_TUMBLE,this.enableRaycaster=(rt,Et,kt)=>{he==null&&(he=new p(rt,this.scene,Et,kt,this.renderer))},this.disableRaycaster=()=>{he.disable(),he=void 0},this.isSyncControl=()=>currentMpde===L.SYNC_CONTROL,this.enableSyncControl=()=>(Z=L.SYNC_CONTROL,et||(et=new T),et.setCurrentCameraSettings(this.cameraObject,Ne[P]),et),this.disableSyncControl=()=>{Z=L.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},u=function(y,v,_,b){var L=y.eyePosition,w=y.targetPosition,k=y.upVector,C=v.eyePosition,A=v.targetPosition,O=v.upVector,N=_,I=b,B=0,F=!1;N.near=Math.min(y.nearPlane,v.nearPlane),N.far=Math.max(y.farPlane,v.farPlane),N.cameraObject.up.set(v.upVector[0],v.upVector[1],v.upVector[2]),this.setDuration=P=>{I=P};var j=P=>{var Z=B+P;Z>I&&(Z=I),B=Z},G=()=>{var P=B/I,Z=[L[0]*(1-P)+C[0]*P,L[1]*(1-P)+C[1]*P,L[2]*(1-P)+C[2]*P],K=[w[0]*(1-P)+A[0]*P,w[1]*(1-P)+A[1]*P,w[2]*(1-P)+A[2]*P];k[0]*(1-P)+O[0]*P,k[1]*(1-P)+O[1]*P,k[2]*(1-P)+O[2]*P,N.cameraObject.position.set(Z[0],Z[1],Z[2]),N.cameraObject.target.set(K[0],K[1],K[2])};this.update=P=>{this.enabled===!1||(j(P),G(),B==I&&(F=!0))},this.isTransitionCompleted=()=>F},d=function(y,v,_,b){var L=b,w=0,k=!1;this.setDuration=A=>{L=A};var C=A=>{var O=w,N=w+A;N>L&&(N=L),w=N;var I=w-O,B=I/L;_.rotateAboutLookAtpoint(y,B*v)};this.update=A=>{this.enabled===!1||(C(A),w==L&&(k=!0))},this.isTransitionCompleted=()=>k},p=function(y,v,_,b,L){var w=y,k=L,C=_,A=b,O=new o.Raycaster;O.params.Line.threshold=.1,O.params.Points.threshold=.1;var N=new o.Vector2,I=!1,B=new Date,F=!1,j=0,G=[],P={zincCamera:void 0,x:-1,y:-1};this.enable=()=>{enable=!0},this.disable=()=>{enable=!1};var Z=(X,ee,oe)=>{if(X.getNDCFromDocumentCoords(ee,oe,N),v!==w){var he=w.getThreeJSScene();k.render(he,X.cameraObject)}O.setFromCamera(N,X.cameraObject);var me=w.getPickableThreeJSObjects();return G.length=0,O.intersectObjects(me,!0,G)};this.pick=(X,ee,oe)=>{k&&w&&X&&C&&(Z(X,ee,oe),C(G,ee,oe))};var K=(X,ee,oe)=>{if(k&&w&&X&&A){if(Z(X,ee,oe),B.setTime(Date.now()),G.length===0){if(F)return;F=!0}else F=!1;A(G,ee,oe)}};this.move=(X,ee,oe)=>{k&&w&&X&&A&&(w.displayMarkers?K(X,ee,oe):(P.zincCamera=X,P.x=ee,P.y=oe,!I&&(j=B?Date.now()-B.getTime():250,250<=j?K(X,ee,oe):(I=!0,setTimeout(U(P),j)))))};var U=X=>function(){I=!1,K(X.zincCamera,X.x,X.y)}},h=function(y,v,_,b){var L=new o.Vector3,w=b;this.stopOnCameraInput=_,this.requireUpdate=!0;var k=new o.Vector3,C=new o.Vector3,A=O=>{var N=Math.sqrt(O[0]*O[0]+O[1]*O[1]),I=4*Math.abs(O[0]),B=4*Math.abs(O[1]),F=.25*(I+B),j=-O[1]/N,G=O[0]/N,P=j*O[0]+G*-O[1];P>F?P=F:P<-F&&(P=-F);var Z=Math.acos(P/F)-.5*Math.PI;L.copy(w.cameraObject.position).sub(w.cameraObject.target).normalize(),k.copy(w.cameraObject.up).normalize(),C.crossVectors(k,L).normalize().multiplyScalar(j),k.multiplyScalar(G),k.add(C).multiplyScalar(Math.cos(Z)),L.multiplyScalar(Math.sin(Z)).add(k)};this.update=O=>{this.enabled===!1||(this.requireUpdate&&(A(y),this.requireUpdate=!1),w.rotateAboutLookAtpoint(L,-v*O/1e3))}},f=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new o.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new o.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1};Object.assign(f.prototype,{update:(()=>{var y,v,_,b,L,w,k=new o.Matrix4,C=new o.Matrix4;return function(A){var O=y!==A.focus||v!==A.fov||_!==A.aspect*this.aspect||b!==A.near||L!==A.far||w!==A.zoom;if(O){y=A.focus,v=A.fov,_=A.aspect*this.aspect,b=A.near,L=A.far,w=A.zoom;var N,I,B=A.projectionMatrix.clone(),F=.064/2,j=F*b/y,G=b*Math.tan(.5*(o.Math.DEG2RAD*v))/A.zoom;C.elements[12]=-F,k.elements[12]=F,N=-G*_+j,I=G*_+j,B.elements[0]=2*b/(I-N),B.elements[8]=(I+N)/(I-N),this.cameraL.projectionMatrix.copy(B),N=-G*_-j,I=G*_-j,B.elements[0]=2*b/(I-N),B.elements[8]=(I+N)/(I-N),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(A.matrixWorld).multiply(C),this.cameraR.matrixWorld.copy(A.matrixWorld).multiply(k)}})()});var m=function(y){var v=new f;v.aspect=.5,this.setSize=(_,b)=>{y.setSize(_,b)},this.render=(_,b)=>{_.updateMatrixWorld(),b.parent===null&&b.updateMatrixWorld(),v.update(b);var L=y.getSize();y.setScissorTest(!0),y.clear(),y.setScissor(0,0,L.width/2,L.height),y.setViewport(0,0,L.width/2,L.height),y.render(_,v.cameraL),y.setScissor(L.width/2,0,L.width/2,L.height),y.setViewport(L.width/2,0,L.width/2,L.height),y.render(_,v.cameraR),y.setScissorTest(!1)}},g=function(y){var v=this;this.object=y,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var _=w=>{v.deviceOrientation=w},b=()=>{typeof window<"u"&&(v.screenOrientation=window.orientation||0)},L=(()=>{var w=new o.Vector3(0,0,1),k=new o.Euler,C=new o.Quaternion,A=new o.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(O,N,I,B,F)=>{var j=new o.Vector3(0,0,1);j.subVectors(O.target,O.position),k.set(I,N,-B,"YXZ");var G=new o.Quaternion;G.setFromEuler(k),G.multiply(A),G.multiply(C.setFromAxisAngle(w,-F)),j.applyQuaternion(G),j.addVectors(O.position,j),O.lookAt(j)}})();this.connect=()=>{b(),typeof window<"u"&&(window.addEventListener("orientationchange",b,!1),window.addEventListener("deviceorientation",_,!1)),v.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",b,!1),window.removeEventListener("deviceorientation",_,!1)),v.enabled=!1},this.update=()=>{if(v.enabled!==!1){var w=v.deviceOrientation.alpha?o.Math.degToRad(v.deviceOrientation.alpha):0,k=v.deviceOrientation.beta?o.Math.degToRad(v.deviceOrientation.beta):0,C=v.deviceOrientation.gamma?o.Math.degToRad(v.deviceOrientation.gamma):0,A=v.screenOrientation?o.Math.degToRad(v.screenOrientation):0;L(v.object,w,k,C,A)}},this.dispose=function(){this.disconnect()},this.connect()},T=function(){var y=void 0,v=void 0,_=void 0,b=new o.Vector3,L=new o.Vector3,w=new o.Vector3,k=new o.Vector3,C=void 0;this.setCurrentCameraSettings=(A,O)=>{y=A.clone(),v=A,_=O,y.near=_.nearPlane,_.farPlane&&(y.far=_.farPlane),_.eyePosition&&y.position.set(_.eyePosition[0],_.eyePosition[1],_.eyePosition[2]),_.upVector&&y.up.set(_.upVector[0],_.upVector[1],_.upVector[2]),_.targetPosition&&(y.target=new o.Vector3(_.targetPosition[0],_.targetPosition[1],_.targetPosition[2]),y.lookAt(y.target)),y.updateProjectionMatrix(),b.copy(y.position).project(y),L.copy(y.target).project(y)},this.getCurrentPosition=()=>(L.copy(v.target).project(y),[L.x,L.y]),this.zoom=A=>{var O=Math.max(v.zoom-.002*A,1);v.zoom=O,v.updateProjectionMatrix()},this.zoomToBox=(A,O)=>{A.getCenter(w),w.project(y),this.setCenterZoom([w.x,w.y],O)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:v.zoom}),this.setCenterZoom=(A,O)=>{w.set(A[0],A[1],L.z).unproject(y),k.copy(w).sub(v.target),v.target.copy(w),v.lookAt(v.target),v.position.add(k),v.zoom=O,v.updateProjectionMatrix()},this.setEventCallback=A=>{(A===void 0||typeof A=="function")&&(C=A)},this.triggerCallback=()=>{C!==void 0&&typeof C=="function"&&C()}};n.Viewport=l,n.CameraControls=c,n.SmoothCameraTransition=u,n.RotateCameraTransition=d,n.RayCaster=p,n.CameraAutoTumble=h,n.StereoEffect=m,n.NDCCameraControl=T},function(r,n,i){var{Group:o,Matrix4:s}=i(3),l=0,c=function(){return"re"+l++},u=function(d){var p=d,h=new o;h.matrixAutoUpdate=!1,h.userData=this;var f=[],m="",g=[],T=new s,y=3e3;T.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.pickableUpdateRequired=!0,this.isRegion=!0,this.uuid=c(),this.hideAllPrimitives=()=>{f.forEach(v=>v.hideAllPrimitives()),g.forEach(v=>v.setVisibility(!1))},this.showAllPrimitives=()=>{f.forEach(v=>v.showAllPrimitives()),g.forEach(v=>v.setVisibility(!0))},this.setVisibility=v=>{h.visible=v},this.getVisibility=()=>h.visible,this.getGroup=()=>h,this.setTransformation=v=>{T.set(...v),h.matrix.copy(T),h.updateMatrixWorld()},this.setName=v=>{v&&v!==""&&(m=v)},this.getName=()=>m,this.getParent=()=>p,this.getFullSeparatedPath=()=>{var v=[];if(m!==""){v.push(m);for(var _,b=p;b!==void 0;)_=b.getName(),_!==""&&v.unshift(_),b=b.getParent()}return v},this.getFullPath=()=>{var v=this.getFullSeparatedPath();if(0<v.length){var _=v.shift();return v.forEach(b=>{_=_.concat("/",b)}),_}return""},this.createChild=v=>{var _=new u(this);return _.setName(v),f.push(_),h.add(_.getGroup()),_},this.getChildWithName=v=>{if(v){for(var _=v.toLowerCase(),b=0;b<f.length;b++)if(f[b].getName().toLowerCase()===_)return f[b]}},this.findChildFromSeparatedPath=v=>{if(v&&0<v.length&&v[0]===""&&v.shift(),v&&0<v.length){var _=this.getChildWithName(v[0]);return _?(v.shift(),_.findChildFromSeparatedPath(v)):void 0}return this},this.findChildFromPath=v=>{var _=v.split("/");return this.findChildFromSeparatedPath(_)},this.createChildFromSeparatedPath=v=>{if(0<v.length&&v[0]===""&&v.shift(),0<v.length){var _=this.getChildWithName(v[0]);return _||(_=this.createChild(v[0])),v.shift(),_.createChildFromSeparatedPath(v)}return this},this.createChildFromPath=v=>{var _=v.split("/");return this.createChildFromSeparatedPath(_)},this.findOrCreateChildFromPath=v=>{var _=this.findChildFromPath(v);return _||(_=this.createChildFromPath(v)),_},this.addZincObject=v=>{v&&(v.setRegion(this),h.add(v.morph),g.push(v),this.pickableUpdateRequired=!0)},this.removeZincObject=v=>{for(var _=0;_<g.length;_++)if(v===g[_])return h.remove(v.morph),g.splice(_,1),void v.dispose()},this.checkPickableUpdateRequred=v=>{if(this.pickableUpdateRequired)return!0;if(v){for(var _=!1,b=0;b<f.length;b++)if(_=f[b].checkPickableUpdateRequred(v),_)return!0}return!1},this.getPickableThreeJSObjects=(v,_)=>(g.forEach(b=>{if(b.morph&&b.morph.visible){var L=b.marker;L&&L.isEnabled()&&v.push(L.morph),v.push(b.morph)}}),_&&f.forEach(b=>{b.getPickableThreeJSObjects(v,_)}),this.pickableUpdateRequired=!1,v),this.setDuration=v=>{y=v,g.forEach(_=>_.setDuration(v)),f.forEach(_=>_.setDuration(v))},this.getDuration=()=>y,this.getBoundingBox=v=>{var _,b;return g.forEach(L=>{b=L.getBoundingBox(),b&&(_==null?_=b.clone():_.union(b))}),v&&f.forEach(L=>{b=L.getBoundingBox(v),b&&(_==null?_=b.clone():_.union(b))}),_},this.clear=v=>{v&&f.forEach(_=>_.clear(v)),g.forEach(_=>{h.remove(_.morph),_.dispose()}),f=[],g=[]},this.objectIsInRegion=(v,_)=>{for(var b=0;b<g.length;b++)if(v===g[b])return!0;if(_){for(var L=0;L<f.length;L++)if(f[L].objectIsInRegion(v,_))return!0}return!1},this.forEachGeometry=(v,_)=>{g.forEach(b=>{b.isGeometry&&v(b)}),_&&f.forEach(b=>b.forEachGeometry(v,_))},this.forEachGlyphset=(v,_)=>{g.forEach(b=>{b.isGlyphset&&v(b)}),_&&f.forEach(b=>b.forEachGlyphset(v,_))},this.forEachPointset=(v,_)=>{g.forEach(b=>{b.isPointset&&v(b)}),_&&f.forEach(b=>b.forEachPointset(v,_))},this.forEachLine=(v,_)=>{g.forEach(b=>{b.isLines&&v(b)}),_&&f.forEach(b=>b.forEachLine(v,_))},this.findObjectsWithAnatomicalId=(v,_)=>(g.forEach(b=>{b.anatomicalId===v&&objectsArray.push(b)}),_&&f.forEach(b=>{var L=b.findObjectsWithAnatomicalId(v,_);objectsArray.push(...L)}),objectsArray),this.findObjectsWithGroupName=(v,_)=>{var b=[];return g.forEach(L=>{var w=L.groupName?L.groupName.toLowerCase():L.groupName,k=v&&v.toLowerCase();w===k&&b.push(L)}),_&&f.forEach(L=>{var w=L.findObjectsWithGroupName(v,_);b.push(...w)}),b},this.findGeometriesWithGroupName=(v,_)=>{var b=this.findObjectsWithGroupName(v,_),L=b.filter(w=>w.isGeometry);return L},this.findPointsetsWithGroupName=(v,_)=>{var b=this.findObjectsWithGroupName(v,_),L=b.filter(w=>w.isPointset);return L},this.findGlyphsetsWithGroupName=(v,_)=>{var b=this.findObjectsWithGroupName(v,_),L=b.filter(w=>w.isGlyphset);return L},this.findLinesWithGroupName=(v,_)=>{var b=this.findObjectsWithGroupName(v,_),L=b.filter(w=>w.isLines);return L},this.getAllObjects=v=>{var _=[...g];return v&&f.forEach(b=>{var L=b.getAllObjects(v);_.push(...L)}),_},this.getChildRegions=v=>{var _=[...f];return v&&f.forEach(b=>{var L=b.getChildRegions(v);_.push(...L)}),_},this.getCurrentTime=()=>{if(g[0]!=null)return g[0].getCurrentTime();for(var v,_=0;_<f.length;_++)if(v=f[_].getCurrentTime(),v!==-1)return v;return-1},this.setMorphTime=(v,_)=>{g.forEach(b=>{b.setMorphTime(v)}),_&&f.forEach(b=>{b.setMorphTime(v)})},this.isTimeVarying=()=>{for(var v=0;v<g.length;v++)if(g[v].isTimeVarying())return!0;for(var _=0;_<f.length;_++)if(f[_].isTimeVarying())return!0;return!1},this.renderGeometries=(v,_,b,L,w)=>{var k=this.getAllObjects(w);if(k.forEach(O=>{O.render(v*_,b,L)}),L&&L.displayMarkers&&b===!1&&0<L.markerDepths.length){var C=Math.min(...L.markerDepths),A=Math.max(...L.markerDepths);k.forEach(O=>{O.processMarkerVisual(C,A,L)})}}};n.Region=u},function(r,n,i){var o=i(3);n.Minimap=function(s){var l=s;this.camera=new o.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var c=new o.BufferGeometry,u=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),d=new o.BufferAttribute(u,3);c.setAttribute("position",d);var p=new o.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new o.Mesh(c,p);var h=new o.Box3,f=new o.Vector3;this.getDiffFromNormalised=(g,T)=>{h.setFromBufferAttribute(d).getCenter(f);var y=f.clone().project(this.camera),v=new o.Vector3(g,T,y.z).unproject(this.camera);return v.sub(f)};var m=(g,T)=>{l.camera.near&&(this.camera.near=l.camera.near),T.farPlane&&(this.camera.far=T.farPlane),T.eyePosition&&this.camera.position.set(T.eyePosition[0],T.eyePosition[1],T.eyePosition[2]),T.upVector&&this.camera.up.set(T.upVector[0],T.upVector[1],T.upVector[2]),T.targetPosition&&this.camera.lookAt(new o.Vector3(T.targetPosition[0],T.targetPosition[1],T.targetPosition[2])),this.camera.zoom=1/g,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var g=new o.Vector3().copy(l.camera.target).project(l.camera),T=new o.Vector3(-1,-1,g.z).unproject(l.camera),y=new o.Vector3(1,-1,g.z).unproject(l.camera),v=new o.Vector3(1,1,g.z).unproject(l.camera),_=new o.Vector3(-1,1,g.z).unproject(l.camera);d.copyVector3sArray([T,y,v,v,_,T]),d.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var g=l.getZincCameraControls(),T=l.getBoundingBox();if(T){var y=T.min.distanceTo(T.max),v=y/2,_=(T.min.x+T.max.x)/2,b=(T.min.y+T.max.y)/2,L=(T.min.z+T.max.z)/2,w=g.getViewportFromCentreAndRadius(_,b,L,v,40,v*4);m(y,w)}}}},function(r,n,i){var o=i(3),s=i(43)(o),l=i(2).Geometry,c=i(44),u=i(45).default,d=o.BufferGeometryLoader,p=function(h){var f;h&&h.isGeometry&&(f=h);var m=void 0,g=void 0,T=!1,y=void 0,v=k=>{var C=f.morph.material.clone();C.morphTargets=!1;var A=new l,O=new d,N=O.parse(k),I=new o.Mesh(N.geometry,C);return A.geometry=I.geometry,A.morph=I,A.morph.userData=A,A},_=k=>{switch(k.data.action){case"message":console.log(k.data.message);break;case"result":var C=new p(v(k.data.object));y&&y(C),y=void 0,T=!1;break;default:throw"Cannot handle specified action."}},b=k=>{if(c!==void 0&&(g=c(46)),!g)m=new(i(47)).GeometryCSGInternal(k);else if(k&&k.isGeometry){var C=k.morph,A=C.geometry.clone().applyMatrix(C.matrix).toJSON();g.addEventListener("message",function(O){_(O)}),g.postMessage({action:"initialise",object:A})}};this.getHostGeometry=()=>{var k=new s(f.morph);return new L(k)},this.getGeometry=()=>f;var L=k=>{var C=f.morph.material.clone();C.morphTargets=!1;var A=k.toMesh(C),O=new l;return O.geometry=A.geometry,O.morph=A,O.morph.userData=O,O};this.setCSG=k=>{m.setCSG(k)};var w=(k,C,A,O)=>{if(T)O("On progress");else{var N=k.morph,I=N.geometry.clone().applyMatrix(N.matrix).toJSON();y=A,T=!0,g.postMessage({action:C,object:I})}};this.intersect=k=>new u((C,A)=>{if(g)w(k,"intersect",C,A);else{var O=m.intersect(k),N=new p(L(O));N.setCSG(O),C(N)}}),this.subtract=k=>new u((C,A)=>{if(g)w(k,"intersect",C,A);else{var O=m.subtract(k),N=new p(L(O));N.setCSG(O),C(N)}}),this.union=k=>new u((C,A)=>{if(g)w(k,"intersect",C,A);else{var O=m.union(k),N=new p(L(O));N.setCSG(O),C(N)}}),this.terminateWorker=()=>{g&&g.terminate()},b(h)};n.GeometryCSG=p},function(r,n,i){var o=1e-5,s=0,l=1,c=2,u=3;r.exports=function(d){var p=function(h){var f,m,g,T,y,v,_,b=[];if(h.isBufferGeometry&&(h=new d.Geometry().fromBufferGeometry(h)),h instanceof d.Geometry)this.matrix=new d.Matrix4;else if(h.isMesh)h.updateMatrix(),this.matrix=h.matrix.clone(),h=h.geometry,h.isBufferGeometry&&(h=new d.Geometry().fromBufferGeometry(h)),h.mergeVertices(),h.computeVertexNormals(!1);else{if(h instanceof p.Node)return this.tree=h,this.matrix=new d.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(f=0,m=h.faces.length;f<m;f++)g=h.faces[f],y=h.faceVertexUvs[0][f],_=new p.Polygon,g instanceof d.Face3?(T=h.vertices[g.a],v=y?new d.Vector2(y[0].x,y[0].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[0],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.b],v=y?new d.Vector2(y[1].x,y[1].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[2],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.c],v=y?new d.Vector2(y[2].x,y[2].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[2],v),T.applyMatrix4(this.matrix),_.vertices.push(T)):(d.Face4,T=h.vertices[g.a],v=y?new d.Vector2(y[0].x,y[0].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[0],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.b],v=y?new d.Vector2(y[1].x,y[1].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[1],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.c],v=y?new d.Vector2(y[2].x,y[2].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[2],v),T.applyMatrix4(this.matrix),_.vertices.push(T),T=h.vertices[g.d],v=y?new d.Vector2(y[3].x,y[3].y):null,T=new p.Vertex(T.x,T.y,T.z,g.vertexNormals[3],v),T.applyMatrix4(this.matrix),_.vertices.push(T)),_.calculateProperties(),b.push(_);this.tree=new p.Node(b)};return p.prototype.subtract=function(h){var f=this.tree.clone(),m=h.tree.clone();return f.invert(),f.clipTo(m),m.clipTo(f),m.invert(),m.clipTo(f),m.invert(),f.build(m.allPolygons()),f.invert(),f=new p(f),f.matrix=this.matrix,f},p.prototype.union=function(h){var f=this.tree.clone(),m=h.tree.clone();return f.clipTo(m),m.clipTo(f),m.invert(),m.clipTo(f),m.invert(),f.build(m.allPolygons()),f=new p(f),f.matrix=this.matrix,f},p.prototype.intersect=function(h){var f=this.tree.clone(),m=h.tree.clone();return f.invert(),m.clipTo(f),m.invert(),f.clipTo(m),m.clipTo(f),f.build(m.allPolygons()),f.invert(),f=new p(f),f.matrix=this.matrix,f},p.prototype.toGeometry=function(){var h,f,m,g,T,y,v,_,b,L,w=new d.Matrix4().getInverse(this.matrix),k=new d.Geometry,C=this.tree.allPolygons(),A=C.length,O={};for(h=0;h<A;h++)for(m=C[h],g=m.vertices.length,f=2;f<g;f++)L=[],_=m.vertices[0],L.push(new d.Vector2(_.uv.x,_.uv.y)),_=new d.Vector3(_.x,_.y,_.z),_.applyMatrix4(w),typeof O[_.x+","+_.y+","+_.z]>"u"?(k.vertices.push(_),T=O[_.x+","+_.y+","+_.z]=k.vertices.length-1):T=O[_.x+","+_.y+","+_.z],_=m.vertices[f-1],L.push(new d.Vector2(_.uv.x,_.uv.y)),_=new d.Vector3(_.x,_.y,_.z),_.applyMatrix4(w),typeof O[_.x+","+_.y+","+_.z]>"u"?(k.vertices.push(_),y=O[_.x+","+_.y+","+_.z]=k.vertices.length-1):y=O[_.x+","+_.y+","+_.z],_=m.vertices[f],L.push(new d.Vector2(_.uv.x,_.uv.y)),_=new d.Vector3(_.x,_.y,_.z),_.applyMatrix4(w),typeof O[_.x+","+_.y+","+_.z]>"u"?(k.vertices.push(_),v=O[_.x+","+_.y+","+_.z]=k.vertices.length-1):v=O[_.x+","+_.y+","+_.z],b=new d.Face3(T,y,v,new d.Vector3(m.normal.x,m.normal.y,m.normal.z)),k.faces.push(b),k.faceVertexUvs[0].push(L);return k},p.prototype.toBufferGeometry=function(){var h=this.toGeometry(),f=new d.BufferGeometry().fromGeometry(h);return f},p.prototype.toMesh=function(h){var f=this.toBufferGeometry(),m=new d.Mesh(f,h);return m.position.setFromMatrixPosition(this.matrix),m.rotation.setFromRotationMatrix(this.matrix),m},p.Polygon=function(h){h instanceof Array||(h=[]),this.vertices=h,0<h.length?this.calculateProperties():this.normal=this.w=void 0},p.Polygon.prototype.calculateProperties=function(){var h=this.vertices[0],f=this.vertices[1],m=this.vertices[2];return this.normal=f.clone().subtract(h).cross(m.clone().subtract(h)).normalize(),this.w=this.normal.clone().dot(h),this},p.Polygon.prototype.clone=function(){var h,f,m=new p.Polygon;for(h=0,f=this.vertices.length;h<f;h++)m.vertices.push(this.vertices[h].clone());return m.calculateProperties(),m},p.Polygon.prototype.flip=function(){var h,f=[];for(this.normal.multiplyScalar(-1),this.w*=-1,h=this.vertices.length-1;0<=h;h--)f.push(this.vertices[h]);return this.vertices=f,this},p.Polygon.prototype.classifyVertex=function(h){var f=this.normal.dot(h)-this.w;return f<-o?c:f>o?l:s},p.Polygon.prototype.classifySide=function(h){var f,m,g,T=0,y=0,v=h.vertices.length;for(f=0;f<v;f++)m=h.vertices[f],g=this.classifyVertex(m),g===l?T++:g===c&&y++;return 0<T&&y===0?l:T===0&&0<y?c:T===0&&y===0?s:u},p.Polygon.prototype.splitPolygon=function(h,f,m,g,T){var y=this.classifySide(h);if(y===s)(0<this.normal.dot(h.normal)?f:m).push(h);else if(y===l)g.push(h);else if(y===c)T.push(h);else{var v,_,b,L,w,k,C,A,O,N=[],I=[];for(_=0,v=h.vertices.length;_<v;_++)b=(_+1)%v,k=h.vertices[_],C=h.vertices[b],L=this.classifyVertex(k),w=this.classifyVertex(C),L!=c&&N.push(k),L!=l&&I.push(k),(L|w)===u&&(A=(this.w-this.normal.dot(k))/this.normal.dot(C.clone().subtract(k)),O=k.interpolate(C,A),N.push(O),I.push(O));3<=N.length&&g.push(new p.Polygon(N).calculateProperties()),3<=I.length&&T.push(new p.Polygon(I).calculateProperties())}},p.Vertex=function(h,f,m,g,T){this.x=h,this.y=f,this.z=m,this.normal=g||new d.Vector3,this.uv=T||new d.Vector2},p.Vertex.prototype.clone=function(){return new p.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},p.Vertex.prototype.add=function(h){return this.x+=h.x,this.y+=h.y,this.z+=h.z,this},p.Vertex.prototype.subtract=function(h){return this.x-=h.x,this.y-=h.y,this.z-=h.z,this},p.Vertex.prototype.multiplyScalar=function(h){return this.x*=h,this.y*=h,this.z*=h,this},p.Vertex.prototype.cross=function(h){var f=this.x,m=this.y,g=this.z;return this.x=m*h.z-g*h.y,this.y=g*h.x-f*h.z,this.z=f*h.y-m*h.x,this},p.Vertex.prototype.normalize=function(){var h=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=h,this.y/=h,this.z/=h,this},p.Vertex.prototype.dot=function(h){return this.x*h.x+this.y*h.y+this.z*h.z},p.Vertex.prototype.lerp=function(h,f){return this.add(h.clone().subtract(this).multiplyScalar(f)),this.normal.add(h.normal.clone().sub(this.normal).multiplyScalar(f)),this.uv.add(h.uv.clone().sub(this.uv).multiplyScalar(f)),this},p.Vertex.prototype.interpolate=function(h,f){return this.clone().lerp(h,f)},p.Vertex.prototype.applyMatrix4=function(h){var f=this.x,m=this.y,g=this.z,T=h.elements;return this.x=T[0]*f+T[4]*m+T[8]*g+T[12],this.y=T[1]*f+T[5]*m+T[9]*g+T[13],this.z=T[2]*f+T[6]*m+T[10]*g+T[14],this},p.Node=function(h){var f,m,g=[],T=[];if(this.polygons=[],this.front=this.back=void 0,h instanceof Array&&h.length!==0){for(this.divider=h[0].clone(),f=0,m=h.length;f<m;f++)this.divider.splitPolygon(h[f],this.polygons,this.polygons,g,T);0<g.length&&(this.front=new p.Node(g)),0<T.length&&(this.back=new p.Node(T))}},p.Node.isConvex=function(h){var f,m;for(f=0;f<h.length;f++)for(m=0;m<h.length;m++)if(f!==m&&h[f].classifySide(h[m])!==c)return!1;return!0},p.Node.prototype.build=function(h){var f,m,g=[],T=[];for(this.divider||(this.divider=h[0].clone()),f=0,m=h.length;f<m;f++)this.divider.splitPolygon(h[f],this.polygons,this.polygons,g,T);0<g.length&&(!this.front&&(this.front=new p.Node),this.front.build(g)),0<T.length&&(!this.back&&(this.back=new p.Node),this.back.build(T))},p.Node.prototype.allPolygons=function(){var h=this.polygons.slice();return this.front&&(h=h.concat(this.front.allPolygons())),this.back&&(h=h.concat(this.back.allPolygons())),h},p.Node.prototype.clone=function(){var h=new p.Node;return h.divider=this.divider.clone(),h.polygons=this.polygons.map(function(f){return f.clone()}),h.front=this.front&&this.front.clone(),h.back=this.back&&this.back.clone(),h},p.Node.prototype.invert=function(){var h,f,m;for(h=0,f=this.polygons.length;h<f;h++)this.polygons[h].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),m=this.front,this.front=this.back,this.back=m,this},p.Node.prototype.clipPolygons=function(h){var f,m,g,T;if(!this.divider)return h.slice();for(g=[],T=[],f=0,m=h.length;f<m;f++)this.divider.splitPolygon(h[f],g,T,g,T);return this.front&&(g=this.front.clipPolygons(g)),T=this.back?this.back.clipPolygons(T):[],g.concat(T)},p.Node.prototype.clipTo=function(h){this.polygons=h.clipPolygons(this.polygons),this.front&&this.front.clipTo(h),this.back&&this.back.clipTo(h)},p}},function(r,n){r.exports=i8r()},function(r,n){r.exports=h8r},function(r,n,i){var o=i(2).Geometry,s=i(3),l=s.BufferGeometryLoader;r.exports=function(c){var u=void 0,d=function(g){var T=new l,y=T.parse(g),v=new s.MeshPhongMaterial,_=new s.Mesh(y.geometry,v),b=new o;return b.morph=_,b},p=function(g){var T=d(g);u=new(i(47)).GeometryCSGInternal(T),c.postMessage({action:"message",message:"Initialised"})},h=function(g){if(u){var T=d(g),y=u.intersect(T),v=y.toBufferGeometry().toJSON();c.postMessage({action:"result",object:v})}},f=function(g){if(u){var T=d(g),y=u.subtract(T),v=y.toBufferGeometry().toJSON();c.postMessage({action:"result",object:v})}},m=function(g){if(u){var T=d(g),y=u.union(T),v=y.toBufferGeometry().toJSON();c.postMessage({action:"result",object:v})}};c.addEventListener("message",function(g){switch(g.data.action){case"initialise":p(g.data.object);break;case"intersect":h(g.data.object);break;case"subtract":f(g.data.object);break;case"union":m(g.data.object);break;default:throw"Cannot handle specified action."}})}},function(r,n,i){var o=i(3),s=i(43)(o);i(2).Geometry,i(42).GeometryCSG;var l=function(c){var u;c&&c.isGeometry&&(u=c);var d;this.setGeometry=h=>{h&&h.isGeometry&&(u=h),d=void 0},this.setCSG=h=>{d=h};var p=h=>{if(u&&u.morph&&h&&h.morph){d===void 0&&(d=new s(u.morph));var f=new s(h.morph);return f}};this.intersect=h=>{var f=p(h);return d&&f?d.intersect(f):void 0},this.subtract=h=>{var f=p(h);return d&&f?d.subtract(f):void 0},this.union=h=>{var f=p(h);return d&&f?d.union(f):void 0}};n.GeometryCSGInternal=l},function(r,n,i){var o=i(3),s=i(43)(o);i(13).Glyphset;var l=function(c){var u;c&&c.isGlyphset&&(u=c);var d=[];this.setGlyphset=f=>{f&&f.isGlyphset&&(u=f),hostCSG=void 0},this.getGlyphset=()=>u;var p=()=>f=>{var m=f.getMesh(),g=f.getLabel();if(m){var T=new s(m.geometry.clone().applyMatrix(m.matrix)),y=[];y.csg=T,y.label=g,m.material&&(y.material=m.material.clone()),d.push(y)}},h=f=>{if(u&&f&&f.morph){d.length==0&&u.forEachGlyph(p());var m=new s(f.morph);return m}};this.intersect=f=>{var m=h(f);if(0<d.length&&m){for(var g=new(i(13)).Glyphset,T=0;T<d.length;T++){var y=d[T],v=y.csg.intersect(m),_=v.toMesh();if(_&&_.geometry&&0<_.geometry.vertices.length){y.material&&(_.material=y.material,_.material.side=o.DoubleSide,_.material.clippingPlanes=null);var b=g.addMeshAsGlyph(_,T+1);b.setLabel(y.label)}}var L=new l(g);return L}}};n.GlyphsetCSG=l}])})})(hEe);var Uv=hEe.exports;const zB=Ucr(Uv),ZVe={isWebGLAvailable:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var e=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&e.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(e){var t={1:"WebGL",2:"WebGL 2"},r={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},n='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',i=document.createElement("div");return i.id="webglmessage",i.style.fontFamily="monospace",i.style.fontSize="20px",i.style.fontWeight="normal",i.style.textAlign="center",i.style.background="#fff",i.style.color="#000",i.style.padding="1.5em",i.style.width="400px",i.style.margin="5em auto 0",r[e]?n=n.replace("$0","graphics card"):n=n.replace("$0","browser"),n=n.replace("$1",t[e]),i.innerHTML=n,i}},lne={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},D2=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};D2.prototype.setName=function(e){if(e&&this.instanceName!==e){this.instanceName=e;const t=this.onChangedCallbacks.slice();for(let r=0;r<t.length;r++)t[r](this,lne.NAME_CHANGED)}},D2.prototype.settingsChanged=function(){const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,lne.SETTINGS_CHANGED)},D2.prototype.exportSettings=function(){const e={};return e.dialog=this.typeName,e.name=this.instanceName,e},D2.prototype.importSettings=function(e){return e.dialog==this.typeName?(this.setName(e.name),!0):!1},D2.prototype.publishChanges=function(e,t,r){for(let n=0;n<this.eventNotifiers.length;n++)this.eventNotifiers[n].publish(this,t,e,r)},D2.prototype.getName=function(){return this.instanceName},D2.prototype.destroy=function(){const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,lne.DESTROYED);delete this},D2.prototype.addChangedCallback=function(e){this.onChangedCallbacks.includes(e)==!1&&this.onChangedCallbacks.push(e)},D2.prototype.removeChangedCallback=function(e){const t=this.onChangedCallbacks.indexOf(e);t>-1&&this.onChangedCallbacks.splice(t,1)},D2.prototype.addNotifier=function(e){this.eventNotifiers.push(e)};const ak={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},f8r=function(e,t,r){this.eventType=e,this.identifiers=t,this.zincObjects=r},m8r=function(e,t,r){this.targetedID=[];const n=e,i=t;this.targetEventType=r;const o=this;r===void 0&&(this.targetEventType=ak.ALL),this.getEventType=function(){return r},this.notify=function(s,l,c,u){if(s!==n&&(o.targetEventType===ak.ALL||o.targetEventType===l)){const d=new f8r(l,c,u);i(d)}}},g8r=function(){const e=[];this.publish=function(t,r,n,i){for(let o=0;o<e.length;o++)e[o].notify(t,r,n,i)},this.subscribe=function(t,r,n){if(typeof r=="function"){const i=new m8r(t,r,n);return e.push(i),i}},this.unsubscribe=function(t){for(let r=0;r<e.length;r++)if(t===e[r]){e.splice(r,1);return}}},y8r=function(){let e=[],t=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const r=[],n=[],i=this,o=function(c,u){if(c.length==0&&u.length==0)return!1;for(let d=0;d<c.length;d++){let p=!1;for(let h=0;h<u.length;h++)c[d]===u[h]&&(p=!0);if(!p)return!0}for(let d=0;d<u.length;d++){let p=!1;for(let h=0;h<c.length;h++)u[d]===c[h]&&(p=!0);if(!p)return!0}return!1},s=function(c,u){if(r.length=0,u.length==0)return c;for(let d=0;d<c.length;d++){let p=!1;for(let h=0;h<u.length;h++)c[d]===u[h]&&(p=!0);p||r.push(c[d])}return r};this.setHighlighted=function(c){const u=[...e];i.resetHighlighted();const d=s(c,t),p=l(d);for(let h=0;h<p.length;h++)p[h]&&p[h].material&&p[h].material.emissive&&p[h].material.emissive.setRGB(...i.highlightColour);return e=d,o(e,u)},this.setSelected=function(c){const u=[...t];s(e,c),i.resetHighlighted(),i.resetSelected();const d=l(c);for(let p=0;p<d.length;p++)d[p]&&d[p].material&&d[p].material.emissive&&d[p].material.emissive.setRGB(...i.selectColour);return t=c,o(t,u)};const l=function(c){n.length=0;for(let u=0;u<c.length;u++)c[u].material&&n.push(c[u]);return n};this.resetHighlighted=function(){const c=l(e);for(let u=0;u<c.length;u++)c[u]&&c[u].material&&(c[u].material.emissive&&c[u].material.emissive.setRGB(...i.originalColour),c[u].material.depthFunc&&(c[u].material.depthFunc=Uv.THREE.LessEqualDepth));e=[]},this.resetSelected=function(){const c=l(t);for(let u=0;u<c.length;u++)c[u]&&c[u].material&&(c[u].material.emissive&&c[u].material.emissive.setRGB(...i.originalColour),c[u].material.depthFunc&&(c[u].material.depthFunc=Uv.THREE.LessEqualDepth));t=[]},this.getSelected=function(){return t},this.reset=function(){i.resetSelected(),i.resetHighlighted()}},cne=zB.THREE,T8r=function(){const e=document.createElement("div");let t;if(e.style.height="100%",ZVe.isWebGLAvailable())t=new zB.Renderer(e,window),zB.defaultMaterialColor=16777116,t.initialiseVisualisation(),t.playAnimation=!1;else{const r=ZVe.getWebGLErrorMessage();e.appendChild(r)}return{Zinc:zB,renderer:t,container:e}},ts=function(){D2.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new y8r,this.zincRenderer=null,this.selectedScreenCoordinates=new cne.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0};ts.prototype=Object.create(D2.prototype),ts.prototype.getIntersectedObject=function(e){if(e){const t=e.map(n=>{if(n&&n.object&&n.object.userData){if(n.object.userData.isMarker)return 1;if(n.object.name&&n.object.userData.isZincObject)return 2}return 0});let r=t.indexOf(1);return r=r>-1?r:t.indexOf(2),e[r]}},ts.prototype.getAnnotationsFromObjects=function(e){const t=[];for(var r=0;r<e.length;r++){const n=e[r].userData;let i;if(n)if(n.isGlyph||n.isGlyphset){let o=n;n.isGlyph&&(o=n.getGlyphset()),i=o.userData?o.userData.annotation:void 0,i&&i.data&&(e[r].name&&e[r].name!=""?i.data.id=e[r].name:i.data.id=o.groupName)}else i=n.userData?n.userData.annotation:void 0,i&&i.data&&(i.data.id=e[r].name);i&&t.push(i)}return t},ts.prototype.setHighlightedByObjects=function(e,t,r){const n=this.graphicsHighlight.setHighlighted(e),i=this.objectsToZincObjects(e);if(r){let o=ak.MOVE;n&&(o=ak.HIGHLIGHTED);const s=this.getAnnotationsFromObjects(e);s.length>0&&(s[0].coords=t),this.publishChanges(s,o,i)}return n},ts.prototype.setHighlightedByZincObjects=function(e,t,r){let n=[];return e&&e.forEach(i=>{i&&i.morph&&n.push(i.morph)}),this.setHighlightedByObjects(n,t,r)},ts.prototype.setupLiveCoordinates=function(e){if(this.liveUpdatesObjects=e,e&&e.length>0){const t=this.scene.getBoundingBoxOfZincObjects(e);let r=new cne.Vector3;t.getCenter(r),this.selectedCenter==null?this.selectedCenter=r:this.selectedCenter.copy(r)}else this.selectedCenter=void 0},ts.prototype.objectsToZincObjects=function(e){const t=[];for(let r=0;r<e.length;r++){let n=e[r].userData;if(n)if(n.isGlyph||n.isGlyphset){let i=n;n.isGlyph&&(i=n.getGlyphset()),t.push(i)}else t.push(n)}return t},ts.prototype.setSelectedByObjects=function(e,t,r){const n=this.graphicsHighlight.setSelected(e);if(n){const i=this.objectsToZincObjects(e);if(this.setupLiveCoordinates(i),r){const o=ak.SELECTED,s=this.getAnnotationsFromObjects(e);s.length>0&&(s[0].coords=t),this.publishChanges(s,o,i)}}return n},ts.prototype.setSelectedByZincObjects=function(e,t,r){let n=[];return e&&e.forEach(i=>{i&&i.morph&&n.push(i.morph)}),this.setSelectedByObjects(n,t,r)};const v8r=function(e){return function(t){e.push(t.getMesh())}};ts.prototype.findObjectsByGroupName=function(e){const t=this.scene.findGeometriesWithGroupName(e),r=[];for(let i=0;i<t.length;i++)r.push(t[i].morph);const n=this.scene.findGlyphsetsWithGroupName(e);for(let i=0;i<n.length;i++)n[i].forEachGlyph(v8r(r));return r},ts.prototype.setHighlightedByGroupName=function(e,t){const r=this.findObjectsByGroupName(e);return this.setHighlightedByObjects(r,void 0,t)},ts.prototype.setSelectedByGroupName=function(e,t){const r=this.findObjectsByGroupName(e);return this.setSelectedByObjects(r,void 0,t)},ts.prototype.changeBackgroundColour=function(e){const t=new cne.Color(e);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(t,1)},ts.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},ts.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},ts.prototype.playAnimation=function(e){this.zincRenderer&&(this.zincRenderer.playAnimation=e)},ts.prototype.setPlayRate=function(e){this.zincRenderer&&this.zincRenderer.setPlayRate(e)},ts.prototype.getPlayRate=function(e){return this.zincRenderer?this.zincRenderer.getPlayRate():0},ts.prototype.initialiseRenderer=function(e){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let t=T8r();this.Zinc=t.Zinc,this.zincRenderer=t.renderer,this.rendererContainer=t.container}e&&(this.displayArea=e,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},ts.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),D2.prototype.destroy.call(this)};const Q8r=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},b8r=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.currentTime=0,this.timeVarying=!1},WVe=function(e){ts.call(this);const t=this;let r;this.sceneData=new b8r;const n=new Array,i=new Array,o=new Array;let s;const l=e;this.NDCCameraControl=void 0,t.typeName="Organ Viewer",this.currentTime=0,this.getSceneData=function(){return t.sceneData},this.updateTime=function(b){let L=6e3;t.scene&&(L=t.scene.getDuration());const w=b/100*L;t.sceneData.nerveMapIsActive||t.scene&&t.scene.setMorphsTime(w),t.sceneData.currentTime=b,t.currentTime=b};const c=function(){let b=3e3;t.scene&&(b=t.scene.getDuration());const L=t.zincRenderer.getCurrentTime();for(let w=0;w<n.length;w++)n[w](L);!t.sceneData.nerveMapIsActive&&r&&r.setMorphsTime(L),t.sceneData.nerveMap&&t.sceneData.nerveMap.additionalReader&&t.sceneData.nerveMap.additionalReader.setTime(L/b),t.sceneData.currentTime=L/b*100,t.currentTime=L/b*100};this.getCurrentTime=function(){return t.sceneData.currentTime},this.toggleSyncControl=(b,L)=>{let w=this.scene.getZincCameraControls();b?(w.resetView(),this.NDCCameraControl=w.enableSyncControl(),w.setRotationMode(L)):(w.disableSyncControl(),this.NDCCameraControl=void 0,w.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=b=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(b,2)},this.setSyncControlCallback=b=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(b)},this.setSyncControlCenterZoom=(b,L)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(b,L)};const u=function(){if(t.zincRenderer.playAnimation&&t.liveUpdatesObjects&&t.setupLiveCoordinates(t.liveUpdatesObjects),t.selectedCenter){const b=new Uv.THREE.Vector3;b.copy(t.selectedCenter);const L=t.scene.vectorToScreenXY(b);t.selectedScreenCoordinates.x=L.x,t.selectedScreenCoordinates.y=L.y}},d=function(){return function(){c()}},p=function(){return function(){u()}};this.addTimeChangedCallback=function(b){n.push(b)},this.setTexturePos=function(b){t.sceneData.nerveMap&&t.sceneData.nerveMap.additionalReader&&t.sceneData.nerveMap.additionalReader.setSliderPos(b)},this.addSceneChangedCallback=function(b){i.push(b)},this.addOrganPartAddedCallback=function(b){o.push(b)},this.setFinishDownloadCallback=function(b){s=b},this.unsetFinishDownloadCallback=function(){s=void 0},this.getNamedObjectsToScreenCoordinates=function(b,L){const w=new Uv.THREE.Vector3;w.setFromMatrixPosition(obj.matrixWorld);const k=width/2,C=height/2;return w.project(L),w.x=w.x*k+k,w.y=-(w.y*C)+C,w};const h=function(b){let L,w;if(b!==void 0){let k=!1;b.object.userData&&b.object.userData.isMarker?(k=!0,w=b.object.userData.parent.morph):w=b.object;try{w.userData.userData.annotation.data.lastActionOnMarker=k}finally{}if(w)if(w.name)L=w.name;else{const C=t.getAnnotationsFromObjects([w]);C&&C[0]&&(L=C[0].data.group)}}return{id:L,object:w}},f=function(){return function(b,L,w){const k=t.getIntersectedObject(b),C=h(k),A={x:L,y:w};if(C.id){C.object.userData.isGlyph?C.object.name?t.setSelectedByObjects([C.object],A,!0):t.setSelectedByZincObjects(C.object.userData.getGlyphset(),A,!0):t.setSelectedByObjects([C.object],A,!0);return}else t.setSelectedByObjects([],A,!0)}},m=function(){return function(b,L,w){const k=t.getIntersectedObject(b),C=h(k),A={x:L,y:w};if(C.id){t.displayArea.style.cursor="pointer",t.setHighlightedByObjects([C.object],A,!0);return}else t.displayArea.style.cursor="auto",t.setHighlightedByObjects([],A,!0)}},g=function(b,L,w,k){if(k=="all"||k=="geometries"){const C=b.findGeometriesWithGroupName(L);for(let A=0;A<C.length;A++)C[A].setVisibility(w)}if(k=="all"||k=="glyphsets"){const C=b.findGlyphsetsWithGroupName(L);for(let A=0;A<C.length;A++)C[A].setVisibility(w)}if(k=="all"||k=="pointsets"){const C=b.findPointsetsWithGroupName(L);for(let A=0;A<C.length;A++)C[A].setVisibility(w)}if(k=="all"||k=="lines"){const C=b.findLinesWithGroupName(L);for(let A=0;A<C.length;A++)C[A].setVisibility(w)}};this.changeGeometriesVisibility=function(b,L){g(t.scene,b,L,"geometries")},this.changeGlyphsetsVisibility=function(b,L){g(t.scene,b,L,"glyphsets")},this.changeLinesVisibility=function(b,L){g(t.scene,b,L,"lines")},this.changePointsetsVisibility=function(b,L){g(t.scene,b,L,"pointsets")},this.changeOrganPartsVisibility=function(b,L,w){let k="all";w!==void 0&&(k=w),g(t.scene,b,L,k)},this.changeOrganPartsVisibilityCallback=function(b){return function(L){t.changeOrganPartsVisibility(b,L)}},this.changeBackgroundColour=function(b){const L=new Uv.THREE.Color(b);t.zincRenderer&&t.zincRenderer.getThreeJSRenderer().setClearColor(L,1)};const T=function(b,L,w,k){for(let O=0;O<o.length;O++)o[O](k,t.scene.isTimeVarying());w&&l.setGeometryColour(k,b,L);const C=new Q8r,A=k.region.getFullPath();C.data={species:t.sceneData.currentSpecies,system:b,part:L,group:k.groupName,region:A,uuid:k.uuid,lastActionOnMarker:!1},k.userData.annotation=C},y=function(b,L,w){return function(k){T(b,L,w,k)}},v=function(){return function(){t.settingsChanged(),t.sceneData.timeVarying=t.scene.isTimeVarying(),s&&s()}};this.updateFieldvisibility=function(b,L){for(let w=0;w<b.length;w++)if(L!=w){const k=b[w].PartName;t.changeOrganPartsVisibility(k,!1)}if(L>-1){const w=b[L].PartName;if(t.scene.findGeometriesWithGroupName(w).length>0||t.scene.findGlyphsetsWithGroupName(w).length>0)t.changeOrganPartsVisibility(w,!0);else{const k=getOrganDetails(b[L].SystemName,w);k!=null&&t.scene.loadMetadataURL(l.getOrgansDirectoryPrefix()+"/"+k.meta)}}},this.getAvailableSpecies=function(b,L,w){const k=new Array;k.push("none");const C=Object.keys(organsFileMap);for(index in C){const A=C[index];A!=b&&organsFileMap[A].hasOwnProperty(L)&&organsFileMap[A][L].hasOwnProperty(w)&&k.push(A)}return k};const _=function(b,L,w,k){t.sceneData.nerveMapIsActive=!1,t.sceneData.nerveMap=void 0,t.sceneData.metaURL="",t.sceneData.viewURL="",t.sceneData.currentSpecies=b,t.sceneData.currentSystem=L,t.sceneData.currentPart=w,t.sceneData.currentTime=0,t.sceneData.timeVarying=!1,t.currentTime=0;let C="";b&&(C=b+"/"),L&&(C=L+"/"),w&&(C=w),t.sceneData.currentName=C};this.loadOrgansFromURL=function(b,L,w,k,C,A){if(t.zincRenderer&&k&&t.sceneData.metaURL!==b){_(L,w,k);const O=t.sceneData.currentName;let N=t.zincRenderer.getSceneByName(O);N?A&&N.clearAll():N=t.zincRenderer.createScene(O);for(let B=0;B<i.length;B++)i[B](t.sceneData);C&&C!=""?(t.sceneData.viewURL=C,N.loadViewURL(t.sceneData.viewURL)):t.sceneData.viewURL=void 0,t.sceneData.metaURL=b,N.loadMetadataURL(b,y(w,k,!1),v()),t.scene=N,t.zincRenderer.setCurrentScene(N),t.graphicsHighlight.reset();const I=N.getZincCameraControls();I.enableRaycaster(N,f(),m()),I.setMouseButtonAction("AUXILIARY","ZOOM"),I.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(b,L,w){if(t.zincRenderer&&L&&t.sceneData.metaURL!==b){_(void 0,void 0,L);const k=t.sceneData.currentName;let C=t.zincRenderer.getSceneByName(k);C?w&&C.clearAll():C=t.zincRenderer.createScene(k);for(let O=0;O<i.length;O++)i[O](t.sceneData);t.sceneData.viewURL=void 0,t.sceneData.metaURL=b,C.loadGLTF(b,y(void 0,L,!1),v()),t.scene=C,t.zincRenderer.setCurrentScene(C),t.graphicsHighlight.reset();const A=C.getZincCameraControls();A.enableRaycaster(C,f(),m()),A.setMouseButtonAction("AUXILIARY","ZOOM"),A.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(b){const L=t.graphicsHighlight.getSelected();L&&L[0]&&L[0].userData&&t.scene.alignObjectToCameraView(L[0].userData,b)},this.exportSettings=function(){const b={};return b.name=t.instanceName,t.sceneData.currentSystem&&(b.system=t.sceneData.currentSystem),t.sceneData.currentSpecies&&(b.species=t.sceneData.currentSpecies),t.sceneData.currentPart&&(b.part=t.sceneData.currentPart),b.metaURL=t.sceneData.metaURL,t.sceneData.viewURL&&(b.viewURL=t.sceneData.viewURL),b.dialog="Organ Viewer",b},this.importSettings=function(b){return b&&b.dialog==this.typeName?(t.setName(b.name),b.metaURL!==void 0&&b.metaURL!=""?t.loadOrgansFromURL(b.metaURL,b.species,b.system,b.part,b.viewURL,!0):t.loadOrgans(b.species,b.system,b.part),!0):!1},function(){t.initialiseRenderer(void 0),t.zincRenderer&&(t.zincRenderer.addPreRenderCallbackFunction(d()),t.zincRenderer.addPostRenderCallbackFunction(p()))}()};WVe.prototype=Object.create(ts.prototype);const x8r={name:"ScaffoldVuer",components:{Button:YN,Col:oS,Loading:ZCe,Option:kee,Popover:aR,Row:WT,Select:See,Slider:XT,TabPane:DCe,Tabs:BCe,MapSvgIcon:Wb,MapSvgSpriteColor:BC,PrimitiveControls:JCe,ScaffoldTooltip:rEe,TreeControls:tEe,ElIconWarningFilled:Xke,ElIconArrowDown:ON,ElIconArrowLeft:HN},props:{url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerLabels:{type:Array,default:function(){return[]}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url}},data:function(){return{currentTime:0,timeVarying:void 0,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],inHelp:!1,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:[],viewingMode:"Exploration",viewingModes:["Annotation","Exploration"],openMapRef:void 0,backgroundIconRef:void 0}},watch:{format:{handler:function(e){this.fileFormat=e},immediate:!0},url:{handler:function(e){(this.state===void 0||this.state.url===void 0)&&this.setURL(e)},immediate:!0},region:{handler:function(e){this.state||this.viewURL||this.setFocusedRegion(e)},immediate:!0},state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0},viewURL:{handler:function(e){this.updateViewURL(e)},immediate:!0},helpMode:function(e){this.setHelpMode(e)},displayMarkers:function(e){this.$module.scene.displayMarkers=e,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(e){this.$module.scene.displayMinimap=e},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(e){this.toggleRendering(e)},markerLabels:function(e){this.previousMarkerLabels.forEach(t=>{this.setMarkerModeForObjectsWithName(t,"off")}),e.forEach(t=>{this.setMarkerModeForObjectsWithName(t,"on")}),this.previousMarkerLabels=e}},beforeCreate:function(){this.$module=new WVe,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new t3r},created:function(){this.timeVarying=a.toRef(this.$module.sceneData,"timeVarying")},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.treeControls.setModule(this.$module);let e=new g8r;e.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(e),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer),this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()})},beforeDestroy:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},methods:{addZincObject:function(e){this.$module.scene&&(this.$module.scene.addZincObject(e),this.zincObjectAdded(e),this.$refs.treeControls&&this.$refs.treeControls.zincObjectAdded(e))},zincObjectAdded:function(e){this.loading=!1,this.$_searchIndex.addZincObject(e,e.uuid),this.$emit("zinc-object-added",e)},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(e=>{this.$_searchIndex.addRegion(e,e.uuid)})},backgroundChangeCallback:function(e){this.currentBackground=e,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let e=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),t=document.createElement("a");document.body.append(t),this.captureFilename?t.download=this.captureFilename:t.download="screenshot.png",t.href=e,t.click(),t.remove()},captureScreenshot:function(e){this.captureFilename=e,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.treeControls&&this.$refs.treeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},formatTooltip(e){if(this.timeMax>=1e3&&e){let t=(e%6e4/1e3).toFixed(2)+"s";return(e>6e4?(e/6e4).toFixed(0)+"m ":"")+t}return e?e.toFixed(2)+" ms":"0 ms"},fitWindow:function(){this.$module.scene&&this.$module.scene.viewAll()},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(e){this.currentSpeed=e,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(e){let t=[];return e&&e!=""&&this.$module.scene&&(t=this.$module.scene.findObjectsWithGroupName(e)),t},viewRegion:function(e){const t=this.$module.scene.getRootRegion(),r=Array.isArray(e)?e:[e],n=$T(t,r,"",!0);let i=this.$module.scene.getBoundingBoxOfZincObjects(n);if(i){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(i);else{const o=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(i),this.$module.scene.camera.far=this.$module.scene.camera.near+o,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(e){e&&(this.isReady?this.viewRegion(e):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:e})))},updateViewURL:function(e){if(e)if(this.isReady){const t=new URL(e,this.url);this.$module.scene.loadViewURL(t)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:e}))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let e=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,e.enableAutoTumble(),e.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},eventNotifierCallback:function(e){const t=[];let r=[];if((e.eventType==1||e.eventType==2)&&(e.identifiers.forEach(n=>{if(n){let i=n.data.id?n.data.id:n.data.group;t.push(i)}}),r=e.zincObjects),e.eventType==1)this.$refs.treeControls&&(t.length>0?this.$refs.treeControls.updateActiveUI(r):(this.hideRegionTooltip(),this.$refs.treeControls.removeActive(!0))),this.viewingMode==="Annotation"&&this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0),this.$emit("scaffold-selected",e.identifiers);else if(e.eventType==2){if(this.selectedObjects.length===0){if(this.hideRegionTooltip(),this.$refs.treeControls&&(t.length>0?this.$refs.treeControls.updateHoverUI(r):this.$refs.treeControls.removeHover(!0)),e.identifiers.length>0&&e.identifiers[0]){let n=e.identifiers[0].data.id?e.identifiers[0].data.id:e.identifiers[0].data.group;e.identifiers[0].coords&&(this.tData.active=!1,this.tData.visible=!0,this.tData.label=n,e.identifiers[0].data.region?this.tData.region=e.identifiers[0].data.region:this.tData.region=void 0,this.tData.x=e.identifiers[0].coords.x,this.tData.y=e.identifiers[0].coords.y)}this.$emit("scaffold-highlighted",e.identifiers)}}else if(e.eventType==3&&e.identifiers.length>0&&e.identifiers[0]&&e.identifiers[0].coords){const n=this.$refs.scaffoldContainer.getBoundingClientRect();this.tData.x=e.identifiers[0].coords.x-n.left,this.tData.y=e.identifiers[0].coords.y-n.top}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(e){let t=e/this.timeMax*100;t!=this.currentTime&&(this.$module.updateTime(t),console.log(this.currentTime))},objectSelected:function(e,t){this.selectedObjects=e,this.selectedObjects&&this.selectedObjects.length>0&&this.$refs.primitiveControls.setObject(this.selectedObjects[0]),this.$module.setSelectedByZincObjects(e,void 0,t)},objectHovered:function(e,t){this.hoveredObjects=e,this.$module.setHighlightedByZincObjects(e,void 0,t)},changeActiveByName:function(e,t,r){const n=Array.isArray(e);if(e===void 0||n&&e.length===0)this.$refs.treeControls.removeActive(r);else{let i=e;n||(i=[i]),this.$refs.treeControls.changeActiveByNames(i,t,r)}},changeHighlightedByName:function(e,t,r){const n=Array.isArray(e);if(e===void 0||n&&e.length===0)this.$refs.treeControls.removeHover(r);else{let i=e;n||(i=[i]),this.$refs.treeControls.changeHoverByNames(i,t,r)}},play:function(e){this.$module.playAnimation(e),this.isPlaying=e},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisibilities.forEach(t=>{t.value=!0})):(this.inHelp=!1,this.hoverVisibilities.forEach(t=>{t.value=!1}))},displayTooltipOfObjectsCallback:function(e,t,r,n,i){const o=this;return function(){o.$module.zincRenderer.removePostRenderCallbackFunction(o.$_regionTooltipCallback),o.$_regionTooltipCallback=void 0,o.displayTooltipOfObjects(e,t,r,n,i)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(e,t,r,n,i){if(t.length>0){let o=t[0].getClosestVertexDOMElementCoords(this.$module.scene);if(o)return o.inView?(e.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=e,this.tData.x=o.position.x,this.tData.y=o.position.y,this.tData.region=r,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),i&&(this.$module.setupLiveCoordinates(t),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),n&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(e,t,r,n,i)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(e,t,r,n,i){return e&&t&&t.length>0&&this.$module.scene?this.displayTooltipOfObjects(e,t,r,n,i):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(e,t,r){if(e&&this.$module.scene){const n=this.$module.scene.getRootRegion(),i=$T(n,[e],"",!0);let o;return i&&i.length>0&&(o=i[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(e,i,o,t,r)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(e,t,r){if(this.$module.scene){const n=eEe(this.$module.scene,e);if(n&&n.objects.length>0)return this.showRegionTooltipWithObjects(n.label,n.objects,n.regionPath,t,r)}return this.hideRegionTooltip(),!1},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setMarkerModeForObjectsWithName:function(e,t){if(e&&this.$module.scene){const r=this.$module.scene.getRootRegion();$T(r,[e],"",!0).forEach(n=>n.setMarkerMode(t))}},setMarkerModeWithAnnotations:function(e,t){if(this.$module.scene){const r=eEe(this.$module.scene,e);r&&r.objects.length>0&&r.objects.forEach(n=>n.setMarkerMode(t))}},showHelpText:function(e){this.inHelp||(this.helpTextWait=setTimeout(()=>{this.hoverVisibilities[e].value=!0},500))},hideHelpText:function(e){this.inHelp||(this.hoverVisibilities[e].value=!1,clearTimeout(this.helpTextWait))},search:function(e,t){if(this.$_searchIndex){if(e===void 0||e===""||Array.isArray(e)&&e.length===0)return this.objectSelected([],!0),!1;{const r=this.$_searchIndex.searchAndProcessResult(e),n=r.zincObjects;if(n.length>0){if(this.objectSelected(n,!0),t)for(let i=0;i<n.length;i++)n[i]&&n[i].groupName&&this.showRegionTooltipWithObjects(r.label,n,r.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(e){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(e)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(e=>{this.$module.scene.minimapScissor[e]=this.minimapSettings[e]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let e=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const t in e)this.timeStamps[e[t]]=t;this.timeMax=this.$module.scene.getDuration()},setURLFinishCallback:function(e){return()=>{if(e){if(e.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(e.viewport);else if(e.viewURL&&e.viewURL!==""){const t=new URL(e.viewURL,this.url);this.$module.scene.loadViewURL(t)}else e.region&&e.region!==""&&this.viewRegion(e.region);e.visibility&&this.$nextTick(()=>{this.$refs.treeControls.setState(e.visibility)})}this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.$emit("on-ready"),this.setMarkers(),this.isReady=!0}},getState:function(){let e={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0};if(this.$refs.treeControls&&(e.visibility=this.$refs.treeControls.getState()),this.$module.scene){let t=this.$module.scene.getZincCameraControls();e.viewport=t.getCurrentViewport()}return e},setState:function(e){e&&(e.url&&e.url!==this._currentURL?this.setURLAndState(e.url,{fileFormat:e.fileFormat,viewport:e.viewport,visibility:e.visibility}):(e.viewport||e.visibility)&&(this.isReady&&this.$module.scene?(e.viewport&&this.$module.scene.getZincCameraControls().setCurrentCameraSettings(e.viewport),e.visibility&&this.$refs.treeControls.setState(e.visibility)):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:e.viewport,visibility:e.visibility}))))},exportGLTF:function(e){return this.$module.scene.exportGLTF(e)},setURLAndState:function(e,t){if(e!=this._currentURL){t&&t.format&&(this.fileFormat=t.format);let r=t&&t.viewport?t.viewport:void 0,n=t&&t.visibility?t.visibility:void 0;this._currentURL=e,this.$refs.treeControls&&this.$refs.treeControls.clear(),this.loading=!0,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewport:r,region:this.region,viewURL:this.viewURL,visibility:n})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(e,"scene",!0):this.$module.loadOrgansFromURL(e,void 0,void 0,"scene",void 0,!0),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor())}},setURL:function(e){this.setURLAndState(e,void 0)},drawerToggled:function(e){this.drawerOpen=e,this.adjustLayout()},adjustLayout:function(){let e=this.$refs.scaffoldContainer.clientWidth;this.minimisedSlider=e<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""},toggleRendering:function(e){this.$module.zincRenderer&&(e?this.$module.zincRenderer.animate():this.$module.zincRenderer.stopAnimate())},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const e=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",e)},toggleSyncControl:function(e,t){this.$module.toggleSyncControl(e,t),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){this.markerLabels.forEach(e=>{this.setMarkerModeForObjectsWithName(e,"on")})}}},une=e=>(a.pushScopeId("data-v-69979745"),e=e(),a.popScopeId(),e),_8r={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},w8r=une(()=>a.createElementVNode("span",{class:"message-text"},"Beta",-1)),L8r=une(()=>a.createElementVNode("span",{class:"message-text"},"What's new?",-1)),S8r={class:"primitive-controls-box"},k8r={class:"animation-data"},M8r={class:"purple"},C8r={class:"animation-data"},E8r={class:"purple"},A8r={class:"animation-data"},O8r={class:"bottom-right-control"},H8r=une(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),V8r=["onClick"];function I8r(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=rEe,c=Xke,u=ja,d=aR,p=tEe,h=JCe,f=a.resolveComponent("map-svg-icon"),m=XT,g=WT,T=DCe,y=kee,v=See,_=BCe,b=YN,L=oS,w=hR;return a.withDirectives((a.openBlock(),a.createElementBlock("div",_8r,[a.createVNode(s),a.createVNode(l,{label:e.tData.label,region:e.tData.region,visible:e.tData.visible,x:e.tData.x,y:e.tData.y,annotationDisplay:e.viewingMode==="Annotation"&&e.tData.active===!0},null,8,["label","region","visible","x","y","annotationDisplay"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:t[0]||(t[0]=a.withKeys((...k)=>o.backgroundChangeCallback&&o.backgroundChangeCallback(...k),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[r.displayWarning?(a.openBlock(),a.createBlock(d,{key:0,ref:"warningPopover",visible:e.hoverVisibilities[6].value,content:r.warningMessage,placement:"right",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[r.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon",onMouseover:t[1]||(t[1]=k=>o.showHelpText(6)),onMouseout:t[2]||(t[2]=k=>o.hideHelpText(6))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),w8r],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),r.displayLatestChanges?(a.openBlock(),a.createBlock(d,{key:1,visible:e.hoverVisibilities[7].value,content:r.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[r.displayLatestChanges&&r.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon",onMouseover:t[3]||(t[3]=k=>o.showHelpText(7)),onMouseout:t[4]||(t[4]=k=>o.hideHelpText(7))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),L8r],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(d,{visible:e.hoverVisibilities[5].value,content:"Change region visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"treeControls","help-mode":r.helpMode,isReady:e.isReady,"show-colour-picker":r.showColourPicker,onObjectSelected:o.objectSelected,onObjectHovered:o.objectHovered,onDrawerToggled:o.drawerToggled},null,8,["help-mode","isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",S8r,[a.createVNode(h,{ref:"primitiveControls"},null,512)]),e.timeVarying?(a.openBlock(),a.createBlock(d,{key:2,ref:"sliderPopover",visible:e.hoverVisibilities[4].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[e.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container",[e.minimisedSlider?"minimised":"",e.sliderPosition]])},[a.createVNode(_,{type:"card"},{default:a.withCtx(()=>[a.createVNode(T,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(g,{class:"tab-content"},{default:a.withCtx(()=>[e.isPlaying?(a.openBlock(),a.createBlock(f,{key:0,icon:"pause",class:"icon-button video-button",onClick:t[5]||(t[5]=k=>o.play(!1))})):(a.openBlock(),a.createBlock(f,{key:1,icon:"play",class:"video-button icon-button",onClick:t[6]||(t[6]=k=>o.play(!0))})),a.createVNode(m,{min:0,max:e.timeMax,"model-value":e.currentTime/100*e.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":o.formatTooltip,marks:e.timeStamps,onInput:t[7]||(t[7]=k=>o.timeChange(k))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(T,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(g,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",k8r,[a.createTextVNode(" Original duration: "),a.createElementVNode("div",M8r,a.toDisplayString(e.orginalDuration),1)]),a.createElementVNode("div",C8r,[a.createTextVNode(" Animation duration: "),a.createElementVNode("div",E8r,a.toDisplayString(e.animateDuration),1)]),a.createElementVNode("div",A8r,[a.createTextVNode(" Playback speed "),a.createVNode(v,{teleported:!0,"model-value":e.currentSpeed,placeholder:"Select",class:"select-box","popper-class":"scaffold_viewer_dropdown",onChange:t[8]||(t[8]=k=>o.speedChanged(k))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.playSpeed,k=>(a.openBlock(),a.createBlock(y,{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",O8r,[a.createVNode(d,{visible:e.hoverVisibilities[0].value,content:"Zoom in",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable"},{reference:a.withCtx(()=>[a.createVNode(f,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[9]||(t[9]=k=>o.zoomIn()),onMouseover:t[10]||(t[10]=k=>o.showHelpText(0)),onMouseout:t[11]||(t[11]=k=>o.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(d,{visible:e.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable"},{reference:a.withCtx(()=>[a.createVNode(f,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[12]||(t[12]=k=>o.zoomOut()),onMouseover:t[13]||(t[13]=k=>o.showHelpText(1)),onMouseout:t[14]||(t[14]=k=>o.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(d,{visible:e.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper non-selectable"},{reference:a.withCtx(()=>[a.createVNode(f,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[15]||(t[15]=k=>o.fitWindow()),onMouseover:t[16]||(t[16]=k=>o.showHelpText(2)),onMouseout:t[17]||(t[17]=k=>o.hideHelpText(2))})]),default:a.withCtx(()=>[H8r]),_:1},8,["visible"])]),e.openMapRef?(a.openBlock(),a.createBlock(d,{key:3,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.openMapOptions,k=>(a.openBlock(),a.createBlock(g,{key:k.key},{default:a.withCtx(()=>[a.createVNode(b,{type:"primary",plain:"",onClick:C=>e.$emit("open-map",k.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(k.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(g,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(g,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(v,{teleported:!1,modelValue:e.viewingMode,"onUpdate:modelValue":t[18]||(t[18]=k=>e.viewingMode=k),placeholder:"Select",class:"select-box viewing-mode","popper-class":"scaffold_viewer_dropdown"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.viewingModes,k=>(a.openBlock(),a.createBlock(y,{key:k,label:k,value:k},{default:a.withCtx(()=>[a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(L,{span:12},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(k),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a.createVNode(g,{class:"backgroundSpacer"}),a.createVNode(g,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode(" Change background ")]),_:1}),a.createVNode(g,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.availableBackground,k=>(a.openBlock(),a.createElementBlock("div",{key:k,class:a.normalizeClass(["backgroundChoice",k,k==e.currentBackground?"active":""]),onClick:C=>o.backgroundChangeCallback(k)},null,10,V8r))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(d,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:a.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(a.openBlock(),a.createBlock(f,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[19]||(t[19]=k=>o.showHelpText(8)),onMouseout:t[20]||(t[20]=k=>o.hideHelpText(8))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(d,{visible:e.hoverVisibilities[3].value,content:"Change background color",placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable"},{reference:a.withCtx(()=>[a.createVNode(f,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[21]||(t[21]=k=>o.showHelpText(3)),onMouseout:t[22]||(t[22]=k=>o.hideHelpText(3))},null,512)]),_:1},8,["visible"])]),_:1})],2)],512),[[a.vShow,r.displayUI&&!e.isTransitioning]])])),[[w,e.loading]])}const P8r={name:"Scaffold",mixins:[ay],components:{ScaffoldVuer:YT(x8r,[["render",I8r],["__scopeId","data-v-69979745"]])},methods:{onResize:function(){this.scaffoldCamera.onResize()},getState:function(){return this.$refs.scaffold.getState()},search:function(e){const t=e.replace(/(^"|"$)/g,"");return this.$refs.scaffold.search(t,!0)},searchSuggestions:function(e,t){if(e===""||!this.$refs.scaffold)return t;this.$refs.scaffold.fetchSuggestions(e).forEach(n=>{n.suggestion&&t.push(n.suggestion)})},handleSyncPanZoomEvent:function(e){if(!this.mouseHovered&&e.type!==this.entry.type){const t=e.payload.origin,r=e.payload.size,n=[t[0]+r[0]/2,t[1]+r[1]/2],i=[(n[0]-.5)*2,(.5-n[1])*2],o=1/Math.max(r[0],r[1]);this.$refs.scaffold.$module.setSyncControlCenterZoom(i,o)}},displayTooltip:function(e){let t;e&&(t=e.name),t?this.$refs.scaffold.search(t,!0):this.$refs.scaffold.hideRegionTooltip()},zoomToFeatures:function(e,t){let r;Array.isArray(e)?r=e:r=[e.name],t&&this.$refs.scaffold.changeActiveByName(r,"",!1),this.$refs.scaffold.viewRegion(r)},highlightFeatures:function(e){let t;Array.isArray(e)?t=e:t=[e.name],this.$refs.scaffold.changeHighlightedByName(t,"",!1)},scaffoldIsReady:function(){if(this.scaffoldLoaded=!0,this.$refs.scaffold.$module.graphicsHighlight.highlightColour=[1,0,1],this.isVisible()){let e="free";this.entry.rotation&&(e=this.entry.rotation),this.$refs.scaffold.toggleSyncControl(this.splitFlowStore.globalCallback,e),this.splitFlowStore.syncMode&&this.$refs.scaffold.fitWindow()}},requestSynchronisedEvent:function(e){if(this.scaffoldLoaded){let t="free";this.entry.rotation&&(t=this.entry.rotation),this.$refs.scaffold.toggleSyncControl(e,t)}},scaffoldHighlighted:function(e,t){const r={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0};t&&t[0]&&(r.internalName=t[0].data.id,r.eventType="highlighted"),this.$emit("resource-selected",r)},scaffoldNavigated:function(e,t){if(this.mouseHovered){const r={paneIndex:this.entry.id,eventType:"panZoom",payload:t,type:e};this.$emit("resource-selected",r)}},updateWithViewUrl:function(e){this.$refs.scaffold.updateViewURL(e)}},computed:{warningMessage:function(){return this.entry.isBodyScaffold?"This map displays the anatomical location and connectivity of nerves, through which the neuron populations from the ApiNATOMY models available in SCKAN can be routed.":"Under active development"},markerLabels:function(){return this.settingsStore.facetLabels}},data:function(){return{apiLocation:process.env.VUE_APP_API_LOCATION,scaffoldCamera:void 0,scaffoldLoaded:!1}},mounted:function(){this.scaffoldCamera=this.$refs.scaffold.$module.scene.getZincCameraControls(),Xo.on("startHelp",()=>{this.startHelp()})}};function N8r(e,t,r,n,i,o){const s=a.resolveComponent("ScaffoldVuer");return a.openBlock(),a.createBlock(s,{state:e.entry.state,url:e.entry.resource,region:e.entry.region,onScaffoldSelected:t[0]||(t[0]=l=>e.resourceSelected(e.entry.type,l,!0)),onScaffoldHighlighted:t[1]||(t[1]=l=>o.scaffoldHighlighted(e.entry.type,l)),onScaffoldNavigated:t[2]||(t[2]=l=>o.scaffoldNavigated(e.entry.type,l)),onOnReady:o.scaffoldIsReady,onOpenMap:e.openMap,ref:"scaffold","background-toggle":!0,traditional:!0,"help-mode":e.helpMode,render:e.visible,"display-latest-message":!0,"warning-message":o.warningMessage,"display-minimap":!1,"display-markers":!1,enableOpenMapUI:!0,"view-u-r-l":e.entry.viewUrl,markerLabels:o.markerLabels,flatmapAPI:e.flatmapAPI},null,8,["state","url","region","onOnReady","onOpenMap","help-mode","render","warning-message","view-u-r-l","markerLabels","flatmapAPI"])}const R8r=Gl(P8r,[["render",N8r],["__scopeId","data-v-4a090bca"]]),Wp=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var KVe;const Ml=typeof window<"u",B8r=e=>typeof e=="string",XVe=()=>{},D8r=Ml&&((KVe=window==null?void 0:window.navigator)==null?void 0:KVe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function JVe(e){return typeof e=="function"?e():a.unref(e)}function F8r(e){return e}function jB(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function z8r(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function Kp(e){var t;const r=JVe(e);return(t=r==null?void 0:r.$el)!=null?t:r}const UB=Ml?window:void 0;function J5(...e){let t,r,n,i;if(B8r(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=UB):[t,r,n,i]=e,!t)return XVe;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,p,h,f)=>(d.addEventListener(p,h,f),()=>d.removeEventListener(p,h,f)),c=a.watch(()=>[Kp(t),JVe(i)],([d,p])=>{s(),d&&o.push(...r.flatMap(h=>n.map(f=>l(d,h,f,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return jB(u),u}let YVe=!1;function j8r(e,t,r={}){const{window:n=UB,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;D8r&&!YVe&&(YVe=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",XVe)));let l=!0;const c=d=>i.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(h=>h===d.target||d.composedPath().includes(h));{const h=Kp(p);return h&&(d.target===h||d.composedPath().includes(h))}}),u=[J5(n,"click",d=>{const p=Kp(e);if(!(!p||p===d.target||d.composedPath().includes(p))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),J5(n,"pointerdown",d=>{const p=Kp(e);p&&(l=!d.composedPath().includes(p)&&!c(d))},{passive:!0}),s&&J5(n,"blur",d=>{var p;const h=Kp(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function $Ve(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),z8r(n,t),r}const eIe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},tIe="__vueuse_ssr_handlers__";eIe[tIe]=eIe[tIe]||{};var rIe=Object.getOwnPropertySymbols,U8r=Object.prototype.hasOwnProperty,G8r=Object.prototype.propertyIsEnumerable,q8r=(e,t)=>{var r={};for(var n in e)U8r.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rIe)for(var n of rIe(e))t.indexOf(n)<0&&G8r.call(e,n)&&(r[n]=e[n]);return r};function Xp(e,t,r={}){const n=r,{window:i=UB}=n,o=q8r(n,["window"]);let s;const l=$Ve(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>Kp(e),p=>{c(),l.value&&i&&p&&(s=new ResizeObserver(t),s.observe(p,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return jB(d),{isSupported:l,stop:d}}var nIe=Object.getOwnPropertySymbols,Z8r=Object.prototype.hasOwnProperty,W8r=Object.prototype.propertyIsEnumerable,K8r=(e,t)=>{var r={};for(var n in e)Z8r.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nIe)for(var n of nIe(e))t.indexOf(n)<0&&W8r.call(e,n)&&(r[n]=e[n]);return r};function X8r(e,t,r={}){const n=r,{window:i=UB}=n,o=K8r(n,["window"]);let s;const l=$Ve(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>Kp(e),p=>{c(),l.value&&i&&p&&(s=new MutationObserver(t),s.observe(p,o))},{immediate:!0}),d=()=>{c(),u()};return jB(d),{isSupported:l,stop:d}}var iIe;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(iIe||(iIe={}));var J8r=Object.defineProperty,oIe=Object.getOwnPropertySymbols,Y8r=Object.prototype.hasOwnProperty,$8r=Object.prototype.propertyIsEnumerable,aIe=(e,t,r)=>t in e?J8r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,emr=(e,t)=>{for(var r in t||(t={}))Y8r.call(t,r)&&aIe(e,r,t[r]);if(oIe)for(var r of oIe(t))$8r.call(t,r)&&aIe(e,r,t[r]);return e};emr({linear:F8r},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const tmr=()=>Ml&&/firefox/i.test(window.navigator.userAgent);/**
4720
4720
  * @vue/shared v3.4.15
4721
4721
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4722
4722
  * @license MIT