@abi-software/flatmapvuer 0.6.1-auth.0 → 0.6.1-auth.1
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.
- package/dist/flatmapvuer.js +13 -9
- package/dist/flatmapvuer.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +1 -1
- package/src/components/FlatmapVuer.vue +26 -21
package/dist/flatmapvuer.umd.cjs
CHANGED
|
@@ -1695,4 +1695,4 @@ ${n.vs}`,n}setDataProperty(n,r,i){const o=ve(this,Z4).get(+n);o&&(!(r in o)||o[r
|
|
|
1695
1695
|
`;)e.i++;e.i++},Math:function(e,t){e.saveText();for(var n=e.i,r,i,o=0;i=e.GetNext();)switch(r=e.i++,i){case"\\":var a=e.GetCS();a===")"&&(i="\\(");case"$":if(o===0&&t===i){var s=e.texParser.configuration,d=new Pct.default(e.string.substr(n,r-n),e.stack.env,s).mml();e.PushMath(d);return}break;case"{":o++;break;case"}":o===0&&e.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace"),o--;break}e.Error("MathNotTerminated","Math-mode is not properly terminated")},MathModeOnly:function(e,t){e.Error("MathModeOnly","'%1' allowed only in math mode",t)},Misplaced:function(e,t){e.Error("Misplaced","'%1' can not be used here",t)},OpenBrace:function(e,t){var n=e.stack.env;e.envStack.push(n),e.stack.env=Object.assign({},n)},CloseBrace:function(e,t){e.envStack.length?(e.saveText(),e.stack.env=e.envStack.pop()):e.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace")},OpenQuote:function(e,t){e.string.charAt(e.i)===t?(e.text+="“",e.i++):e.text+="‘"},CloseQuote:function(e,t){e.string.charAt(e.i)===t?(e.text+="”",e.i++):e.text+="’"},Tilde:function(e,t){e.text+=" "},Space:function(e,t){for(e.text+=" ";e.GetNext().match(/\s/);)e.i++},SelfQuote:function(e,t){e.text+=t.substr(1)},Insert:function(e,t,n){e.text+=n},Accent:function(e,t,n){var r=e.ParseArg(t),i=e.create("token","mo",{},n);e.addAttributes(i),e.Push(e.create("node","mover",[r,i]))},Emph:function(e,t){var n=e.stack.env.mathvariant==="-tex-mathit"?"normal":"-tex-mathit";e.Push(e.ParseTextArg(t,{mathvariant:n}))},SetFont:function(e,t,n){e.saveText(),e.stack.env.mathvariant=n},SetSize:function(e,t,n){e.saveText(),e.stack.env.mathsize=n},CheckAutoload:function(e,t){var n=e.configuration.packageData.get("autoload"),r=e.texParser;t=t.slice(1);var i=r.lookup("macro",t);if(!i||n&&i._func===n.Autoload){if(r.parse("macro",[r,t]),!i)return;(0,kct.retryAfter)(Promise.resolve())}r.parse("macro",[e,t])},Macro:U5.default.Macro,Spacer:U5.default.Spacer,Hskip:U5.default.Hskip,rule:U5.default.rule,Rule:U5.default.Rule,HandleRef:U5.default.HandleRef};var oc={},Bct=I&&I.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vO=I&&I.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Rct=I&&I.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Nct=I&&I.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Xd=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(oc,"__esModule",{value:!0}),oc.TextParser=void 0;var Fct=Xd(Hi()),xO=Xd(hr),jct=Xd(Pr()),zct=pn,bO=Xd(Ir),LO=Qn,Uct=function(e){Bct(t,e);function t(n,r,i,o){var a=e.call(this,n,r,i)||this;return a.level=o,a}return Object.defineProperty(t.prototype,"texParser",{get:function(){return this.configuration.packageData.get("textmacros").texParser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){return this.texParser.tags},enumerable:!1,configurable:!0}),t.prototype.mml=function(){return this.level!=null?this.create("node","mstyle",this.nodes,{displaystyle:!1,scriptlevel:this.level}):this.nodes.length===1?this.nodes[0]:this.create("node","mrow",this.nodes)},t.prototype.Parse=function(){this.text="",this.nodes=[],this.envStack=[],e.prototype.Parse.call(this)},t.prototype.saveText=function(){if(this.text){var n=this.stack.env.mathvariant,r=jct.default.internalText(this,this.text,n?{mathvariant:n}:{});this.text="",this.Push(r)}},t.prototype.Push=function(n){if(this.text&&this.saveText(),n instanceof LO.StopItem)return e.prototype.Push.call(this,n);if(n instanceof LO.StyleItem){this.stack.env.mathcolor=this.stack.env.color;return}n instanceof zct.AbstractMmlNode&&(this.addAttributes(n),this.nodes.push(n))},t.prototype.PushMath=function(n){var r,i,o=this.stack.env;n.isKind("TeXAtom")||(n=this.create("node","TeXAtom",[n]));try{for(var a=vO(["mathsize","mathcolor"]),s=a.next();!s.done;s=a.next()){var d=s.value;o[d]&&!n.attributes.getExplicit(d)&&(!n.isToken&&!n.isKind("mstyle")&&(n=this.create("node","mstyle",[n])),bO.default.setAttribute(n,d,o[d]))}}catch(f){r={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}n.isInferred&&(n=this.create("node","mrow",n.childNodes)),this.nodes.push(n)},t.prototype.addAttributes=function(n){var r,i,o=this.stack.env;if(n.isToken)try{for(var a=vO(["mathsize","mathcolor","mathvariant"]),s=a.next();!s.done;s=a.next()){var d=s.value;o[d]&&!n.attributes.getExplicit(d)&&bO.default.setAttribute(n,d,o[d])}}catch(f){r={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},t.prototype.ParseTextArg=function(n,r){var i=this.GetArgument(n);return r=Object.assign(Object.assign({},this.stack.env),r),new t(i,r,this.configuration).mml()},t.prototype.ParseArg=function(n){return new t(this.GetArgument(n),this.stack.env,this.configuration).mml()},t.prototype.Error=function(n,r){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];throw new(xO.default.bind.apply(xO.default,Nct([void 0,n,r],Rct(i),!1)))},t}(Fct.default);oc.TextParser=Uct;var $ct=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Gct=gn,so=yi,Zct=z5,qct=$ct(Pr()),Wct=oc;new Gct.CommandMap("textcomp-macros",{textasciicircum:["Insert","^"],textasciitilde:["Insert","~"],textasteriskcentered:["Insert","*"],textbackslash:["Insert","\\"],textbar:["Insert","|"],textbraceleft:["Insert","{"],textbraceright:["Insert","}"],textbullet:["Insert","•"],textdagger:["Insert","†"],textdaggerdbl:["Insert","‡"],textellipsis:["Insert","…"],textemdash:["Insert","—"],textendash:["Insert","–"],textexclamdown:["Insert","¡"],textgreater:["Insert",">"],textless:["Insert","<"],textordfeminine:["Insert","ª"],textordmasculine:["Insert","º"],textparagraph:["Insert","¶"],textperiodcentered:["Insert","·"],textquestiondown:["Insert","¿"],textquotedblleft:["Insert","“"],textquotedblright:["Insert","”"],textquoteleft:["Insert","‘"],textquoteright:["Insert","’"],textsection:["Insert","§"],textunderscore:["Insert","_"],textvisiblespace:["Insert","␣"],textacutedbl:["Insert","˝"],textasciiacute:["Insert","´"],textasciibreve:["Insert","˘"],textasciicaron:["Insert","ˇ"],textasciidieresis:["Insert","¨"],textasciimacron:["Insert","¯"],textgravedbl:["Insert","˵"],texttildelow:["Insert","˷"],textbaht:["Insert","฿"],textcent:["Insert","¢"],textcolonmonetary:["Insert","₡"],textcurrency:["Insert","¤"],textdollar:["Insert","$"],textdong:["Insert","₫"],texteuro:["Insert","€"],textflorin:["Insert","ƒ"],textguarani:["Insert","₲"],textlira:["Insert","₤"],textnaira:["Insert","₦"],textpeso:["Insert","₱"],textsterling:["Insert","£"],textwon:["Insert","₩"],textyen:["Insert","¥"],textcircledP:["Insert","℗"],textcompwordmark:["Insert",""],textcopyleft:["Insert","🄯"],textcopyright:["Insert","©"],textregistered:["Insert","®"],textservicemark:["Insert","℠"],texttrademark:["Insert","™"],textbardbl:["Insert","‖"],textbigcircle:["Insert","◯"],textblank:["Insert","␢"],textbrokenbar:["Insert","¦"],textdiscount:["Insert","⁒"],textestimated:["Insert","℮"],textinterrobang:["Insert","‽"],textinterrobangdown:["Insert","⸘"],textmusicalnote:["Insert","♪"],textnumero:["Insert","№"],textopenbullet:["Insert","◦"],textpertenthousand:["Insert","‱"],textperthousand:["Insert","‰"],textrecipe:["Insert","℞"],textreferencemark:["Insert","※"],textlangle:["Insert","〈"],textrangle:["Insert","〉"],textlbrackdbl:["Insert","⟦"],textrbrackdbl:["Insert","⟧"],textlquill:["Insert","⁅"],textrquill:["Insert","⁆"],textcelsius:["Insert","℃"],textdegree:["Insert","°"],textdiv:["Insert","÷"],textdownarrow:["Insert","↓"],textfractionsolidus:["Insert","⁄"],textleftarrow:["Insert","←"],textlnot:["Insert","¬"],textmho:["Insert","℧"],textminus:["Insert","−"],textmu:["Insert","µ"],textohm:["Insert","Ω"],textonehalf:["Insert","½"],textonequarter:["Insert","¼"],textonesuperior:["Insert","¹"],textpm:["Insert","±"],textrightarrow:["Insert","→"],textsurd:["Insert","√"],textthreequarters:["Insert","¾"],textthreesuperior:["Insert","³"],texttimes:["Insert","×"],texttwosuperior:["Insert","²"],textuparrow:["Insert","↑"],textborn:["Insert","*"],textdied:["Insert","†"],textdivorced:["Insert","⚮"],textmarried:["Insert","⚭"],textcentoldstyle:["Insert","¢",so.TexConstant.Variant.OLDSTYLE],textdollaroldstyle:["Insert","$",so.TexConstant.Variant.OLDSTYLE],textzerooldstyle:["Insert","0",so.TexConstant.Variant.OLDSTYLE],textoneoldstyle:["Insert","1",so.TexConstant.Variant.OLDSTYLE],texttwooldstyle:["Insert","2",so.TexConstant.Variant.OLDSTYLE],textthreeoldstyle:["Insert","3",so.TexConstant.Variant.OLDSTYLE],textfouroldstyle:["Insert","4",so.TexConstant.Variant.OLDSTYLE],textfiveoldstyle:["Insert","5",so.TexConstant.Variant.OLDSTYLE],textsixoldstyle:["Insert","6",so.TexConstant.Variant.OLDSTYLE],textsevenoldstyle:["Insert","7",so.TexConstant.Variant.OLDSTYLE],texteightoldstyle:["Insert","8",so.TexConstant.Variant.OLDSTYLE],textnineoldstyle:["Insert","9",so.TexConstant.Variant.OLDSTYLE]},{Insert:function(e,t,n,r){if(e instanceof Wct.TextParser){if(!r){Zct.TextMacrosMethods.Insert(e,t,n);return}e.saveText()}e.Push(qct.default.internalText(e,n,r?{mathvariant:r}:{}))}}),Object.defineProperty(gy,"__esModule",{value:!0}),gy.TextcompConfiguration=void 0;var Xct=rr;gy.TextcompConfiguration=Xct.Configuration.create("textcomp",{handler:{macro:["textcomp-macros"]}});var ac={},wO=gn,La=yi,EO=z5,G4=pa;new wO.MacroMap("text-special",{$:"Math","%":"Comment","^":"MathModeOnly",_:"MathModeOnly","&":"Misplaced","#":"Misplaced","~":"Tilde"," ":"Space"," ":"Space","\r":"Space","\n":"Space"," ":"Tilde","{":"OpenBrace","}":"CloseBrace","`":"OpenQuote","'":"CloseQuote"},EO.TextMacrosMethods),new wO.CommandMap("text-macros",{"(":"Math",$:"SelfQuote",_:"SelfQuote","%":"SelfQuote","{":"SelfQuote","}":"SelfQuote"," ":"SelfQuote","&":"SelfQuote","#":"SelfQuote","\\":"SelfQuote","'":["Accent","´"],"’":["Accent","´"],"`":["Accent","`"],"‘":["Accent","`"],"^":["Accent","^"],'"':["Accent","¨"],"~":["Accent","~"],"=":["Accent","¯"],".":["Accent","˙"],u:["Accent","˘"],v:["Accent","ˇ"],emph:"Emph",rm:["SetFont",La.TexConstant.Variant.NORMAL],mit:["SetFont",La.TexConstant.Variant.ITALIC],oldstyle:["SetFont",La.TexConstant.Variant.OLDSTYLE],cal:["SetFont",La.TexConstant.Variant.CALLIGRAPHIC],it:["SetFont","-tex-mathit"],bf:["SetFont",La.TexConstant.Variant.BOLD],bbFont:["SetFont",La.TexConstant.Variant.DOUBLESTRUCK],scr:["SetFont",La.TexConstant.Variant.SCRIPT],frak:["SetFont",La.TexConstant.Variant.FRAKTUR],sf:["SetFont",La.TexConstant.Variant.SANSSERIF],tt:["SetFont",La.TexConstant.Variant.MONOSPACE],tiny:["SetSize",.5],Tiny:["SetSize",.6],scriptsize:["SetSize",.7],small:["SetSize",.85],normalsize:["SetSize",1],large:["SetSize",1.2],Large:["SetSize",1.44],LARGE:["SetSize",1.73],huge:["SetSize",2.07],Huge:["SetSize",2.49],Bbb:["Macro","{\\bbFont #1}",1],textnormal:["Macro","{\\rm #1}",1],textup:["Macro","{\\rm #1}",1],textrm:["Macro","{\\rm #1}",1],textit:["Macro","{\\it #1}",1],textbf:["Macro","{\\bf #1}",1],textsf:["Macro","{\\sf #1}",1],texttt:["Macro","{\\tt #1}",1],dagger:["Insert","†"],ddagger:["Insert","‡"],S:["Insert","§"],",":["Spacer",G4.MATHSPACE.thinmathspace],":":["Spacer",G4.MATHSPACE.mediummathspace],">":["Spacer",G4.MATHSPACE.mediummathspace],";":["Spacer",G4.MATHSPACE.thickmathspace],"!":["Spacer",G4.MATHSPACE.negativethinmathspace],enspace:["Spacer",.5],quad:["Spacer",1],qquad:["Spacer",2],thinspace:["Spacer",G4.MATHSPACE.thinmathspace],negthinspace:["Spacer",G4.MATHSPACE.negativethinmathspace],hskip:"Hskip",hspace:"Hskip",kern:"Hskip",mskip:"Hskip",mspace:"Hskip",mkern:"Hskip",rule:"rule",Rule:["Rule"],Space:["Rule","blank"],color:"CheckAutoload",textcolor:"CheckAutoload",colorbox:"CheckAutoload",fcolorbox:"CheckAutoload",href:"CheckAutoload",style:"CheckAutoload",class:"CheckAutoload",cssId:"CheckAutoload",unicode:"CheckAutoload",ref:["HandleRef",!1],eqref:["HandleRef",!0]},EO.TextMacrosMethods);var Kct=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$5;Object.defineProperty(ac,"__esModule",{value:!0}),ac.TextMacrosConfiguration=ac.TextBaseConfiguration=void 0;var yy=rr,Yct=Kct(r9),MO=ls,w3=Qn,AO=oc,Jct=z5;ac.TextBaseConfiguration=yy.Configuration.create("text-base",{parser:"text",handler:{character:["command","text-special"],macro:["text-macros"]},fallback:{character:function(e,t){e.text+=t},macro:function(e,t){var n=e.texParser,r=n.lookup("macro",t);r&&r._func!==Jct.TextMacrosMethods.Macro&&e.Error("MathMacro","%1 is only supported in math mode","\\"+t),n.parse("macro",[e,t])}},items:($5={},$5[w3.StartItem.prototype.kind]=w3.StartItem,$5[w3.StopItem.prototype.kind]=w3.StopItem,$5[w3.MmlItem.prototype.kind]=w3.MmlItem,$5[w3.StyleItem.prototype.kind]=w3.StyleItem,$5)});function t8t(e,t,n,r){var i=e.configuration.packageData.get("textmacros");return e instanceof AO.TextParser||(i.texParser=e),[new AO.TextParser(t,r?{mathvariant:r}:{},i.parseOptions,n).mml()]}ac.TextMacrosConfiguration=yy.Configuration.create("textmacros",{config:function(e,t){var n=new yy.ParserConfiguration(t.parseOptions.options.textmacros.packages,["tex","text"]);n.init();var r=new Yct.default(n,[]);r.options=t.parseOptions.options,n.config(t),MO.TagsFactory.addTags(n.tags),r.tags=MO.TagsFactory.getDefault(),r.tags.configuration=r,r.packageData=t.parseOptions.packageData,r.packageData.set("textmacros",{parseOptions:r,jax:t,texParser:null}),r.options.internalMath=t8t},preprocessors:[function(e){var t=e.data.packageData.get("textmacros");t.parseOptions.nodeFactory.setMmlFactory(t.jax.mmlFactory)}],options:{textmacros:{packages:["text-base"]}}});var _y={};Object.defineProperty(_y,"__esModule",{value:!0}),_y.UpgreekConfiguration=void 0;var e8t=rr,n8t=gn,r8t=yi;function i8t(e,t){var n=t.attributes||{};n.mathvariant=r8t.TexConstant.Variant.NORMAL;var r=e.create("token","mi",n,t.char);e.Push(r)}new n8t.CharacterMap("upgreek",i8t,{upalpha:"α",upbeta:"β",upgamma:"γ",updelta:"δ",upepsilon:"ϵ",upzeta:"ζ",upeta:"η",uptheta:"θ",upiota:"ι",upkappa:"κ",uplambda:"λ",upmu:"μ",upnu:"ν",upxi:"ξ",upomicron:"ο",uppi:"π",uprho:"ρ",upsigma:"σ",uptau:"τ",upupsilon:"υ",upphi:"ϕ",upchi:"χ",uppsi:"ψ",upomega:"ω",upvarepsilon:"ε",upvartheta:"ϑ",upvarpi:"ϖ",upvarrho:"ϱ",upvarsigma:"ς",upvarphi:"φ",Upgamma:"Γ",Updelta:"Δ",Uptheta:"Θ",Uplambda:"Λ",Upxi:"Ξ",Uppi:"Π",Upsigma:"Σ",Upupsilon:"Υ",Upphi:"Φ",Uppsi:"Ψ",Upomega:"Ω"}),_y.UpgreekConfiguration=e8t.Configuration.create("upgreek",{handler:{macro:["upgreek"]}});var o8t={};(function(e){var t=I&&I.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.UnicodeConfiguration=e.UnicodeMethods=void 0;var n=rr,r=t(hr),i=gn,o=t(Pr()),a=t(Ir),s=Fl;e.UnicodeMethods={};var d={};e.UnicodeMethods.Unicode=function(f,Q){var p=f.GetBrackets(Q),g=null,_=null;p&&(p.replace(/ /g,"").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/)?(g=p.replace(/ /g,"").split(/,/),_=f.GetBrackets(Q)):_=p);var x=o.default.trimSpaces(f.GetArgument(Q)).replace(/^0x/,"x");if(!x.match(/^(x[0-9A-Fa-f]+|[0-9]+)$/))throw new r.default("BadUnicode","Argument to \\unicode must be a number");var b=parseInt(x.match(/^x/)?"0"+x:x);d[b]?_||(_=d[b][2]):d[b]=[800,200,_,b],g&&(d[b][0]=Math.floor(parseFloat(g[0])*1e3),d[b][1]=Math.floor(parseFloat(g[1])*1e3));var A=f.stack.env.font,E={};_?(d[b][2]=E.fontfamily=_.replace(/'/g,"'"),A&&(A.match(/bold/)&&(E.fontweight="bold"),A.match(/italic|-mathit/)&&(E.fontstyle="italic"))):A&&(E.mathvariant=A);var O=f.create("token","mtext",E,(0,s.numeric)(x));a.default.setProperty(O,"unicode",!0),f.Push(O)},new i.CommandMap("unicode",{unicode:"Unicode"},e.UnicodeMethods),e.UnicodeConfiguration=n.Configuration.create("unicode",{handler:{macro:["unicode"]}})})(o8t);var a8t={};(function(e){var t=I&&I.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.VerbConfiguration=e.VerbMethods=void 0;var n=rr,r=yi,i=gn,o=t(hr);e.VerbMethods={},e.VerbMethods.Verb=function(a,s){var d=a.GetNext(),f=++a.i;if(d==="")throw new o.default("MissingArgFor","Missing argument for %1",s);for(;a.i<a.string.length&&a.string.charAt(a.i)!==d;)a.i++;if(a.i===a.string.length)throw new o.default("NoClosingDelim","Can't find closing delimiter for %1",a.currentCS);var Q=a.string.slice(f,a.i).replace(/ /g," ");a.i++,a.Push(a.create("token","mtext",{mathvariant:r.TexConstant.Variant.MONOSPACE},Q))},new i.CommandMap("verb",{verb:"Verb"},e.VerbMethods),e.VerbConfiguration=n.Configuration.create("verb",{handler:{macro:["verb"]}})})(a8t),Object.defineProperty(gg,"__esModule",{value:!0});var CO=gg.AllPackages=void 0;cO(),typeof MathJax<"u"&&MathJax.loader&&MathJax.loader.preLoad("[tex]/action","[tex]/ams","[tex]/amscd","[tex]/bbox","[tex]/boldsymbol","[tex]/braket","[tex]/bussproofs","[tex]/cancel","[tex]/cases","[tex]/centernot","[tex]/color","[tex]/colorv2","[tex]/colortbl","[tex]/empheq","[tex]/enclose","[tex]/extpfeil","[tex]/gensymb","[tex]/html","[tex]/mathtools","[tex]/mhchem","[tex]/newcommand","[tex]/noerrors","[tex]/noundefined","[tex]/physics","[tex]/upgreek","[tex]/unicode","[tex]/verb","[tex]/configmacros","[tex]/tagformat","[tex]/textcomp","[tex]/textmacros","[tex]/setoptions"),CO=gg.AllPackages=["base","action","ams","amscd","bbox","boldsymbol","braket","bussproofs","cancel","cases","centernot","color","colortbl","empheq","enclose","extpfeil","gensymb","html","mathtools","mhchem","newcommand","noerrors","noundefined","upgreek","unicode","verb","configmacros","tagformat","textcomp","textmacros"];const s8t=16,l8t=8,c8t=["svg a{fill:blue;stroke:blue}",'[data-mml-node="mstyle"]>rect[data-bgcolor="true"]{rx: 8%; ry: 12%}','[data-mml-node="merror"]>g{fill:red;stroke:red}','[data-mml-node="merror"]>rect[data-background]{fill:yellow;stroke:none}',"[data-frame],[data-line]{stroke-width:70px;fill:none}",".mjx-dashed{stroke-dasharray:140}",".mjx-dotted{stroke-linecap:round;stroke-dasharray:0,140}","use[data-c]{stroke-width:3px}"].join(""),SO=SS();cH(SO);const u8t=new iC({packages:CO}),h8t=new h0t.SVG({fontCache:"local"}),d8t=Gu.mathjax.document("",{InputJax:u8t,OutputJax:h8t});function f8t(e){const t=d8t.convert(e,{display:!1,em:2*s8t,ex:2*l8t});return SO.innerHTML(t).replace(/<defs>/,`<defs><style>${c8t}</style>`)}function HO(e,t,n){return e===null?[t[0]-n.lng,t[1]-n.lat,t[2]+n.lng,t[3]+n.lat]:[Math.min(e[0],t[0]-n.lng),Math.min(e[1],t[1]-n.lat),Math.max(e[2],t[2]+n.lng),Math.max(e[3],t[3]+n.lat)]}function T8t(e){if(e.geometry.type==="Point")return e.geometry.coordinates;const t=e.geometry.coordinates,n="area"in e.properties?Math.sqrt(e.properties.area)/5e5:.1;return Lq(t,n)}function Q8t(e){if(!("renderedLabel"in e)){const t="label"in e?e.label:"user_label"in e?e.user_label:"",n=t!==""?(t.substr(0,1).toUpperCase()+t.substr(1)).replaceAll(`
|
|
1696
1696
|
`,"<br/>"):"";e.renderedLabel=n.replaceAll(/`\$([^\$]*)\$`/g,r=>f8t(r.slice(2,-2)))}return e.renderedLabel}class p8t{constructor(t){Zn(this,Ls);Zn(this,X4);Zn(this,K4);Zn(this,Y4);Zn(this,fc);Zn(this,n1,null);Zn(this,r0,null);Zn(this,T2,null);this._flatmap=t,this._map=t.map,this._activeFeatures=new Set,this._selectedFeatureIds=new Map,this._currentPopup=null,this._infoControl=null,this._tooltip=null,this._inQuery=!1,this._modal=!1,this.__colourOptions={colour:!0,outline:!0},this.__activeMarker=null,this.__lastMarkerId=9e5,this.__markerIdByMarker=new Map,this.__markerIdByFeatureId=new Map,this.__annotationByMarkerId=new Map,this.__markerPositions=new Map,t.setInitialPosition(),this._layerManager=new aW(t),this.__featureEnabledCount=new Map(Array.from(this._flatmap.annotations.keys()).map(i=>[+i,0]));const n=t.options.style!=="functional";this.__pathManager=new Iq(t,this,n);const r=this.__pathManager.pathTypes();for(const i of r)this.__pathManager.enablePathsByType(i.type,i.enabled,!0);if(this.__pathManager.haveCentrelines&&this.enableCentrelines(this.__pathManager.enabledCentrelines,!0),this.__systemsManager=new S2t(this._flatmap,this,n),this.__enabledConnectivityTaxons=new Set(this._flatmap.taxonIdentifiers),t.options.minimap&&($r(this,r0,new $2t(t,t.options.minimap)),this._map.addControl(ve(this,r0))),t.options.fullscreenControl===!0&&this._map.addControl(new Zi.FullscreenControl,"top-right"),t.options.navigationControl){const i=t.options.navigationControl,o=typeof i=="string"&&["top-left","top-right","bottom-right","bottom-left"].includes(i)?i:"bottom-right";this._map.addControl(new NavigationControl(t),o)}$r(this,T2,new C2t(t,this)),t.options.standalone&&(this._map.addControl(new z2t(t)),this._infoControl=new O2t(t),this._map.addControl(this._infoControl),this._map.addControl(new B2t(t)),this._map.addControl(new F2t(t,r)),this._map.addControl(new D2t(t,this._layerManager)),this.__pathManager.haveCentrelines&&this._map.addControl(new P2t(t,this._layerManager,{showCentrelines:!1})),t.options.style==="functional"?(this._map.addControl(new G2t(t,this.__systemsManager.systems)),this._map.addControl(new I2t(t,t.options.layerOptions))):this._map.addControl(new Z2t(t)),this._map.addControl(new j2t(this)),t.options.annotator&&this._map.addControl(new k2t(t))),this.__setupAnnotation(),$r(this,n1,new N2t(t,!1)),this._map.addControl(ve(this,n1)),this._map.on("click",this.clickEvent_.bind(this)),this._map.on("touchend",this.clickEvent_.bind(this)),this._map.on("mousemove",this.mouseMoveEvent_.bind(this)),this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null,this.__lastClickLngLat=null,this._map.on("move",this.panZoomEvent_.bind(this,"pan")),this._map.on("zoom",this.panZoomEvent_.bind(this,"zoom")),this.__pan_zoom_enabled=!1}get minimap(){return ve(this,r0)}get pathManager(){return this.__pathManager}getState(){return{center:this._map.getCenter().toArray(),zoom:this._map.getZoom(),layers:this.layers}}setState(t){const n={};"center"in t&&(n.center=t.center),"zoom"in t&&(n.zoom=t.zoom,"center"in t?n.around=t.center:n.around=[0,0]),Object.keys(n).length>0&&this._map.jumpTo(n)}showAnnotator(t=!0){ve(this,n1)&&ve(this,n1).show(t)}inDrawingAnnotationMode(){if(ve(this,n1))return ve(this,n1).inDrawingMode()}commitAnnotationEvent(t){ve(this,n1)&&ve(this,n1).commitEvent(t)}abortAnnotationEvent(t){ve(this,n1)&&ve(this,n1).abortEvent(t)}rollbackAnnotationEvent(t){ve(this,n1)&&ve(this,n1).rollbackEvent(t)}clearAnnotationFeature(){ve(this,n1)&&ve(this,n1).clearFeature()}trashAnnotationFeature(){ve(this,n1)&&ve(this,n1).trashFeature()}addAnnotationFeature(t){ve(this,n1)&&ve(this,n1).addFeature(t)}refreshAnnotationFeatureGeometry(t){if(ve(this,n1))return ve(this,n1).refreshGeometry(t)}changeAnnotationDrawMode(t){ve(this,n1)&&ve(this,n1).changeMode(t)}__setupAnnotation(){this.__featureIdToMapId=new Map([...this._flatmap.annotations.entries()].map(t=>[t[1].id,t[0]]));for(const t of this.__featureIdToMapId.values()){const n=this.mapFeature(t);n!==void 0&&this._map.setFeatureState(n,{"map-annotation":!0})}}setFeatureAnnotated(t){const n=this.__featureIdToMapId.get(t);if(n){const r=this.mapFeature(n);r!==void 0&&this._map.setFeatureState(r,{annotated:!0})}}setPaint(t){this.__colourOptions=t,Rn(this,Ls,L6).call(this,t)}getLayers(){return this._layerManager.layers}enableLayer(t,n=!0){this._layerManager.activate(t,n)}enable3dPaths(t=!0){ve(this,T2)&&ve(this,T2).enable(t)}getSystems(){return this.__systemsManager.systems}enableSystem(t,n=!0){this.__systemsManager.enable(t,n)}mapFeature(t){const n=this._flatmap.annotation(t);if(n!==void 0)return{id:t,source:lQ,sourceLayer:(this._flatmap.options.separateLayers?`${n.layer}_${n["tile-layer"]}`:n["tile-layer"]).replaceAll("/","_"),children:n.children||[]}}enableMapFeature(t,n=!0){if(t!==void 0){const r=Rn(this,X4,Kc).call(this,t);"hidden"in r?n?Rn(this,K4,Yc).call(this,t,"hidden"):r.hidden||Rn(this,Y4,Jc).call(this,t,{hidden:!0}):n||Rn(this,Y4,Jc).call(this,t,{hidden:!0}),this.__enableFeatureMarker(t.id,n)}}enableFeature(t,n=!0,r=!1){const i=this.__featureEnabledCount.get(+t);(r||n&&i===0||!n&&i==1)&&this.enableMapFeature(this.mapFeature(t),n),r?this.__featureEnabledCount.set(+t,n?1:0):this.__featureEnabledCount.set(+t,i+(n?1:-1))}enableFeatureWithChildren(t,n=!0,r=!1){const i=this.mapFeature(t);if(i!==void 0){this.enableFeature(t,n,r);for(const o of i.children)this.enableFeatureWithChildren(o,n,r)}}__enableFeatureMarker(t,n=!0){const r=this.__markerIdByFeatureId.get(+t);if(r!==void 0){const i=document.getElementById(`marker-${r}`);i&&(i.style.visibility=n?"visible":"hidden")}}__featureEnabled(t){if(t.id){const n=Rn(this,X4,Kc).call(this,t);return n!==void 0&&(!("hidden"in n)||!n.hidden)}return Xp.includes(t.layer.id)}featureSelected_(t){return this._selectedFeatureIds.has(+t)}selectFeature(t,n=!0){const r=this._flatmap.annotation(t);if(r&&"sckan"in r){const a=this._layerManager.sckanState;if(a==="none"||a==="valid"&&!r.sckan||a==="invalid"&&r.sckan)return!1}t=+t;let i=!1;const o=this._selectedFeatureIds.size===0;if(this._selectedFeatureIds.has(t))this._selectedFeatureIds.set(t,this._selectedFeatureIds.get(t)+1),i=!0;else{const a=this.mapFeature(t);if(a!==void 0){const s=Rn(this,X4,Kc).call(this,a);s!==void 0&&(!("hidden"in s)||!s.hidden)&&(Rn(this,Y4,Jc).call(this,a,{selected:!0}),this._selectedFeatureIds.set(t,1),i=!0)}}return i&&o&&Rn(this,Ls,L6).call(this,{...this.__colourOptions,dimmed:n}),i}unselectFeature(t){if(t=+t,this._selectedFeatureIds.has(t)){const n=this._selectedFeatureIds.get(t);if(n>1)this._selectedFeatureIds.set(t,n-1);else{const r=this.mapFeature(t);r!==void 0&&(Rn(this,K4,Yc).call(this,r,"selected"),this._selectedFeatureIds.delete(+t))}}this._selectedFeatureIds.size===0&&Rn(this,Ls,L6).call(this,{...this.__colourOptions,dimmed:!1})}unselectFeatures(){for(const t of this._selectedFeatureIds.keys()){const n=this.mapFeature(t);n!==void 0&&Rn(this,K4,Yc).call(this,n,"selected")}this._selectedFeatureIds.clear(),Rn(this,Ls,L6).call(this,{...this.__colourOptions,dimmed:!1})}activateFeature(t){t!==void 0&&(Rn(this,Y4,Jc).call(this,t,{active:!0}),this._activeFeatures.add(t))}activateLineFeatures(t){for(const n of t){+n.properties.featureId,this.activateFeature(n);const r=new Set(t.map(i=>i.properties.featureId));for(const i of this.__pathManager.lineFeatureIds(r))this.activateFeature(this.mapFeature(i))}}resetActiveFeatures_(){for(const t of this._activeFeatures)Rn(this,K4,Yc).call(this,t,"active");this._activeFeatures.clear()}smallestAnnotatedPolygonFeature_(t){let n=0,r=null;for(const i of t)if(i.geometry.type.includes("Polygon")&&Rn(this,X4,Kc).call(this,i)["map-annotation"]){const o=nq(i.geometry.type,i.geometry.coordinates),a=uq(o);(r===null||n>a)&&(r=i,n=a)}return r}setModal_(t){this._modal=!0}__clearModal(t){this._modal=!1}reset(){this.__clearModal(),this.__clearActiveMarker(),this.unselectFeatures()}clearSearchResults(t=!0){this.unselectFeatures()}selectFeatures(t){if(t.length){this.unselectFeatures();for(const n of t){const r=this._flatmap.annotation(n);if(r&&this.selectFeature(n)&&"type"in r&&r.type.startsWith("line"))for(const i of this.__pathManager.lineFeatureIds([n]))this.selectFeature(i)}}}showSearchResults(t){this.unselectFeatures(),this.zoomToFeatures(t,{noZoomIn:!0})}zoomToFeatures(t,n=null){if(n=T4(n,{noZoomIn:!1,padding:10}),t.length){this.unselectFeatures();let r=null;if(n.noZoomIn){const o=this._map.getBounds().toArray();r=[...o[0],...o[1]]}const i=this._map.unproject({x:n.padding,y:n.padding});i.lng-=r[0],i.lat=r[3]-i.lat;for(const o of t){const a=this._flatmap.annotation(o);if(a&&this.selectFeature(o)&&(r=HO(r,a.bounds,i),"type"in a&&a.type.startsWith("line"))){for(const s of this.__pathManager.lineFeatureIds([o]))if(this.selectFeature(s)){const d=this._flatmap.annotation(s);r=HO(r,d.bounds,i)}}}r!==null&&this._map.fitBounds(r,{padding:0,animate:!1})}}showPopup(t,n,r={}){const i=this._flatmap.annotation(t),o=r&&r.annotationFeatureGeometry;if(i||o){this._currentPopup&&(r&&r.preserveSelection&&(this._currentPopup.options.preserveSelection=r.preserveSelection),this._currentPopup.remove()),r&&r.preserveSelection?delete r.preserveSelection:this.unselectFeatures(),this.selectFeature(t);let a=null;"positionAtLastClick"in r&&r.positionAtLastClick&&this.__lastClickLngLat!==null?a=this.__lastClickLngLat:o?a=r.annotationFeatureGeometry:a=this.__markerPosition(t,i),this._map.getBounds().contains(a)||this._map.panTo(a),this.setModal_(),this._currentPopup=new Zi.Popup(r).addTo(this._map),this._currentPopup.on("close",this.__onCloseCurrentPopup.bind(this)),o&&this._currentPopup.on("close",this.abortAnnotationEvent.bind(this)),this._currentPopup.setLngLat(a),typeof n=="object"?this._currentPopup.setDOMContent(n):this._currentPopup.setText(n)}}__onCloseCurrentPopup(){this._currentPopup&&(this.__clearModal(),this._currentPopup.options&&this._currentPopup.options.preserveSelection||this.unselectFeatures(),this._currentPopup=null)}removeTooltip_(){this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}lineTooltip_(t){const n=[];for(const r of t){const i=r.properties;if("error"in i&&n.push(`<div class="feature-error">Error: ${i.error}</div>`),"warning"in i&&n.push(`<div class="feature-error">Warning: ${i.warning}</div>`),"label"in i&&(!("tooltip"in i)||i.tooltip)){const o=i.label,a=(o.substr(0,1).toUpperCase()+o.substr(1)).replaceAll(`
|
|
1697
1697
|
`,"<br/>");n.includes(a)||n.push(a)}}return n.length===0?"":`<div class='flatmap-feature-label'>${n.join("<hr/>")}</div>`}tooltipHtml_(t,n=!1){const r=[];if("error"in t&&r.push(`<div class="feature-error">Error: ${t.error}</div>`),"warning"in t&&r.push(`<div class="feature-error">Warning: ${t.warning}</div>`),("label"in t||"hyperlink"in t||"user_label"in t)&&(n||!("tooltip"in t)||t.tooltip)){const i=Q8t(t);"hyperlink"in t?i===""?r.push(`<a href='${t.hyperlink}'>${t.hyperlink}</a>`):r.push(`<a href='${t.hyperlink}'>${i}</a></div>`):r.push(i)}return r.length===0?"":`<div class='flatmap-feature-label'>${r.join("<hr/>")}</div>`}__featureEvent(t,n){return n.sourceLayer===no?this._flatmap.featureEvent(t,this.__pathManager.pathProperties(n)):"properties"in n?this._flatmap.featureEvent(t,n.properties):!1}__resetFeatureDisplay(){this.removeTooltip_(),this._map.getCanvas().style.cursor="default",this.resetActiveFeatures_()}mouseMoveEvent_(t){if(this._modal)return;this.__resetFeatureDisplay();const n=this._infoControl&&this._infoControl.active;n&&this._infoControl.reset();const r=Rn(this,fc,Q_).call(this,t.point);if(r.length===0){this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null;return}const i=r[0],o="properties"in i&&"models"in i.properties?i.properties.models:null;this._lastFeatureMouseEntered!==i.id&&(this._lastFeatureModelsMouse===null||this._lastFeatureModelsMouse!==o)&&(this.__featureEvent("mouseenter",i)?(this._lastFeatureMouseEntered=i.id,this._lastFeatureModelsMouse=o):(this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null));let a="",s="";n&&("tooltip"in r[0].properties||this.activateFeature(r[0]),a=this._infoControl.featureInformation(r,t.lngLat));const d=r.filter(Q=>"centreline"in Q.properties||"type"in Q.properties&&Q.properties.type.startsWith("line"));let f=null;if(d.length>0)s=this.lineTooltip_(d),f=d[0],this.activateLineFeatures(d);else{let Q=r.filter(p=>("hyperlink"in p.properties||"label"in p.properties||"user_label"in p.properties)&&(!("tooltip"in p.properties)||p.properties.tooltip)).sort((p,g)=>p.properties.area-g.properties.area);if(Q.length>0){const p=this._map.getZoom(),g=Q.filter(x=>x.properties.group&&p<x.properties.scale+1);g.length>0&&(Q=g);const _=Q[0];if(_.properties.user_drawn&&(_.id=_.properties.id),s=this.tooltipHtml_(_.properties),f=_,this._flatmap.options.debug){const x=["featureId","nerveId","tile-layer","type",...qp],b=[],A=[];for(const E of Q)if(!A.includes(E.id)){A.push(E.id);for(const O of x)O in E.properties&&(b.push(`<span class="info-name">${O}:</span>`),b.push(`<span class="info-value">${E.properties[O]}</span>`))}this._flatmap.options.debug||(a=`<div id="info-control-info">${b.join(`
|
|
1698
|
-
`)}</div>`)}this.activateFeature(_),this.__activateRelatedFeatures(_),"hyperlink"in _.properties&&(this._map.getCanvas().style.cursor="pointer")}}a!==""&&this._infoControl.show(a),this.__showToolTip(s,t.lngLat,f)}__showToolTip(t,n,r=null){if(t!==""||this._flatmap.options.showId&&r!==null){let i="";if(this._flatmap.options.showPosition){const o=aL(n.toArray()),s=Tq(o).geometry.coordinates;i=r===null?JSON.stringify(s):`${JSON.stringify(s)} (${r.id})`}this._flatmap.options.showId&&r!==null&&"id"in r.properties&&(i=`${i} ${r.properties.id}`),i!==""&&(t=`<span>${i}</span><br/>${t}`),t!==""&&(this._tooltip=new Zi.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-tooltip-popup"}),this._tooltip.setLngLat(n).setHTML(t).addTo(this._map))}}selectionEvent_(t,n){if(n!==void 0){const r=+n.id,i=!("properties"in n&&"kind"in n.properties&&["cell-type","scaffold","tissue"].includes(n.properties.kind));if(t.ctrlKey||t.metaKey){const o=this.featureSelected_(r);for(const a of this._activeFeatures)o?this.unselectFeature(a.id):this.selectFeature(a.id,i)}else{let o=!0;for(const a of this._selectedFeatureIds.keys())if(a===r){o=!1;break}if(this.unselectFeatures(),o)for(const a of this._activeFeatures)this.selectFeature(a.id,i)}}}clickEvent_(t){if(this._modal)return;this.__clearActiveMarker();const n=Rn(this,fc,Q_).call(this,t.point);if(n.length==0){this.unselectFeatures();return}const r=this.inDrawingAnnotationMode(),i=n.filter(a=>!a.id)[0],o=n.filter(a=>a.id)[0];this.selectionEvent_(t.originalEvent,o),this._modal?(this.__resetFeatureDisplay(),this.unselectFeatures(),this.__clearModal()):i&&!r?this.__featureEvent("click",i):o&&(this.__lastClickLngLat=t.lngLat,this.__featureEvent("click",o),"properties"in o&&"hyperlink"in o.properties&&window.open(o.properties.hyperlink,"_blank"))}__activateRelatedFeatures(t){if("nerveId"in t.properties){const n=t.properties.nerveId;n!==t.id&&this.activateFeature(this.mapFeature(n));for(const r of this.__pathManager.nerveFeatureIds(n))this.activateFeature(this.mapFeature(r))}if("nodeId"in t.properties)for(const n of this.__pathManager.pathFeatureIds(t.properties.nodeId))this.activateFeature(this.mapFeature(n))}enablePathsBySystem(t,n=!0,r=!1){this.__pathManager.enablePathsBySystem(t,n,r)}enablePathsByType(t,n=!0){this.__pathManager.enablePathsByType(t,n)}pathFeatureIds(t){const n=new Y8;return n.extend(this.__pathManager.connectivityModelFeatureIds(t)),n.extend(this.__pathManager.pathModelFeatureIds(t)),n}pathModelNodes(t){return this.__pathManager.pathModelNodes(t)}nodePathModels(t){return this.__pathManager.nodePathModels(t)}enableCentrelines(t=!0,n=!1){this.__pathManager.enablePathsByType("centreline",t,n),Rn(this,Ls,L6).call(this,{showCentrelines:t})}enableSckanPaths(t,n=!0){this._layerManager.enableSckanPaths(t,n)}enableConnectivityByTaxonIds(t,n=!0){if(n)for(const r of t)this.__enabledConnectivityTaxons.add(r);else for(const r of t)this.__enabledConnectivityTaxons.delete(r);this._layerManager.setFilter({taxons:[...this.__enabledConnectivityTaxons.values()]})}excludeAnnotated(t=!1){Rn(this,Ls,L6).call(this,{excludeAnnotated:t})}__markerPosition(t,n){if(this.__markerPositions.has(t))return this.__markerPositions.get(t);let r=n.markerPosition||n.centroid;if(r===null||r==null){const i=this._map.querySourceFeatures(lQ,{sourceLayer:this._flatmap.options.separateLayers?`${n.layer}_${n["tile-layer"]}`:n["tile-layer"],filter:["all",["==",["id"],parseInt(t)],["==",["geometry-type"],"Polygon"]]});i.length>0&&(r=T8t(i[0]))}return this.__markerPositions.set(t,r),r}addMarker(t,n={}){const r=this._flatmap.modelFeatureIds(t);let i=-1;for(const o of r){const a=this._flatmap.annotation(o);if(!(!("markerPosition"in a)&&!a.geometry.includes("Polygon"))&&!("marker"in a)){i===-1&&(this.__lastMarkerId+=1,i=this.__lastMarkerId);const s=n.colour||"#005974",d=n.element?new Zi.Marker({element:n.element}):new Zi.Marker({color:s,scale:.5}),f=document.createElement("div"),Q=document.createElement("div");Q.innerHTML=d.getElement().innerHTML,f.id=`marker-${i}`,f.appendChild(Q);const p={element:f};"className"in n&&(p.className=n.className);const g=this.__markerPosition(o,a),_=new Zi.Marker(p).setLngLat(g).addTo(this._map);f.addEventListener("mouseenter",this.markerMouseEvent_.bind(this,_,t)),f.addEventListener("mousemove",this.markerMouseEvent_.bind(this,_,t)),f.addEventListener("mouseleave",this.markerMouseEvent_.bind(this,_,t)),f.addEventListener("click",this.markerMouseEvent_.bind(this,_,t)),this.__markerIdByMarker.set(_,i),this.__markerIdByFeatureId.set(+o,i),this.__annotationByMarkerId.set(i,a),this.__featureEnabled(this.mapFeature(+o))||(f.style.visibility="hidden")}}return i===-1&&console.warn(`Unable to find feature '${t}' on which to place marker`),i}clearMarkers(){for(const t of this.__markerIdByMarker.keys())t.remove();this.__markerIdByMarker.clear(),this.__annotationByMarkerId.clear()}removeMarker(t){for(const[n,r]of this.__markerIdByMarker.entries())if(t===r){n.remove(),this.__markerIdByMarker.remove(n),this.__annotationByMarkerId.remove(r);break}}visibleMarkerAnatomicalIds(){const t=[],n=this._map.getBounds();for(const[r,i]of this.__markerIdByMarker.entries())if(n.contains(r.getLngLat())){const o=this.__annotationByMarkerId.get(i);t.includes(o.models)||t.push(o.models)}return t}markerMouseEvent_(t,n,r){if(!(this._modal||this.__activeMarker!==null&&r.type==="mouseleave")){if(["mouseenter","mouseleave","click"].includes(r.type)&&(this.__activeMarker=t,this.removeTooltip_(),t.setPopup(null),t.getElement().style.cursor="default",["mouseenter","click"].includes(r.type))){const i=this.__markerIdByMarker.get(t),o=this.__annotationByMarkerId.get(i),a=this.mapFeature(o.featureId);a!==void 0&&(r.type==="mouseenter"?(this.resetActiveFeatures_(),this.activateFeature(a)):this.selectionEvent_(r,a));const s=this.tooltipHtml_(o,!0);this.__showToolTip(s,t.getLngLat()),this._flatmap.markerEvent(r.type,i,n)}r.stopPropagation()}}__clearActiveMarker(){this.__activeMarker!==null&&(this.__activeMarker.setPopup(null),this.__activeMarker=null)}showMarkerPopup(t,n,r){const i=this.__activeMarker;if(t!==this.__markerIdByMarker.get(i))return this.__clearActiveMarker(),!1;const o=i.getLngLat();this._map.getBounds().contains(o)||this._map.panTo(o);const a=document.createElement("div");return typeof n=="object"?a.appendChild(n):a.innerHTML=n,a.addEventListener("click",s=>this.__clearActiveMarker()),this._tooltip=new Zi.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-marker-popup"}),this._tooltip.setLngLat(o).setDOMContent(a),i.setPopup(this._tooltip),i.togglePopup(),!0}enablePanZoomEvents(t=!0){this.__pan_zoom_enabled=t}panZoomEvent_(t){this.__pan_zoom_enabled&&this._flatmap.panZoomEvent(t)}}n1=new WeakMap,r0=new WeakMap,T2=new WeakMap,Ls=new WeakSet,L6=function(t){this._layerManager.setPaint(t),ve(this,T2)&&ve(this,T2).setPaint(t)},X4=new WeakSet,Kc=function(t){return this._map.getFeatureState(t)},K4=new WeakSet,Yc=function(t,n){this._map.removeFeatureState(t,n),ve(this,T2)&&ve(this,T2).removeFeatureState(t.id,n)},Y4=new WeakSet,Jc=function(t,n){this._map.setFeatureState(t,n),ve(this,T2)&&ve(this,T2).setFeatureState(t.id,n)},fc=new WeakSet,Q_=function(t){let n=[];return ve(this,T2)&&(n=ve(this,T2).queryFeaturesAtPoint(t)),n.length===0&&(n=this._map.queryRenderedFeatures(t)),n.filter(r=>this.__featureEnabled(r))};const m8t=[{id:"label-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAmCAIAAADbSlUzAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAACVSURBVFhH7dixDoJAEIThfXqMBcYKrTQ+jkYSStDYkVhZINxyEshJcZXJtC7FfNlmur9eyXb7Vqf6+bI9HUKyWkt5e4RlOF9ycerjsqbqpfefuKzNJawBWIOxBmMNxhqMNRhrMNZgrMFYg7EGYw3GGow1GGuw5dU07y4ua22nUlb3uKxd80IOx1Pjxp+f4P/P+ZButl+YrbXnPs+YmAAAAABJRU5ErkJggg==",options:{content:[21,4,28,33],stretchX:[[21,28]],stretchY:[[4,33]]}},{id:"xlabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJExO2pF7NAAAAqUlEQVQ4y+3OIQ6CYBiH8ef9MDhxc8yABjeP4LwAx3BWTwE3oHkMrBa7JJN3YBogfQkjr0HcDCg0C0/+7f2/AjghycLFj0ECYMarHPRcUoQx25uEJMsR/lUQj4YUtQ+K9aC+1IgABPFc/NjUcy1JYD5++tXM0LEe9rCHPfwXzDu43ChV2qaUKjWWLFLUfkdqLVnkXDiWK4LDkMlckCkwfs8p1cmSbfbs7k+jIi/gASaPYQAAAABJRU5ErkJggg==",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"ylabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJEyeXEKp4AAAAwklEQVQ4y+3ULU/DUBhA4XO/2rUgwV1ZBWLJBP9fI0gQuMktWcJSwUq79n68qAoSGnCYHv3oowBD09jz88t1CpGcBQCtFYWz3D3tNuz3EXgojqdWLt0gKWWZSynLpRvkeGqFpinVuf2QsnDc3mz4qe7zyjgF9BQidVWyVF2VTCGicxa0VotQa0XOguaPrXCFK1zhv8D5VkvNt9POGvphXIT9MOKsAbyvfl2z95UCCrw3769vfYjp2+ydNdxvH2sOh/QFh8F7PWWiL5EAAAAASUVORK5CYII=",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"rounded-rectangle",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGmSURBVDiNldPBitpAGAfwv5mMmy85JCistD5Ai/gCPYovYJENCPZQF8VD36HXUkrfQws9R8WLF58gh2h2W2PpoeTWxBgzMr1spd3uUvOHOQ2//3yHb4C/UyGi95Zl3XLOUwASgFRVNTVN8ysRfQTwFA+FMdYhoqjf7+9ns5kMgkCGYSjDMJTb7VbO53M5HA4PRBRzzl//g8vlcrxYLE7osbNcLmWlUok459cAULgb+2YymRi1Wu3B6e7H9300Go1dkiTPGRG97Xa7LzqdjnqWBlAqlRBFEVzXNZRisXhl2/bFufh3bNvmAF4WOOd73/cvDMPIVSCEQLVaFUqWZbkxAKiqCsaYVHLLe1E452kcx7mhEALH47Gg6Lr+3fO83AXr9Rq6rofK4XD4NB6P07wFo9Eok1J+LgC41DTt1nEco16vn4VXqxWazeYuSZJnCoAfWZZdt9vtneu6/8We56HVasVCiDcAvp0uGGM2Ef3s9Xp7x3HkZrM57X8QBHI6ncrBYJASUcQYe/XYA5eapr2zLOuGc77H3XfmnKemaX4hog8AnvwJfgHMKs1jQ++4tQAAAABJRU5ErkJggg==",options:{content:[3,3,13,13],stretchX:[[7,9]],stretchY:[[7,9]]}}],g8t=1.4,OO="NCBITaxon:2787823";class y8t{constructor(t,n,r,i){this._baseUrl=n,this.__id=r.id,this.__uuid=r.uuid,this.__details=r.details,this.__provenance=r.provenance,this.__created=r.created,this.__taxon=r.taxon,this.__biologicalSex=r.biologicalSex,this._mapNumber=r.number,this._callback=r.callback,this._layers=r.layers,this._markers=r.markers,this._options=r.options,this._pathways=r.pathways,this._resolve=i,this._map=null,this.__searchIndex=new tq(this),this.__idToAnnotation=new Map,this.__datasetToFeatureIds=new Map,this.__modelToFeatureIds=new Map,this.__mapSourceToFeatureIds=new Map,this.__annIdToFeatureId=new Map,this.__taxonToFeatureIds=new Map;for(const[a,s]of Object.entries(r.annotations))this.__addAnnotation(a,s),this.__searchIndex.indexMetadata(a,s);for(const[a,s]of Object.entries(r.style.sources))if(s.url&&(s.url=this.makeServerUrl(s.url)),s.tiles){const d=[];for(const f of s.tiles)d.push(this.makeServerUrl(f));s.tiles=d}"images"in r.options||(r.options.images=[]);for(const a of m8t){let s=!1;for(const d of r.options.images)if(a.id===d.id){s=!0;break}s||r.options.images.push(a)}const o={style:r.style,container:t,attributionControl:!1};"maxZoom"in r.options&&(o.maxZoom=r.options.maxZoom),"minZoom"in r.options&&(o.minZoom=r.options.minZoom),o.hash=r.options.debug===!0,this._map=new Zi.Map(o),r.options.debug===!0&&(this._map.showTileBoundaries=!0),this._map.setRenderWorldCopies(!1),this._userInteractions=null,this._initialState=null,this._map.on("idle",()=>{if(this._userInteractions===null)this.setupUserInteractions_();else if(this._initialState===null){this._map.setMinZoom(3),this._map.setMaxBounds(null),this._map.setRenderWorldCopies(!0),this._bounds=this._map.getBounds();const a=this._bounds.toArray(),s=Zi.MercatorCoordinate.fromLngLat(a[0]),d=Zi.MercatorCoordinate.fromLngLat(a[1]);this.__normalised_origin=[s.x,d.y],this.__normalised_size=[d.x-s.x,s.y-d.y],"state"in this._options&&this._userInteractions.setState(this._options.state),this._initialState=this.getState(),this._userInteractions.minimap&&this._userInteractions.minimap.initialise(),this._resolve(this)}})}async setupUserInteractions_(){for(const t of this._options.images)await this.addImage(t.id,t.url,"",t.options);this._userInteractions=new p8t(this)}get bounds(){return this._bounds}resetMap(){this._initialState!==null&&this.setState(this._initialState),this._userInteractions!==null&&this._userInteractions.reset()}zoomIn(){this._map.zoomIn()}zoomOut(){this._map.zoomOut()}pathTypes(){if(this._userInteractions!==null)return this._userInteractions.pathManager.pathTypes()}enablePath(t,n=!0){this._userInteractions!==null&&this._userInteractions.enablePathsByType(t,n)}enableSckanPath(t,n=!0){this._userInteractions!==null&&this._userInteractions.enableSckanPaths(t,n)}enableConnectivityByTaxonIds(t,n=!0){this._userInteractions!==null&&(Array.isArray(t)?this._userInteractions.enableConnectivityByTaxonIds(t,n):this._userInteractions.enableConnectivityByTaxonIds([t],n))}enableCentrelines(t=!0){this._userInteractions!==null&&this._userInteractions.enableCentrelines(t)}loadImage_(t){return new Promise((n,r)=>{this._map.loadImage(t,(i,o)=>{i?r(i):n(o)})})}loadEncodedImage_(t){return new Promise((n,r)=>{const i=new Image;i.src=t,i.onload=o=>n(o.target)})}async addImage(t,n,r,i={}){if(!this._map.hasImage(t)){const o=await(n.startsWith("data:image")?this.loadEncodedImage_(n):this.loadImage_(n.startsWith("/")?this.makeServerUrl(n):new URL(n,r)));this._map.addImage(t,o,i)}}makeServerUrl(t,n="flatmap/"){return t.startsWith("http://")||t.startsWith("https://")?t:t.startsWith("/")?`${this._baseUrl}${n}${this.__uuid}${t}`:`${this._baseUrl}${n}${this.__uuid}/${t}`}get taxon(){return this.__taxon}get biologicalSex(){return this.__biologicalSex}get created(){return this.__created}get id(){return this.__id}get uuid(){return this.__uuid}get details(){return this.__details}get provenance(){return this.__provenance}get uniqueId(){return`${this.__uuid}-${this._mapNumber}`}get annotations(){return this.__idToAnnotation}annotation(t){return this.__idToAnnotation.get(t.toString())}setFeatureAnnotated(t){this._userInteractions!==null&&this._userInteractions.setFeatureAnnotated(t)}__updateFeatureIdMapEntry(t,n,r){const i=J8(t),o=n.get(i);o?o.push(r):n.set(i,[r])}__updateFeatureIdMap(t,n,r,i=null){if(t in r&&r[t].length){const o=r[t];if(Array.isArray(o))for(const a of o)this.__updateFeatureIdMapEntry(a,n,r.featureId);else this.__updateFeatureIdMapEntry(o,n,r.featureId)}else i!==null&&"models"in r&&r.models.startsWith(Vq)&&this.__updateFeatureIdMapEntry(i,n,r.featureId)}__addAnnotation(t,n){n.featureId=t,this.__idToAnnotation.set(t,n),this.__updateFeatureIdMap("dataset",this.__datasetToFeatureIds,n),this.__updateFeatureIdMap("models",this.__modelToFeatureIds,n),this.__updateFeatureIdMap("source",this.__mapSourceToFeatureIds,n),this.__updateFeatureIdMap("taxons",this.__taxonToFeatureIds,n,OO),this.__annIdToFeatureId.set(n.id,t)}modelFeatureIds(t){const n=this.__modelToFeatureIds.get(J8(t));return n||[]}modelFeatureIdList(t){const n=new Y8;if(Array.isArray(t))for(const r of t)n.extend(this.modelFeatureIds(r));else n.extend(this.modelFeatureIds(t));return n.length==0&&(n.extend(this.__datasetToFeatureIds.get(t)),n.extend(this.__mapSourceToFeatureIds.get(t))),n.length==0&&this._userInteractions!==null&&n.extend(this._userInteractions.pathFeatureIds(t)),n}modelForFeature(t){const n=this.__idToAnnotation.get(t);return n&&"models"in n?J8(n.models):null}nodePathModels(t){if(this._userInteractions!==null)return this._userInteractions.nodePathModels(t)}pathModelNodes(t){if(this._userInteractions!==null)return new[...this._userInteractions.pathModelNodes(t)]}taxonFeatureIds(t){const n=this.__taxonToFeatureIds.get(J8(t));return[...new Set(n||[])]}get layers(){return this._layers}get map(){return this._map}get markers(){return this._markers}get anatomicalIdentifiers(){return[...this.__modelToFeatureIds.keys()]}get taxonIdentifiers(){return[...this.__taxonToFeatureIds.keys()]}get datasets(){return[...this.__datasetToFeatureIds.keys()]}get options(){return this._options}get pathways(){return this._pathways}getZoom(){return{mapUUID:this.__uuid,minZoom:this._map.getMinZoom(),zoom:this._map.getZoom(),maxZoom:this._map.getMaxZoom()}}callback(t,n,...r){if(this._callback)return n.mapUUID=this.__uuid,this._callback(t,n,...r)}setInitialPosition(){"bounds"in this._options&&this._map.fitBounds(this._options.bounds,{animate:!1}),"center"in this._options&&this._map.setCenter(this._options.center),"zoom"in this._options&&this._map.setZoom(this._options.zoom)}close(){this._map&&(this._map.remove(),this._map=null)}resize(){this._map.resize()}getIdentifier(){return{taxon:this.__taxon,biologicalSex:this.__biologicalSex,uuid:this.__uuid}}getState(){return this._userInteractions!==null?this._userInteractions.getState():{}}setState(t){this._userInteractions!==null&&this._userInteractions.setState(t)}showPopup(t,n,r){this._userInteractions!==null&&this._userInteractions.showPopup(t,n,r)}setPaint(t=null){t=T4(t,{colour:!0,outline:!0}),this._userInteractions!==null&&this._userInteractions.setPaint(t)}setColour(t=null){console.log("`setColour()` is deprecated; please use `setPaint()` instead."),this.setPaint(t)}getBackgroundColour(){return this._map.getPaintProperty("background","background-color")}getBackgroundOpacity(){return this._map.getPaintProperty("background","background-opacity")}setBackgroundColour(t){localStorage.setItem("flatmap-background-colour",t),this._map.setPaintProperty("background","background-color",t),this._userInteractions.minimap&&this._userInteractions.minimap.setBackgroundColour(t)}setBackgroundOpacity(t){this._map.setPaintProperty("background","background-opacity",t),this._userInteractions.minimap&&this._userInteractions.minimap.setBackgroundOpacity(t)}showMinimap(t){this._userInteractions.minimap&&this._userInteractions.minimap.show(t)}getLayers(){if(this._userInteractions!==null)return this._userInteractions.getLayers()}enableLayer(t,n=!0){if(this._userInteractions!==null)return this._userInteractions.enableLayer(t,n)}enable3dPaths(t=!0){this._userInteractions!==null&&this._userInteractions.enable3dPaths(t)}getSystems(){if(this._userInteractions!==null)return this._userInteractions.getSystems()}enableSystem(t,n=!0){if(this._userInteractions!==null)return this._userInteractions.enableSystem(t,n)}addMarker(t,n={}){return this._userInteractions!==null?this._userInteractions.addMarker(t,n):-1}removeMarker(t){this._userInteractions!==null&&this._userInteractions.removeMarker(t)}clearMarkers(){this._userInteractions!==null&&this._userInteractions.clearMarkers()}visibleMarkerAnatomicalIds(){if(this._userInteractions!==null)return this._userInteractions.visibleMarkerAnatomicalIds()}showMarkerPopup(t,n,r={}){return this._userInteractions!==null?this._userInteractions.showMarkerPopup(t,n,r):!1}__exportedProperties(t){const n={},r=["id","featureId","connectivity","dataset","kind","label","models","source","taxons","hyperlinks","completeness","missing-nodes","alert","biological-sex"],i=["hyperlinks"];for(const o of r)o in t&&t[o]!==void 0&&(i.includes(o)?n[o]=JSON.parse(t[o]):o==="featureId"?n[o]=+t[o]:n[o]=t[o]);return Object.keys(n).length>0&&(n.type="feature"),n}showAnnotator(t=!0){this._userInteractions!==null&&this._userInteractions.showAnnotator(t)}annotationEvent(t,n){this.callback("annotation",{type:t,feature:n})}commitAnnotationEvent(t){this._userInteractions&&this._userInteractions.commitAnnotationEvent(t)}rollbackAnnotationEvent(t){this._userInteractions&&this._userInteractions.rollbackAnnotationEvent(t)}clearAnnotationFeature(){this._userInteractions&&this._userInteractions.clearAnnotationFeature()}trashAnnotationFeature(){this._userInteractions&&this._userInteractions.trashAnnotationFeature()}addAnnotationFeature(t){this._userInteractions&&this._userInteractions.addAnnotationFeature(t)}refreshAnnotationFeatureGeometry(t){if(this._userInteractions)return this._userInteractions.refreshAnnotationFeatureGeometry(t)}changeAnnotationDrawMode(t){this._userInteractions&&this._userInteractions.changeAnnotationDrawMode(t)}featureEvent(t,n){const r=this.__exportedProperties(n);return Object.keys(r).length>0?(this.callback(t,r),!0):!1}featureProperties(t){const n=this.annotation(t);return n?this.__exportedProperties(n):{}}markerEvent(t,n,r){this.callback(t,{type:"marker",id:n,models:r})}controlEvent(t,n,r){this.callback(t,{type:"control",control:n,value:r})}enablePanZoomEvents(t=!0){this._userInteractions!==null&&this._userInteractions.enablePanZoomEvents(t)}panZoomEvent(t){const n=this._map.getBounds();if(this.__normalised_origin!==void 0){const r=Zi.MercatorCoordinate.fromLngLat(n.toArray()[0]),i=Zi.MercatorCoordinate.fromLngLat(n.toArray()[1]),o=[(r.x-this.__normalised_origin[0])/this.__normalised_size[0],(i.y-this.__normalised_origin[1])/this.__normalised_size[1]],a=[(i.x-r.x)/this.__normalised_size[0],(r.y-i.y)/this.__normalised_size[1]];this.callback("pan-zoom",{type:t,origin:o,size:a})}}panZoomTo(t,n){if(this.__normalised_origin!==void 0){const r=t[0]*this.__normalised_size[0]+this.__normalised_origin[0],i=t[1]*this.__normalised_size[1]+this.__normalised_origin[1],o=r+n[0]*this.__normalised_size[0],a=i+n[1]*this.__normalised_size[1],s=new Zi.MercatorCoordinate(r,a,0).toLngLat(),d=new Zi.MercatorCoordinate(o,i,0).toLngLat();this._map.fitBounds([s,d],{animate:!1})}}search(t,n=!1){return n?this.__searchIndex.auto_suggest(t):this.__searchIndex.search(t)}clearSearchResults(){this._userInteractions!==null&&this._userInteractions.clearSearchResults()}showSearchResults(t){this._userInteractions!==null&&this._userInteractions.showSearchResults(t.featureIds)}selectFeatures(t){if(this._userInteractions!==null){const n=this.modelFeatureIdList(t);this._userInteractions.selectFeatures(n)}}zoomToFeatures(t,n=null){if(n=T4(n,{select:!0,highlight:!1,padding:100}),this._userInteractions!==null){const r=this.modelFeatureIdList(t);this._userInteractions.zoomToFeatures(r,n)}}selectGeoJSONFeatures(t){this._userInteractions!==null&&this._userInteractions.selectFeatures(t)}zoomToGeoJSONFeatures(t,n=null){n=T4(n,{select:!0,highlight:!1,padding:100}),this._userInteractions!==null&&this._userInteractions.zoomToFeatures(t,n)}}class VO{constructor(t,n={}){this._mapServer=new AZ(t),this._options=n,this._mapList=[],this._mapNumber=0,this._initialisingMutex=new Oq,this._initialised=!1}async ensureInitialised_(){return await this._initialisingMutex.dispatch(async()=>{if(!this._initialised){this._mapList=[];const t=await this._mapServer.loadJSON("");for(const n of t)n.separateLayers="version"in n&&n.version>=g8t,this._mapList.push(n);this._initialised=!0}})}allMaps(){return new Promise(async(t,n)=>{await this.ensureInitialised_();const r={};for(const i of this._mapList){const o="uuid"in i?i.uuid:i.id;r[o]=i}t(r)})}findMap_(t){return new Promise(async(n,r)=>{await this.ensureInitialised_(),n(this.lookupMap_(t))})}latestMap_(t){const n=t.constructor.name==="String"?t:"uuid"in t?t.uuid:"taxon"in t?t.taxon:null;if(n===null)return null;let r=null,i="";for(const o of this._mapList)if(("uuid"in o&&n===o.uuid||n===o.id||"taxon"in o&&n===o.taxon||n===o.source)&&(!("biologicalSex"in t)||"biologicalSex"in o&&t.biologicalSex===o.biologicalSex))if("created"in o)i<o.created&&(i=o.created,r=o);else{r=o;break}return r}lookupMap_(t){return typeof t=="object"?this.latestMap_(t):this.latestMap_({uuid:t})}loadMap(t,n,r,i={}){return new Promise(async(o,a)=>{try{const s=await this.findMap_(t);s===null&&a(`Unknown map: ${JSON.stringify(t)}`);const d="uuid"in s?s.uuid:s.id,f=await this._mapServer.loadJSON(`flatmap/${d}/`),Q="uuid"in f?f.uuid:f.id;if(d!==Q)throw new Error(`Map '${d}' has wrong ID in index`);const p=Object.assign({},this._options,i);!("bounds"in i)&&"bounds"in f&&(p.bounds=f.bounds),"style"in f?p.style=f.style:p.style="flatmap",!("image-layers"in f)&&"image_layer"in f&&(f["image-layers"]=f.image_layer);let g=[];if(!("version"in f)||f.version<=1)for(const V of f.layers)typeof V=="string"?g.push({id:V,description:V.charAt(0).toUpperCase()+V.slice(1),selectable:!0}):g.push(V);else g=await this._mapServer.loadJSON(`flatmap/${d}/layers`);const _=await this._mapServer.loadJSON(`flatmap/${d}/style`);"glyphs"in _||(_.glyphs="https://fonts.openmaptiles.org/{fontstack}/{range}.pbf");const x=await this._mapServer.loadJSON(`flatmap/${d}/pathways`),b=await this._mapServer.loadJSON(`flatmap/${d}/annotations`),A=await this._mapServer.loadJSON(`flatmap/${d}/metadata`),E=await this._mapServer.loadJSON(`flatmap/${d}/markers`);return"vector-tiles"in _.sources&&("minZoom"in p||(p.minZoom=_.sources["vector-tiles"].minzoom),"maxZoom"in p||(p.maxZoom=_.sources["vector-tiles"].maxzoom)),"layerOptions"in p?("colour"in p.layerOptions||(p.layerOptions.colour=!0),"outline"in p.layerOptions||(p.layerOptions.outline=!0)):p.layerOptions={colour:!0,outline:!0},p.layerOptions.authoring="authoring"in f?f.authoring:!1,p.separateLayers=s.separateLayers,this._mapNumber+=1,new y8t(n,this._mapServer.url(),{id:s,uuid:d,details:f,taxon:s.taxon,biologicalSex:s.biologicalSex,style:_,options:p,layers:g,markers:E,annotations:b,number:this._mapNumber,pathways:x,provenance:A,provenance:A,callback:r},o)}catch(s){a(s)}})}}/*! js-cookie v3.0.5 | MIT */function Kd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var _8t={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function vy(e,t){function n(i,o,a){if(!(typeof document>"u")){a=Kd({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var d in a)a[d]&&(s+="; "+d,a[d]!==!0&&(s+="="+a[d].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var d=o[s].split("="),f=d.slice(1).join("=");try{var Q=decodeURIComponent(d[0]);if(a[Q]=e.read(f,Q),i===Q)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",Kd({},o,{expires:-1}))},withAttributes:function(i){return vy(this.converter,Kd({},this.attributes,i))},withConverter:function(i){return vy(Kd({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var xy=vy(_8t,{path:"/"}),wa=function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},L1=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},xs,sc,Vi,Ea,E3;const v8t=1e4;class x8t{constructor(t){xs.add(this),sc.set(this,void 0),Vi.set(this,null),Ea.set(this,null),t.slice(-1)==="/"?wa(this,sc,t.slice(0,-1),"f"):wa(this,sc,t,"f")}get currentUser(){return L1(this,Ea,"f")}get currentError(){return L1(this,Vi,"f")}async authenticate(t){wa(this,Vi,null,"f"),wa(this,Ea,null,"f");const n=await L1(this,xs,"m",E3).call(this,t,"authenticate");return"error"in n?(xy.remove("annotation-key"),Promise.resolve(L1(this,Vi,"f"))):(xy.set("annotation-key",n.session,{secure:!0,expires:1}),wa(this,Ea,n.data,"f"),Promise.resolve(L1(this,Ea,"f")))}async unauthenticate(t){wa(this,Vi,null,"f"),wa(this,Ea,null,"f");const n=await L1(this,xs,"m",E3).call(this,t,"unauthenticate");return"success"in n?Promise.resolve(n):Promise.resolve(L1(this,Vi,"f"))}async annotatedItemIds(t,n){const r=await L1(this,xs,"m",E3).call(this,t,"items/","GET",{resource:n});return"error"in r?Promise.resolve(L1(this,Vi,"f")):Promise.resolve(r)}async drawnFeatures(t,n){const r=await L1(this,xs,"m",E3).call(this,t,"features/","GET",{resource:n});return"error"in r?Promise.resolve(L1(this,Vi,"f")):Promise.resolve(r)}async itemAnnotations(t,n,r){const i=await L1(this,xs,"m",E3).call(this,t,"annotations/","GET",{resource:n,item:r});return"error"in i?Promise.resolve(L1(this,Vi,"f")):Promise.resolve(i)}async annotation(t,n){const r=await L1(this,xs,"m",E3).call(this,t,"annotation/","GET",{annotation:n});return"error"in r?Promise.resolve(L1(this,Vi,"f")):Promise.resolve(r)}async addAnnotation(t,n){if(L1(this,Ea,"f")&&L1(this,Ea,"f").canUpdate){const r=Object.assign({creator:L1(this,Ea,"f"),created:new Date().toISOString()},n),i=await L1(this,xs,"m",E3).call(this,t,"annotation/","POST",{data:r});if(!("error"in i))return Promise.resolve(i);wa(this,Vi,i,"f")}else wa(this,Vi,{error:"user cannot add annotation"},"f");return Promise.resolve(L1(this,Vi,"f"))}}sc=new WeakMap,Vi=new WeakMap,Ea=new WeakMap,xs=new WeakSet,E3=async function(t,n,r="GET",i={}){let o=!0;const a=new AbortController;setTimeout(()=>{o&&(console.log("Annotation server timeout..."),a.abort())},v8t);const s={method:r,signal:a.signal};let d=`${L1(this,sc,"f")}/${n}`;const f=xy.get("annotation-key")||"";if(r==="GET"){const p=[];for(const[g,_]of Object.entries(i))p.push(`${g}=${encodeURIComponent(JSON.stringify(_))}`);p.push(`key=${encodeURIComponent(t)}`),p.push(`session=${encodeURIComponent(f)}`),d+="?"+p.join("&"),s.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(r==="POST"){const p=Object.assign({key:t,session:f},i);s.body=JSON.stringify(p),s.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const Q=await fetch(d,s);return o=!1,Q.ok?Promise.resolve(await Q.json()):(wa(this,Vi,{error:`${Q.status} ${Q.statusText}`},"f"),Promise.resolve(L1(this,Vi,"f")))};const b8t=(e,t)=>{let n,r,i,o,a,s;t.style.left="",t.style.top="",t.addEventListener("mousedown",f=>{f.preventDefault(),n=t.offsetLeft,r=t.offsetTop,i=f.clientX,o=f.clientY,t.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",()=>{t.removeEventListener("mousemove",d,!1)},!1)},!1);function d(f){f.preventDefault(),a=n-(i-f.clientX),s=r-(o-f.clientY),t.style.left=`${a}px`,t.style.top=`${s}px`}},L8t=e=>{let t={lng:0,lat:0},n;return e.type==="Polygon"?n=e.coordinates[0]:n=e.coordinates,e.type!=="Point"?(n.map(r=>{t.lng+=parseFloat(r[0]),t.lat+=parseFloat(r[1])}),t.lng=t.lng/n.length,t.lat=t.lat/n.length):(t.lng+=parseFloat(n[0]),t.lat+=parseFloat(n[1])),t},DO=(e,t)=>{const n=[];let r=e.organs?e.organs:e.ftus;const i=r?r.filter((o,a)=>r.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${t}.${o.label}`},s=DO(o,a.key);s.length>0&&(a.children=s),n.push(a)}),n},w8t=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},E8t={name:"FlatmapVuer",components:{Button:bo,Col:oa,Loading:eG,Radio:cb,RadioGroup:ub,Row:Lo,Select:j6,Dialog:r$,MapSvgIcon:A1.MapSvgIcon,MapSvgSpriteColor:A1.MapSvgSpriteColor,Tooltip:GT,TreeControls:Nb,SelectionsGroup:Rb,SvgLegends:Fb,ElIconWarningFilled:Mv,ElIconArrowDown:Zs,ElIconArrowLeft:wv},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},setup(e){return{annotator:h.markRaw(new x8t(`${e.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.inDrawing=!1,this.initialiseDialog(),this.activeDrawTool=void 0,this.createdEvent=void 0},cancelDrawnFeature:function(){this.createdEvent&&(this.closePopup(),this.annotationEntry={...this.createdEvent.feature,resourceId:this.serverUUID},this.rollbackAnnotationEvent(),this.initialiseDrawing())},confirmDrawnFeature:function(){this.createdEvent&&(this.checkAndCreatePopups(this.createdEvent),Object.keys(this.relevanceEntry).length>0&&(this.annotationEntry.feature.relevance=this.relevanceEntry),this.initialiseDrawing())},initialiseDialog:function(){this.relevanceDisplay=!1,this.relevanceEntry={}},relevanceDialogPopup:function(){!this.$el.querySelector(".drawRelevance").classList.contains("inactive")&&!this.inDrawing&&(this.closePopup(),this.relevanceDisplay=!this.relevanceDisplay)},drawingEvent:function(e){if(this.closePopup(),this.drawnTypes.includes(e)&&!this.activeDrawMode&&!this.relevanceDisplay){if(e==="Point"){const t=this.$el.querySelector(".mapbox-gl-draw_point");this.$el.querySelector(".mapbox-gl-draw_point").click(),this.activeDrawTool=t.classList.contains("active")?"Point":void 0}else if(e==="LineString"){const t=this.$el.querySelector(".mapbox-gl-draw_line");this.$el.querySelector(".mapbox-gl-draw_line").click(),this.activeDrawTool=t.classList.contains("active")?"LineString":void 0}else if(e==="Polygon"){const t=this.$el.querySelector(".mapbox-gl-draw_polygon");this.$el.querySelector(".mapbox-gl-draw_polygon").click(),this.activeDrawTool=t.classList.contains("active")?"Polygon":void 0}}else this.drawModes.includes(e)&&!this.activeDrawTool&&(e==="Delete"?(this.currentDrawnFeature&&(!this.activeDrawMode||this.activeDrawMode==="Edit")&&(this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[this.currentDrawnFeature.id]}}),this.trashAnnotationFeature()),this.activeDrawMode=this.activeDrawMode==="Delete"?void 0:"Delete",this.activeDrawMode||(this.currentDrawnFeature=void 0)):e==="Edit"&&(this.activeDrawMode=this.activeDrawMode==="Edit"?void 0:"Edit"))},changeAnnotationDrawMode:function(e){this.mapImp&&this.mapImp.changeAnnotationDrawMode(e)},clearAnnotationFeature:function(){this.mapImp&&this.drawnAnnotationFeatures&&this.drawnAnnotationFeatures.length>0&&this.mapImp.clearAnnotationFeature()},trashAnnotationFeature:function(){this.mapImp&&this.mapImp.trashAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&this.drawnAnnotationEvent.includes(this.annotationEntry.type)&&this.mapImp.rollbackAnnotationEvent(this.annotationEntry)},commitAnnotationEvent:function(e){this.mapImp&&this.drawnAnnotationEvent.includes(this.annotationEntry.type)&&e&&(this.annotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?this.closePopup():this.addAnnotationFeature())},setFeatureAnnotated:function(){this.mapImp&&this.annotator.annotatedItemIds(this.userApiKey,this.serverUUID).then(e=>{for(const t of e)this.mapImp.setFeatureAnnotated(t)}).catch(e=>{console.log(e)})},addAnnotationFeature:function(){this.mapImp&&(this.annotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None"&&this.annotator.drawnFeatures(this.userApiKey,this.serverUUID).then(e=>{if(this.drawnType!=="All tools"&&(e=e.filter(t=>t.geometry.type===this.drawnType)),this.drawnAnnotationFeatures=e,!this.annotationSubmitted)for(const t of e)this.annotatedType!=="Everyone"?this.annotator.itemAnnotations(this.userApiKey,this.serverUUID,t.id).then(n=>{let r=n.filter(i=>i.creator.name===this.userInformation.name&&i.creator.email===this.userInformation.email).length>0;(this.annotatedType==="Me"&&r||this.annotatedType==="Others"&&!r)&&this.mapImp.addAnnotationFeature(t)}).catch(n=>{console.log(n)}):this.mapImp.addAnnotationFeature(t)}).catch(e=>{console.log(e)}))},showAnnotator:function(e){this.mapImp&&(this.mapImp.showAnnotator(e),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(e){this.drawnType=e,this.mapImp&&this.addAnnotationFeature()},setAnnotatedType:function(e){this.annotatedType=e,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(e){this.flightPath3DRadio=e,this.mapImp&&this.mapImp.enable3dPaths(e)},viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(n=>{const r={colour:n.colour,enabled:n.enabled,label:n.id,key:n.id},i=DO(n,r.key);i.length>0&&(r.children=i),t.children.push(r)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,t.forEach(n=>{jb(e,n).then(r=>{const i={taxon:n,label:r};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setColour({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlineRadio=e,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:e})},resetView:function(){this.mapImp&&(this.mapImp.resetMap(),this.$refs.centrelinesSelection&&this.$refs.centrelinesSelection.reset(),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset())},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},centreLinesSelected:function(e){this.mapImp&&this.mapImp.enableCentrelines(e.value)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},highlightConnectedPaths:function(e){if(this.mapImp){let n=[...this.mapImp.pathModelNodes(e)].map(i=>this.mapImp.featureProperties(i)),r=[];n.forEach(i=>{this.mapImp.nodePathModels(i.featureId).forEach(o=>{r.push(o)})}),this.mapImp.zoomToFeatures(r,{noZoomIn:!0})}},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},checkAllTaxons:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableConnectivityByTaxonIds(t,e.value))},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},eventCallback:function(){return(e,t,...n)=>{if(e==="annotation"){const r={feature:t,userData:n,eventType:e};if(t.type==="aborted")this.annotationSubmitted?this.annotationSubmitted=!1:this.rollbackAnnotationEvent();else if(t.type==="modeChanged")t.feature.mode.startsWith("draw_")?(this.initialiseDialog(),this.inDrawing=!0):t.feature.mode==="simple_select"&&this.inDrawing?this.createdEvent?this.relevanceDisplay=!0:this.initialiseDrawing():t.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(t.type==="selectionChanged")this.currentDrawnFeature=t.feature.features.length===0?void 0:t.feature.features[0],r.feature.feature=this.currentDrawnFeature,this.inDrawing||(this.initialiseDialog(),this.currentDrawnFeature&&(this.processRelevance(),this.checkAndCreateDrawnFeaturePopups(r)));else{if(t.type==="created"||t.type==="updated"){t.type==="updated"&&t.feature.action&&(t.positionUpdated=t.feature.action==="move");const i=this.mapImp.refreshAnnotationFeatureGeometry(t.feature);r.feature.feature=i}t.type==="created"?this.createdEvent=r:this.checkAndCreatePopups(r)}}else if(e!=="pan-zoom"){const r=t.label,i=[t.models],o=this.entry,a=this.biologicalSex;let s;t.taxons&&(typeof t.taxons!="object"?s=JSON.parse(t.taxons):s=t.taxons);const d={dataset:t.dataset,biologicalSex:a,taxonomy:o,resource:i,label:r,feature:t,userData:n,eventType:e,provenanceTaxonomy:s};e==="click"?this.viewingMode==="Network Discovery"?this.highlightConnectedPaths([t.models]):(this.currentActive=t.models?t.models:"",this.inDrawing&&!this.relevanceDisplay&&this.processRelevance(d)):e==="mouseenter"&&this.viewingMode!=="Network Discovery"&&(this.currentHover=t.models?t.models:""),t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Network Discovery"&&!this.inDrawing&&this.checkAndCreatePopups(d),this.$emit("resource-selected",d)}else this.$emit("pan-zoom-callback",t)}},dialogCssHacks:function(){this.$nextTick(()=>{const e=this.$el.querySelector(".relevance-dialog");b8t(this.$el,e);let t,n;const r=this.$el.getBoundingClientRect(),i=e.getBoundingClientRect();this.dialogPosition.x>r.width/2?t=this.dialogPosition.x-i.width:t=this.dialogPosition.x,this.dialogPosition.y>r.height/2?n=this.dialogPosition.y-i.height:n=this.dialogPosition.y,e.style.transform=`translate(${t-this.dialogPosition.offsetX}px, ${n-this.dialogPosition.offsetY}px)`})},drawIconCssHacks:function(){(this.$el.querySelector(".iconSelected")||!this.relevanceDisplay)&&(this.drawnTypes.map(e=>{const t=this.$el.querySelector(`.draw${e}`);t&&(t.classList.remove("iconSelected"),t.classList.remove("inactive"))}),this.drawModes.map(e=>{this.$el.querySelector(`.draw${e}`).classList.remove("iconSelected"),this.$el.querySelector(`.draw${e}`).classList.remove("inactive")})),this.activeDrawTool?(this.$el.querySelector(`.draw${this.activeDrawTool}`).classList.add("iconSelected"),this.drawModes.map(e=>{this.$el.querySelector(`.draw${e}`).classList.add("inactive")})):(this.activeDrawMode||this.relevanceDisplay)&&(this.activeDrawMode&&this.$el.querySelector(`.draw${this.activeDrawMode}`).classList.add("iconSelected"),this.drawnTypes.map(e=>{const t=this.$el.querySelector(`.draw${e}`);t&&t.classList.add("inactive")}))},processRelevance:function(e=void 0){if(e&&e.feature){let t=e.feature.models?e.feature.models:e.feature.featureId;t&&this.activeDrawTool==="LineString"&&(this.relevanceEntry[t]=e)}else if(this.currentDrawnFeature&&this.drawnAnnotationFeatures){let t=this.drawnAnnotationFeatures.filter(n=>n.id===this.currentDrawnFeature.id)[0];t&&t.relevance&&(this.relevanceEntry=t.relevance)}},checkAndCreateDrawnFeaturePopups:function(e){this.activeDrawMode&&(this.doubleClickedFeature?(e.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:e.feature.feature.id}}),this.trashAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[e.feature.feature.id]}}),this.trashAnnotationFeature()))},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature?(this.annotationEntry={...e.feature,resourceId:this.serverUUID},e.feature.featureId&&e.feature.models?this.displayTooltip(e.feature.models):e.feature.feature&&(this.inDrawing||this.activeDrawMode?(this.annotationSubmitted=!1,this.annotationEntry.featureId=e.feature.feature.id,this.displayTooltip(e.feature.feature.id,L8t(e.feature.feature.geometry))):e.feature.type==="updated"&&this.rollbackAnnotationEvent(),(e.feature.type==="updated"||e.feature.type==="deleted")&&this.initialiseDialog())):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(e);(t[0]||t[1]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(this.resourceForTooltip=e.resource[0],e.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(e))}},popUpCssHacks:function(){let e=document.querySelector(".flatmap-tooltip-popup");e&&(e.style.display="none"),document.querySelector(".maplibregl-popup-close-button").style.display="block",this.$refs.tooltip.$el.style.display="flex",document.querySelector(".maplibregl-popup-close-button").onclick=()=>{e&&(e.style.display="block")}},closePopup:function(){let e=document.querySelector(".maplibregl-popup-close-button");e&&e.click()},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},createTooltipFromNeuronCuration:async function(e){this.tooltipEntry=await this.flatmapQueries.createTooltipData(e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,n){let r=n;this.mapImp&&(r?r.className||(r.className="custom-popup"):r={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,r))},showMarkerPopup:function(e,t,n){this.mapImp&&this.mapImp.showMarkerPopup(e,t,n)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisibilities.forEach(t=>{t.value=!0}),this.openFlatmapHelpPopup()):(this.inHelp=!1,this.hoverVisibilities.forEach(t=>{t.value=!1}),this.closeFlatmapHelpPopup())},showToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0},500))},hideToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},500))},displayTooltip:function(e,t=void 0){this.tooltipDisplay=!0;let n,r={className:"flatmapvuer-popover"};t?(n=e,r.annotationFeatureGeometry=t):(n=this.mapImp.modelFeatureIds(e)[0],this.inDrawing||(r.positionAtLastClick=!0)),this.disableUI||this.$nextTick(()=>{this.mapImp.showPopup(n,this.$refs.tooltip.$el,r),this.popUpCssHacks()})},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"})}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let n of t.values())n.label&&e.push(n.label);return Array.from(new Set(e))}},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?e.viewport&&this.mapImp.setState(e.viewport):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){e&&(e.viewport&&this.mapImp.setState(e.viewport),e.searchTerm&&this.searchAndShowResult(e.searchTerm,!0))},setFlightPathInfo:function(e){(e===1.6||e>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!0))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0;let t=!1;this.displayMinimap&&(t={position:"top-right"});let n={taxon:this.entry};this.uuid&&(n.uuid=this.uuid),e?e.uuid?n={uuid:e.uuid}:e.entry&&(n.taxon=e.entry,e.biologicalSex?n.biologicalSex=e.biologicalSex:n.taxon==="NCBITaxon:9606"&&(n.biologicalSex="PATO:0000384")):this.biologicalSex&&(n.biologicalSex=this.biologicalSex),this.mapManager.loadMap(n,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:t}).then(i=>{this.mapImp=i,this.serverUUID=this.mapImp.getIdentifier().uuid;let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(e)})}else e&&(this._stateToBeSet={viewport:e.viewport,searchTerm:e.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),n=parseInt(t.paddingTop)+parseInt(t.paddingBottom),r=e.clientHeight-n;this.pathwaysMaxHeight=r-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(){this.sensor=new wZ(this.$refs.display,this.mapResize),this.mapImp.options&&this.mapImp.options.style==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.$emit("ready",this)},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t){if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),!0;{const n=this.mapImp.search(e);if(n&&n.results&&n.results.length>0){if(this.mapImp.showSearchResults(n),t&&n.results[0].featureId&&n.results[0].text){const r=this.mapImp.annotation(n.results[0].featureId);this.mapImp.showPopup(n.results[0].featureId,r.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(e){return this.mapImp?this.mapImp.search(e):[]}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:4},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},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"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},userApiKey:{type:String,default:void 0},disableUI:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,userApiKey:this.userApiKey,$annotator:this.annotator}},data:function(){return{annotationEntry:{},tooltipDisplay:!0,serverUUID:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],yellowstar:bZ,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:vZ,tooltipEntry:w8t(),connectivityTooltipVisible:!1,drawerOpen:!1,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",currentDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:["Annotation","Exploration","Network Discovery"],drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Everyone",annotatedTypes:["Everyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,annotator:void 0,userInformation:void 0,activeDrawTool:void 0,drawnAnnotationEvent:["created","updated","deleted"],createdEvent:void 0,annotationSubmitted:!1,inDrawing:!1,relevanceDisplay:!1,relevanceEntry:{},drawnAnnotationFeatures:void 0,doubleClickedFeature:!1,activeDrawMode:void 0,drawModes:["Delete","Edit"],dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{relevance:function(){return Object.keys(this.relevanceEntry).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e,t){e!==t&&this.setHelpMode(val)},state:{handler:function(e,t){e!==t&&(this.mapManager?this.setState(e):this.setStateRequired=!0)},immediate:!0,deep:!0},activeDrawTool:function(){this.drawIconCssHacks()},activeDrawMode:function(){this.drawIconCssHacks()},relevance:function(e){const t=this.$el.querySelector(".drawRelevance");e?t.classList.remove("inactive"):(this.relevanceDisplay=!1,t.classList.add("inactive"))},relevanceDisplay:function(e){const t=this.$el.querySelector(".drawRelevance");e?(t.classList.add("iconSelected"),this.dialogCssHacks()):t.classList.remove("iconSelected"),this.drawIconCssHacks()},dialogPosition:{handler:function(){const e=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=e.x,this.dialogPosition.offsetY=e.y},deep:!0,once:!0},viewingMode:function(e){e==="Annotation"?(this.$el.querySelector(".maplibregl-canvas").addEventListener("click",t=>{t.preventDefault(),this.dialogPosition.x=t.clientX,this.dialogPosition.y=t.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()},!1),this.showAnnotator(!0),this.annotator.authenticate(this.userApiKey).then(t=>{t.name&&t.email&&(this.userInformation=t,this.setFeatureAnnotated(),this.drawnAnnotationFeatures||this.addAnnotationFeature())})):this.showAnnotator(!1)},disableUI:function(e){e&&this.closeTooltip()}},created:function(){},mounted:function(){this.openMapRef=h.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=h.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new VO(this.flatmapAPI),this.flatmapQueries=new xZ,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Po=e=>(h.pushScopeId("data-v-2ec30d63"),e=e(),h.popScopeId(),e),M8t={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},A8t={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},C8t={style:{height:"100%",width:"100%"},ref:"display"},S8t={class:"beta-popovers"},H8t=Po(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),O8t=Po(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),V8t=Po(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),D8t=Po(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),I8t=Po(()=>h.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),P8t={key:1,class:"warning-text"},k8t=Po(()=>h.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),B8t=Po(()=>h.createElementVNode("b",null,"Network discovery mode",-1)),R8t=Po(()=>h.createElementVNode("p",null," You can now view the network of neurons connected to a selected neuron. This mode is located in the settings at the bottom right. Once discovery mode is on, click on a neuron to see its connections. ",-1)),N8t=Po(()=>h.createElementVNode("b",null,"Now can display up to 6 panes",-1)),F8t=Po(()=>h.createElementVNode("p",null," You can now display up to 6 panes in the flatmap. This allows you to compare between different datasets and/or different views of the same dataset. ",-1)),j8t={key:0,class:"bottom-draw-control"},z8t={class:"bottom-right-control"},U8t=Po(()=>h.createElementVNode("div",null,[h.createTextVNode(" Fit to "),h.createElementVNode("br"),h.createTextVNode(" window ")],-1)),$8t=["innerHTML"],G8t=["innerHTML"],Z8t=["onClick"];function q8t(e,t,n,r,i,o){const a=h.resolveComponent("map-svg-sprite-color"),s=Mv,d=X1,f=B8,Q=Zs,p=h.resolveComponent("map-svg-icon"),g=Fb,_=Nb,x=Rb,b=wv,A=bo,E=Lo,O=oa,V=k8,k=j6,j=cb,U=ub,$=GT,J=cG,tt=Cb,st=U8;return h.withDirectives((h.openBlock(),h.createElementBlock("div",M8t,[h.createVNode(a),h.createElementVNode("div",A8t,[h.createElementVNode("div",C8t,null,512),h.withDirectives(h.createElementVNode("div",S8t,[h.createElementVNode("div",null,[h.createVNode(f,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[6].value,ref:"warningPopover"},{reference:h.withCtx(()=>[n.displayWarning?(h.openBlock(),h.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=ot=>o.showToolitip(6)),onMouseout:t[8]||(t[8]=ot=>o.hideToolitip(6))},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(s)]),_:1}),n.isLegacy?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[I8t,h.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...ot)=>o.viewLatestMap&&o.viewLatestMap(...ot))}," Click here for the latest map ")],64)):(h.openBlock(),h.createElementBlock("span",P8t,"Beta"))],32)):h.createCommentVNode("",!0)]),default:h.withCtx(()=>[n.isLegacy?(h.openBlock(),h.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=ot=>o.showToolitip(6)),onMouseout:t[1]||(t[1]=ot=>o.hideToolitip(6))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(h.openBlock(),h.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=ot=>o.showToolitip(6)),onMouseout:t[3]||(t[3]=ot=>o.hideToolitip(6))},[h.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),H8t,h.createTextVNode(" models available in "),O8t,h.createTextVNode(". ")],32)):(h.openBlock(),h.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=ot=>o.showToolitip(6)),onMouseout:t[5]||(t[5]=ot=>o.hideToolitip(6))},[h.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),V8t,h.createTextVNode(" models available in "),D8t,h.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),n.displayLatestChanges?(h.openBlock(),h.createBlock(f,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[7].value},{reference:h.withCtx(()=>[n.displayLatestChanges?(h.openBlock(),h.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=ot=>o.showToolitip(7)),onMouseout:t[10]||(t[10]=ot=>o.hideToolitip(7))},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(s)]),_:1}),k8t],32)):h.createCommentVNode("",!0)]),default:h.withCtx(()=>[B8t,R8t,N8t,F8t]),_:1},8,["visible"])):h.createCommentVNode("",!0)],512),[[h.vShow,!n.disableUI]]),h.withDirectives(h.createVNode(d,{class:h.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:h.withCtx(()=>[h.createVNode(Q)]),_:1},8,["class","onClick"]),[[h.vShow,e.minimapResizeShow]]),e.viewingMode==="Annotation"&&e.userInformation?h.withDirectives((h.openBlock(),h.createElementBlock("div",j8t,[h.createVNode(f,{content:"Relevance",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[10].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"connection",class:"icon-button drawRelevance inactive",onClick:o.relevanceDialogPopup,onMouseover:t[11]||(t[11]=ot=>o.showToolitip(10)),onMouseout:t[12]||(t[12]=ot=>o.hideToolitip(10))},null,8,["onClick"])]),_:1},8,["visible"]),e.drawnType!=="LineString"&&e.drawnType!=="Polygon"?(h.openBlock(),h.createBlock(f,{key:0,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[11].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"drawPoint",class:"icon-button drawPoint",onClick:t[13]||(t[13]=ot=>o.drawingEvent("Point")),onMouseover:t[14]||(t[14]=ot=>o.showToolitip(11)),onMouseout:t[15]||(t[15]=ot=>o.hideToolitip(11))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),e.drawnType!=="Point"&&e.drawnType!=="Polygon"?(h.openBlock(),h.createBlock(f,{key:1,content:"Draw Line",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[12].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"drawLine",class:"icon-button drawLineString",onClick:t[16]||(t[16]=ot=>o.drawingEvent("LineString")),onMouseover:t[17]||(t[17]=ot=>o.showToolitip(12)),onMouseout:t[18]||(t[18]=ot=>o.hideToolitip(12))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),e.drawnType!=="Point"&&e.drawnType!=="LineString"?(h.openBlock(),h.createBlock(f,{key:2,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[13].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:t[19]||(t[19]=ot=>o.drawingEvent("Polygon")),onMouseover:t[20]||(t[20]=ot=>o.showToolitip(13)),onMouseout:t[21]||(t[21]=ot=>o.hideToolitip(13))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),h.createVNode(f,{content:"Delete",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[14].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"drawTrash",class:"icon-button drawDelete",onClick:t[22]||(t[22]=ot=>o.drawingEvent("Delete")),onMouseover:t[23]||(t[23]=ot=>o.showToolitip(14)),onMouseout:t[24]||(t[24]=ot=>o.hideToolitip(14))})]),_:1},8,["visible"]),h.createVNode(f,{content:"Edit",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[15].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"comment",class:"icon-button drawEdit",onClick:t[25]||(t[25]=ot=>o.drawingEvent("Edit")),onMouseover:t[26]||(t[26]=ot=>o.showToolitip(15)),onMouseout:t[27]||(t[27]=ot=>o.hideToolitip(15))})]),_:1},8,["visible"])],512)),[[h.vShow,!n.disableUI]]):h.createCommentVNode("",!0),h.withDirectives(h.createElementVNode("div",z8t,[h.createVNode(f,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[0].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[28]||(t[28]=ot=>o.zoomIn()),onMouseover:t[29]||(t[29]=ot=>o.showToolitip(0)),onMouseout:t[30]||(t[30]=ot=>o.hideToolitip(0))})]),_:1},8,["visible"]),h.createVNode(f,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[31]||(t[31]=ot=>o.zoomOut()),onMouseover:t[32]||(t[32]=ot=>o.showToolitip(1)),onMouseout:t[33]||(t[33]=ot=>o.hideToolitip(1))})]),_:1},8,["visible"]),h.createVNode(f,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[34]||(t[34]=ot=>o.resetView()),onMouseover:t[35]||(t[35]=ot=>o.showToolitip(2)),onMouseout:t[36]||(t[36]=ot=>o.hideToolitip(2))})]),default:h.withCtx(()=>[U8t]),_:1},8,["visible"])],512),[[h.vShow,!n.disableUI]]),h.createVNode(f,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper",visible:e.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:h.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:h.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(g,{key:0,class:"svg-legends-container"})),h.createVNode(f,{content:"Location of the featured dataset",placement:"right",teleported:!1,trigger:"hover","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar},null,8,$8t),[[h.vShow,n.showStarInLegend],[tt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),h.createVNode(f,{content:"Find these markers for data",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[5].value,ref:"markerPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,G8t),[[h.vShow,e.hoverVisibilities[5].value],[tt,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(h.openBlock(),h.createBlock(_,{key:1,active:e.currentActive,hover:e.currentHover,"tree-data":e.systems,ref:"treeControls",onChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):h.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(h.openBlock(),h.createBlock(x,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:o.centreLinesSelected,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged"])):h.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(h.openBlock(),h.createBlock(x,{title:"Observed in",labelKey:"label",identifierKey:"taxon",selections:e.taxonConnectivity,onChanged:o.taxonsSelected,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckAll"])):h.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(h.openBlock(),h.createBlock(x,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:o.pathwaysSelected,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onCheckAll"])):h.createCommentVNode("",!0)],6)),[[tt,void 0,"checkBoxPopover"]]),h.createElementVNode("div",{onClick:t[37]||(t[37]=(...ot)=>o.toggleDrawer&&o.toggleDrawer(...ot)),class:h.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(b)]),_:1})],2)],2),[[h.vShow,!n.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(h.openBlock(),h.createBlock(f,{key:1,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.openMapOptions,ot=>(h.openBlock(),h.createBlock(E,{key:ot.key},{default:h.withCtx(()=>[h.createVNode(A,{type:"primary",plain:"",onClick:gt=>e.$emit("open-map",ot.key)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(ot.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):h.createCommentVNode("",!0),h.createVNode(f,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"200",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:h.withCtx(()=>[h.createElementVNode("div",null,[h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Viewing Mode")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(k,{teleported:!1,modelValue:e.viewingMode,"onUpdate:modelValue":t[38]||(t[38]=ot=>e.viewingMode=ot),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.viewingModes,(ot,gt)=>(h.openBlock(),h.createBlock(V,{key:ot+gt,label:ot,value:ot},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(O,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(ot),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.viewingMode==="Annotation"&&e.userInformation?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Drawn By*")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(k,{teleported:!1,modelValue:e.drawnType,"onUpdate:modelValue":t[39]||(t[39]=ot=>e.drawnType=ot),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.drawnTypes,ot=>(h.openBlock(),h.createBlock(V,{key:ot,label:ot,value:ot},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(O,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(ot),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Annotated By*")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(k,{teleported:!1,modelValue:e.annotatedType,"onUpdate:modelValue":t[40]||(t[40]=ot=>e.annotatedType=ot),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.annotatedTypes,ot=>(h.openBlock(),h.createBlock(V,{key:ot,label:ot,value:ot},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(O,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(ot),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):h.createCommentVNode("",!0),e.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:1,class:"backgroundSpacer"})):h.createCommentVNode("",!0),e.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:2,class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Flight path display")]),_:1})):h.createCommentVNode("",!0),e.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:3,class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(U,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[41]||(t[41]=ot=>e.flightPath3DRadio=ot),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:h.withCtx(()=>[h.createVNode(j,{label:!1},{default:h.withCtx(()=>[h.createTextVNode("2D")]),_:1}),h.createVNode(j,{label:!0},{default:h.withCtx(()=>[h.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):h.createCommentVNode("",!0),h.createVNode(E,{class:"backgroundSpacer"}),h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Organs display")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(U,{modelValue:e.colourRadio,"onUpdate:modelValue":t[42]||(t[42]=ot=>e.colourRadio=ot),class:"flatmap-radio",onChange:o.setColour},{default:h.withCtx(()=>[h.createVNode(j,{label:!0},{default:h.withCtx(()=>[h.createTextVNode("Colour")]),_:1}),h.createVNode(j,{label:!1},{default:h.withCtx(()=>[h.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),h.createVNode(E,{class:"backgroundSpacer"}),h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Outlines display")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(U,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[43]||(t[43]=ot=>e.outlinesRadio=ot),class:"flatmap-radio",onChange:o.setOutlines},{default:h.withCtx(()=>[h.createVNode(j,{label:!0},{default:h.withCtx(()=>[h.createTextVNode("Show")]),_:1}),h.createVNode(j,{label:!1},{default:h.withCtx(()=>[h.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),h.createVNode(E,{class:"backgroundSpacer"}),h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Change background")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.availableBackground,ot=>(h.openBlock(),h.createElementBlock("div",{key:ot,class:h.normalizeClass(["backgroundChoice",ot,ot==e.currentBackground?"active":""]),onClick:gt=>o.backgroundChangeCallback(ot)},null,10,Z8t))),128))]),_:1})])]),_:1},8,["virtual-ref"]),h.withDirectives(h.createElementVNode("div",{class:h.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(f,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper"},{reference:h.withCtx(()=>[n.enableOpenMapUI&&n.openMapOptions.length>0?(h.openBlock(),h.createBlock(p,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[44]||(t[44]=ot=>o.showToolitip(8)),onMouseout:t[45]||(t[45]=ot=>o.hideToolitip(8))},null,512)):h.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(f,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper"},{reference:h.withCtx(()=>[h.createVNode(p,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[46]||(t[46]=ot=>o.showToolitip(3)),onMouseout:t[47]||(t[47]=ot=>o.hideToolitip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[h.vShow,!n.disableUI]]),h.withDirectives(h.createVNode($,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,entry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","entry","annotationDisplay","onAnnotation"]),[[h.vShow,e.tooltipDisplay]]),h.withDirectives(h.createVNode(J,{class:"relevance-dialog",entry:e.relevanceEntry,drawing:e.inDrawing,relevance:o.relevance,onDisplay:o.relevanceDialogPopup,onConfirm:o.confirmDrawnFeature,onCancel:o.cancelDrawnFeature,onPopup:o.closePopup,onTooltip:o.checkAndCreatePopups},null,8,["entry","drawing","relevance","onDisplay","onConfirm","onCancel","onPopup","onTooltip"]),[[h.vShow,e.relevanceDisplay]])])])),[[st,e.loading]])}const by=aa(E8t,[["render",q8t],["__scopeId","data-v-2ec30d63"]]),IO={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},W8t={name:"MultiFlatmapVuer",components:{Col:oa,Row:Lo,Option:k8,Select:j6,Popover:B8,FlatmapVuer:by},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),$8.on("onActionClick",e=>{this.resourceSelected(e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(r=>{const i=this.availableSpecies[r].uuid;if(i&&t.map(o=>o.uuid).indexOf(i)>0)this.speciesList[r]=h.reactive(this.availableSpecies[r]);else for(let o=0;o<t.length;o++)if(this.availableSpecies[r].taxo===t[o].taxon)if(this.availableSpecies[r].biologicalSex){if(t[o].biologicalSex&&t[o].biologicalSex===this.availableSpecies[r].biologicalSex){this.speciesList[r]=h.reactive(this.availableSpecies[r]);break}}else{this.speciesList[r]=h.reactive(this.availableSpecies[r]);break}});let n=this.initial;if(this.state){const r=this.state.state;(!r||!r.uuid&&!r.entry)&&this.state.species?n=this.state.species:n=void 0}n&&(n&&this.speciesList[n]!==void 0?this.activeSpecies=n:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this._initialised=!0,e(),this._resolveList.forEach(r=>{r()})})):this._initialised?e():this._resolveList.push(e)})},resourceSelected:function(e){this.$emit("resource-selected",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},showPopup:function(e,t,n){this.getCurrentFlatmap().showPopup(e,t,n)},showMarkerPopup:function(e,t,n){this.getCurrentFlatmap().showMarkerPopup(e,t,n)},setSpecies:function(e,t,n){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(n){const r=n-1;r>=0&&this.$nextTick(()=>{this.setSpecies(e,t,r)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let n=0;n<t.length;n++){const r=this.speciesList[t[n]];if(!r.isLegacy&&r.taxo===e.entry&&r.biologicalSex===e.biologicalSex){this.setSpecies(t[n],e,0);return}}},createLegacyEntry:function(e,t,n){if(n&&t){let r="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?r=e.species:r=r+` ${e.species}`),this.speciesList[r]=h.reactive({taxo:t,isLegacy:!0,displayWarning:!0}),{species:r,state:{entry:t,uuid:n,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const n=e.state;if(n.uuid){if(n.entry)return new Promise(()=>{const r=new VO(this.flatmapAPI),i={taxon:n.entry};n.biologicalSex&&(i.biologicalSex=n.biologicalSex),r.findMap_(i).then(o=>{if(o.uuid!==n.uuid)return this.createLegacyEntry(e,n.entry,n.uuid)}).then(o=>{t(o||e)}).catch(()=>{t(e)})})}else if(n.entry){const r=n.entry in IO?IO[n.entry]:void 0,i=this.createLegacyEntry(e,n.entry,r);t(i||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})})}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},userApiKey:{type:String,default:void 0},disableUI:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},X8t=e=>(h.pushScopeId("data-v-39e75155"),e=e(),h.popScopeId(),e),K8t={class:"multi-container",ref:"multiContainer"},Y8t={key:0,style:{position:"absolute","z-index":"10"}},J8t=X8t(()=>h.createElementVNode("div",{class:"species-display-text"},"Species",-1)),tut={class:"select-box-icon"};function eut(e,t,n,r,i,o){const a=k8,s=j6,d=B8,f=by;return h.openBlock(),h.createElementBlock("div",K8t,[n.disableUI?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",Y8t,[J8t,h.createVNode(d,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper right-popper",visible:n.helpMode,teleported:!1,ref:"selectPopover"},{reference:h.withCtx(()=>[h.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=Q=>e.activeSpecies=Q),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.speciesList,(Q,p)=>(h.openBlock(),h.createBlock(a,{key:p,label:p,value:p},{default:h.withCtx(()=>[h.createElementVNode("span",tut,[h.createElementVNode("i",{class:h.normalizeClass(Q.iconClass)},null,2)]),h.createTextVNode(" "+h.toDisplayString(p),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.speciesList,(Q,p)=>h.withDirectives((h.openBlock(),h.createBlock(f,{key:p,entry:Q.taxo,uuid:Q.uuid,biologicalSex:Q.biologicalSex,displayWarning:Q.displayWarning,displayLatestChanges:Q.displayLatestChanges,isLegacy:Q.isLegacy,ref_for:!0,ref:p,enableOpenMapUI:n.enableOpenMapUI,openMapOptions:n.openMapOptions,disableUI:n.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,onOpenMap:t[1]||(t[1]=g=>e.$emit("open-map",g)),minZoom:n.minZoom,helpMode:n.helpMode,renderAtMounted:n.renderAtMounted,displayMinimap:n.displayMinimap,showStarInLegend:n.showStarInLegend,style:{height:"100%"},flatmapAPI:n.flatmapAPI,sparcAPI:n.sparcAPI,userApiKey:n.userApiKey},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","minZoom","helpMode","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI","userApiKey"])),[[h.vShow,e.activeSpecies==p]])),128))],512)}const nut=aa(W8t,[["render",eut],["__scopeId","data-v-39e75155"]]);Un.FlatmapVuer=by,Un.MultiFlatmapVuer=nut,Un.Tooltip=GT,Object.defineProperty(Un,Symbol.toStringTag,{value:"Module"})});
|
|
1698
|
+
`)}</div>`)}this.activateFeature(_),this.__activateRelatedFeatures(_),"hyperlink"in _.properties&&(this._map.getCanvas().style.cursor="pointer")}}a!==""&&this._infoControl.show(a),this.__showToolTip(s,t.lngLat,f)}__showToolTip(t,n,r=null){if(t!==""||this._flatmap.options.showId&&r!==null){let i="";if(this._flatmap.options.showPosition){const o=aL(n.toArray()),s=Tq(o).geometry.coordinates;i=r===null?JSON.stringify(s):`${JSON.stringify(s)} (${r.id})`}this._flatmap.options.showId&&r!==null&&"id"in r.properties&&(i=`${i} ${r.properties.id}`),i!==""&&(t=`<span>${i}</span><br/>${t}`),t!==""&&(this._tooltip=new Zi.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-tooltip-popup"}),this._tooltip.setLngLat(n).setHTML(t).addTo(this._map))}}selectionEvent_(t,n){if(n!==void 0){const r=+n.id,i=!("properties"in n&&"kind"in n.properties&&["cell-type","scaffold","tissue"].includes(n.properties.kind));if(t.ctrlKey||t.metaKey){const o=this.featureSelected_(r);for(const a of this._activeFeatures)o?this.unselectFeature(a.id):this.selectFeature(a.id,i)}else{let o=!0;for(const a of this._selectedFeatureIds.keys())if(a===r){o=!1;break}if(this.unselectFeatures(),o)for(const a of this._activeFeatures)this.selectFeature(a.id,i)}}}clickEvent_(t){if(this._modal)return;this.__clearActiveMarker();const n=Rn(this,fc,Q_).call(this,t.point);if(n.length==0){this.unselectFeatures();return}const r=this.inDrawingAnnotationMode(),i=n.filter(a=>!a.id)[0],o=n.filter(a=>a.id)[0];this.selectionEvent_(t.originalEvent,o),this._modal?(this.__resetFeatureDisplay(),this.unselectFeatures(),this.__clearModal()):i&&!r?this.__featureEvent("click",i):o&&(this.__lastClickLngLat=t.lngLat,this.__featureEvent("click",o),"properties"in o&&"hyperlink"in o.properties&&window.open(o.properties.hyperlink,"_blank"))}__activateRelatedFeatures(t){if("nerveId"in t.properties){const n=t.properties.nerveId;n!==t.id&&this.activateFeature(this.mapFeature(n));for(const r of this.__pathManager.nerveFeatureIds(n))this.activateFeature(this.mapFeature(r))}if("nodeId"in t.properties)for(const n of this.__pathManager.pathFeatureIds(t.properties.nodeId))this.activateFeature(this.mapFeature(n))}enablePathsBySystem(t,n=!0,r=!1){this.__pathManager.enablePathsBySystem(t,n,r)}enablePathsByType(t,n=!0){this.__pathManager.enablePathsByType(t,n)}pathFeatureIds(t){const n=new Y8;return n.extend(this.__pathManager.connectivityModelFeatureIds(t)),n.extend(this.__pathManager.pathModelFeatureIds(t)),n}pathModelNodes(t){return this.__pathManager.pathModelNodes(t)}nodePathModels(t){return this.__pathManager.nodePathModels(t)}enableCentrelines(t=!0,n=!1){this.__pathManager.enablePathsByType("centreline",t,n),Rn(this,Ls,L6).call(this,{showCentrelines:t})}enableSckanPaths(t,n=!0){this._layerManager.enableSckanPaths(t,n)}enableConnectivityByTaxonIds(t,n=!0){if(n)for(const r of t)this.__enabledConnectivityTaxons.add(r);else for(const r of t)this.__enabledConnectivityTaxons.delete(r);this._layerManager.setFilter({taxons:[...this.__enabledConnectivityTaxons.values()]})}excludeAnnotated(t=!1){Rn(this,Ls,L6).call(this,{excludeAnnotated:t})}__markerPosition(t,n){if(this.__markerPositions.has(t))return this.__markerPositions.get(t);let r=n.markerPosition||n.centroid;if(r===null||r==null){const i=this._map.querySourceFeatures(lQ,{sourceLayer:this._flatmap.options.separateLayers?`${n.layer}_${n["tile-layer"]}`:n["tile-layer"],filter:["all",["==",["id"],parseInt(t)],["==",["geometry-type"],"Polygon"]]});i.length>0&&(r=T8t(i[0]))}return this.__markerPositions.set(t,r),r}addMarker(t,n={}){const r=this._flatmap.modelFeatureIds(t);let i=-1;for(const o of r){const a=this._flatmap.annotation(o);if(!(!("markerPosition"in a)&&!a.geometry.includes("Polygon"))&&!("marker"in a)){i===-1&&(this.__lastMarkerId+=1,i=this.__lastMarkerId);const s=n.colour||"#005974",d=n.element?new Zi.Marker({element:n.element}):new Zi.Marker({color:s,scale:.5}),f=document.createElement("div"),Q=document.createElement("div");Q.innerHTML=d.getElement().innerHTML,f.id=`marker-${i}`,f.appendChild(Q);const p={element:f};"className"in n&&(p.className=n.className);const g=this.__markerPosition(o,a),_=new Zi.Marker(p).setLngLat(g).addTo(this._map);f.addEventListener("mouseenter",this.markerMouseEvent_.bind(this,_,t)),f.addEventListener("mousemove",this.markerMouseEvent_.bind(this,_,t)),f.addEventListener("mouseleave",this.markerMouseEvent_.bind(this,_,t)),f.addEventListener("click",this.markerMouseEvent_.bind(this,_,t)),this.__markerIdByMarker.set(_,i),this.__markerIdByFeatureId.set(+o,i),this.__annotationByMarkerId.set(i,a),this.__featureEnabled(this.mapFeature(+o))||(f.style.visibility="hidden")}}return i===-1&&console.warn(`Unable to find feature '${t}' on which to place marker`),i}clearMarkers(){for(const t of this.__markerIdByMarker.keys())t.remove();this.__markerIdByMarker.clear(),this.__annotationByMarkerId.clear()}removeMarker(t){for(const[n,r]of this.__markerIdByMarker.entries())if(t===r){n.remove(),this.__markerIdByMarker.remove(n),this.__annotationByMarkerId.remove(r);break}}visibleMarkerAnatomicalIds(){const t=[],n=this._map.getBounds();for(const[r,i]of this.__markerIdByMarker.entries())if(n.contains(r.getLngLat())){const o=this.__annotationByMarkerId.get(i);t.includes(o.models)||t.push(o.models)}return t}markerMouseEvent_(t,n,r){if(!(this._modal||this.__activeMarker!==null&&r.type==="mouseleave")){if(["mouseenter","mouseleave","click"].includes(r.type)&&(this.__activeMarker=t,this.removeTooltip_(),t.setPopup(null),t.getElement().style.cursor="default",["mouseenter","click"].includes(r.type))){const i=this.__markerIdByMarker.get(t),o=this.__annotationByMarkerId.get(i),a=this.mapFeature(o.featureId);a!==void 0&&(r.type==="mouseenter"?(this.resetActiveFeatures_(),this.activateFeature(a)):this.selectionEvent_(r,a));const s=this.tooltipHtml_(o,!0);this.__showToolTip(s,t.getLngLat()),this._flatmap.markerEvent(r.type,i,n)}r.stopPropagation()}}__clearActiveMarker(){this.__activeMarker!==null&&(this.__activeMarker.setPopup(null),this.__activeMarker=null)}showMarkerPopup(t,n,r){const i=this.__activeMarker;if(t!==this.__markerIdByMarker.get(i))return this.__clearActiveMarker(),!1;const o=i.getLngLat();this._map.getBounds().contains(o)||this._map.panTo(o);const a=document.createElement("div");return typeof n=="object"?a.appendChild(n):a.innerHTML=n,a.addEventListener("click",s=>this.__clearActiveMarker()),this._tooltip=new Zi.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-marker-popup"}),this._tooltip.setLngLat(o).setDOMContent(a),i.setPopup(this._tooltip),i.togglePopup(),!0}enablePanZoomEvents(t=!0){this.__pan_zoom_enabled=t}panZoomEvent_(t){this.__pan_zoom_enabled&&this._flatmap.panZoomEvent(t)}}n1=new WeakMap,r0=new WeakMap,T2=new WeakMap,Ls=new WeakSet,L6=function(t){this._layerManager.setPaint(t),ve(this,T2)&&ve(this,T2).setPaint(t)},X4=new WeakSet,Kc=function(t){return this._map.getFeatureState(t)},K4=new WeakSet,Yc=function(t,n){this._map.removeFeatureState(t,n),ve(this,T2)&&ve(this,T2).removeFeatureState(t.id,n)},Y4=new WeakSet,Jc=function(t,n){this._map.setFeatureState(t,n),ve(this,T2)&&ve(this,T2).setFeatureState(t.id,n)},fc=new WeakSet,Q_=function(t){let n=[];return ve(this,T2)&&(n=ve(this,T2).queryFeaturesAtPoint(t)),n.length===0&&(n=this._map.queryRenderedFeatures(t)),n.filter(r=>this.__featureEnabled(r))};const m8t=[{id:"label-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAmCAIAAADbSlUzAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAACVSURBVFhH7dixDoJAEIThfXqMBcYKrTQ+jkYSStDYkVhZINxyEshJcZXJtC7FfNlmur9eyXb7Vqf6+bI9HUKyWkt5e4RlOF9ycerjsqbqpfefuKzNJawBWIOxBmMNxhqMNRhrMNZgrMFYg7EGYw3GGow1GGuw5dU07y4ua22nUlb3uKxd80IOx1Pjxp+f4P/P+ZButl+YrbXnPs+YmAAAAABJRU5ErkJggg==",options:{content:[21,4,28,33],stretchX:[[21,28]],stretchY:[[4,33]]}},{id:"xlabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJExO2pF7NAAAAqUlEQVQ4y+3OIQ6CYBiH8ef9MDhxc8yABjeP4LwAx3BWTwE3oHkMrBa7JJN3YBogfQkjr0HcDCg0C0/+7f2/AjghycLFj0ECYMarHPRcUoQx25uEJMsR/lUQj4YUtQ+K9aC+1IgABPFc/NjUcy1JYD5++tXM0LEe9rCHPfwXzDu43ChV2qaUKjWWLFLUfkdqLVnkXDiWK4LDkMlckCkwfs8p1cmSbfbs7k+jIi/gASaPYQAAAABJRU5ErkJggg==",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"ylabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJEyeXEKp4AAAAwklEQVQ4y+3ULU/DUBhA4XO/2rUgwV1ZBWLJBP9fI0gQuMktWcJSwUq79n68qAoSGnCYHv3oowBD09jz88t1CpGcBQCtFYWz3D3tNuz3EXgojqdWLt0gKWWZSynLpRvkeGqFpinVuf2QsnDc3mz4qe7zyjgF9BQidVWyVF2VTCGicxa0VotQa0XOguaPrXCFK1zhv8D5VkvNt9POGvphXIT9MOKsAbyvfl2z95UCCrw3769vfYjp2+ydNdxvH2sOh/QFh8F7PWWiL5EAAAAASUVORK5CYII=",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"rounded-rectangle",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGmSURBVDiNldPBitpAGAfwv5mMmy85JCistD5Ai/gCPYovYJENCPZQF8VD36HXUkrfQws9R8WLF58gh2h2W2PpoeTWxBgzMr1spd3uUvOHOQ2//3yHb4C/UyGi95Zl3XLOUwASgFRVNTVN8ysRfQTwFA+FMdYhoqjf7+9ns5kMgkCGYSjDMJTb7VbO53M5HA4PRBRzzl//g8vlcrxYLE7osbNcLmWlUok459cAULgb+2YymRi1Wu3B6e7H9300Go1dkiTPGRG97Xa7LzqdjnqWBlAqlRBFEVzXNZRisXhl2/bFufh3bNvmAF4WOOd73/cvDMPIVSCEQLVaFUqWZbkxAKiqCsaYVHLLe1E452kcx7mhEALH47Gg6Lr+3fO83AXr9Rq6rofK4XD4NB6P07wFo9Eok1J+LgC41DTt1nEco16vn4VXqxWazeYuSZJnCoAfWZZdt9vtneu6/8We56HVasVCiDcAvp0uGGM2Ef3s9Xp7x3HkZrM57X8QBHI6ncrBYJASUcQYe/XYA5eapr2zLOuGc77H3XfmnKemaX4hog8AnvwJfgHMKs1jQ++4tQAAAABJRU5ErkJggg==",options:{content:[3,3,13,13],stretchX:[[7,9]],stretchY:[[7,9]]}}],g8t=1.4,OO="NCBITaxon:2787823";class y8t{constructor(t,n,r,i){this._baseUrl=n,this.__id=r.id,this.__uuid=r.uuid,this.__details=r.details,this.__provenance=r.provenance,this.__created=r.created,this.__taxon=r.taxon,this.__biologicalSex=r.biologicalSex,this._mapNumber=r.number,this._callback=r.callback,this._layers=r.layers,this._markers=r.markers,this._options=r.options,this._pathways=r.pathways,this._resolve=i,this._map=null,this.__searchIndex=new tq(this),this.__idToAnnotation=new Map,this.__datasetToFeatureIds=new Map,this.__modelToFeatureIds=new Map,this.__mapSourceToFeatureIds=new Map,this.__annIdToFeatureId=new Map,this.__taxonToFeatureIds=new Map;for(const[a,s]of Object.entries(r.annotations))this.__addAnnotation(a,s),this.__searchIndex.indexMetadata(a,s);for(const[a,s]of Object.entries(r.style.sources))if(s.url&&(s.url=this.makeServerUrl(s.url)),s.tiles){const d=[];for(const f of s.tiles)d.push(this.makeServerUrl(f));s.tiles=d}"images"in r.options||(r.options.images=[]);for(const a of m8t){let s=!1;for(const d of r.options.images)if(a.id===d.id){s=!0;break}s||r.options.images.push(a)}const o={style:r.style,container:t,attributionControl:!1};"maxZoom"in r.options&&(o.maxZoom=r.options.maxZoom),"minZoom"in r.options&&(o.minZoom=r.options.minZoom),o.hash=r.options.debug===!0,this._map=new Zi.Map(o),r.options.debug===!0&&(this._map.showTileBoundaries=!0),this._map.setRenderWorldCopies(!1),this._userInteractions=null,this._initialState=null,this._map.on("idle",()=>{if(this._userInteractions===null)this.setupUserInteractions_();else if(this._initialState===null){this._map.setMinZoom(3),this._map.setMaxBounds(null),this._map.setRenderWorldCopies(!0),this._bounds=this._map.getBounds();const a=this._bounds.toArray(),s=Zi.MercatorCoordinate.fromLngLat(a[0]),d=Zi.MercatorCoordinate.fromLngLat(a[1]);this.__normalised_origin=[s.x,d.y],this.__normalised_size=[d.x-s.x,s.y-d.y],"state"in this._options&&this._userInteractions.setState(this._options.state),this._initialState=this.getState(),this._userInteractions.minimap&&this._userInteractions.minimap.initialise(),this._resolve(this)}})}async setupUserInteractions_(){for(const t of this._options.images)await this.addImage(t.id,t.url,"",t.options);this._userInteractions=new p8t(this)}get bounds(){return this._bounds}resetMap(){this._initialState!==null&&this.setState(this._initialState),this._userInteractions!==null&&this._userInteractions.reset()}zoomIn(){this._map.zoomIn()}zoomOut(){this._map.zoomOut()}pathTypes(){if(this._userInteractions!==null)return this._userInteractions.pathManager.pathTypes()}enablePath(t,n=!0){this._userInteractions!==null&&this._userInteractions.enablePathsByType(t,n)}enableSckanPath(t,n=!0){this._userInteractions!==null&&this._userInteractions.enableSckanPaths(t,n)}enableConnectivityByTaxonIds(t,n=!0){this._userInteractions!==null&&(Array.isArray(t)?this._userInteractions.enableConnectivityByTaxonIds(t,n):this._userInteractions.enableConnectivityByTaxonIds([t],n))}enableCentrelines(t=!0){this._userInteractions!==null&&this._userInteractions.enableCentrelines(t)}loadImage_(t){return new Promise((n,r)=>{this._map.loadImage(t,(i,o)=>{i?r(i):n(o)})})}loadEncodedImage_(t){return new Promise((n,r)=>{const i=new Image;i.src=t,i.onload=o=>n(o.target)})}async addImage(t,n,r,i={}){if(!this._map.hasImage(t)){const o=await(n.startsWith("data:image")?this.loadEncodedImage_(n):this.loadImage_(n.startsWith("/")?this.makeServerUrl(n):new URL(n,r)));this._map.addImage(t,o,i)}}makeServerUrl(t,n="flatmap/"){return t.startsWith("http://")||t.startsWith("https://")?t:t.startsWith("/")?`${this._baseUrl}${n}${this.__uuid}${t}`:`${this._baseUrl}${n}${this.__uuid}/${t}`}get taxon(){return this.__taxon}get biologicalSex(){return this.__biologicalSex}get created(){return this.__created}get id(){return this.__id}get uuid(){return this.__uuid}get details(){return this.__details}get provenance(){return this.__provenance}get uniqueId(){return`${this.__uuid}-${this._mapNumber}`}get annotations(){return this.__idToAnnotation}annotation(t){return this.__idToAnnotation.get(t.toString())}setFeatureAnnotated(t){this._userInteractions!==null&&this._userInteractions.setFeatureAnnotated(t)}__updateFeatureIdMapEntry(t,n,r){const i=J8(t),o=n.get(i);o?o.push(r):n.set(i,[r])}__updateFeatureIdMap(t,n,r,i=null){if(t in r&&r[t].length){const o=r[t];if(Array.isArray(o))for(const a of o)this.__updateFeatureIdMapEntry(a,n,r.featureId);else this.__updateFeatureIdMapEntry(o,n,r.featureId)}else i!==null&&"models"in r&&r.models.startsWith(Vq)&&this.__updateFeatureIdMapEntry(i,n,r.featureId)}__addAnnotation(t,n){n.featureId=t,this.__idToAnnotation.set(t,n),this.__updateFeatureIdMap("dataset",this.__datasetToFeatureIds,n),this.__updateFeatureIdMap("models",this.__modelToFeatureIds,n),this.__updateFeatureIdMap("source",this.__mapSourceToFeatureIds,n),this.__updateFeatureIdMap("taxons",this.__taxonToFeatureIds,n,OO),this.__annIdToFeatureId.set(n.id,t)}modelFeatureIds(t){const n=this.__modelToFeatureIds.get(J8(t));return n||[]}modelFeatureIdList(t){const n=new Y8;if(Array.isArray(t))for(const r of t)n.extend(this.modelFeatureIds(r));else n.extend(this.modelFeatureIds(t));return n.length==0&&(n.extend(this.__datasetToFeatureIds.get(t)),n.extend(this.__mapSourceToFeatureIds.get(t))),n.length==0&&this._userInteractions!==null&&n.extend(this._userInteractions.pathFeatureIds(t)),n}modelForFeature(t){const n=this.__idToAnnotation.get(t);return n&&"models"in n?J8(n.models):null}nodePathModels(t){if(this._userInteractions!==null)return this._userInteractions.nodePathModels(t)}pathModelNodes(t){if(this._userInteractions!==null)return new[...this._userInteractions.pathModelNodes(t)]}taxonFeatureIds(t){const n=this.__taxonToFeatureIds.get(J8(t));return[...new Set(n||[])]}get layers(){return this._layers}get map(){return this._map}get markers(){return this._markers}get anatomicalIdentifiers(){return[...this.__modelToFeatureIds.keys()]}get taxonIdentifiers(){return[...this.__taxonToFeatureIds.keys()]}get datasets(){return[...this.__datasetToFeatureIds.keys()]}get options(){return this._options}get pathways(){return this._pathways}getZoom(){return{mapUUID:this.__uuid,minZoom:this._map.getMinZoom(),zoom:this._map.getZoom(),maxZoom:this._map.getMaxZoom()}}callback(t,n,...r){if(this._callback)return n.mapUUID=this.__uuid,this._callback(t,n,...r)}setInitialPosition(){"bounds"in this._options&&this._map.fitBounds(this._options.bounds,{animate:!1}),"center"in this._options&&this._map.setCenter(this._options.center),"zoom"in this._options&&this._map.setZoom(this._options.zoom)}close(){this._map&&(this._map.remove(),this._map=null)}resize(){this._map.resize()}getIdentifier(){return{taxon:this.__taxon,biologicalSex:this.__biologicalSex,uuid:this.__uuid}}getState(){return this._userInteractions!==null?this._userInteractions.getState():{}}setState(t){this._userInteractions!==null&&this._userInteractions.setState(t)}showPopup(t,n,r){this._userInteractions!==null&&this._userInteractions.showPopup(t,n,r)}setPaint(t=null){t=T4(t,{colour:!0,outline:!0}),this._userInteractions!==null&&this._userInteractions.setPaint(t)}setColour(t=null){console.log("`setColour()` is deprecated; please use `setPaint()` instead."),this.setPaint(t)}getBackgroundColour(){return this._map.getPaintProperty("background","background-color")}getBackgroundOpacity(){return this._map.getPaintProperty("background","background-opacity")}setBackgroundColour(t){localStorage.setItem("flatmap-background-colour",t),this._map.setPaintProperty("background","background-color",t),this._userInteractions.minimap&&this._userInteractions.minimap.setBackgroundColour(t)}setBackgroundOpacity(t){this._map.setPaintProperty("background","background-opacity",t),this._userInteractions.minimap&&this._userInteractions.minimap.setBackgroundOpacity(t)}showMinimap(t){this._userInteractions.minimap&&this._userInteractions.minimap.show(t)}getLayers(){if(this._userInteractions!==null)return this._userInteractions.getLayers()}enableLayer(t,n=!0){if(this._userInteractions!==null)return this._userInteractions.enableLayer(t,n)}enable3dPaths(t=!0){this._userInteractions!==null&&this._userInteractions.enable3dPaths(t)}getSystems(){if(this._userInteractions!==null)return this._userInteractions.getSystems()}enableSystem(t,n=!0){if(this._userInteractions!==null)return this._userInteractions.enableSystem(t,n)}addMarker(t,n={}){return this._userInteractions!==null?this._userInteractions.addMarker(t,n):-1}removeMarker(t){this._userInteractions!==null&&this._userInteractions.removeMarker(t)}clearMarkers(){this._userInteractions!==null&&this._userInteractions.clearMarkers()}visibleMarkerAnatomicalIds(){if(this._userInteractions!==null)return this._userInteractions.visibleMarkerAnatomicalIds()}showMarkerPopup(t,n,r={}){return this._userInteractions!==null?this._userInteractions.showMarkerPopup(t,n,r):!1}__exportedProperties(t){const n={},r=["id","featureId","connectivity","dataset","kind","label","models","source","taxons","hyperlinks","completeness","missing-nodes","alert","biological-sex"],i=["hyperlinks"];for(const o of r)o in t&&t[o]!==void 0&&(i.includes(o)?n[o]=JSON.parse(t[o]):o==="featureId"?n[o]=+t[o]:n[o]=t[o]);return Object.keys(n).length>0&&(n.type="feature"),n}showAnnotator(t=!0){this._userInteractions!==null&&this._userInteractions.showAnnotator(t)}annotationEvent(t,n){this.callback("annotation",{type:t,feature:n})}commitAnnotationEvent(t){this._userInteractions&&this._userInteractions.commitAnnotationEvent(t)}rollbackAnnotationEvent(t){this._userInteractions&&this._userInteractions.rollbackAnnotationEvent(t)}clearAnnotationFeature(){this._userInteractions&&this._userInteractions.clearAnnotationFeature()}trashAnnotationFeature(){this._userInteractions&&this._userInteractions.trashAnnotationFeature()}addAnnotationFeature(t){this._userInteractions&&this._userInteractions.addAnnotationFeature(t)}refreshAnnotationFeatureGeometry(t){if(this._userInteractions)return this._userInteractions.refreshAnnotationFeatureGeometry(t)}changeAnnotationDrawMode(t){this._userInteractions&&this._userInteractions.changeAnnotationDrawMode(t)}featureEvent(t,n){const r=this.__exportedProperties(n);return Object.keys(r).length>0?(this.callback(t,r),!0):!1}featureProperties(t){const n=this.annotation(t);return n?this.__exportedProperties(n):{}}markerEvent(t,n,r){this.callback(t,{type:"marker",id:n,models:r})}controlEvent(t,n,r){this.callback(t,{type:"control",control:n,value:r})}enablePanZoomEvents(t=!0){this._userInteractions!==null&&this._userInteractions.enablePanZoomEvents(t)}panZoomEvent(t){const n=this._map.getBounds();if(this.__normalised_origin!==void 0){const r=Zi.MercatorCoordinate.fromLngLat(n.toArray()[0]),i=Zi.MercatorCoordinate.fromLngLat(n.toArray()[1]),o=[(r.x-this.__normalised_origin[0])/this.__normalised_size[0],(i.y-this.__normalised_origin[1])/this.__normalised_size[1]],a=[(i.x-r.x)/this.__normalised_size[0],(r.y-i.y)/this.__normalised_size[1]];this.callback("pan-zoom",{type:t,origin:o,size:a})}}panZoomTo(t,n){if(this.__normalised_origin!==void 0){const r=t[0]*this.__normalised_size[0]+this.__normalised_origin[0],i=t[1]*this.__normalised_size[1]+this.__normalised_origin[1],o=r+n[0]*this.__normalised_size[0],a=i+n[1]*this.__normalised_size[1],s=new Zi.MercatorCoordinate(r,a,0).toLngLat(),d=new Zi.MercatorCoordinate(o,i,0).toLngLat();this._map.fitBounds([s,d],{animate:!1})}}search(t,n=!1){return n?this.__searchIndex.auto_suggest(t):this.__searchIndex.search(t)}clearSearchResults(){this._userInteractions!==null&&this._userInteractions.clearSearchResults()}showSearchResults(t){this._userInteractions!==null&&this._userInteractions.showSearchResults(t.featureIds)}selectFeatures(t){if(this._userInteractions!==null){const n=this.modelFeatureIdList(t);this._userInteractions.selectFeatures(n)}}zoomToFeatures(t,n=null){if(n=T4(n,{select:!0,highlight:!1,padding:100}),this._userInteractions!==null){const r=this.modelFeatureIdList(t);this._userInteractions.zoomToFeatures(r,n)}}selectGeoJSONFeatures(t){this._userInteractions!==null&&this._userInteractions.selectFeatures(t)}zoomToGeoJSONFeatures(t,n=null){n=T4(n,{select:!0,highlight:!1,padding:100}),this._userInteractions!==null&&this._userInteractions.zoomToFeatures(t,n)}}class VO{constructor(t,n={}){this._mapServer=new AZ(t),this._options=n,this._mapList=[],this._mapNumber=0,this._initialisingMutex=new Oq,this._initialised=!1}async ensureInitialised_(){return await this._initialisingMutex.dispatch(async()=>{if(!this._initialised){this._mapList=[];const t=await this._mapServer.loadJSON("");for(const n of t)n.separateLayers="version"in n&&n.version>=g8t,this._mapList.push(n);this._initialised=!0}})}allMaps(){return new Promise(async(t,n)=>{await this.ensureInitialised_();const r={};for(const i of this._mapList){const o="uuid"in i?i.uuid:i.id;r[o]=i}t(r)})}findMap_(t){return new Promise(async(n,r)=>{await this.ensureInitialised_(),n(this.lookupMap_(t))})}latestMap_(t){const n=t.constructor.name==="String"?t:"uuid"in t?t.uuid:"taxon"in t?t.taxon:null;if(n===null)return null;let r=null,i="";for(const o of this._mapList)if(("uuid"in o&&n===o.uuid||n===o.id||"taxon"in o&&n===o.taxon||n===o.source)&&(!("biologicalSex"in t)||"biologicalSex"in o&&t.biologicalSex===o.biologicalSex))if("created"in o)i<o.created&&(i=o.created,r=o);else{r=o;break}return r}lookupMap_(t){return typeof t=="object"?this.latestMap_(t):this.latestMap_({uuid:t})}loadMap(t,n,r,i={}){return new Promise(async(o,a)=>{try{const s=await this.findMap_(t);s===null&&a(`Unknown map: ${JSON.stringify(t)}`);const d="uuid"in s?s.uuid:s.id,f=await this._mapServer.loadJSON(`flatmap/${d}/`),Q="uuid"in f?f.uuid:f.id;if(d!==Q)throw new Error(`Map '${d}' has wrong ID in index`);const p=Object.assign({},this._options,i);!("bounds"in i)&&"bounds"in f&&(p.bounds=f.bounds),"style"in f?p.style=f.style:p.style="flatmap",!("image-layers"in f)&&"image_layer"in f&&(f["image-layers"]=f.image_layer);let g=[];if(!("version"in f)||f.version<=1)for(const V of f.layers)typeof V=="string"?g.push({id:V,description:V.charAt(0).toUpperCase()+V.slice(1),selectable:!0}):g.push(V);else g=await this._mapServer.loadJSON(`flatmap/${d}/layers`);const _=await this._mapServer.loadJSON(`flatmap/${d}/style`);"glyphs"in _||(_.glyphs="https://fonts.openmaptiles.org/{fontstack}/{range}.pbf");const x=await this._mapServer.loadJSON(`flatmap/${d}/pathways`),b=await this._mapServer.loadJSON(`flatmap/${d}/annotations`),A=await this._mapServer.loadJSON(`flatmap/${d}/metadata`),E=await this._mapServer.loadJSON(`flatmap/${d}/markers`);return"vector-tiles"in _.sources&&("minZoom"in p||(p.minZoom=_.sources["vector-tiles"].minzoom),"maxZoom"in p||(p.maxZoom=_.sources["vector-tiles"].maxzoom)),"layerOptions"in p?("colour"in p.layerOptions||(p.layerOptions.colour=!0),"outline"in p.layerOptions||(p.layerOptions.outline=!0)):p.layerOptions={colour:!0,outline:!0},p.layerOptions.authoring="authoring"in f?f.authoring:!1,p.separateLayers=s.separateLayers,this._mapNumber+=1,new y8t(n,this._mapServer.url(),{id:s,uuid:d,details:f,taxon:s.taxon,biologicalSex:s.biologicalSex,style:_,options:p,layers:g,markers:E,annotations:b,number:this._mapNumber,pathways:x,provenance:A,provenance:A,callback:r},o)}catch(s){a(s)}})}}/*! js-cookie v3.0.5 | MIT */function Kd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var _8t={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function vy(e,t){function n(i,o,a){if(!(typeof document>"u")){a=Kd({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var d in a)a[d]&&(s+="; "+d,a[d]!==!0&&(s+="="+a[d].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var d=o[s].split("="),f=d.slice(1).join("=");try{var Q=decodeURIComponent(d[0]);if(a[Q]=e.read(f,Q),i===Q)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",Kd({},o,{expires:-1}))},withAttributes:function(i){return vy(this.converter,Kd({},this.attributes,i))},withConverter:function(i){return vy(Kd({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var xy=vy(_8t,{path:"/"}),wa=function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},L1=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},xs,sc,Vi,Ea,E3;const v8t=1e4;class x8t{constructor(t){xs.add(this),sc.set(this,void 0),Vi.set(this,null),Ea.set(this,null),t.slice(-1)==="/"?wa(this,sc,t.slice(0,-1),"f"):wa(this,sc,t,"f")}get currentUser(){return L1(this,Ea,"f")}get currentError(){return L1(this,Vi,"f")}async authenticate(t){wa(this,Vi,null,"f"),wa(this,Ea,null,"f");const n=await L1(this,xs,"m",E3).call(this,t,"authenticate");return"error"in n?(xy.remove("annotation-key"),Promise.resolve(L1(this,Vi,"f"))):(xy.set("annotation-key",n.session,{secure:!0,expires:1}),wa(this,Ea,n.data,"f"),Promise.resolve(L1(this,Ea,"f")))}async unauthenticate(t){wa(this,Vi,null,"f"),wa(this,Ea,null,"f");const n=await L1(this,xs,"m",E3).call(this,t,"unauthenticate");return"success"in n?Promise.resolve(n):Promise.resolve(L1(this,Vi,"f"))}async annotatedItemIds(t,n){const r=await L1(this,xs,"m",E3).call(this,t,"items/","GET",{resource:n});return"error"in r?Promise.resolve(L1(this,Vi,"f")):Promise.resolve(r)}async drawnFeatures(t,n){const r=await L1(this,xs,"m",E3).call(this,t,"features/","GET",{resource:n});return"error"in r?Promise.resolve(L1(this,Vi,"f")):Promise.resolve(r)}async itemAnnotations(t,n,r){const i=await L1(this,xs,"m",E3).call(this,t,"annotations/","GET",{resource:n,item:r});return"error"in i?Promise.resolve(L1(this,Vi,"f")):Promise.resolve(i)}async annotation(t,n){const r=await L1(this,xs,"m",E3).call(this,t,"annotation/","GET",{annotation:n});return"error"in r?Promise.resolve(L1(this,Vi,"f")):Promise.resolve(r)}async addAnnotation(t,n){if(L1(this,Ea,"f")&&L1(this,Ea,"f").canUpdate){const r=Object.assign({creator:L1(this,Ea,"f"),created:new Date().toISOString()},n),i=await L1(this,xs,"m",E3).call(this,t,"annotation/","POST",{data:r});if(!("error"in i))return Promise.resolve(i);wa(this,Vi,i,"f")}else wa(this,Vi,{error:"user cannot add annotation"},"f");return Promise.resolve(L1(this,Vi,"f"))}}sc=new WeakMap,Vi=new WeakMap,Ea=new WeakMap,xs=new WeakSet,E3=async function(t,n,r="GET",i={}){let o=!0;const a=new AbortController;setTimeout(()=>{o&&(console.log("Annotation server timeout..."),a.abort())},v8t);const s={method:r,signal:a.signal};let d=`${L1(this,sc,"f")}/${n}`;const f=xy.get("annotation-key")||"";if(r==="GET"){const p=[];for(const[g,_]of Object.entries(i))p.push(`${g}=${encodeURIComponent(JSON.stringify(_))}`);p.push(`key=${encodeURIComponent(t)}`),p.push(`session=${encodeURIComponent(f)}`),d+="?"+p.join("&"),s.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(r==="POST"){const p=Object.assign({key:t,session:f},i);s.body=JSON.stringify(p),s.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const Q=await fetch(d,s);return o=!1,Q.ok?Promise.resolve(await Q.json()):(wa(this,Vi,{error:`${Q.status} ${Q.statusText}`},"f"),Promise.resolve(L1(this,Vi,"f")))};const b8t=(e,t)=>{let n,r,i,o,a,s;t.style.left="",t.style.top="",t.addEventListener("mousedown",f=>{f.preventDefault(),n=t.offsetLeft,r=t.offsetTop,i=f.clientX,o=f.clientY,t.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",()=>{t.removeEventListener("mousemove",d,!1)},!1)},!1);function d(f){f.preventDefault(),a=n-(i-f.clientX),s=r-(o-f.clientY),t.style.left=`${a}px`,t.style.top=`${s}px`}},L8t=e=>{let t={lng:0,lat:0},n;return e.type==="Polygon"?n=e.coordinates[0]:n=e.coordinates,e.type!=="Point"?(n.map(r=>{t.lng+=parseFloat(r[0]),t.lat+=parseFloat(r[1])}),t.lng=t.lng/n.length,t.lat=t.lat/n.length):(t.lng+=parseFloat(n[0]),t.lat+=parseFloat(n[1])),t},DO=(e,t)=>{const n=[];let r=e.organs?e.organs:e.ftus;const i=r?r.filter((o,a)=>r.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${t}.${o.label}`},s=DO(o,a.key);s.length>0&&(a.children=s),n.push(a)}),n},w8t=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},E8t={name:"FlatmapVuer",components:{Button:bo,Col:oa,Loading:eG,Radio:cb,RadioGroup:ub,Row:Lo,Select:j6,Dialog:r$,MapSvgIcon:A1.MapSvgIcon,MapSvgSpriteColor:A1.MapSvgSpriteColor,Tooltip:GT,TreeControls:Nb,SelectionsGroup:Rb,SvgLegends:Fb,ElIconWarningFilled:Mv,ElIconArrowDown:Zs,ElIconArrowLeft:wv},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},setup(e){return{annotator:h.markRaw(new x8t(`${e.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.inDrawing=!1,this.initialiseDialog(),this.activeDrawTool=void 0,this.createdEvent=void 0},cancelDrawnFeature:function(){this.createdEvent&&(this.closePopup(),this.annotationEntry={...this.createdEvent.feature,resourceId:this.serverUUID},this.rollbackAnnotationEvent(),this.initialiseDrawing())},confirmDrawnFeature:function(){this.createdEvent&&(this.checkAndCreatePopups(this.createdEvent),Object.keys(this.relevanceEntry).length>0&&(this.annotationEntry.feature.relevance=this.relevanceEntry),this.initialiseDrawing())},initialiseDialog:function(){this.relevanceDisplay=!1,this.relevanceEntry={}},relevanceDialogPopup:function(){!this.$el.querySelector(".drawRelevance").classList.contains("inactive")&&!this.inDrawing&&(this.closePopup(),this.relevanceDisplay=!this.relevanceDisplay)},drawingEvent:function(e){if(this.closePopup(),this.drawnTypes.includes(e)&&!this.activeDrawMode&&!this.relevanceDisplay){if(e==="Point"){const t=this.$el.querySelector(".mapbox-gl-draw_point");this.$el.querySelector(".mapbox-gl-draw_point").click(),this.activeDrawTool=t.classList.contains("active")?"Point":void 0}else if(e==="LineString"){const t=this.$el.querySelector(".mapbox-gl-draw_line");this.$el.querySelector(".mapbox-gl-draw_line").click(),this.activeDrawTool=t.classList.contains("active")?"LineString":void 0}else if(e==="Polygon"){const t=this.$el.querySelector(".mapbox-gl-draw_polygon");this.$el.querySelector(".mapbox-gl-draw_polygon").click(),this.activeDrawTool=t.classList.contains("active")?"Polygon":void 0}}else this.drawModes.includes(e)&&!this.activeDrawTool&&(e==="Delete"?(this.currentDrawnFeature&&(!this.activeDrawMode||this.activeDrawMode==="Edit")&&(this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[this.currentDrawnFeature.id]}}),this.trashAnnotationFeature()),this.activeDrawMode=this.activeDrawMode==="Delete"?void 0:"Delete",this.activeDrawMode||(this.currentDrawnFeature=void 0)):e==="Edit"&&(this.activeDrawMode=this.activeDrawMode==="Edit"?void 0:"Edit"))},changeAnnotationDrawMode:function(e){this.mapImp&&this.mapImp.changeAnnotationDrawMode(e)},clearAnnotationFeature:function(){this.mapImp&&this.drawnAnnotationFeatures&&this.drawnAnnotationFeatures.length>0&&this.mapImp.clearAnnotationFeature()},trashAnnotationFeature:function(){this.mapImp&&this.mapImp.trashAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&this.drawnAnnotationEvent.includes(this.annotationEntry.type)&&this.mapImp.rollbackAnnotationEvent(this.annotationEntry)},commitAnnotationEvent:function(e){this.mapImp&&this.drawnAnnotationEvent.includes(this.annotationEntry.type)&&e&&(this.annotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?this.closePopup():this.addAnnotationFeature())},setFeatureAnnotated:function(){this.mapImp&&this.annotator.annotatedItemIds(this.userApiKey,this.serverUUID).then(e=>{for(const t of e)this.mapImp.setFeatureAnnotated(t)}).catch(e=>{console.log(e)})},addAnnotationFeature:function(){this.mapImp&&(this.annotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None"&&this.annotator.drawnFeatures(this.userApiKey,this.serverUUID).then(e=>{if(this.drawnType!=="All tools"&&(e=e.filter(t=>t.geometry.type===this.drawnType)),this.drawnAnnotationFeatures=e,!this.annotationSubmitted)for(const t of e)this.annotatedType!=="Everyone"?this.annotator.itemAnnotations(this.userApiKey,this.serverUUID,t.id).then(n=>{let r=n.filter(i=>i.creator.name===this.userInformation.name&&i.creator.email===this.userInformation.email).length>0;(this.annotatedType==="Me"&&r||this.annotatedType==="Others"&&!r)&&this.mapImp.addAnnotationFeature(t)}).catch(n=>{console.log(n)}):this.mapImp.addAnnotationFeature(t)}).catch(e=>{console.log(e)}))},showAnnotator:function(e){this.mapImp&&(this.mapImp.showAnnotator(e),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(e){this.drawnType=e,this.mapImp&&this.addAnnotationFeature()},setAnnotatedType:function(e){this.annotatedType=e,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(e){this.flightPath3DRadio=e,this.mapImp&&this.mapImp.enable3dPaths(e)},viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(n=>{const r={colour:n.colour,enabled:n.enabled,label:n.id,key:n.id},i=DO(n,r.key);i.length>0&&(r.children=i),t.children.push(r)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,t.forEach(n=>{jb(e,n).then(r=>{const i={taxon:n,label:r};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setColour({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlineRadio=e,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:e})},resetView:function(){this.mapImp&&(this.mapImp.resetMap(),this.$refs.centrelinesSelection&&this.$refs.centrelinesSelection.reset(),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset())},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},centreLinesSelected:function(e){this.mapImp&&this.mapImp.enableCentrelines(e.value)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},highlightConnectedPaths:function(e){if(this.mapImp){let n=[...this.mapImp.pathModelNodes(e)].map(i=>this.mapImp.featureProperties(i)),r=[];n.forEach(i=>{this.mapImp.nodePathModels(i.featureId).forEach(o=>{r.push(o)})}),this.mapImp.zoomToFeatures(r,{noZoomIn:!0})}},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},checkAllTaxons:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableConnectivityByTaxonIds(t,e.value))},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},eventCallback:function(){return(e,t,...n)=>{if(e==="annotation"){const r={feature:t,userData:n,eventType:e};if(t.type==="aborted")this.annotationSubmitted?this.annotationSubmitted=!1:this.rollbackAnnotationEvent();else if(t.type==="modeChanged")t.feature.mode.startsWith("draw_")?(this.initialiseDialog(),this.inDrawing=!0):t.feature.mode==="simple_select"&&this.inDrawing?this.createdEvent?this.relevanceDisplay=!0:this.initialiseDrawing():t.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(t.type==="selectionChanged")this.currentDrawnFeature=t.feature.features.length===0?void 0:t.feature.features[0],r.feature.feature=this.currentDrawnFeature,this.inDrawing||(this.initialiseDialog(),this.currentDrawnFeature&&(this.processRelevance(),this.checkAndCreateDrawnFeaturePopups(r)));else{if(t.type==="created"||t.type==="updated"){t.type==="updated"&&t.feature.action&&(t.positionUpdated=t.feature.action==="move");const i=this.mapImp.refreshAnnotationFeatureGeometry(t.feature);r.feature.feature=i}t.type==="created"?this.createdEvent=r:this.checkAndCreatePopups(r)}}else if(e!=="pan-zoom"){const r=t.label,i=[t.models],o=this.entry,a=this.biologicalSex;let s;t.taxons&&(typeof t.taxons!="object"?s=JSON.parse(t.taxons):s=t.taxons);const d={dataset:t.dataset,biologicalSex:a,taxonomy:o,resource:i,label:r,feature:t,userData:n,eventType:e,provenanceTaxonomy:s};e==="click"?this.viewingMode==="Network Discovery"?this.highlightConnectedPaths([t.models]):(this.currentActive=t.models?t.models:"",this.inDrawing&&!this.relevanceDisplay&&this.processRelevance(d)):e==="mouseenter"&&this.viewingMode!=="Network Discovery"&&(this.currentHover=t.models?t.models:""),t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Network Discovery"&&!this.inDrawing&&this.checkAndCreatePopups(d),this.$emit("resource-selected",d)}else this.$emit("pan-zoom-callback",t)}},dialogCssHacks:function(){this.$nextTick(()=>{const e=this.$el.querySelector(".relevance-dialog");if(this.$el&&e){b8t(this.$el,e);let t,n;const r=this.$el.getBoundingClientRect(),i=e.getBoundingClientRect();this.dialogPosition.x>r.width/2?t=this.dialogPosition.x-i.width:t=this.dialogPosition.x,this.dialogPosition.y>r.height/2?n=this.dialogPosition.y-i.height:n=this.dialogPosition.y,e.style.transform=`translate(${t-this.dialogPosition.offsetX}px, ${n-this.dialogPosition.offsetY}px)`}})},drawIconCssHacks:function(){(this.$el.querySelector(".iconSelected")||!this.relevanceDisplay)&&(this.drawnTypes.map(e=>{const t=this.$el.querySelector(`.draw${e}`);t&&(t.classList.remove("iconSelected"),t.classList.remove("inactive"))}),this.drawModes.map(e=>{this.$el.querySelector(`.draw${e}`).classList.remove("iconSelected"),this.$el.querySelector(`.draw${e}`).classList.remove("inactive")})),this.activeDrawTool?(this.$el.querySelector(`.draw${this.activeDrawTool}`).classList.add("iconSelected"),this.drawModes.map(e=>{this.$el.querySelector(`.draw${e}`).classList.add("inactive")})):(this.activeDrawMode||this.relevanceDisplay)&&(this.activeDrawMode&&this.$el.querySelector(`.draw${this.activeDrawMode}`).classList.add("iconSelected"),this.drawnTypes.map(e=>{const t=this.$el.querySelector(`.draw${e}`);t&&t.classList.add("inactive")}))},processRelevance:function(e=void 0){if(e&&e.feature){let t=e.feature.models?e.feature.models:e.feature.featureId;t&&this.activeDrawTool==="LineString"&&(this.relevanceEntry[t]=e)}else if(this.currentDrawnFeature&&this.drawnAnnotationFeatures){let t=this.drawnAnnotationFeatures.filter(n=>n.id===this.currentDrawnFeature.id)[0];t&&t.relevance&&(this.relevanceEntry=t.relevance)}},checkAndCreateDrawnFeaturePopups:function(e){this.activeDrawMode&&(this.doubleClickedFeature?(e.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:e.feature.feature.id}}),this.trashAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[e.feature.feature.id]}}),this.trashAnnotationFeature()))},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature?(this.annotationEntry={...e.feature,resourceId:this.serverUUID},e.feature.featureId&&e.feature.models?this.displayTooltip(e.feature.models):e.feature.feature&&(this.inDrawing||this.activeDrawMode?(this.annotationSubmitted=!1,this.annotationEntry.featureId=e.feature.feature.id,this.displayTooltip(e.feature.feature.id,L8t(e.feature.feature.geometry))):e.feature.type==="updated"&&this.rollbackAnnotationEvent(),(e.feature.type==="updated"||e.feature.type==="deleted")&&this.initialiseDialog())):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(e);(t[0]||t[1]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(this.resourceForTooltip=e.resource[0],e.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(e))}},popUpCssHacks:function(){let e=document.querySelector(".flatmap-tooltip-popup");e&&(e.style.display="none"),document.querySelector(".maplibregl-popup-close-button").style.display="block",this.$refs.tooltip.$el.style.display="flex",document.querySelector(".maplibregl-popup-close-button").onclick=()=>{e&&(e.style.display="block")}},closePopup:function(){let e=document.querySelector(".maplibregl-popup-close-button");e&&e.click()},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},createTooltipFromNeuronCuration:async function(e){this.tooltipEntry=await this.flatmapQueries.createTooltipData(e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,n){let r=n;this.mapImp&&(r?r.className||(r.className="custom-popup"):r={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,r))},showMarkerPopup:function(e,t,n){this.mapImp&&this.mapImp.showMarkerPopup(e,t,n)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisibilities.forEach(t=>{t.value=!0}),this.openFlatmapHelpPopup()):(this.inHelp=!1,this.hoverVisibilities.forEach(t=>{t.value=!1}),this.closeFlatmapHelpPopup())},showToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0},500))},hideToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},500))},displayTooltip:function(e,t=void 0){this.tooltipDisplay=!0;let n,r={className:"flatmapvuer-popover"};t?(n=e,r.annotationFeatureGeometry=t):(n=this.mapImp.modelFeatureIds(e)[0],this.inDrawing||(r.positionAtLastClick=!0)),this.disableUI||this.$nextTick(()=>{this.mapImp.showPopup(n,this.$refs.tooltip.$el,r),this.popUpCssHacks()})},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"})}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let n of t.values())n.label&&e.push(n.label);return Array.from(new Set(e))}},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?e.viewport&&this.mapImp.setState(e.viewport):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){e&&(e.viewport&&this.mapImp.setState(e.viewport),e.searchTerm&&this.searchAndShowResult(e.searchTerm,!0))},setFlightPathInfo:function(e){(e===1.6||e>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!0))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0;let t=!1;this.displayMinimap&&(t={position:"top-right"});let n={taxon:this.entry};this.uuid&&(n.uuid=this.uuid),e?e.uuid?n={uuid:e.uuid}:e.entry&&(n.taxon=e.entry,e.biologicalSex?n.biologicalSex=e.biologicalSex:n.taxon==="NCBITaxon:9606"&&(n.biologicalSex="PATO:0000384")):this.biologicalSex&&(n.biologicalSex=this.biologicalSex),this.mapManager.loadMap(n,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:t}).then(i=>{this.mapImp=i,this.serverUUID=this.mapImp.getIdentifier().uuid;let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(e)})}else e&&(this._stateToBeSet={viewport:e.viewport,searchTerm:e.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),n=parseInt(t.paddingTop)+parseInt(t.paddingBottom),r=e.clientHeight-n;this.pathwaysMaxHeight=r-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(){this.sensor=new wZ(this.$refs.display,this.mapResize),this.mapImp.options&&this.mapImp.options.style==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.$emit("ready",this)},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t){if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),!0;{const n=this.mapImp.search(e);if(n&&n.results&&n.results.length>0){if(this.mapImp.showSearchResults(n),t&&n.results[0].featureId&&n.results[0].text){const r=this.mapImp.annotation(n.results[0].featureId);this.mapImp.showPopup(n.results[0].featureId,r.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(e){return this.mapImp?this.mapImp.search(e):[]}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:4},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},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"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},userApiKey:{type:String,default:void 0},disableUI:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,userApiKey:this.userApiKey,$annotator:this.annotator}},data:function(){return{annotationEntry:{},tooltipDisplay:!0,serverUUID:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],yellowstar:bZ,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:vZ,tooltipEntry:w8t(),connectivityTooltipVisible:!1,drawerOpen:!1,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",currentDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:["Annotation","Exploration","Network Discovery"],drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Everyone",annotatedTypes:["Everyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,annotator:void 0,userInformation:void 0,activeDrawTool:void 0,drawnAnnotationEvent:["created","updated","deleted"],createdEvent:void 0,annotationSubmitted:!1,inDrawing:!1,relevanceDisplay:!1,relevanceEntry:{},drawnAnnotationFeatures:void 0,doubleClickedFeature:!1,activeDrawMode:void 0,drawModes:["Delete","Edit"],dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{relevance:function(){return Object.keys(this.relevanceEntry).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e,t){e!==t&&this.setHelpMode(val)},state:{handler:function(e,t){e!==t&&(this.mapManager?this.setState(e):this.setStateRequired=!0)},immediate:!0,deep:!0},activeDrawTool:function(){this.drawIconCssHacks()},activeDrawMode:function(){this.drawIconCssHacks()},relevance:function(e){const t=this.$el.querySelector(".drawRelevance");e?t.classList.remove("inactive"):(this.relevanceDisplay=!1,t.classList.add("inactive"))},relevanceDisplay:function(e){const t=this.$el.querySelector(".drawRelevance");e?(t.classList.add("iconSelected"),this.dialogCssHacks()):t.classList.remove("iconSelected"),this.drawIconCssHacks()},dialogPosition:{handler:function(){if(this.$el){const e=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=e.x,this.dialogPosition.offsetY=e.y}},deep:!0,once:!0},viewingMode:function(e){e==="Annotation"?(console.log(this.userApiKey),this.$el.querySelector(".maplibregl-canvas").addEventListener("click",t=>{t.preventDefault(),this.dialogPosition.x=t.clientX,this.dialogPosition.y=t.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()},!1),this.showAnnotator(!0),this.annotator.authenticate(this.userApiKey).then(t=>{t.name&&t.email&&(this.userInformation=t,this.setFeatureAnnotated(),this.drawnAnnotationFeatures||this.addAnnotationFeature())})):this.showAnnotator(!1)},disableUI:function(e){e&&this.closeTooltip()}},created:function(){},mounted:function(){this.openMapRef=h.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=h.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new VO(this.flatmapAPI),this.flatmapQueries=new xZ,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Po=e=>(h.pushScopeId("data-v-7f745d83"),e=e(),h.popScopeId(),e),M8t={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},A8t={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},C8t={style:{height:"100%",width:"100%"},ref:"display"},S8t={class:"beta-popovers"},H8t=Po(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),O8t=Po(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),V8t=Po(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),D8t=Po(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),I8t=Po(()=>h.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),P8t={key:1,class:"warning-text"},k8t=Po(()=>h.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),B8t=Po(()=>h.createElementVNode("b",null,"Network discovery mode",-1)),R8t=Po(()=>h.createElementVNode("p",null," You can now view the network of neurons connected to a selected neuron. This mode is located in the settings at the bottom right. Once discovery mode is on, click on a neuron to see its connections. ",-1)),N8t=Po(()=>h.createElementVNode("b",null,"Now can display up to 6 panes",-1)),F8t=Po(()=>h.createElementVNode("p",null," You can now display up to 6 panes in the flatmap. This allows you to compare between different datasets and/or different views of the same dataset. ",-1)),j8t={key:0,class:"bottom-draw-control"},z8t={class:"bottom-right-control"},U8t=Po(()=>h.createElementVNode("div",null,[h.createTextVNode(" Fit to "),h.createElementVNode("br"),h.createTextVNode(" window ")],-1)),$8t=["innerHTML"],G8t=["innerHTML"],Z8t=["onClick"];function q8t(e,t,n,r,i,o){const a=h.resolveComponent("map-svg-sprite-color"),s=Mv,d=X1,f=B8,Q=Zs,p=h.resolveComponent("map-svg-icon"),g=Fb,_=Nb,x=Rb,b=wv,A=bo,E=Lo,O=oa,V=k8,k=j6,j=cb,U=ub,$=GT,J=cG,tt=Cb,st=U8;return h.withDirectives((h.openBlock(),h.createElementBlock("div",M8t,[h.createVNode(a),h.createElementVNode("div",A8t,[h.createElementVNode("div",C8t,null,512),h.withDirectives(h.createElementVNode("div",S8t,[h.createElementVNode("div",null,[h.createVNode(f,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[6].value,ref:"warningPopover"},{reference:h.withCtx(()=>[n.displayWarning?(h.openBlock(),h.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=ot=>o.showToolitip(6)),onMouseout:t[8]||(t[8]=ot=>o.hideToolitip(6))},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(s)]),_:1}),n.isLegacy?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[I8t,h.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...ot)=>o.viewLatestMap&&o.viewLatestMap(...ot))}," Click here for the latest map ")],64)):(h.openBlock(),h.createElementBlock("span",P8t,"Beta"))],32)):h.createCommentVNode("",!0)]),default:h.withCtx(()=>[n.isLegacy?(h.openBlock(),h.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=ot=>o.showToolitip(6)),onMouseout:t[1]||(t[1]=ot=>o.hideToolitip(6))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(h.openBlock(),h.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=ot=>o.showToolitip(6)),onMouseout:t[3]||(t[3]=ot=>o.hideToolitip(6))},[h.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),H8t,h.createTextVNode(" models available in "),O8t,h.createTextVNode(". ")],32)):(h.openBlock(),h.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=ot=>o.showToolitip(6)),onMouseout:t[5]||(t[5]=ot=>o.hideToolitip(6))},[h.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),V8t,h.createTextVNode(" models available in "),D8t,h.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),n.displayLatestChanges?(h.openBlock(),h.createBlock(f,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[7].value},{reference:h.withCtx(()=>[n.displayLatestChanges?(h.openBlock(),h.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=ot=>o.showToolitip(7)),onMouseout:t[10]||(t[10]=ot=>o.hideToolitip(7))},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(s)]),_:1}),k8t],32)):h.createCommentVNode("",!0)]),default:h.withCtx(()=>[B8t,R8t,N8t,F8t]),_:1},8,["visible"])):h.createCommentVNode("",!0)],512),[[h.vShow,!n.disableUI]]),h.withDirectives(h.createVNode(d,{class:h.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:h.withCtx(()=>[h.createVNode(Q)]),_:1},8,["class","onClick"]),[[h.vShow,e.minimapResizeShow]]),e.viewingMode==="Annotation"&&e.userInformation?h.withDirectives((h.openBlock(),h.createElementBlock("div",j8t,[h.createVNode(f,{content:"Relevance",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[10].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"connection",class:"icon-button drawRelevance inactive",onClick:o.relevanceDialogPopup,onMouseover:t[11]||(t[11]=ot=>o.showToolitip(10)),onMouseout:t[12]||(t[12]=ot=>o.hideToolitip(10))},null,8,["onClick"])]),_:1},8,["visible"]),e.drawnType!=="LineString"&&e.drawnType!=="Polygon"?(h.openBlock(),h.createBlock(f,{key:0,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[11].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"drawPoint",class:"icon-button drawPoint",onClick:t[13]||(t[13]=ot=>o.drawingEvent("Point")),onMouseover:t[14]||(t[14]=ot=>o.showToolitip(11)),onMouseout:t[15]||(t[15]=ot=>o.hideToolitip(11))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),e.drawnType!=="Point"&&e.drawnType!=="Polygon"?(h.openBlock(),h.createBlock(f,{key:1,content:"Draw Line",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[12].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"drawLine",class:"icon-button drawLineString",onClick:t[16]||(t[16]=ot=>o.drawingEvent("LineString")),onMouseover:t[17]||(t[17]=ot=>o.showToolitip(12)),onMouseout:t[18]||(t[18]=ot=>o.hideToolitip(12))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),e.drawnType!=="Point"&&e.drawnType!=="LineString"?(h.openBlock(),h.createBlock(f,{key:2,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[13].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:t[19]||(t[19]=ot=>o.drawingEvent("Polygon")),onMouseover:t[20]||(t[20]=ot=>o.showToolitip(13)),onMouseout:t[21]||(t[21]=ot=>o.hideToolitip(13))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),h.createVNode(f,{content:"Delete",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[14].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"drawTrash",class:"icon-button drawDelete",onClick:t[22]||(t[22]=ot=>o.drawingEvent("Delete")),onMouseover:t[23]||(t[23]=ot=>o.showToolitip(14)),onMouseout:t[24]||(t[24]=ot=>o.hideToolitip(14))})]),_:1},8,["visible"]),h.createVNode(f,{content:"Edit",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:e.hoverVisibilities[15].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"comment",class:"icon-button drawEdit",onClick:t[25]||(t[25]=ot=>o.drawingEvent("Edit")),onMouseover:t[26]||(t[26]=ot=>o.showToolitip(15)),onMouseout:t[27]||(t[27]=ot=>o.hideToolitip(15))})]),_:1},8,["visible"])],512)),[[h.vShow,!n.disableUI]]):h.createCommentVNode("",!0),h.withDirectives(h.createElementVNode("div",z8t,[h.createVNode(f,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[0].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[28]||(t[28]=ot=>o.zoomIn()),onMouseover:t[29]||(t[29]=ot=>o.showToolitip(0)),onMouseout:t[30]||(t[30]=ot=>o.hideToolitip(0))})]),_:1},8,["visible"]),h.createVNode(f,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[31]||(t[31]=ot=>o.zoomOut()),onMouseover:t[32]||(t[32]=ot=>o.showToolitip(1)),onMouseout:t[33]||(t[33]=ot=>o.hideToolitip(1))})]),_:1},8,["visible"]),h.createVNode(f,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value},{reference:h.withCtx(()=>[h.createVNode(p,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[34]||(t[34]=ot=>o.resetView()),onMouseover:t[35]||(t[35]=ot=>o.showToolitip(2)),onMouseout:t[36]||(t[36]=ot=>o.hideToolitip(2))})]),default:h.withCtx(()=>[U8t]),_:1},8,["visible"])],512),[[h.vShow,!n.disableUI]]),h.createVNode(f,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper",visible:e.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:h.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:h.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(g,{key:0,class:"svg-legends-container"})),h.createVNode(f,{content:"Location of the featured dataset",placement:"right",teleported:!1,trigger:"hover","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar},null,8,$8t),[[h.vShow,n.showStarInLegend],[tt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),h.createVNode(f,{content:"Find these markers for data",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[5].value,ref:"markerPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,G8t),[[h.vShow,e.hoverVisibilities[5].value],[tt,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(h.openBlock(),h.createBlock(_,{key:1,active:e.currentActive,hover:e.currentHover,"tree-data":e.systems,ref:"treeControls",onChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):h.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(h.openBlock(),h.createBlock(x,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:o.centreLinesSelected,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged"])):h.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(h.openBlock(),h.createBlock(x,{title:"Observed in",labelKey:"label",identifierKey:"taxon",selections:e.taxonConnectivity,onChanged:o.taxonsSelected,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckAll"])):h.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(h.openBlock(),h.createBlock(x,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:o.pathwaysSelected,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onCheckAll"])):h.createCommentVNode("",!0)],6)),[[tt,void 0,"checkBoxPopover"]]),h.createElementVNode("div",{onClick:t[37]||(t[37]=(...ot)=>o.toggleDrawer&&o.toggleDrawer(...ot)),class:h.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(b)]),_:1})],2)],2),[[h.vShow,!n.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(h.openBlock(),h.createBlock(f,{key:1,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.openMapOptions,ot=>(h.openBlock(),h.createBlock(E,{key:ot.key},{default:h.withCtx(()=>[h.createVNode(A,{type:"primary",plain:"",onClick:gt=>e.$emit("open-map",ot.key)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(ot.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):h.createCommentVNode("",!0),h.createVNode(f,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"200",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:h.withCtx(()=>[h.createElementVNode("div",null,[h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Viewing Mode")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(k,{teleported:!1,modelValue:e.viewingMode,"onUpdate:modelValue":t[38]||(t[38]=ot=>e.viewingMode=ot),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.viewingModes,(ot,gt)=>(h.openBlock(),h.createBlock(V,{key:ot+gt,label:ot,value:ot},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(O,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(ot),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.viewingMode==="Annotation"&&e.userInformation?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Drawn By*")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(k,{teleported:!1,modelValue:e.drawnType,"onUpdate:modelValue":t[39]||(t[39]=ot=>e.drawnType=ot),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.drawnTypes,ot=>(h.openBlock(),h.createBlock(V,{key:ot,label:ot,value:ot},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(O,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(ot),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Annotated By*")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(k,{teleported:!1,modelValue:e.annotatedType,"onUpdate:modelValue":t[40]||(t[40]=ot=>e.annotatedType=ot),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.annotatedTypes,ot=>(h.openBlock(),h.createBlock(V,{key:ot,label:ot,value:ot},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(O,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(ot),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):h.createCommentVNode("",!0),e.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:1,class:"backgroundSpacer"})):h.createCommentVNode("",!0),e.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:2,class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Flight path display")]),_:1})):h.createCommentVNode("",!0),e.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:3,class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(U,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[41]||(t[41]=ot=>e.flightPath3DRadio=ot),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:h.withCtx(()=>[h.createVNode(j,{label:!1},{default:h.withCtx(()=>[h.createTextVNode("2D")]),_:1}),h.createVNode(j,{label:!0},{default:h.withCtx(()=>[h.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):h.createCommentVNode("",!0),h.createVNode(E,{class:"backgroundSpacer"}),h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Organs display")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(U,{modelValue:e.colourRadio,"onUpdate:modelValue":t[42]||(t[42]=ot=>e.colourRadio=ot),class:"flatmap-radio",onChange:o.setColour},{default:h.withCtx(()=>[h.createVNode(j,{label:!0},{default:h.withCtx(()=>[h.createTextVNode("Colour")]),_:1}),h.createVNode(j,{label:!1},{default:h.withCtx(()=>[h.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),h.createVNode(E,{class:"backgroundSpacer"}),h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Outlines display")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(U,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[43]||(t[43]=ot=>e.outlinesRadio=ot),class:"flatmap-radio",onChange:o.setOutlines},{default:h.withCtx(()=>[h.createVNode(j,{label:!0},{default:h.withCtx(()=>[h.createTextVNode("Show")]),_:1}),h.createVNode(j,{label:!1},{default:h.withCtx(()=>[h.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),h.createVNode(E,{class:"backgroundSpacer"}),h.createVNode(E,{class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Change background")]),_:1}),h.createVNode(E,{class:"backgroundControl"},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.availableBackground,ot=>(h.openBlock(),h.createElementBlock("div",{key:ot,class:h.normalizeClass(["backgroundChoice",ot,ot==e.currentBackground?"active":""]),onClick:gt=>o.backgroundChangeCallback(ot)},null,10,Z8t))),128))]),_:1})])]),_:1},8,["virtual-ref"]),h.withDirectives(h.createElementVNode("div",{class:h.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(f,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper"},{reference:h.withCtx(()=>[n.enableOpenMapUI&&n.openMapOptions.length>0?(h.openBlock(),h.createBlock(p,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[44]||(t[44]=ot=>o.showToolitip(8)),onMouseout:t[45]||(t[45]=ot=>o.hideToolitip(8))},null,512)):h.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(f,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper"},{reference:h.withCtx(()=>[h.createVNode(p,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[46]||(t[46]=ot=>o.showToolitip(3)),onMouseout:t[47]||(t[47]=ot=>o.hideToolitip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[h.vShow,!n.disableUI]]),h.withDirectives(h.createVNode($,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,entry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","entry","annotationDisplay","onAnnotation"]),[[h.vShow,e.tooltipDisplay]]),h.withDirectives(h.createVNode(J,{class:"relevance-dialog",entry:e.relevanceEntry,drawing:e.inDrawing,relevance:o.relevance,onDisplay:o.relevanceDialogPopup,onConfirm:o.confirmDrawnFeature,onCancel:o.cancelDrawnFeature,onPopup:o.closePopup,onTooltip:o.checkAndCreatePopups},null,8,["entry","drawing","relevance","onDisplay","onConfirm","onCancel","onPopup","onTooltip"]),[[h.vShow,e.relevanceDisplay]])])])),[[st,e.loading]])}const by=aa(E8t,[["render",q8t],["__scopeId","data-v-7f745d83"]]),IO={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},W8t={name:"MultiFlatmapVuer",components:{Col:oa,Row:Lo,Option:k8,Select:j6,Popover:B8,FlatmapVuer:by},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),$8.on("onActionClick",e=>{this.resourceSelected(e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(r=>{const i=this.availableSpecies[r].uuid;if(i&&t.map(o=>o.uuid).indexOf(i)>0)this.speciesList[r]=h.reactive(this.availableSpecies[r]);else for(let o=0;o<t.length;o++)if(this.availableSpecies[r].taxo===t[o].taxon)if(this.availableSpecies[r].biologicalSex){if(t[o].biologicalSex&&t[o].biologicalSex===this.availableSpecies[r].biologicalSex){this.speciesList[r]=h.reactive(this.availableSpecies[r]);break}}else{this.speciesList[r]=h.reactive(this.availableSpecies[r]);break}});let n=this.initial;if(this.state){const r=this.state.state;(!r||!r.uuid&&!r.entry)&&this.state.species?n=this.state.species:n=void 0}n&&(n&&this.speciesList[n]!==void 0?this.activeSpecies=n:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this._initialised=!0,e(),this._resolveList.forEach(r=>{r()})})):this._initialised?e():this._resolveList.push(e)})},resourceSelected:function(e){this.$emit("resource-selected",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},showPopup:function(e,t,n){this.getCurrentFlatmap().showPopup(e,t,n)},showMarkerPopup:function(e,t,n){this.getCurrentFlatmap().showMarkerPopup(e,t,n)},setSpecies:function(e,t,n){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(n){const r=n-1;r>=0&&this.$nextTick(()=>{this.setSpecies(e,t,r)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let n=0;n<t.length;n++){const r=this.speciesList[t[n]];if(!r.isLegacy&&r.taxo===e.entry&&r.biologicalSex===e.biologicalSex){this.setSpecies(t[n],e,0);return}}},createLegacyEntry:function(e,t,n){if(n&&t){let r="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?r=e.species:r=r+` ${e.species}`),this.speciesList[r]=h.reactive({taxo:t,isLegacy:!0,displayWarning:!0}),{species:r,state:{entry:t,uuid:n,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const n=e.state;if(n.uuid){if(n.entry)return new Promise(()=>{const r=new VO(this.flatmapAPI),i={taxon:n.entry};n.biologicalSex&&(i.biologicalSex=n.biologicalSex),r.findMap_(i).then(o=>{if(o.uuid!==n.uuid)return this.createLegacyEntry(e,n.entry,n.uuid)}).then(o=>{t(o||e)}).catch(()=>{t(e)})})}else if(n.entry){const r=n.entry in IO?IO[n.entry]:void 0,i=this.createLegacyEntry(e,n.entry,r);t(i||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})})}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},userApiKey:{type:String,default:void 0},disableUI:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},X8t=e=>(h.pushScopeId("data-v-39e75155"),e=e(),h.popScopeId(),e),K8t={class:"multi-container",ref:"multiContainer"},Y8t={key:0,style:{position:"absolute","z-index":"10"}},J8t=X8t(()=>h.createElementVNode("div",{class:"species-display-text"},"Species",-1)),tut={class:"select-box-icon"};function eut(e,t,n,r,i,o){const a=k8,s=j6,d=B8,f=by;return h.openBlock(),h.createElementBlock("div",K8t,[n.disableUI?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",Y8t,[J8t,h.createVNode(d,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper right-popper",visible:n.helpMode,teleported:!1,ref:"selectPopover"},{reference:h.withCtx(()=>[h.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=Q=>e.activeSpecies=Q),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.speciesList,(Q,p)=>(h.openBlock(),h.createBlock(a,{key:p,label:p,value:p},{default:h.withCtx(()=>[h.createElementVNode("span",tut,[h.createElementVNode("i",{class:h.normalizeClass(Q.iconClass)},null,2)]),h.createTextVNode(" "+h.toDisplayString(p),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(e.speciesList,(Q,p)=>h.withDirectives((h.openBlock(),h.createBlock(f,{key:p,entry:Q.taxo,uuid:Q.uuid,biologicalSex:Q.biologicalSex,displayWarning:Q.displayWarning,displayLatestChanges:Q.displayLatestChanges,isLegacy:Q.isLegacy,ref_for:!0,ref:p,enableOpenMapUI:n.enableOpenMapUI,openMapOptions:n.openMapOptions,disableUI:n.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,onOpenMap:t[1]||(t[1]=g=>e.$emit("open-map",g)),minZoom:n.minZoom,helpMode:n.helpMode,renderAtMounted:n.renderAtMounted,displayMinimap:n.displayMinimap,showStarInLegend:n.showStarInLegend,style:{height:"100%"},flatmapAPI:n.flatmapAPI,sparcAPI:n.sparcAPI,userApiKey:n.userApiKey},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","minZoom","helpMode","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI","userApiKey"])),[[h.vShow,e.activeSpecies==p]])),128))],512)}const nut=aa(W8t,[["render",eut],["__scopeId","data-v-39e75155"]]);Un.FlatmapVuer=by,Un.MultiFlatmapVuer=nut,Un.Tooltip=GT,Object.defineProperty(Un,Symbol.toStringTag,{value:"Module"})});
|