@abi-software/flatmapvuer 1.1.0-beta.0 → 1.1.0-beta.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.
@@ -1660,7 +1660,7 @@ ${e.vs}`,e}setDataProperty(e,r,n){const i=Dt(this,F5).get(+e);i&&(!(r in i)||i[r
1660
1660
  `),this.__sckanCount=By.length,this.__checkedCount=this.__initialState==="all"?this.__sckanCount:this.__initialState==="none"?0:1,this.__halfCount=Math.trunc(this.__sckanCount/2),this.__button=document.createElement("button"),this.__button.id="map-sckan-button",this.__button.className="control-button text-button",this.__button.setAttribute("type","button"),this.__button.setAttribute("aria-label","Show/hide valid SCKAN paths"),this.__button.setAttribute("control-visible","false"),this.__button.textContent="SCKAN",this.__button.title="Show/hide valid SCKAN paths",this.__container.appendChild(this.__button),this.__container.addEventListener("click",this.onClick_.bind(this)),this.__container}onRemove(){this.__container.parentNode.removeChild(this.__container),this.__map=void 0}onClick_(e){if(e.target.id==="map-sckan-button")if(this.__button.getAttribute("control-visible")==="false"){this.__container.appendChild(this.__sckan),this.__button.setAttribute("control-visible","true");const r=document.getElementById("sckan-all-paths");r.indeterminate=this.__checkedCount>0&&this.__checkedCount<this.__sckanCount,this.__sckan.focus()}else this.__sckan=this.__container.removeChild(this.__sckan),this.__button.setAttribute("control-visible","false");else if(e.target.tagName==="INPUT"){if(e.target.id==="sckan-all-paths"){e.target.indeterminate&&(e.target.checked=this.__checkedCount>=this.__halfCount,e.target.indeterminate=!1),e.target.checked?(this.__state="all",this.__checkedCount=this.__sckanCount):(this.__state="none",this.__checkedCount=0);for(const r of By){const n=document.getElementById(`sckan-${r.id}`);n&&(n.checked=e.target.checked,this.__flatmap.enableSckanPath(r.id,e.target.checked))}}else if(e.target.id.startsWith("sckan-")){const r=e.target.id.substring(6);this.__flatmap.enableSckanPath(r,e.target.checked),e.target.checked?this.__checkedCount+=1:this.__checkedCount-=1;const n=document.getElementById("sckan-all-paths");this.__checkedCount===0?(n.checked=!1,n.indeterminate=!1):this.__checkedCount===this.__sckanCount?(n.checked=!0,n.indeterminate=!1):n.indeterminate=!0}}e.stopPropagation()}}class Lht{constructor(e,r={showCentrelines:!1}){this.__flatmap=e,this.__map=void 0,this.__visible=r.showCentrelines||!1}getDefaultPosition(){return"top-right"}onAdd(e){return this.__map=e,this.__container=document.createElement("div"),this.__container.className="maplibregl-ctrl",this.__button=document.createElement("button"),this.__button.id="map-nerve-button",this.__button.className="control-button text-button",this.__button.setAttribute("type","button"),this.__button.setAttribute("aria-label","Show/hide nerve centrelines"),this.__button.textContent="NERVES",this.__button.title="Show/hide nerve centrelines",this.__container.appendChild(this.__button),this.__container.addEventListener("click",this.onClick_.bind(this)),this.__container}onRemove(){this.__container.parentNode.removeChild(this.__container),this.__map=void 0}onClick_(e){e.target.id==="map-nerve-button"&&(this.__visible=!this.__visible,this.__flatmap.enableCentrelines(this.__visible)),e.stopPropagation()}}var z5;class xht{constructor(e){_r(this,z5,!1),this.__flatmap=e,this.__map=null}getDefaultPosition(){return"top-right"}onAdd(e){return this.__map=e,this.__container=document.createElement("div"),this.__container.className="maplibregl-ctrl",this.__button=document.createElement("button"),this.__button.id="map-annotated-button",this.__button.className="control-button text-button",this.__button.setAttribute("type","button"),this.__button.setAttribute("aria-label","Draw on map for annotation"),this.__button.textContent="DRAW",this.__button.title="Draw on map for annotation",this.__container.appendChild(this.__button),this.__container.addEventListener("click",this.onClick_.bind(this)),this.__setBackground(),this.__container}__setBackground(){Dt(this,z5)?this.__button.setAttribute("style","background: red"):this.__button.removeAttribute("style")}onRemove(){this.__container.parentNode.removeChild(this.__container),this.__map=null}onClick_(e){e.target.id==="map-annotated-button"&&(Vr(this,z5,!Dt(this,z5)),this.__setBackground(),this.__flatmap.showAnnotator(Dt(this,z5))),e.stopPropagation()}}z5=new WeakMap;class wht{constructor(e){this.__flatmap=e,this.__map=void 0}getDefaultPosition(){return"bottom-right"}onAdd(e){this.__map=e,this.__container=document.createElement("div"),this.__container.className="maplibregl-ctrl",this.__colourDiv=document.createElement("div"),this.__colourDiv.setAttribute("aria-label","Change background colour"),this.__colourDiv.title="Change background colour";const r=_ht(this.__flatmap.getBackgroundColour());return this.__colourDiv.innerHTML=`<input type="color" id="colourPicker" value="${r}">`,this.__container.appendChild(this.__colourDiv),this.__colourDiv.addEventListener("input",this.__updateColour.bind(this),!1),this.__colourDiv.addEventListener("change",this.__updateColour.bind(this),!1),this.__container}onRemove(){this.__container.parentNode.removeChild(this.__container),this.__map=void 0}__updateColour(e){const r=e.target.value;this.__flatmap.setBackgroundColour(r),this.__flatmap.controlEvent("change","background",r),e.stopPropagation()}}var AO={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(P,function(){var r=function(k,$){var F={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},q={on:function(pt,yt,Zt){if(F[pt]===void 0)throw new Error("Invalid event type: "+pt);F[pt].push({selector:yt,fn:Zt})},render:function(pt){$.store.featureChanged(pt)}},it=function(pt,yt){for(var Zt=F[pt],ne=Zt.length;ne--;){var me=Zt[ne];if(me.selector(yt)){me.fn.call(q,yt)||$.store.render(),$.ui.updateMapClasses();break}}};return k.start.call(q),{render:k.render,stop:function(){k.stop&&k.stop()},trash:function(){k.trash&&(k.trash(),$.store.render())},combineFeatures:function(){k.combineFeatures&&k.combineFeatures()},uncombineFeatures:function(){k.uncombineFeatures&&k.uncombineFeatures()},drag:function(pt){it("drag",pt)},click:function(pt){it("click",pt)},mousemove:function(pt){it("mousemove",pt)},mousedown:function(pt){it("mousedown",pt)},mouseup:function(pt){it("mouseup",pt)},mouseout:function(pt){it("mouseout",pt)},keydown:function(pt){it("keydown",pt)},keyup:function(pt){it("keyup",pt)},touchstart:function(pt){it("touchstart",pt)},touchmove:function(pt){it("touchmove",pt)},touchend:function(pt){it("touchend",pt)},tap:function(pt){it("tap",pt)}}};function n(k){return k&&k.__esModule&&Object.prototype.hasOwnProperty.call(k,"default")?k.default:k}function i(k){if(k.__esModule)return k;var $=k.default;if(typeof $=="function"){var F=function q(){if(this instanceof q){var it=[null];it.push.apply(it,arguments);var pt=Function.bind.apply($,it);return new pt}return $.apply(this,arguments)};F.prototype=$.prototype}else F={};return Object.defineProperty(F,"__esModule",{value:!0}),Object.keys(k).forEach(function(q){var it=Object.getOwnPropertyDescriptor(k,q);Object.defineProperty(F,q,it.get?it:{enumerable:!0,get:function(){return k[q]}})}),F}var o={},a={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:63567523142e-4},s=a;function d(k){var $=0;if(k&&k.length>0){$+=Math.abs(p(k[0]));for(var F=1;F<k.length;F++)$-=Math.abs(p(k[F]))}return $}function p(k){var $,F,q,it,pt,yt,Zt=0,ne=k.length;if(ne>2){for(yt=0;yt<ne;yt++)yt===ne-2?(q=ne-2,it=ne-1,pt=0):yt===ne-1?(q=ne-1,it=0,pt=1):(q=yt,it=yt+1,pt=yt+2),$=k[q],F=k[it],Zt+=(f(k[pt][0])-f($[0]))*Math.sin(f(F[1]));Zt=Zt*s.RADIUS*s.RADIUS/2}return Zt}function f(k){return k*Math.PI/180}o.geometry=function k($){var F,q=0;switch($.type){case"Polygon":return d($.coordinates);case"MultiPolygon":for(F=0;F<$.coordinates.length;F++)q+=d($.coordinates[F]);return q;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(F=0;F<$.geometries.length;F++)q+=k($.geometries[F]);return q}},o.ring=p;var Q={CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},m={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},_={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},v={POLYGON:"polygon",LINE:"line_string",POINT:"point"},b={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},M={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},E={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},V={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},O={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},R={ACTIVE:"true",INACTIVE:"false"},j=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],G=-85,z=Object.freeze({__proto__:null,classes:Q,sources:m,cursors:_,types:v,geojsonTypes:b,modes:M,events:E,updateActions:V,meta:O,activeStates:R,interactions:j,LAT_MIN:-90,LAT_RENDERED_MIN:G,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}),J={Point:0,LineString:1,MultiLineString:1,Polygon:2};function tt(k,$){var F=J[k.geometry.type]-J[$.geometry.type];return F===0&&k.geometry.type===b.POLYGON?k.area-$.area:F}function ot(k){return k.map(function($){return $.geometry.type===b.POLYGON&&($.area=o.geometry({type:b.FEATURE,property:{},geometry:$.geometry})),$}).sort(tt).map(function($){return delete $.area,$})}function et(k,$){return $===void 0&&($=0),[[k.point.x-$,k.point.y-$],[k.point.x+$,k.point.y+$]]}function Tt(k){if(this._items={},this._nums={},this._length=k?k.length:0,k)for(var $=0,F=k.length;$<F;$++)this.add(k[$]),k[$]!==void 0&&(typeof k[$]=="string"?this._items[k[$]]=$:this._nums[k[$]]=$)}Tt.prototype.add=function(k){return this.has(k)||(this._length++,typeof k=="string"?this._items[k]=this._length:this._nums[k]=this._length),this},Tt.prototype.delete=function(k){return this.has(k)===!1||(this._length--,delete this._items[k],delete this._nums[k]),this},Tt.prototype.has=function(k){return(typeof k=="string"||typeof k=="number")&&(this._items[k]!==void 0||this._nums[k]!==void 0)},Tt.prototype.values=function(){var k=this,$=[];return Object.keys(this._items).forEach(function(F){$.push({k:F,v:k._items[F]})}),Object.keys(this._nums).forEach(function(F){$.push({k:JSON.parse(F),v:k._nums[F]})}),$.sort(function(F,q){return F.v-q.v}).map(function(F){return F.k})},Tt.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var At=[O.FEATURE,O.MIDPOINT,O.VERTEX],Ut={click:function(k,$,F){return ee(k,$,F,F.options.clickBuffer)},touch:function(k,$,F){return ee(k,$,F,F.options.touchBuffer)}};function ee(k,$,F,q){if(F.map===null)return[];var it=k?et(k,q):$,pt={};F.options.styles&&(pt.layers=F.options.styles.map(function(me){return me.id}).filter(function(me){return F.map.getLayer(me)!=null}));var yt=F.map.queryRenderedFeatures(it,pt).filter(function(me){return At.indexOf(me.properties.meta)!==-1}),Zt=new Tt,ne=[];return yt.forEach(function(me){var Me=me.properties.id;Zt.has(Me)||(Zt.add(Me),ne.push(me))}),ot(ne)}function ue(k,$){var F=Ut.click(k,null,$),q={mouse:_.NONE};return F[0]&&(q.mouse=F[0].properties.active===R.ACTIVE?_.MOVE:_.POINTER,q.feature=F[0].properties.meta),$.events.currentModeName().indexOf("draw")!==-1&&(q.mouse=_.ADD),$.ui.queueMapClasses(q),$.ui.updateMapClasses(),F[0]}function Ft(k,$){var F=k.x-$.x,q=k.y-$.y;return Math.sqrt(F*F+q*q)}function pe(k,$,F){F===void 0&&(F={});var q=F.fineTolerance!=null?F.fineTolerance:4,it=F.grossTolerance!=null?F.grossTolerance:12,pt=F.interval!=null?F.interval:500;k.point=k.point||$.point,k.time=k.time||$.time;var yt=Ft(k.point,$.point);return yt<q||yt<it&&$.time-k.time<pt}function lr(k,$,F){F===void 0&&(F={});var q=F.tolerance!=null?F.tolerance:25,it=F.interval!=null?F.interval:250;return k.point=k.point||$.point,k.time=k.time||$.time,Ft(k.point,$.point)<q&&$.time-k.time<it}var Xt={exports:{}},le=Xt.exports=function(k,$){if($||($=16),k===void 0&&(k=128),k<=0)return"0";for(var F=Math.log(Math.pow(2,k))/Math.log($),q=2;F===1/0;q*=2)F=Math.log(Math.pow(2,k/q))/Math.log($)*q;var it=F-Math.floor(F),pt="";for(q=0;q<Math.floor(F);q++)pt=Math.floor(Math.random()*$).toString($)+pt;if(it){var yt=Math.pow($,it);pt=Math.floor(Math.random()*yt).toString($)+pt}var Zt=parseInt(pt,$);return Zt!==1/0&&Zt>=Math.pow(2,k)?le(k,$):pt};le.rack=function(k,$,F){var q=function(pt){var yt=0;do{if(yt++>10){if(!F)throw new Error("too many ID collisions, use more bits");k+=F}var Zt=le(k,$)}while(Object.hasOwnProperty.call(it,Zt));return it[Zt]=pt,Zt},it=q.hats={};return q.get=function(pt){return q.hats[pt]},q.set=function(pt,yt){return q.hats[pt]=yt,q},q.bits=k||128,q.base=$||16,q};var ge=n(Xt.exports),Le=function(k,$){this.ctx=k,this.properties=$.properties||{},this.coordinates=$.geometry.coordinates,this.id=$.id||ge(),this.type=$.geometry.type};Le.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},Le.prototype.incomingCoords=function(k){this.setCoordinates(k)},Le.prototype.setCoordinates=function(k){this.coordinates=k,this.changed()},Le.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},Le.prototype.setProperty=function(k,$){this.properties[k]=$},Le.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:b.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},Le.prototype.internal=function(k){var $={id:this.id,meta:O.FEATURE,"meta:type":this.type,active:R.INACTIVE,mode:k};if(this.ctx.options.userProperties)for(var F in this.properties)$["user_"+F]=this.properties[F];return{type:b.FEATURE,properties:$,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var Fe=function(k,$){Le.call(this,k,$)};(Fe.prototype=Object.create(Le.prototype)).isValid=function(){return typeof this.coordinates[0]=="number"&&typeof this.coordinates[1]=="number"},Fe.prototype.updateCoordinate=function(k,$,F){this.coordinates=arguments.length===3?[$,F]:[k,$],this.changed()},Fe.prototype.getCoordinate=function(){return this.getCoordinates()};var Ge=function(k,$){Le.call(this,k,$)};(Ge.prototype=Object.create(Le.prototype)).isValid=function(){return this.coordinates.length>1},Ge.prototype.addCoordinate=function(k,$,F){this.changed();var q=parseInt(k,10);this.coordinates.splice(q,0,[$,F])},Ge.prototype.getCoordinate=function(k){var $=parseInt(k,10);return JSON.parse(JSON.stringify(this.coordinates[$]))},Ge.prototype.removeCoordinate=function(k){this.changed(),this.coordinates.splice(parseInt(k,10),1)},Ge.prototype.updateCoordinate=function(k,$,F){var q=parseInt(k,10);this.coordinates[q]=[$,F],this.changed()};var je=function(k,$){Le.call(this,k,$),this.coordinates=this.coordinates.map(function(F){return F.slice(0,-1)})};(je.prototype=Object.create(Le.prototype)).isValid=function(){return this.coordinates.length!==0&&this.coordinates.every(function(k){return k.length>2})},je.prototype.incomingCoords=function(k){this.coordinates=k.map(function($){return $.slice(0,-1)}),this.changed()},je.prototype.setCoordinates=function(k){this.coordinates=k,this.changed()},je.prototype.addCoordinate=function(k,$,F){this.changed();var q=k.split(".").map(function(it){return parseInt(it,10)});this.coordinates[q[0]].splice(q[1],0,[$,F])},je.prototype.removeCoordinate=function(k){this.changed();var $=k.split(".").map(function(q){return parseInt(q,10)}),F=this.coordinates[$[0]];F&&(F.splice($[1],1),F.length<3&&this.coordinates.splice($[0],1))},je.prototype.getCoordinate=function(k){var $=k.split(".").map(function(q){return parseInt(q,10)}),F=this.coordinates[$[0]];return JSON.parse(JSON.stringify(F[$[1]]))},je.prototype.getCoordinates=function(){return this.coordinates.map(function(k){return k.concat([k[0]])})},je.prototype.updateCoordinate=function(k,$,F){this.changed();var q=k.split("."),it=parseInt(q[0],10),pt=parseInt(q[1],10);this.coordinates[it]===void 0&&(this.coordinates[it]=[]),this.coordinates[it][pt]=[$,F]};var Bt={MultiPoint:Fe,MultiLineString:Ge,MultiPolygon:je},qt=function(k,$,F,q,it){var pt=F.split("."),yt=parseInt(pt[0],10),Zt=pt[1]?pt.slice(1).join("."):null;return k[yt][$](Zt,q,it)},he=function(k,$){if(Le.call(this,k,$),delete this.coordinates,this.model=Bt[$.geometry.type],this.model===void 0)throw new TypeError($.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures($.geometry.coordinates)};function jt(k){this.map=k.map,this.drawConfig=JSON.parse(JSON.stringify(k.options||{})),this._ctx=k}(he.prototype=Object.create(Le.prototype))._coordinatesToFeatures=function(k){var $=this,F=this.model.bind(this);return k.map(function(q){return new F($.ctx,{id:ge(),type:b.FEATURE,properties:{},geometry:{coordinates:q,type:$.type.replace("Multi","")}})})},he.prototype.isValid=function(){return this.features.every(function(k){return k.isValid()})},he.prototype.setCoordinates=function(k){this.features=this._coordinatesToFeatures(k),this.changed()},he.prototype.getCoordinate=function(k){return qt(this.features,"getCoordinate",k)},he.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(function(k){return k.type===b.POLYGON?k.getCoordinates():k.coordinates})))},he.prototype.updateCoordinate=function(k,$,F){qt(this.features,"updateCoordinate",k,$,F),this.changed()},he.prototype.addCoordinate=function(k,$,F){qt(this.features,"addCoordinate",k,$,F),this.changed()},he.prototype.removeCoordinate=function(k){qt(this.features,"removeCoordinate",k),this.changed()},he.prototype.getFeatures=function(){return this.features},jt.prototype.setSelected=function(k){return this._ctx.store.setSelected(k)},jt.prototype.setSelectedCoordinates=function(k){var $=this;this._ctx.store.setSelectedCoordinates(k),k.reduce(function(F,q){return F[q.feature_id]===void 0&&(F[q.feature_id]=!0,$._ctx.store.get(q.feature_id).changed()),F},{})},jt.prototype.getSelected=function(){return this._ctx.store.getSelected()},jt.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},jt.prototype.isSelected=function(k){return this._ctx.store.isSelected(k)},jt.prototype.getFeature=function(k){return this._ctx.store.get(k)},jt.prototype.select=function(k){return this._ctx.store.select(k)},jt.prototype.deselect=function(k){return this._ctx.store.deselect(k)},jt.prototype.deleteFeature=function(k,$){return $===void 0&&($={}),this._ctx.store.delete(k,$)},jt.prototype.addFeature=function(k){return this._ctx.store.add(k)},jt.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},jt.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},jt.prototype.setActionableState=function(k){k===void 0&&(k={});var $={trash:k.trash||!1,combineFeatures:k.combineFeatures||!1,uncombineFeatures:k.uncombineFeatures||!1};return this._ctx.events.actionable($)},jt.prototype.changeMode=function(k,$,F){return $===void 0&&($={}),F===void 0&&(F={}),this._ctx.events.changeMode(k,$,F)},jt.prototype.updateUIClasses=function(k){return this._ctx.ui.queueMapClasses(k)},jt.prototype.activateUIButton=function(k){return this._ctx.ui.setActiveButton(k)},jt.prototype.featuresAt=function(k,$,F){if(F===void 0&&(F="click"),F!=="click"&&F!=="touch")throw new Error("invalid buffer type");return Ut[F](k,$,this._ctx)},jt.prototype.newFeature=function(k){var $=k.geometry.type;return $===b.POINT?new Fe(this._ctx,k):$===b.LINE_STRING?new Ge(this._ctx,k):$===b.POLYGON?new je(this._ctx,k):new he(this._ctx,k)},jt.prototype.isInstanceOf=function(k,$){if(k===b.POINT)return $ instanceof Fe;if(k===b.LINE_STRING)return $ instanceof Ge;if(k===b.POLYGON)return $ instanceof je;if(k==="MultiFeature")return $ instanceof he;throw new Error("Unknown feature class: "+k)},jt.prototype.doRender=function(k){return this._ctx.store.featureChanged(k)},jt.prototype.onSetup=function(){},jt.prototype.onDrag=function(){},jt.prototype.onClick=function(){},jt.prototype.onMouseMove=function(){},jt.prototype.onMouseDown=function(){},jt.prototype.onMouseUp=function(){},jt.prototype.onMouseOut=function(){},jt.prototype.onKeyUp=function(){},jt.prototype.onKeyDown=function(){},jt.prototype.onTouchStart=function(){},jt.prototype.onTouchMove=function(){},jt.prototype.onTouchEnd=function(){},jt.prototype.onTap=function(){},jt.prototype.onStop=function(){},jt.prototype.onTrash=function(){},jt.prototype.onCombineFeature=function(){},jt.prototype.onUncombineFeature=function(){},jt.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var fe={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},Ne=Object.keys(fe);function Ae(k){var $=Object.keys(k);return function(F,q){q===void 0&&(q={});var it={},pt=$.reduce(function(yt,Zt){return yt[Zt]=k[Zt],yt},new jt(F));return{start:function(){var yt=this;it=pt.onSetup(q),Ne.forEach(function(Zt){var ne,me=fe[Zt],Me=function(){return!1};k[me]&&(Me=function(){return!0}),yt.on(Zt,Me,(ne=me,function(_e){return pt[ne](it,_e)}))})},stop:function(){pt.onStop(it)},trash:function(){pt.onTrash(it)},combineFeatures:function(){pt.onCombineFeatures(it)},uncombineFeatures:function(){pt.onUncombineFeatures(it)},render:function(yt,Zt){pt.toDisplayFeatures(it,yt,Zt)}}}}function Ve(k){return[].concat(k).filter(function($){return $!==void 0})}function ke(){var k=this;if(!(k.ctx.map&&k.ctx.map.getSource(m.HOT)!==void 0))return ne();var $=k.ctx.events.currentModeName();k.ctx.ui.queueMapClasses({mode:$});var F=[],q=[];k.isDirty?q=k.getAllIds():(F=k.getChangedIds().filter(function(me){return k.get(me)!==void 0}),q=k.sources.hot.filter(function(me){return me.properties.id&&F.indexOf(me.properties.id)===-1&&k.get(me.properties.id)!==void 0}).map(function(me){return me.properties.id})),k.sources.hot=[];var it=k.sources.cold.length;k.sources.cold=k.isDirty?[]:k.sources.cold.filter(function(me){var Me=me.properties.id||me.properties.parent;return F.indexOf(Me)===-1});var pt=it!==k.sources.cold.length||q.length>0;function yt(me,Me){var _e=k.get(me).internal($);k.ctx.events.currentModeRender(_e,function(or){k.sources[Me].push(or)})}if(F.forEach(function(me){return yt(me,"hot")}),q.forEach(function(me){return yt(me,"cold")}),pt&&k.ctx.map.getSource(m.COLD).setData({type:b.FEATURE_COLLECTION,features:k.sources.cold}),k.ctx.map.getSource(m.HOT).setData({type:b.FEATURE_COLLECTION,features:k.sources.hot}),k._emitSelectionChange&&(k.ctx.map.fire(E.SELECTION_CHANGE,{features:k.getSelected().map(function(me){return me.toGeoJSON()}),points:k.getSelectedCoordinates().map(function(me){return{type:b.FEATURE,properties:{},geometry:{type:b.POINT,coordinates:me.coordinates}}})}),k._emitSelectionChange=!1),k._deletedFeaturesToEmit.length){var Zt=k._deletedFeaturesToEmit.map(function(me){return me.toGeoJSON()});k._deletedFeaturesToEmit=[],k.ctx.map.fire(E.DELETE,{features:Zt})}function ne(){k.isDirty=!1,k.clearChangedIds()}ne(),k.ctx.map.fire(E.RENDER,{})}function ze(k){var $,F=this;this._features={},this._featureIds=new Tt,this._selectedFeatureIds=new Tt,this._selectedCoordinates=[],this._changedFeatureIds=new Tt,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=k,this.sources={hot:[],cold:[]},this.render=function(){$||($=requestAnimationFrame(function(){$=null,ke.call(F)}))},this.isDirty=!1}function zt(k,$){var F=k._selectedCoordinates.filter(function(q){return k._selectedFeatureIds.has(q.feature_id)});k._selectedCoordinates.length===F.length||$.silent||(k._emitSelectionChange=!0),k._selectedCoordinates=F}ze.prototype.createRenderBatch=function(){var k=this,$=this.render,F=0;return this.render=function(){F++},function(){k.render=$,F>0&&k.render()}},ze.prototype.setDirty=function(){return this.isDirty=!0,this},ze.prototype.featureChanged=function(k){return this._changedFeatureIds.add(k),this},ze.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},ze.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},ze.prototype.getAllIds=function(){return this._featureIds.values()},ze.prototype.add=function(k){return this.featureChanged(k.id),this._features[k.id]=k,this._featureIds.add(k.id),this},ze.prototype.delete=function(k,$){var F=this;return $===void 0&&($={}),Ve(k).forEach(function(q){F._featureIds.has(q)&&(F._featureIds.delete(q),F._selectedFeatureIds.delete(q),$.silent||F._deletedFeaturesToEmit.indexOf(F._features[q])===-1&&F._deletedFeaturesToEmit.push(F._features[q]),delete F._features[q],F.isDirty=!0)}),zt(this,$),this},ze.prototype.get=function(k){return this._features[k]},ze.prototype.getAll=function(){var k=this;return Object.keys(this._features).map(function($){return k._features[$]})},ze.prototype.select=function(k,$){var F=this;return $===void 0&&($={}),Ve(k).forEach(function(q){F._selectedFeatureIds.has(q)||(F._selectedFeatureIds.add(q),F._changedFeatureIds.add(q),$.silent||(F._emitSelectionChange=!0))}),this},ze.prototype.deselect=function(k,$){var F=this;return $===void 0&&($={}),Ve(k).forEach(function(q){F._selectedFeatureIds.has(q)&&(F._selectedFeatureIds.delete(q),F._changedFeatureIds.add(q),$.silent||(F._emitSelectionChange=!0))}),zt(this,$),this},ze.prototype.clearSelected=function(k){return k===void 0&&(k={}),this.deselect(this._selectedFeatureIds.values(),{silent:k.silent}),this},ze.prototype.setSelected=function(k,$){var F=this;return $===void 0&&($={}),k=Ve(k),this.deselect(this._selectedFeatureIds.values().filter(function(q){return k.indexOf(q)===-1}),{silent:$.silent}),this.select(k.filter(function(q){return!F._selectedFeatureIds.has(q)}),{silent:$.silent}),this},ze.prototype.setSelectedCoordinates=function(k){return this._selectedCoordinates=k,this._emitSelectionChange=!0,this},ze.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},ze.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},ze.prototype.getSelected=function(){var k=this;return this._selectedFeatureIds.values().map(function($){return k.get($)})},ze.prototype.getSelectedCoordinates=function(){var k=this;return this._selectedCoordinates.map(function($){return{coordinates:k.get($.feature_id).getCoordinate($.coord_path)}})},ze.prototype.isSelected=function(k){return this._selectedFeatureIds.has(k)},ze.prototype.setFeatureProperty=function(k,$,F){this.get(k).setProperty($,F),this.featureChanged(k)},ze.prototype.storeMapConfig=function(){var k=this;j.forEach(function($){k.ctx.map[$]&&(k._mapInitialConfig[$]=k.ctx.map[$].isEnabled())})},ze.prototype.restoreMapConfig=function(){var k=this;Object.keys(this._mapInitialConfig).forEach(function($){k._mapInitialConfig[$]?k.ctx.map[$].enable():k.ctx.map[$].disable()})},ze.prototype.getInitialConfigValue=function(k){return this._mapInitialConfig[k]===void 0||this._mapInitialConfig[k]};var Pr=function(){for(var k=arguments,$={},F=0;F<arguments.length;F++){var q=k[F];for(var it in q)mn.call(q,it)&&($[it]=q[it])}return $},mn=Object.prototype.hasOwnProperty,We=n(Pr),vr=["mode","feature","mouse"];function Nn(k){var $=null,F=null,q={onRemove:function(){return k.map.off("load",q.connect),clearInterval(F),q.removeLayers(),k.store.restoreMapConfig(),k.ui.removeButtons(),k.events.removeEventListeners(),k.ui.clearMapClasses(),k.boxZoomInitial&&k.map.boxZoom.enable(),k.map=null,k.container=null,k.store=null,$&&$.parentNode&&$.parentNode.removeChild($),$=null,this},connect:function(){k.map.off("load",q.connect),clearInterval(F),q.addLayers(),k.store.storeMapConfig(),k.events.addEventListeners()},onAdd:function(it){var pt=it.fire;return it.fire=function(yt,Zt){var ne=arguments;return pt.length===1&&arguments.length!==1&&(ne=[We({},{type:yt},Zt)]),pt.apply(it,ne)},k.map=it,k.events=function(yt){var Zt=Object.keys(yt.options.modes).reduce(function(ae,Ye){return ae[Ye]=Ae(yt.options.modes[Ye]),ae},{}),ne={},me={},Me={},_e=null,or=null;Me.drag=function(ae,Ye){Ye({point:ae.point,time:new Date().getTime()})?(yt.ui.queueMapClasses({mouse:_.DRAG}),or.drag(ae)):ae.originalEvent.stopPropagation()},Me.mousedrag=function(ae){Me.drag(ae,function(Ye){return!pe(ne,Ye)})},Me.touchdrag=function(ae){Me.drag(ae,function(Ye){return!lr(me,Ye)})},Me.mousemove=function(ae){if((ae.originalEvent.buttons!==void 0?ae.originalEvent.buttons:ae.originalEvent.which)===1)return Me.mousedrag(ae);var Ye=ue(ae,yt);ae.featureTarget=Ye,or.mousemove(ae)},Me.mousedown=function(ae){ne={time:new Date().getTime(),point:ae.point};var Ye=ue(ae,yt);ae.featureTarget=Ye,or.mousedown(ae)},Me.mouseup=function(ae){var Ye=ue(ae,yt);ae.featureTarget=Ye,pe(ne,{point:ae.point,time:new Date().getTime()})?or.click(ae):or.mouseup(ae)},Me.mouseout=function(ae){or.mouseout(ae)},Me.touchstart=function(ae){if(yt.options.touchEnabled){me={time:new Date().getTime(),point:ae.point};var Ye=Ut.touch(ae,null,yt)[0];ae.featureTarget=Ye,or.touchstart(ae)}},Me.touchmove=function(ae){if(yt.options.touchEnabled)return or.touchmove(ae),Me.touchdrag(ae)},Me.touchend=function(ae){if(ae.originalEvent.preventDefault(),yt.options.touchEnabled){var Ye=Ut.touch(ae,null,yt)[0];ae.featureTarget=Ye,lr(me,{time:new Date().getTime(),point:ae.point})?or.tap(ae):or.touchend(ae)}};var Hn=function(ae){return!(ae===8||ae===46||ae>=48&&ae<=57)};function Mr(ae,Ye,Ir){Ir===void 0&&(Ir={}),or.stop();var Wn=Zt[ae];if(Wn===void 0)throw new Error(ae+" is not valid");_e=ae;var Sn=Wn(yt,Ye);or=r(Sn,yt),Ir.silent||yt.map.fire(E.MODE_CHANGE,{mode:ae}),yt.store.setDirty(),yt.store.render()}Me.keydown=function(ae){(ae.srcElement||ae.target).classList.contains("mapboxgl-canvas")&&(ae.keyCode!==8&&ae.keyCode!==46||!yt.options.controls.trash?Hn(ae.keyCode)?or.keydown(ae):ae.keyCode===49&&yt.options.controls.point?Mr(M.DRAW_POINT):ae.keyCode===50&&yt.options.controls.line_string?Mr(M.DRAW_LINE_STRING):ae.keyCode===51&&yt.options.controls.polygon&&Mr(M.DRAW_POLYGON):(ae.preventDefault(),or.trash()))},Me.keyup=function(ae){Hn(ae.keyCode)&&or.keyup(ae)},Me.zoomend=function(){yt.store.changeZoom()},Me.data=function(ae){if(ae.dataType==="style"){var Ye=yt.setup,Ir=yt.map,Wn=yt.options,Sn=yt.store;Wn.styles.some(function(X2){return Ir.getLayer(X2.id)})||(Ye.addLayers(),Sn.setDirty(),Sn.render())}};var Dn={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){_e=yt.options.defaultMode,or=r(Zt[_e](yt),yt)},changeMode:Mr,actionable:function(ae){var Ye=!1;Object.keys(ae).forEach(function(Ir){if(Dn[Ir]===void 0)throw new Error("Invalid action type");Dn[Ir]!==ae[Ir]&&(Ye=!0),Dn[Ir]=ae[Ir]}),Ye&&yt.map.fire(E.ACTIONABLE,{actions:Dn})},currentModeName:function(){return _e},currentModeRender:function(ae,Ye){return or.render(ae,Ye)},fire:function(ae,Ye){Me[ae]&&Me[ae](Ye)},addEventListeners:function(){yt.map.on("mousemove",Me.mousemove),yt.map.on("mousedown",Me.mousedown),yt.map.on("mouseup",Me.mouseup),yt.map.on("data",Me.data),yt.map.on("touchmove",Me.touchmove),yt.map.on("touchstart",Me.touchstart),yt.map.on("touchend",Me.touchend),yt.container.addEventListener("mouseout",Me.mouseout),yt.options.keybindings&&(yt.container.addEventListener("keydown",Me.keydown),yt.container.addEventListener("keyup",Me.keyup))},removeEventListeners:function(){yt.map.off("mousemove",Me.mousemove),yt.map.off("mousedown",Me.mousedown),yt.map.off("mouseup",Me.mouseup),yt.map.off("data",Me.data),yt.map.off("touchmove",Me.touchmove),yt.map.off("touchstart",Me.touchstart),yt.map.off("touchend",Me.touchend),yt.container.removeEventListener("mouseout",Me.mouseout),yt.options.keybindings&&(yt.container.removeEventListener("keydown",Me.keydown),yt.container.removeEventListener("keyup",Me.keyup))},trash:function(ae){or.trash(ae)},combineFeatures:function(){or.combineFeatures()},uncombineFeatures:function(){or.uncombineFeatures()},getMode:function(){return _e}}}(k),k.ui=function(yt){var Zt={},ne=null,me={mode:null,feature:null,mouse:null},Me={mode:null,feature:null,mouse:null};function _e(ae){Me=We(Me,ae)}function or(){var ae,Ye;if(yt.container){var Ir=[],Wn=[];vr.forEach(function(Sn){Me[Sn]!==me[Sn]&&(Ir.push(Sn+"-"+me[Sn]),Me[Sn]!==null&&Wn.push(Sn+"-"+Me[Sn]))}),Ir.length>0&&(ae=yt.container.classList).remove.apply(ae,Ir),Wn.length>0&&(Ye=yt.container.classList).add.apply(Ye,Wn),me=We(me,Me)}}function Hn(ae,Ye){Ye===void 0&&(Ye={});var Ir=document.createElement("button");return Ir.className=Q.CONTROL_BUTTON+" "+Ye.className,Ir.setAttribute("title",Ye.title),Ye.container.appendChild(Ir),Ir.addEventListener("click",function(Wn){if(Wn.preventDefault(),Wn.stopPropagation(),Wn.target===ne)return Mr(),void Ye.onDeactivate();Dn(ae),Ye.onActivate()},!0),Ir}function Mr(){ne&&(ne.classList.remove(Q.ACTIVE_BUTTON),ne=null)}function Dn(ae){Mr();var Ye=Zt[ae];Ye&&Ye&&ae!=="trash"&&(Ye.classList.add(Q.ACTIVE_BUTTON),ne=Ye)}return{setActiveButton:Dn,queueMapClasses:_e,updateMapClasses:or,clearMapClasses:function(){_e({mode:null,feature:null,mouse:null}),or()},addButtons:function(){var ae=yt.options.controls,Ye=document.createElement("div");return Ye.className=Q.CONTROL_GROUP+" "+Q.CONTROL_BASE,ae&&(ae[v.LINE]&&(Zt[v.LINE]=Hn(v.LINE,{container:Ye,className:Q.CONTROL_BUTTON_LINE,title:"LineString tool "+(yt.options.keybindings?"(l)":""),onActivate:function(){return yt.events.changeMode(M.DRAW_LINE_STRING)},onDeactivate:function(){return yt.events.trash()}})),ae[v.POLYGON]&&(Zt[v.POLYGON]=Hn(v.POLYGON,{container:Ye,className:Q.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(yt.options.keybindings?"(p)":""),onActivate:function(){return yt.events.changeMode(M.DRAW_POLYGON)},onDeactivate:function(){return yt.events.trash()}})),ae[v.POINT]&&(Zt[v.POINT]=Hn(v.POINT,{container:Ye,className:Q.CONTROL_BUTTON_POINT,title:"Marker tool "+(yt.options.keybindings?"(m)":""),onActivate:function(){return yt.events.changeMode(M.DRAW_POINT)},onDeactivate:function(){return yt.events.trash()}})),ae.trash&&(Zt.trash=Hn("trash",{container:Ye,className:Q.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){yt.events.trash()}})),ae.combine_features&&(Zt.combine_features=Hn("combineFeatures",{container:Ye,className:Q.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){yt.events.combineFeatures()}})),ae.uncombine_features&&(Zt.uncombine_features=Hn("uncombineFeatures",{container:Ye,className:Q.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){yt.events.uncombineFeatures()}}))),Ye},removeButtons:function(){Object.keys(Zt).forEach(function(ae){var Ye=Zt[ae];Ye.parentNode&&Ye.parentNode.removeChild(Ye),delete Zt[ae]})}}}(k),k.container=it.getContainer(),k.store=new ze(k),$=k.ui.addButtons(),k.options.boxSelect&&(k.boxZoomInitial=it.boxZoom.isEnabled(),it.boxZoom.disable(),it.dragPan.disable(),it.dragPan.enable()),it.loaded()?q.connect():(it.on("load",q.connect),F=setInterval(function(){it.loaded()&&q.connect()},16)),k.events.start(),$},addLayers:function(){k.map.addSource(m.COLD,{data:{type:b.FEATURE_COLLECTION,features:[]},type:"geojson"}),k.map.addSource(m.HOT,{data:{type:b.FEATURE_COLLECTION,features:[]},type:"geojson"}),k.options.styles.forEach(function(it){k.map.addLayer(it)}),k.store.setDirty(!0),k.store.render()},removeLayers:function(){k.options.styles.forEach(function(it){k.map.getLayer(it.id)&&k.map.removeLayer(it.id)}),k.map.getSource(m.COLD)&&k.map.removeSource(m.COLD),k.map.getSource(m.HOT)&&k.map.removeSource(m.HOT)}};return k.setup=q,q}var S1=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}];function wn(k){return function($){var F=$.featureTarget;return!!F&&!!F.properties&&F.properties.meta===k}}function ye(k){return!!k.originalEvent&&!!k.originalEvent.shiftKey&&k.originalEvent.button===0}function cr(k){return!!k.featureTarget&&!!k.featureTarget.properties&&k.featureTarget.properties.active===R.ACTIVE&&k.featureTarget.properties.meta===O.FEATURE}function Wr(k){return!!k.featureTarget&&!!k.featureTarget.properties&&k.featureTarget.properties.active===R.INACTIVE&&k.featureTarget.properties.meta===O.FEATURE}function $n(k){return k.featureTarget===void 0}function Qe(k){return!!k.featureTarget&&!!k.featureTarget.properties&&k.featureTarget.properties.meta===O.FEATURE}function Bn(k){var $=k.featureTarget;return!!$&&!!$.properties&&$.properties.meta===O.VERTEX}function Tn(k){return!!k.originalEvent&&k.originalEvent.shiftKey===!0}function ci(k){return k.keyCode===27}function ui(k){return k.keyCode===13}var be=Object.freeze({__proto__:null,isOfMetaType:wn,isShiftMousedown:ye,isActiveFeature:cr,isInactiveFeature:Wr,noTarget:$n,isFeature:Qe,isVertex:Bn,isShiftDown:Tn,isEscapeKey:ci,isEnterKey:ui,isTrue:function(){return!0}}),gr=ur;function ur(k,$){this.x=k,this.y=$}ur.prototype={clone:function(){return new ur(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,$){return this.clone()._rotateAround(k,$)},matMult:function(k){return this.clone()._matMult(k)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var $=k.x-this.x,F=k.y-this.y;return $*$+F*F},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,$){return Math.atan2(this.x*$-this.y*k,this.x*k+this.y*$)},_matMult:function(k){var $=k[0]*this.x+k[1]*this.y,F=k[2]*this.x+k[3]*this.y;return this.x=$,this.y=F,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var $=Math.cos(k),F=Math.sin(k),q=$*this.x-F*this.y,it=F*this.x+$*this.y;return this.x=q,this.y=it,this},_rotateAround:function(k,$){var F=Math.cos(k),q=Math.sin(k),it=$.x+F*(this.x-$.x)-q*(this.y-$.y),pt=$.y+q*(this.x-$.x)+F*(this.y-$.y);return this.x=it,this.y=pt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ur.convert=function(k){return k instanceof ur?k:Array.isArray(k)?new ur(k[0],k[1]):k};var r1=n(gr);function n1(k,$){var F=$.getBoundingClientRect();return new r1(k.clientX-F.left-($.clientLeft||0),k.clientY-F.top-($.clientTop||0))}function sr(k,$,F,q){return{type:b.FEATURE,properties:{meta:O.VERTEX,parent:k,coord_path:F,active:q?R.ACTIVE:R.INACTIVE},geometry:{type:b.POINT,coordinates:$}}}function Li(k,$,F){var q=$.geometry.coordinates,it=F.geometry.coordinates;if(q[1]>85||q[1]<G||it[1]>85||it[1]<G)return null;var pt={lng:(q[0]+it[0])/2,lat:(q[1]+it[1])/2};return{type:b.FEATURE,properties:{meta:O.MIDPOINT,parent:k,lng:pt.lng,lat:pt.lat,coord_path:F.properties.coord_path},geometry:{type:b.POINT,coordinates:[pt.lng,pt.lat]}}}function C1(k,$,F){$===void 0&&($={}),F===void 0&&(F=null);var q,it=k.geometry,pt=it.type,yt=it.coordinates,Zt=k.properties&&k.properties.id,ne=[];function me(_e,or){var Hn="",Mr=null;_e.forEach(function(Dn,ae){var Ye=or!=null?or+"."+ae:String(ae),Ir=sr(Zt,Dn,Ye,Me(Ye));if($.midpoints&&Mr){var Wn=Li(Zt,Mr,Ir);Wn&&ne.push(Wn)}Mr=Ir;var Sn=JSON.stringify(Dn);Hn!==Sn&&ne.push(Ir),ae===0&&(Hn=Sn)})}function Me(_e){return!!$.selectedPaths&&$.selectedPaths.indexOf(_e)!==-1}return pt===b.POINT?ne.push(sr(Zt,yt,F,Me(F))):pt===b.POLYGON?yt.forEach(function(_e,or){me(_e,F!==null?F+"."+or:String(or))}):pt===b.LINE_STRING?me(yt,F):pt.indexOf(b.MULTI_PREFIX)===0&&(q=pt.replace(b.MULTI_PREFIX,""),yt.forEach(function(_e,or){var Hn={type:b.FEATURE,properties:k.properties,geometry:{type:q,coordinates:_e}};ne=ne.concat(C1(Hn,$,or))})),ne}var mt={enable:function(k){setTimeout(function(){k.map&&k.map.doubleClickZoom&&k._ctx&&k._ctx.store&&k._ctx.store.getInitialConfigValue&&k._ctx.store.getInitialConfigValue("doubleClickZoom")&&k.map.doubleClickZoom.enable()},0)},disable:function(k){setTimeout(function(){k.map&&k.map.doubleClickZoom&&k.map.doubleClickZoom.disable()},0)}},nt={exports:{}},st=function(k){if(!k||!k.type)return null;var $=ht[k.type];if(!$)return null;if($==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:k}]};if($==="feature")return{type:"FeatureCollection",features:[k]};if($==="featurecollection")return k},ht={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"},gt=n(st),St=Object.freeze({__proto__:null,default:function k($){switch($&&$.type||null){case"FeatureCollection":return $.features=$.features.reduce(function(F,q){return F.concat(k(q))},[]),$;case"Feature":return $.geometry?k($.geometry).map(function(F){var q={type:"Feature",properties:JSON.parse(JSON.stringify($.properties)),geometry:F};return $.id!==void 0&&(q.id=$.id),q}):[$];case"MultiPoint":return $.coordinates.map(function(F){return{type:"Point",coordinates:F}});case"MultiPolygon":return $.coordinates.map(function(F){return{type:"Polygon",coordinates:F}});case"MultiLineString":return $.coordinates.map(function(F){return{type:"LineString",coordinates:F}});case"GeometryCollection":return $.geometries.map(k).reduce(function(F,q){return F.concat(q)},[]);case"Point":case"Polygon":case"LineString":return[$]}}}),Ct=st,Ot=i(St),Et=function(k){return function $(F){return Array.isArray(F)&&F.length&&typeof F[0]=="number"?[F]:F.reduce(function(q,it){return Array.isArray(it)&&Array.isArray(it[0])?q.concat($(it)):(q.push(it),q)},[])}(k)};Ot instanceof Function||(Ot=Ot.default);var Rt={exports:{}},oe=Rt.exports=function(k){return new Kt(k)};function Kt(k){this.value=k}function re(k,$,F){var q=[],it=[],pt=!0;return function yt(Zt){var ne=F?Vt(Zt):Zt,me={},Me=!0,_e={node:ne,node_:Zt,path:[].concat(q),parent:it[it.length-1],parents:it,key:q.slice(-1)[0],isRoot:q.length===0,level:q.length,circular:null,update:function(Mr,Dn){_e.isRoot||(_e.parent.node[_e.key]=Mr),_e.node=Mr,Dn&&(Me=!1)},delete:function(Mr){delete _e.parent.node[_e.key],Mr&&(Me=!1)},remove:function(Mr){rr(_e.parent.node)?_e.parent.node.splice(_e.key,1):delete _e.parent.node[_e.key],Mr&&(Me=!1)},keys:null,before:function(Mr){me.before=Mr},after:function(Mr){me.after=Mr},pre:function(Mr){me.pre=Mr},post:function(Mr){me.post=Mr},stop:function(){pt=!1},block:function(){Me=!1}};if(!pt)return _e;function or(){if(typeof _e.node=="object"&&_e.node!==null){_e.keys&&_e.node_===_e.node||(_e.keys=Jt(_e.node)),_e.isLeaf=_e.keys.length==0;for(var Mr=0;Mr<it.length;Mr++)if(it[Mr].node_===Zt){_e.circular=it[Mr];break}}else _e.isLeaf=!0,_e.keys=null;_e.notLeaf=!_e.isLeaf,_e.notRoot=!_e.isRoot}or();var Hn=$.call(_e,_e.node);return Hn!==void 0&&_e.update&&_e.update(Hn),me.before&&me.before.call(_e,_e.node),Me&&(typeof _e.node!="object"||_e.node===null||_e.circular||(it.push(_e),or(),tr(_e.keys,function(Mr,Dn){q.push(Mr),me.pre&&me.pre.call(_e,_e.node[Mr],Mr);var ae=yt(_e.node[Mr]);F&&Dr.call(_e.node,Mr)&&(_e.node[Mr]=ae.node),ae.isLast=Dn==_e.keys.length-1,ae.isFirst=Dn==0,me.post&&me.post.call(_e,ae),q.pop()}),it.pop()),me.after&&me.after.call(_e,_e.node)),_e}(k).node}function Vt(k){if(typeof k=="object"&&k!==null){var $;if(rr(k))$=[];else if(we(k)==="[object Date]")$=new Date(k.getTime?k.getTime():k);else if(function(it){return we(it)==="[object RegExp]"}(k))$=new RegExp(k);else if(function(it){return we(it)==="[object Error]"}(k))$={message:k.message};else if(function(it){return we(it)==="[object Boolean]"}(k))$=new Boolean(k);else if(function(it){return we(it)==="[object Number]"}(k))$=new Number(k);else if(function(it){return we(it)==="[object String]"}(k))$=new String(k);else if(Object.create&&Object.getPrototypeOf)$=Object.create(Object.getPrototypeOf(k));else if(k.constructor===Object)$={};else{var F=k.constructor&&k.constructor.prototype||k.__proto__||{},q=function(){};q.prototype=F,$=new q}return tr(Jt(k),function(it){$[it]=k[it]}),$}return k}Kt.prototype.get=function(k){for(var $=this.value,F=0;F<k.length;F++){var q=k[F];if(!$||!Dr.call($,q)){$=void 0;break}$=$[q]}return $},Kt.prototype.has=function(k){for(var $=this.value,F=0;F<k.length;F++){var q=k[F];if(!$||!Dr.call($,q))return!1;$=$[q]}return!0},Kt.prototype.set=function(k,$){for(var F=this.value,q=0;q<k.length-1;q++){var it=k[q];Dr.call(F,it)||(F[it]={}),F=F[it]}return F[k[q]]=$,$},Kt.prototype.map=function(k){return re(this.value,k,!0)},Kt.prototype.forEach=function(k){return this.value=re(this.value,k,!1),this.value},Kt.prototype.reduce=function(k,$){var F=arguments.length===1,q=F?this.value:$;return this.forEach(function(it){this.isRoot&&F||(q=k.call(this,q,it))}),q},Kt.prototype.paths=function(){var k=[];return this.forEach(function($){k.push(this.path)}),k},Kt.prototype.nodes=function(){var k=[];return this.forEach(function($){k.push(this.node)}),k},Kt.prototype.clone=function(){var k=[],$=[];return function F(q){for(var it=0;it<k.length;it++)if(k[it]===q)return $[it];if(typeof q=="object"&&q!==null){var pt=Vt(q);return k.push(q),$.push(pt),tr(Jt(q),function(yt){pt[yt]=F(q[yt])}),k.pop(),$.pop(),pt}return q}(this.value)};var Jt=Object.keys||function(k){var $=[];for(var F in k)$.push(F);return $};function we(k){return Object.prototype.toString.call(k)}var rr=Array.isArray||function(k){return Object.prototype.toString.call(k)==="[object Array]"},tr=function(k,$){if(k.forEach)return k.forEach($);for(var F=0;F<k.length;F++)$(k[F],F,k)};tr(Jt(Kt.prototype),function(k){oe[k]=function($){var F=[].slice.call(arguments,1),q=new Kt($);return q[k].apply(q,F)}});var Dr=Object.hasOwnProperty||function(k,$){return $ in k},Gr=Rt.exports,en=Ze;function Ze(k){if(!(this instanceof Ze))return new Ze(k);this._bbox=k||[1/0,1/0,-1/0,-1/0],this._valid=!!k}Ze.prototype.include=function(k){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],k[0]),this._bbox[1]=Math.min(this._bbox[1],k[1]),this._bbox[2]=Math.max(this._bbox[2],k[0]),this._bbox[3]=Math.max(this._bbox[3],k[1]),this},Ze.prototype.equals=function(k){var $;return $=k instanceof Ze?k.bbox():k,this._bbox[0]==$[0]&&this._bbox[1]==$[1]&&this._bbox[2]==$[2]&&this._bbox[3]==$[3]},Ze.prototype.center=function(k){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Ze.prototype.union=function(k){var $;return this._valid=!0,$=k instanceof Ze?k.bbox():k,this._bbox[0]=Math.min(this._bbox[0],$[0]),this._bbox[1]=Math.min(this._bbox[1],$[1]),this._bbox[2]=Math.max(this._bbox[2],$[2]),this._bbox[3]=Math.max(this._bbox[3],$[3]),this},Ze.prototype.bbox=function(){return this._valid?this._bbox:null},Ze.prototype.contains=function(k){if(!k)return this._fastContains();if(!this._valid)return null;var $=k[0],F=k[1];return this._bbox[0]<=$&&this._bbox[1]<=F&&this._bbox[2]>=$&&this._bbox[3]>=F},Ze.prototype.intersect=function(k){return this._valid?($=k instanceof Ze?k.bbox():k,!(this._bbox[0]>$[2]||this._bbox[2]<$[0]||this._bbox[3]<$[1]||this._bbox[1]>$[3])):null;var $},Ze.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var k="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",k)},Ze.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var Xr=function(k){if(!k)return[];var $=Ot(Ct(k)),F=[];return $.features.forEach(function(q){q.geometry&&(F=F.concat(Et(q.geometry.coordinates)))}),F},En=Gr,c1=en,qn={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},y1=Object.keys(qn);function A1(k){for(var $=c1(),F=Xr(k),q=0;q<F.length;q++)$.include(F[q]);return $}nt.exports=function(k){return A1(k).bbox()},nt.exports.polygon=function(k){return A1(k).polygon()},nt.exports.bboxify=function(k){return En(k).map(function($){$&&y1.some(function(F){return!!$[F]&&qn[F].indexOf($.type)!==-1})&&($.bbox=A1($).bbox(),this.update($))})};var X3=n(nt.exports),Uo=-90;function Er(k,$){var F=Uo,q=90,it=Uo,pt=90,yt=270,Zt=-270;k.forEach(function(me){var Me=X3(me),_e=Me[1],or=Me[3],Hn=Me[0],Mr=Me[2];_e>F&&(F=_e),or<q&&(q=or),or>it&&(it=or),_e<pt&&(pt=_e),Hn<yt&&(yt=Hn),Mr>Zt&&(Zt=Mr)});var ne=$;return F+ne.lat>85&&(ne.lat=85-F),it+ne.lat>90&&(ne.lat=90-it),q+ne.lat<-85&&(ne.lat=-85-q),pt+ne.lat<Uo&&(ne.lat=Uo-pt),yt+ne.lng<=-270&&(ne.lng+=360*Math.ceil(Math.abs(ne.lng)/360)),Zt+ne.lng>=270&&(ne.lng-=360*Math.ceil(Math.abs(ne.lng)/360)),ne}function Ni(k,$){var F=Er(k.map(function(q){return q.toGeoJSON()}),$);k.forEach(function(q){var it,pt=q.getCoordinates(),yt=function(ne){var me={lng:ne[0]+F.lng,lat:ne[1]+F.lat};return[me.lng,me.lat]},Zt=function(ne){return ne.map(function(me){return yt(me)})};q.type===b.POINT?it=yt(pt):q.type===b.LINE_STRING||q.type===b.MULTI_POINT?it=pt.map(yt):q.type===b.POLYGON||q.type===b.MULTI_LINE_STRING?it=pt.map(Zt):q.type===b.MULTI_POLYGON&&(it=pt.map(function(ne){return ne.map(function(me){return Zt(me)})})),q.incomingCoords(it)})}var sn={onSetup:function(k){var $=this,F={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:k.featureIds||[]};return this.setSelected(F.initiallySelectedFeatureIds.filter(function(q){return $.getFeature(q)!==void 0})),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),F},fireUpdate:function(){this.map.fire(E.UPDATE,{action:V.MOVE,features:this.getSelected().map(function(k){return k.toGeoJSON()})})},fireActionable:function(){var k=this,$=this.getSelected(),F=$.filter(function(Zt){return k.isInstanceOf("MultiFeature",Zt)}),q=!1;if($.length>1){q=!0;var it=$[0].type.replace("Multi","");$.forEach(function(Zt){Zt.type.replace("Multi","")!==it&&(q=!1)})}var pt=F.length>0,yt=$.length>0;this.setActionableState({combineFeatures:q,uncombineFeatures:pt,trash:yt})},getUniqueIds:function(k){return k.length?k.map(function($){return $.properties.id}).filter(function($){return $!==void 0}).reduce(function($,F){return $.add(F),$},new Tt).values():[]},stopExtendedInteractions:function(k){k.boxSelectElement&&(k.boxSelectElement.parentNode&&k.boxSelectElement.parentNode.removeChild(k.boxSelectElement),k.boxSelectElement=null),this.map.dragPan.enable(),k.boxSelecting=!1,k.canBoxSelect=!1,k.dragMoving=!1,k.canDragMove=!1},onStop:function(){mt.enable(this)},onMouseMove:function(k,$){return Qe($)&&k.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(k),!0},onMouseOut:function(k){return!k.dragMoving||this.fireUpdate()}};sn.onTap=sn.onClick=function(k,$){return $n($)?this.clickAnywhere(k,$):wn(O.VERTEX)($)?this.clickOnVertex(k,$):Qe($)?this.clickOnFeature(k,$):void 0},sn.clickAnywhere=function(k){var $=this,F=this.getSelectedIds();F.length&&(this.clearSelectedFeatures(),F.forEach(function(q){return $.doRender(q)})),mt.enable(this),this.stopExtendedInteractions(k)},sn.clickOnVertex=function(k,$){this.changeMode(M.DIRECT_SELECT,{featureId:$.featureTarget.properties.parent,coordPath:$.featureTarget.properties.coord_path,startPos:$.lngLat}),this.updateUIClasses({mouse:_.MOVE})},sn.startOnActiveFeature=function(k,$){this.stopExtendedInteractions(k),this.map.dragPan.disable(),this.doRender($.featureTarget.properties.id),k.canDragMove=!0,k.dragMoveLocation=$.lngLat},sn.clickOnFeature=function(k,$){var F=this;mt.disable(this),this.stopExtendedInteractions(k);var q=Tn($),it=this.getSelectedIds(),pt=$.featureTarget.properties.id,yt=this.isSelected(pt);if(!q&&yt&&this.getFeature(pt).type!==b.POINT)return this.changeMode(M.DIRECT_SELECT,{featureId:pt});yt&&q?(this.deselect(pt),this.updateUIClasses({mouse:_.POINTER}),it.length===1&&mt.enable(this)):!yt&&q?(this.select(pt),this.updateUIClasses({mouse:_.MOVE})):yt||q||(it.forEach(function(Zt){return F.doRender(Zt)}),this.setSelected(pt),this.updateUIClasses({mouse:_.MOVE})),this.doRender(pt)},sn.onMouseDown=function(k,$){return cr($)?this.startOnActiveFeature(k,$):this.drawConfig.boxSelect&&ye($)?this.startBoxSelect(k,$):void 0},sn.startBoxSelect=function(k,$){this.stopExtendedInteractions(k),this.map.dragPan.disable(),k.boxSelectStartLocation=n1($.originalEvent,this.map.getContainer()),k.canBoxSelect=!0},sn.onTouchStart=function(k,$){if(cr($))return this.startOnActiveFeature(k,$)},sn.onDrag=function(k,$){return k.canDragMove?this.dragMove(k,$):this.drawConfig.boxSelect&&k.canBoxSelect?this.whileBoxSelect(k,$):void 0},sn.whileBoxSelect=function(k,$){k.boxSelecting=!0,this.updateUIClasses({mouse:_.ADD}),k.boxSelectElement||(k.boxSelectElement=document.createElement("div"),k.boxSelectElement.classList.add(Q.BOX_SELECT),this.map.getContainer().appendChild(k.boxSelectElement));var F=n1($.originalEvent,this.map.getContainer()),q=Math.min(k.boxSelectStartLocation.x,F.x),it=Math.max(k.boxSelectStartLocation.x,F.x),pt=Math.min(k.boxSelectStartLocation.y,F.y),yt=Math.max(k.boxSelectStartLocation.y,F.y),Zt="translate("+q+"px, "+pt+"px)";k.boxSelectElement.style.transform=Zt,k.boxSelectElement.style.WebkitTransform=Zt,k.boxSelectElement.style.width=it-q+"px",k.boxSelectElement.style.height=yt-pt+"px"},sn.dragMove=function(k,$){k.dragMoving=!0,$.originalEvent.stopPropagation();var F={lng:$.lngLat.lng-k.dragMoveLocation.lng,lat:$.lngLat.lat-k.dragMoveLocation.lat};Ni(this.getSelected(),F),k.dragMoveLocation=$.lngLat},sn.onTouchEnd=sn.onMouseUp=function(k,$){var F=this;if(k.dragMoving)this.fireUpdate();else if(k.boxSelecting){var q=[k.boxSelectStartLocation,n1($.originalEvent,this.map.getContainer())],it=this.featuresAt(null,q,"click"),pt=this.getUniqueIds(it).filter(function(yt){return!F.isSelected(yt)});pt.length&&(this.select(pt),pt.forEach(function(yt){return F.doRender(yt)}),this.updateUIClasses({mouse:_.MOVE}))}this.stopExtendedInteractions(k)},sn.toDisplayFeatures=function(k,$,F){$.properties.active=this.isSelected($.properties.id)?R.ACTIVE:R.INACTIVE,F($),this.fireActionable(),$.properties.active===R.ACTIVE&&$.geometry.type!==b.POINT&&C1($).forEach(F)},sn.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},sn.onCombineFeatures=function(){var k=this.getSelected();if(!(k.length===0||k.length<2)){for(var $=[],F=[],q=k[0].type.replace("Multi",""),it=0;it<k.length;it++){var pt=k[it];if(pt.type.replace("Multi","")!==q)return;pt.type.includes("Multi")?pt.getCoordinates().forEach(function(Zt){$.push(Zt)}):$.push(pt.getCoordinates()),F.push(pt.toGeoJSON())}if(F.length>1){var yt=this.newFeature({type:b.FEATURE,properties:F[0].properties,geometry:{type:"Multi"+q,coordinates:$}});this.addFeature(yt),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([yt.id]),this.map.fire(E.COMBINE_FEATURES,{createdFeatures:[yt.toGeoJSON()],deletedFeatures:F})}this.fireActionable()}},sn.onUncombineFeatures=function(){var k=this,$=this.getSelected();if($.length!==0){for(var F=[],q=[],it=function(yt){var Zt=$[yt];k.isInstanceOf("MultiFeature",Zt)&&(Zt.getFeatures().forEach(function(ne){k.addFeature(ne),ne.properties=Zt.properties,F.push(ne.toGeoJSON()),k.select([ne.id])}),k.deleteFeature(Zt.id,{silent:!0}),q.push(Zt.toGeoJSON()))},pt=0;pt<$.length;pt++)it(pt);F.length>1&&this.map.fire(E.UNCOMBINE_FEATURES,{createdFeatures:F,deletedFeatures:q}),this.fireActionable()}};var Mn=wn(O.VERTEX),u1=wn(O.MIDPOINT),h1={fireUpdate:function(){this.map.fire(E.UPDATE,{action:V.CHANGE_COORDINATES,features:this.getSelected().map(function(k){return k.toGeoJSON()})})},fireActionable:function(k){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:k.selectedCoordPaths.length>0})},startDragging:function(k,$){this.map.dragPan.disable(),k.canDragMove=!0,k.dragMoveLocation=$.lngLat},stopDragging:function(k){this.map.dragPan.enable(),k.dragMoving=!1,k.canDragMove=!1,k.dragMoveLocation=null},onVertex:function(k,$){this.startDragging(k,$);var F=$.featureTarget.properties,q=k.selectedCoordPaths.indexOf(F.coord_path);Tn($)||q!==-1?Tn($)&&q===-1&&k.selectedCoordPaths.push(F.coord_path):k.selectedCoordPaths=[F.coord_path];var it=this.pathsToCoordinates(k.featureId,k.selectedCoordPaths);this.setSelectedCoordinates(it)},onMidpoint:function(k,$){this.startDragging(k,$);var F=$.featureTarget.properties;k.feature.addCoordinate(F.coord_path,F.lng,F.lat),this.fireUpdate(),k.selectedCoordPaths=[F.coord_path]},pathsToCoordinates:function(k,$){return $.map(function(F){return{feature_id:k,coord_path:F}})},onFeature:function(k,$){k.selectedCoordPaths.length===0?this.startDragging(k,$):this.stopDragging(k)},dragFeature:function(k,$,F){Ni(this.getSelected(),F),k.dragMoveLocation=$.lngLat},dragVertex:function(k,$,F){for(var q=k.selectedCoordPaths.map(function(Zt){return k.feature.getCoordinate(Zt)}),it=Er(q.map(function(Zt){return{type:b.FEATURE,properties:{},geometry:{type:b.POINT,coordinates:Zt}}}),F),pt=0;pt<q.length;pt++){var yt=q[pt];k.feature.updateCoordinate(k.selectedCoordPaths[pt],yt[0]+it.lng,yt[1]+it.lat)}},clickNoTarget:function(){this.changeMode(M.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(M.SIMPLE_SELECT)},clickActiveFeature:function(k){k.selectedCoordPaths=[],this.clearSelectedCoordinates(),k.feature.changed()},onSetup:function(k){var $=k.featureId,F=this.getFeature($);if(!F)throw new Error("You must provide a featureId to enter direct_select mode");if(F.type===b.POINT)throw new TypeError("direct_select mode doesn't handle point features");var q={featureId:$,feature:F,dragMoveLocation:k.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:k.coordPath?[k.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates($,q.selectedCoordPaths)),this.setSelected($),mt.disable(this),this.setActionableState({trash:!0}),q},onStop:function(){mt.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(k,$,F){k.featureId===$.properties.id?($.properties.active=R.ACTIVE,F($),C1($,{map:this.map,midpoints:!0,selectedPaths:k.selectedCoordPaths}).forEach(F)):($.properties.active=R.INACTIVE,F($)),this.fireActionable(k)},onTrash:function(k){k.selectedCoordPaths.sort(function($,F){return F.localeCompare($,"en",{numeric:!0})}).forEach(function($){return k.feature.removeCoordinate($)}),this.fireUpdate(),k.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(k),k.feature.isValid()===!1&&(this.deleteFeature([k.featureId]),this.changeMode(M.SIMPLE_SELECT,{}))},onMouseMove:function(k,$){var F=cr($),q=Mn($),it=u1($),pt=k.selectedCoordPaths.length===0;return F&&pt||q&&!pt?this.updateUIClasses({mouse:_.MOVE}):this.updateUIClasses({mouse:_.NONE}),(q||F||it)&&k.dragMoving&&this.fireUpdate(),this.stopDragging(k),!0},onMouseOut:function(k){return k.dragMoving&&this.fireUpdate(),!0}};h1.onTouchStart=h1.onMouseDown=function(k,$){return Mn($)?this.onVertex(k,$):cr($)?this.onFeature(k,$):u1($)?this.onMidpoint(k,$):void 0},h1.onDrag=function(k,$){if(k.canDragMove===!0){k.dragMoving=!0,$.originalEvent.stopPropagation();var F={lng:$.lngLat.lng-k.dragMoveLocation.lng,lat:$.lngLat.lat-k.dragMoveLocation.lat};k.selectedCoordPaths.length>0?this.dragVertex(k,$,F):this.dragFeature(k,$,F),k.dragMoveLocation=$.lngLat}},h1.onClick=function(k,$){return $n($)?this.clickNoTarget(k,$):cr($)?this.clickActiveFeature(k,$):Wr($)?this.clickInactive(k,$):void this.stopDragging(k)},h1.onTap=function(k,$){return $n($)?this.clickNoTarget(k,$):cr($)?this.clickActiveFeature(k,$):Wr($)?this.clickInactive(k,$):void 0},h1.onTouchEnd=h1.onMouseUp=function(k){k.dragMoving&&this.fireUpdate(),this.stopDragging(k)};var $r={};function w1(k,$){return!!k.lngLat&&k.lngLat.lng===$[0]&&k.lngLat.lat===$[1]}$r.onSetup=function(){var k=this.newFeature({type:b.FEATURE,properties:{},geometry:{type:b.POINT,coordinates:[]}});return this.addFeature(k),this.clearSelectedFeatures(),this.updateUIClasses({mouse:_.ADD}),this.activateUIButton(v.POINT),this.setActionableState({trash:!0}),{point:k}},$r.stopDrawingAndRemove=function(k){this.deleteFeature([k.point.id],{silent:!0}),this.changeMode(M.SIMPLE_SELECT)},$r.onTap=$r.onClick=function(k,$){this.updateUIClasses({mouse:_.MOVE}),k.point.updateCoordinate("",$.lngLat.lng,$.lngLat.lat),this.map.fire(E.CREATE,{features:[k.point.toGeoJSON()]}),this.changeMode(M.SIMPLE_SELECT,{featureIds:[k.point.id]})},$r.onStop=function(k){this.activateUIButton(),k.point.getCoordinate().length||this.deleteFeature([k.point.id],{silent:!0})},$r.toDisplayFeatures=function(k,$,F){var q=$.properties.id===k.point.id;if($.properties.active=q?R.ACTIVE:R.INACTIVE,!q)return F($)},$r.onTrash=$r.stopDrawingAndRemove,$r.onKeyUp=function(k,$){if(ci($)||ui($))return this.stopDrawingAndRemove(k,$)};var io={onSetup:function(){var k=this.newFeature({type:b.FEATURE,properties:{},geometry:{type:b.POLYGON,coordinates:[[]]}});return this.addFeature(k),this.clearSelectedFeatures(),mt.disable(this),this.updateUIClasses({mouse:_.ADD}),this.activateUIButton(v.POLYGON),this.setActionableState({trash:!0}),{polygon:k,currentVertexPosition:0}},clickAnywhere:function(k,$){if(k.currentVertexPosition>0&&w1($,k.polygon.coordinates[0][k.currentVertexPosition-1]))return this.changeMode(M.SIMPLE_SELECT,{featureIds:[k.polygon.id]});this.updateUIClasses({mouse:_.ADD}),k.polygon.updateCoordinate("0."+k.currentVertexPosition,$.lngLat.lng,$.lngLat.lat),k.currentVertexPosition++,k.polygon.updateCoordinate("0."+k.currentVertexPosition,$.lngLat.lng,$.lngLat.lat)},clickOnVertex:function(k){return this.changeMode(M.SIMPLE_SELECT,{featureIds:[k.polygon.id]})},onMouseMove:function(k,$){k.polygon.updateCoordinate("0."+k.currentVertexPosition,$.lngLat.lng,$.lngLat.lat),Bn($)&&this.updateUIClasses({mouse:_.POINTER})}};io.onTap=io.onClick=function(k,$){return Bn($)?this.clickOnVertex(k,$):this.clickAnywhere(k,$)},io.onKeyUp=function(k,$){ci($)?(this.deleteFeature([k.polygon.id],{silent:!0}),this.changeMode(M.SIMPLE_SELECT)):ui($)&&this.changeMode(M.SIMPLE_SELECT,{featureIds:[k.polygon.id]})},io.onStop=function(k){this.updateUIClasses({mouse:_.NONE}),mt.enable(this),this.activateUIButton(),this.getFeature(k.polygon.id)!==void 0&&(k.polygon.removeCoordinate("0."+k.currentVertexPosition),k.polygon.isValid()?this.map.fire(E.CREATE,{features:[k.polygon.toGeoJSON()]}):(this.deleteFeature([k.polygon.id],{silent:!0}),this.changeMode(M.SIMPLE_SELECT,{},{silent:!0})))},io.toDisplayFeatures=function(k,$,F){var q=$.properties.id===k.polygon.id;if($.properties.active=q?R.ACTIVE:R.INACTIVE,!q)return F($);if($.geometry.coordinates.length!==0){var it=$.geometry.coordinates[0].length;if(!(it<3)){if($.properties.meta=O.FEATURE,F(sr(k.polygon.id,$.geometry.coordinates[0][0],"0.0",!1)),it>3){var pt=$.geometry.coordinates[0].length-3;F(sr(k.polygon.id,$.geometry.coordinates[0][pt],"0."+pt,!1))}if(it<=4){var yt=[[$.geometry.coordinates[0][0][0],$.geometry.coordinates[0][0][1]],[$.geometry.coordinates[0][1][0],$.geometry.coordinates[0][1][1]]];if(F({type:b.FEATURE,properties:$.properties,geometry:{coordinates:yt,type:b.LINE_STRING}}),it===3)return}return F($)}}},io.onTrash=function(k){this.deleteFeature([k.polygon.id],{silent:!0}),this.changeMode(M.SIMPLE_SELECT)};var _1={onSetup:function(k){var $,F,q=(k=k||{}).featureId,it="forward";if(q){if(!($=this.getFeature(q)))throw new Error("Could not find a feature with the provided featureId");var pt=k.from;if(pt&&pt.type==="Feature"&&pt.geometry&&pt.geometry.type==="Point"&&(pt=pt.geometry),pt&&pt.type==="Point"&&pt.coordinates&&pt.coordinates.length===2&&(pt=pt.coordinates),!pt||!Array.isArray(pt))throw new Error("Please use the `from` property to indicate which point to continue the line from");var yt=$.coordinates.length-1;if($.coordinates[yt][0]===pt[0]&&$.coordinates[yt][1]===pt[1])F=yt+1,$.addCoordinate.apply($,[F].concat($.coordinates[yt]));else{if($.coordinates[0][0]!==pt[0]||$.coordinates[0][1]!==pt[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");it="backwards",F=0,$.addCoordinate.apply($,[F].concat($.coordinates[0]))}}else $=this.newFeature({type:b.FEATURE,properties:{},geometry:{type:b.LINE_STRING,coordinates:[]}}),F=0,this.addFeature($);return this.clearSelectedFeatures(),mt.disable(this),this.updateUIClasses({mouse:_.ADD}),this.activateUIButton(v.LINE),this.setActionableState({trash:!0}),{line:$,currentVertexPosition:F,direction:it}},clickAnywhere:function(k,$){if(k.currentVertexPosition>0&&w1($,k.line.coordinates[k.currentVertexPosition-1])||k.direction==="backwards"&&w1($,k.line.coordinates[k.currentVertexPosition+1]))return this.changeMode(M.SIMPLE_SELECT,{featureIds:[k.line.id]});this.updateUIClasses({mouse:_.ADD}),k.line.updateCoordinate(k.currentVertexPosition,$.lngLat.lng,$.lngLat.lat),k.direction==="forward"?(k.currentVertexPosition++,k.line.updateCoordinate(k.currentVertexPosition,$.lngLat.lng,$.lngLat.lat)):k.line.addCoordinate(0,$.lngLat.lng,$.lngLat.lat)},clickOnVertex:function(k){return this.changeMode(M.SIMPLE_SELECT,{featureIds:[k.line.id]})},onMouseMove:function(k,$){k.line.updateCoordinate(k.currentVertexPosition,$.lngLat.lng,$.lngLat.lat),Bn($)&&this.updateUIClasses({mouse:_.POINTER})}};_1.onTap=_1.onClick=function(k,$){if(Bn($))return this.clickOnVertex(k,$);this.clickAnywhere(k,$)},_1.onKeyUp=function(k,$){ui($)?this.changeMode(M.SIMPLE_SELECT,{featureIds:[k.line.id]}):ci($)&&(this.deleteFeature([k.line.id],{silent:!0}),this.changeMode(M.SIMPLE_SELECT))},_1.onStop=function(k){mt.enable(this),this.activateUIButton(),this.getFeature(k.line.id)!==void 0&&(k.line.removeCoordinate(""+k.currentVertexPosition),k.line.isValid()?this.map.fire(E.CREATE,{features:[k.line.toGeoJSON()]}):(this.deleteFeature([k.line.id],{silent:!0}),this.changeMode(M.SIMPLE_SELECT,{},{silent:!0})))},_1.onTrash=function(k){this.deleteFeature([k.line.id],{silent:!0}),this.changeMode(M.SIMPLE_SELECT)},_1.toDisplayFeatures=function(k,$,F){var q=$.properties.id===k.line.id;if($.properties.active=q?R.ACTIVE:R.INACTIVE,!q)return F($);$.geometry.coordinates.length<2||($.properties.meta=O.FEATURE,F(sr(k.line.id,$.geometry.coordinates[k.direction==="forward"?$.geometry.coordinates.length-2:1],""+(k.direction==="forward"?$.geometry.coordinates.length-2:1),!1)),F($))};var Jr={simple_select:sn,direct_select:h1,draw_point:$r,draw_polygon:io,draw_line_string:_1},vo={defaultMode:M.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:S1,modes:Jr,controls:{},userProperties:!1},oo={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},gn={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function Bi(k,$){return k.map(function(F){return F.source?F:We(F,{id:F.id+"."+$,source:$==="hot"?m.HOT:m.COLD})})}var V1={exports:{}};(function(k,$){var F="__lodash_hash_undefined__",q=9007199254740991,it="[object Arguments]",pt="[object Array]",yt="[object Boolean]",Zt="[object Date]",ne="[object Error]",me="[object Function]",Me="[object Map]",_e="[object Number]",or="[object Object]",Hn="[object Promise]",Mr="[object RegExp]",Dn="[object Set]",ae="[object String]",Ye="[object Symbol]",Ir="[object WeakMap]",Wn="[object ArrayBuffer]",Sn="[object DataView]",X2=/^\[object .+?Constructor\]$/,K3=/^(?:0|[1-9]\d*)$/,ln={};ln["[object Float32Array]"]=ln["[object Float64Array]"]=ln["[object Int8Array]"]=ln["[object Int16Array]"]=ln["[object Int32Array]"]=ln["[object Uint8Array]"]=ln["[object Uint8ClampedArray]"]=ln["[object Uint16Array]"]=ln["[object Uint32Array]"]=!0,ln[it]=ln[pt]=ln[Wn]=ln[yt]=ln[Sn]=ln[Zt]=ln[ne]=ln[me]=ln[Me]=ln[_e]=ln[or]=ln[Mr]=ln[Dn]=ln[ae]=ln[Ir]=!1;var K2=typeof P=="object"&&P&&P.Object===Object&&P,uc=typeof self=="object"&&self&&self.Object===Object&&self,Zo=K2||uc||Function("return this")(),w6=$&&!$.nodeType&&$,S0=w6&&k&&!k.nodeType&&k,y2=S0&&S0.exports===w6,Ua=y2&&K2.process,hi=function(){try{return Ua&&Ua.binding&&Ua.binding("util")}catch{}}(),U1=hi&&hi.isTypedArray;function Ga(It,te){for(var He=-1,nr=It==null?0:It.length;++He<nr;)if(te(It[He],He,It))return!0;return!1}function qr(It){var te=-1,He=Array(It.size);return It.forEach(function(nr,un){He[++te]=[un,nr]}),He}function Y3(It){var te=-1,He=Array(It.size);return It.forEach(function(nr){He[++te]=nr}),He}var J3,t4,Us,E6=Array.prototype,M6=Function.prototype,Y2=Object.prototype,e4=Zo["__core-js_shared__"],H6=M6.toString,ei=Y2.hasOwnProperty,C0=(J3=/[^.]+$/.exec(e4&&e4.keys&&e4.keys.IE_PROTO||""))?"Symbol(src)_1."+J3:"",A0=Y2.toString,hc=RegExp("^"+H6.call(ei).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V0=y2?Zo.Buffer:void 0,r4=Zo.Symbol,O0=Zo.Uint8Array,n4=Y2.propertyIsEnumerable,i4=E6.splice,$o=r4?r4.toStringTag:void 0,o4=Object.getOwnPropertySymbols,Za=V0?V0.isBuffer:void 0,k0=(t4=Object.keys,Us=Object,function(It){return t4(Us(It))}),a4=na(Zo,"DataView"),J2=na(Zo,"Map"),qo=na(Zo,"Promise"),s4=na(Zo,"Set"),_2=na(Zo,"WeakMap"),xo=na(Object,"create"),P0=b2(a4),S6=b2(J2),Kr=b2(qo),$a=b2(s4),dc=b2(_2),C6=r4?r4.prototype:void 0,ta=C6?C6.valueOf:void 0;function ea(It){var te=-1,He=It==null?0:It.length;for(this.clear();++te<He;){var nr=It[te];this.set(nr[0],nr[1])}}function cn(It){var te=-1,He=It==null?0:It.length;for(this.clear();++te<He;){var nr=It[te];this.set(nr[0],nr[1])}}function v2(It){var te=-1,He=It==null?0:It.length;for(this.clear();++te<He;){var nr=It[te];this.set(nr[0],nr[1])}}function Rr(It){var te=-1,He=It==null?0:It.length;for(this.__data__=new v2;++te<He;)this.add(It[te])}function Di(It){var te=this.__data__=new cn(It);this.size=te.size}function fn(It,te){var He=qa(It),nr=!He&&h4(It),un=!He&&!nr&&I6(It),Fr=!He&&!nr&&!un&&ia(It),Cn=He||nr||un||Fr,Xn=Cn?function(p1,ao){for(var Eo=-1,G1=Array(p1);++Eo<p1;)G1[Eo]=ao(Eo);return G1}(It.length,String):[],wi=Xn.length;for(var pn in It)!ei.call(It,pn)||Cn&&(pn=="length"||un&&(pn=="offset"||pn=="parent")||Fr&&(pn=="buffer"||pn=="byteLength"||pn=="byteOffset")||k6(pn,wi))||Xn.push(pn);return Xn}function nn(It,te){for(var He=It.length;He--;)if(P6(It[He][0],te))return He;return-1}function wo(It){return It==null?It===void 0?"[object Undefined]":"[object Null]":$o&&$o in Object(It)?function(te){var He=ei.call(te,$o),nr=te[$o];try{te[$o]=void 0;var un=!0}catch{}var Fr=A0.call(te);return un&&(He?te[$o]=nr:delete te[$o]),Fr}(It):function(te){return A0.call(te)}(It)}function Gs(It){return O1(It)&&wo(It)==it}function A6(It,te,He,nr,un){return It===te||(It==null||te==null||!O1(It)&&!O1(te)?It!=It&&te!=te:function(Fr,Cn,Xn,wi,pn,p1){var ao=qa(Fr),Eo=qa(Cn),G1=ao?pt:xi(Fr),Mo=Eo?pt:xi(Cn),Ho=(G1=G1==it?or:G1)==or,L2=(Mo=Mo==it?or:Mo)==or,jn=G1==Mo;if(jn&&I6(Fr)){if(!I6(Cn))return!1;ao=!0,Ho=!1}if(jn&&!Ho)return p1||(p1=new Di),ao||ia(Fr)?u4(Fr,Cn,Xn,wi,pn,p1):function(Nr,Yr,Wa,x2,Zs,Mi,k1){switch(Wa){case Sn:if(Nr.byteLength!=Yr.byteLength||Nr.byteOffset!=Yr.byteOffset)return!1;Nr=Nr.buffer,Yr=Yr.buffer;case Wn:return!(Nr.byteLength!=Yr.byteLength||!Mi(new O0(Nr),new O0(Yr)));case yt:case Zt:case _e:return P6(+Nr,+Yr);case ne:return Nr.name==Yr.name&&Nr.message==Yr.message;case Mr:case ae:return Nr==Yr+"";case Me:var ri=qr;case Dn:var Ie=1&x2;if(ri||(ri=Y3),Nr.size!=Yr.size&&!Ie)return!1;var Xa=k1.get(Nr);if(Xa)return Xa==Yr;x2|=2,k1.set(Nr,Yr);var Fi=u4(ri(Nr),ri(Yr),x2,Zs,Mi,k1);return k1.delete(Nr),Fi;case Ye:if(ta)return ta.call(Nr)==ta.call(Yr)}return!1}(Fr,Cn,G1,Xn,wi,pn,p1);if(!(1&Xn)){var So=Ho&&ei.call(Fr,"__wrapped__"),Ei=L2&&ei.call(Cn,"__wrapped__");if(So||Ei){var Co=So?Fr.value():Fr,I0=Ei?Cn.value():Cn;return p1||(p1=new Di),pn(Co,I0,Xn,wi,p1)}}return jn?(p1||(p1=new Di),function(Nr,Yr,Wa,x2,Zs,Mi){var k1=1&Wa,ri=V6(Nr),Ie=ri.length,Xa=V6(Yr).length;if(Ie!=Xa&&!k1)return!1;for(var Fi=Ie;Fi--;){var ji=ri[Fi];if(!(k1?ji in Yr:ei.call(Yr,ji)))return!1}var d4=Mi.get(Nr);if(d4&&Mi.get(Yr))return d4==Yr;var Pe=!0;Mi.set(Nr,Yr),Mi.set(Yr,Nr);for(var oa=k1;++Fi<Ie;){var aa=Nr[ji=ri[Fi]],$s=Yr[ji];if(x2)var qs=k1?x2($s,aa,ji,Yr,Nr,Mi):x2(aa,$s,ji,Nr,Yr,Mi);if(!(qs===void 0?aa===$s||Zs(aa,$s,Wa,x2,Mi):qs)){Pe=!1;break}oa||(oa=ji=="constructor")}if(Pe&&!oa){var Ka=Nr.constructor,Ya=Yr.constructor;Ka==Ya||!("constructor"in Nr)||!("constructor"in Yr)||typeof Ka=="function"&&Ka instanceof Ka&&typeof Ya=="function"&&Ya instanceof Ya||(Pe=!1)}return Mi.delete(Nr),Mi.delete(Yr),Pe}(Fr,Cn,Xn,wi,pn,p1)):!1}(It,te,He,nr,A6,un))}function l4(It){return!(!Wo(It)||function(te){return!!C0&&C0 in te}(It))&&(R6(It)?hc:X2).test(b2(It))}function c4(It){if(He=(te=It)&&te.constructor,nr=typeof He=="function"&&He.prototype||Y2,te!==nr)return k0(It);var te,He,nr,un=[];for(var Fr in Object(It))ei.call(It,Fr)&&Fr!="constructor"&&un.push(Fr);return un}function u4(It,te,He,nr,un,Fr){var Cn=1&He,Xn=It.length,wi=te.length;if(Xn!=wi&&!(Cn&&wi>Xn))return!1;var pn=Fr.get(It);if(pn&&Fr.get(te))return pn==te;var p1=-1,ao=!0,Eo=2&He?new Rr:void 0;for(Fr.set(It,te),Fr.set(te,It);++p1<Xn;){var G1=It[p1],Mo=te[p1];if(nr)var Ho=Cn?nr(Mo,G1,p1,te,It,Fr):nr(G1,Mo,p1,It,te,Fr);if(Ho!==void 0){if(Ho)continue;ao=!1;break}if(Eo){if(!Ga(te,function(L2,jn){if(So=jn,!Eo.has(So)&&(G1===L2||un(G1,L2,He,nr,Fr)))return Eo.push(jn);var So})){ao=!1;break}}else if(G1!==Mo&&!un(G1,Mo,He,nr,Fr)){ao=!1;break}}return Fr.delete(It),Fr.delete(te),ao}function V6(It){return function(te,He,nr){var un=He(te);return qa(te)?un:function(Fr,Cn){for(var Xn=-1,wi=Cn.length,pn=Fr.length;++Xn<wi;)Fr[pn+Xn]=Cn[Xn];return Fr}(un,nr(te))}(It,N6,O6)}function ra(It,te){var He,nr,un=It.__data__;return((nr=typeof(He=te))=="string"||nr=="number"||nr=="symbol"||nr=="boolean"?He!=="__proto__":He===null)?un[typeof te=="string"?"string":"hash"]:un.map}function na(It,te){var He=function(nr,un){return nr==null?void 0:nr[un]}(It,te);return l4(He)?He:void 0}ea.prototype.clear=function(){this.__data__=xo?xo(null):{},this.size=0},ea.prototype.delete=function(It){var te=this.has(It)&&delete this.__data__[It];return this.size-=te?1:0,te},ea.prototype.get=function(It){var te=this.__data__;if(xo){var He=te[It];return He===F?void 0:He}return ei.call(te,It)?te[It]:void 0},ea.prototype.has=function(It){var te=this.__data__;return xo?te[It]!==void 0:ei.call(te,It)},ea.prototype.set=function(It,te){var He=this.__data__;return this.size+=this.has(It)?0:1,He[It]=xo&&te===void 0?F:te,this},cn.prototype.clear=function(){this.__data__=[],this.size=0},cn.prototype.delete=function(It){var te=this.__data__,He=nn(te,It);return!(He<0)&&(He==te.length-1?te.pop():i4.call(te,He,1),--this.size,!0)},cn.prototype.get=function(It){var te=this.__data__,He=nn(te,It);return He<0?void 0:te[He][1]},cn.prototype.has=function(It){return nn(this.__data__,It)>-1},cn.prototype.set=function(It,te){var He=this.__data__,nr=nn(He,It);return nr<0?(++this.size,He.push([It,te])):He[nr][1]=te,this},v2.prototype.clear=function(){this.size=0,this.__data__={hash:new ea,map:new(J2||cn),string:new ea}},v2.prototype.delete=function(It){var te=ra(this,It).delete(It);return this.size-=te?1:0,te},v2.prototype.get=function(It){return ra(this,It).get(It)},v2.prototype.has=function(It){return ra(this,It).has(It)},v2.prototype.set=function(It,te){var He=ra(this,It),nr=He.size;return He.set(It,te),this.size+=He.size==nr?0:1,this},Rr.prototype.add=Rr.prototype.push=function(It){return this.__data__.set(It,F),this},Rr.prototype.has=function(It){return this.__data__.has(It)},Di.prototype.clear=function(){this.__data__=new cn,this.size=0},Di.prototype.delete=function(It){var te=this.__data__,He=te.delete(It);return this.size=te.size,He},Di.prototype.get=function(It){return this.__data__.get(It)},Di.prototype.has=function(It){return this.__data__.has(It)},Di.prototype.set=function(It,te){var He=this.__data__;if(He instanceof cn){var nr=He.__data__;if(!J2||nr.length<199)return nr.push([It,te]),this.size=++He.size,this;He=this.__data__=new v2(nr)}return He.set(It,te),this.size=He.size,this};var O6=o4?function(It){return It==null?[]:(It=Object(It),function(te,He){for(var nr=-1,un=te==null?0:te.length,Fr=0,Cn=[];++nr<un;){var Xn=te[nr];He(Xn,nr,te)&&(Cn[Fr++]=Xn)}return Cn}(o4(It),function(te){return n4.call(It,te)}))}:function(){return[]},xi=wo;function k6(It,te){return!!(te=te??q)&&(typeof It=="number"||K3.test(It))&&It>-1&&It%1==0&&It<te}function b2(It){if(It!=null){try{return H6.call(It)}catch{}try{return It+""}catch{}}return""}function P6(It,te){return It===te||It!=It&&te!=te}(a4&&xi(new a4(new ArrayBuffer(1)))!=Sn||J2&&xi(new J2)!=Me||qo&&xi(qo.resolve())!=Hn||s4&&xi(new s4)!=Dn||_2&&xi(new _2)!=Ir)&&(xi=function(It){var te=wo(It),He=te==or?It.constructor:void 0,nr=He?b2(He):"";if(nr)switch(nr){case P0:return Sn;case S6:return Me;case Kr:return Hn;case $a:return Dn;case dc:return Ir}return te});var h4=Gs(function(){return arguments}())?Gs:function(It){return O1(It)&&ei.call(It,"callee")&&!n4.call(It,"callee")},qa=Array.isArray,I6=Za||function(){return!1};function R6(It){if(!Wo(It))return!1;var te=wo(It);return te==me||te=="[object GeneratorFunction]"||te=="[object AsyncFunction]"||te=="[object Proxy]"}function Fn(It){return typeof It=="number"&&It>-1&&It%1==0&&It<=q}function Wo(It){var te=typeof It;return It!=null&&(te=="object"||te=="function")}function O1(It){return It!=null&&typeof It=="object"}var ia=U1?function(It){return function(te){return It(te)}}(U1):function(It){return O1(It)&&Fn(It.length)&&!!ln[wo(It)]};function N6(It){return(te=It)!=null&&Fn(te.length)&&!R6(te)?fn(It):c4(It);var te}k.exports=function(It,te){return A6(It,te)}})(V1,V1.exports);var bo=n(V1.exports);function d1(k,$){return k.length===$.length&&JSON.stringify(k.map(function(F){return F}).sort())===JSON.stringify($.map(function(F){return F}).sort())}var zs={Polygon:je,LineString:Ge,Point:Fe,MultiPolygon:he,MultiLineString:he,MultiPoint:he},Go=Object.freeze({__proto__:null,CommonSelectors:be,constrainFeatureMovement:Er,createMidPoint:Li,createSupplementaryPoints:C1,createVertex:sr,doubleClickZoom:mt,euclideanDistance:Ft,featuresAt:Ut,getFeatureAtAndSetCursors:ue,isClick:pe,isEventAtCoordinates:w1,isTap:lr,mapEventToBoundingBox:et,ModeHandler:r,moveFeatures:Ni,sortFeatures:ot,stringSetsAreEqual:d1,StringSet:Tt,theme:S1,toDenseArray:Ve}),Zr=function(k,$){var F={options:k=function(it){it===void 0&&(it={});var pt=We(it);return it.controls||(pt.controls={}),it.displayControlsDefault===!1?pt.controls=We(gn,it.controls):pt.controls=We(oo,it.controls),(pt=We(vo,pt)).styles=Bi(pt.styles,"cold").concat(Bi(pt.styles,"hot")),pt}(k)};$=function(it,pt){return pt.modes=M,pt.getFeatureIdsAt=function(yt){return Ut.click({point:yt},null,it).map(function(Zt){return Zt.properties.id})},pt.getSelectedIds=function(){return it.store.getSelectedIds()},pt.getSelected=function(){return{type:b.FEATURE_COLLECTION,features:it.store.getSelectedIds().map(function(yt){return it.store.get(yt)}).map(function(yt){return yt.toGeoJSON()})}},pt.getSelectedPoints=function(){return{type:b.FEATURE_COLLECTION,features:it.store.getSelectedCoordinates().map(function(yt){return{type:b.FEATURE,properties:{},geometry:{type:b.POINT,coordinates:yt.coordinates}}})}},pt.set=function(yt){if(yt.type===void 0||yt.type!==b.FEATURE_COLLECTION||!Array.isArray(yt.features))throw new Error("Invalid FeatureCollection");var Zt=it.store.createRenderBatch(),ne=it.store.getAllIds().slice(),me=pt.add(yt),Me=new Tt(me);return(ne=ne.filter(function(_e){return!Me.has(_e)})).length&&pt.delete(ne),Zt(),me},pt.add=function(yt){var Zt=JSON.parse(JSON.stringify(gt(yt))).features.map(function(ne){if(ne.id=ne.id||ge(),ne.geometry===null)throw new Error("Invalid geometry: null");if(it.store.get(ne.id)===void 0||it.store.get(ne.id).type!==ne.geometry.type){var me=zs[ne.geometry.type];if(me===void 0)throw new Error("Invalid geometry type: "+ne.geometry.type+".");var Me=new me(it,ne);it.store.add(Me)}else{var _e=it.store.get(ne.id);_e.properties=ne.properties,bo(_e.properties,ne.properties)||it.store.featureChanged(_e.id),bo(_e.getCoordinates(),ne.geometry.coordinates)||_e.incomingCoords(ne.geometry.coordinates)}return ne.id});return it.store.render(),Zt},pt.get=function(yt){var Zt=it.store.get(yt);if(Zt)return Zt.toGeoJSON()},pt.getAll=function(){return{type:b.FEATURE_COLLECTION,features:it.store.getAll().map(function(yt){return yt.toGeoJSON()})}},pt.delete=function(yt){return it.store.delete(yt,{silent:!0}),pt.getMode()!==M.DIRECT_SELECT||it.store.getSelectedIds().length?it.store.render():it.events.changeMode(M.SIMPLE_SELECT,void 0,{silent:!0}),pt},pt.deleteAll=function(){return it.store.delete(it.store.getAllIds(),{silent:!0}),pt.getMode()===M.DIRECT_SELECT?it.events.changeMode(M.SIMPLE_SELECT,void 0,{silent:!0}):it.store.render(),pt},pt.changeMode=function(yt,Zt){return Zt===void 0&&(Zt={}),yt===M.SIMPLE_SELECT&&pt.getMode()===M.SIMPLE_SELECT?(d1(Zt.featureIds||[],it.store.getSelectedIds())||(it.store.setSelected(Zt.featureIds,{silent:!0}),it.store.render()),pt):(yt===M.DIRECT_SELECT&&pt.getMode()===M.DIRECT_SELECT&&Zt.featureId===it.store.getSelectedIds()[0]||it.events.changeMode(yt,Zt,{silent:!0}),pt)},pt.getMode=function(){return it.events.getMode()},pt.trash=function(){return it.events.trash({silent:!0}),pt},pt.combineFeatures=function(){return it.events.combineFeatures({silent:!0}),pt},pt.uncombineFeatures=function(){return it.events.uncombineFeatures({silent:!0}),pt},pt.setFeatureProperty=function(yt,Zt,ne){return it.store.setFeatureProperty(yt,Zt,ne),pt},pt}(F,$),F.api=$;var q=Nn(F);return $.onAdd=q.onAdd,$.onRemove=q.onRemove,$.types=v,$.options=k,$};function Lo(k){Zr(k,this)}return Lo.modes=Jr,Lo.constants=z,Lo.lib=Go,Lo})})(AO);var Eht=AO.exports;const V7=El(Eht),VO=V7.lib.theme.map(t=>t.id),Dy=[...VO.map(t=>`${t}.cold`),...VO.map(t=>`${t}.hot`)];var O7,Qh,I3,e6;class Mht{constructor(e,r=!1){_r(this,O7),_r(this,I3),V7.constants.classes.CONTROL_BASE="maplibregl-ctrl",V7.constants.classes.CONTROL_PREFIX="maplibregl-ctrl-",V7.constants.classes.CONTROL_GROUP="maplibregl-ctrl-group",this.__flatmap=e,this.__committedFeatures=new Map,this.__uncommittedFeatureIds=new Set,this.__visible=r,this.__draw=new V7({displayControlsDefault:!1,controls:{point:!0,line_string:!0,polygon:!0,trash:!0},userProperties:!0,keybindings:!0}),this.__map=null,this.__inDrawing=!1}onAdd(e){return this.__map=e,this.__container=this.__draw.onAdd(e),this.__draw.options.controls.trash=!0,window.addEventListener("keyup",function(r){r.key==="Alt"&&r.preventDefault()},!1),e.on("draw.modechange",this.modeChangedEvent.bind(this)),e.on("draw.create",this.createdFeature.bind(this)),e.on("draw.delete",this.deletedFeature.bind(this)),e.on("draw.update",this.updatedFeature.bind(this)),e.on("draw.selectionchange",this.selectionChangedEvent.bind(this)),this.show(this.__visible),this.__container}onRemove(){this.__container.parentNode.removeChild(this.__container),this.__container=null,this.__map=null}show(e=!0){if(this.__container){if(this.__container.style.display=e?"block":"none",e&&!this.__visible)for(const r of Dy)this.__map.setLayoutProperty(r,"visibility","visible");else if(!e&&this.__visible)for(const r of Dy)this.__map.setLayoutProperty(r,"visibility","none")}this.__visible=e}createdFeature(e){const r=xr(this,O7,Qh).call(this,e);r&&(this.__draw.setFeatureProperty(r.id,"drawn",!0),this.__draw.setFeatureProperty(r.id,"label","Drawn annotation"),r.properties={user_drawn:!0,user_label:"Drawn annotation"},xr(this,I3,e6).call(this,"created",r))}deletedFeature(e){const r=xr(this,O7,Qh).call(this,e);r&&(this.__uncommittedFeatureIds.has(r.id)||xr(this,I3,e6).call(this,"deleted",r))}updatedFeature(e){const r=xr(this,O7,Qh).call(this,e);r&&(r.action=e.action,this.__uncommittedFeatureIds.has(r.id)||xr(this,I3,e6).call(this,"updated",r))}modeChangedEvent(e){this.__inDrawing=e.mode.startsWith("draw"),xr(this,I3,e6).call(this,"modeChanged",e)}selectionChangedEvent(e){xr(this,I3,e6).call(this,"selectionChanged",e)}inDrawingMode(){return this.__inDrawing}commitEvent(e){const r=e.feature;e.type==="deleted"?this.__committedFeatures.delete(r.id):this.__committedFeatures.set(r.id,r),this.__uncommittedFeatureIds.delete(r.id)}abortEvent(e){xr(this,I3,e6).call(this,"aborted",e)}rollbackEvent(e){const r=e.feature;if(e.type==="created")this.__draw.delete(r.id),this.__committedFeatures.delete(r.id),this.__uncommittedFeatureIds.delete(r.id);else if(e.type==="deleted")this.__draw.add(r),this.__committedFeatures.set(r.id,r),this.__uncommittedFeatureIds.delete(r.id);else if(e.type==="updated"){const n=this.__committedFeatures.get(r.id);n&&(this.__draw.delete(r.id),this.__draw.add(n),this.__uncommittedFeatureIds.delete(r.id))}}clearFeatures(){this.__draw.deleteAll()}removeFeature(){this.__draw.trash()}addFeature(e){e=Object.assign({},e,{type:"Feature"});const r=this.__draw.add(e);this.__committedFeatures.set(r[0],e),this.__uncommittedFeatureIds.delete(r[0])}refreshGeometry(e){return this.__draw.get(e.id)||null}changeMode(e){this.__draw.changeMode(e.mode,e.options)}}O7=new WeakSet,Qh=function(t){const e=t.features.filter(r=>r.type==="Feature").map(r=>({id:r.id,type:"Feature",geometry:r.geometry}));return e.length?e[0]:null},I3=new WeakSet,e6=function(t,e){e.id&&this.__uncommittedFeatureIds.add(e.id),this.__flatmap.annotationEvent(t,e)};class Hht{constructor(e,r){this._flatmap=e,this._map=void 0,this.__pathTypes=r}getDefaultPosition(){return"top-right"}onAdd(e){this._map=e,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl",this._container.id="flatmap-nerve-key",this._legend=document.createElement("div"),this._legend.id="nerve-key-text",this._legend.className="flatmap-nerve-grid";const r=[];r.push('<label for="path-all-paths">ALL PATHS:</label><div class="nerve-line"></div><input id="path-all-paths" type="checkbox" checked/>'),this.__checkedCount=0;for(const n of this.__pathTypes){const i=!("enabled"in n)||n.enabled?"checked":"";i!=""&&(this.__checkedCount+=1);const o=n.colour||"#440",a=n.dashed?`background: repeating-linear-gradient(to right,${o} 0,${o} 6px,transparent 6px,transparent 9px);`:`background: ${o};`;r.push(`<label for="path-${n.type}">${n.label}</label><div class="nerve-line" style="${a}"></div><input id="path-${n.type}" type="checkbox" ${i}/>`)}return this._legend.innerHTML=r.join(`
1661
1661
  `),this.__halfCount=Math.trunc(this.__pathTypes.length/2),this._button=document.createElement("button"),this._button.id="nerve-key-button",this._button.className="control-button text-button",this._button.setAttribute("type","button"),this._button.setAttribute("aria-label","Nerve paths legend"),this._button.setAttribute("control-visible","false"),this._button.textContent="PATHS",this._button.title="Show/hide neuron paths",this._container.appendChild(this._button),this._container.addEventListener("click",this.onClick_.bind(this)),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}onClick_(e){if(e.target.id==="nerve-key-button")if(this._button.getAttribute("control-visible")==="false"){this._container.appendChild(this._legend),this._button.setAttribute("control-visible","true");const r=document.getElementById("path-all-paths");r.indeterminate=this.__checkedCount<this.__pathTypes.length&&this.__checkedCount>0,this._legend.focus()}else this._legend=this._container.removeChild(this._legend),this._button.setAttribute("control-visible","false");else if(e.target.tagName==="INPUT"){if(e.target.id==="path-all-paths"){e.target.indeterminate&&(e.target.checked=this.__checkedCount>=this.__halfCount,e.target.indeterminate=!1),e.target.checked?this.__checkedCount=this.__pathTypes.length:this.__checkedCount=0;for(const r of this.__pathTypes){const n=document.getElementById(`path-${r.type}`);n&&(n.checked=e.target.checked,this._flatmap.enablePath(r.type,e.target.checked))}}else if(e.target.id.startsWith("path-")){const r=e.target.id.substring(5);this._flatmap.enablePath(r,e.target.checked),e.target.checked?this.__checkedCount+=1:this.__checkedCount-=1;const n=document.getElementById("path-all-paths");this.__checkedCount===0?(n.checked=!1,n.indeterminate=!1):this.__checkedCount===this.__pathTypes.length?(n.checked=!0,n.indeterminate=!1):n.indeterminate=!0}}e.stopPropagation()}}var no,Ms,r6,mh,k7;class Sht{constructor(e,r){_r(this,no,void 0),_r(this,Ms,void 0),_r(this,r6,!1),_r(this,mh,null),_r(this,k7,void 0),Vr(this,k7,e),Vr(this,r6,!!r)}getDefaultPosition(){return"top-right"}onAdd(e){return Vr(this,mh,e),Vr(this,Ms,document.createElement("div")),Dt(this,Ms).className="maplibregl-ctrl",Vr(this,no,document.createElement("button")),Dt(this,no).className="control-button text-button",Dt(this,no).setAttribute("type","button"),Dt(this,no).setAttribute("aria-label","Show flight paths"),Dt(this,no).textContent="3D",Dt(this,no).title="Show/hide flight paths",Dt(this,Ms).appendChild(Dt(this,no)),Dt(this,Ms).addEventListener("click",this.onClick.bind(this)),Dt(this,r6)&&(Dt(this,no).classList.add("control-active"),this.__setBackground()),Dt(this,Ms)}onRemove(){Dt(this,Ms).parentNode.removeChild(Dt(this,Ms)),Vr(this,mh,void 0)}__setBackground(){Dt(this,r6)?Dt(this,no).setAttribute("style","background: red"):Dt(this,no).removeAttribute("style")}onClick(e){Dt(this,no).classList.contains("control-active")?(Dt(this,k7).enableFlightPaths(!1),Dt(this,no).classList.remove("control-active"),Vr(this,r6,!1)):(Dt(this,k7).enableFlightPaths(!0),Dt(this,no).classList.add("control-active"),Vr(this,r6,!0)),this.__setBackground()}}no=new WeakMap,Ms=new WeakMap,r6=new WeakMap,mh=new WeakMap,k7=new WeakMap;class Cht{constructor(e){this.__flatmap=e}onAdd(e){return this._map=e,this._container=document.createElement("div"),this._container.className="maplibregl-ctrl search-control",this._input=document.createElement("input"),this._input.id="search-control-input",this._input.setAttribute("type","search"),this._input.setAttribute("visible","false"),this._input.setAttribute("placeholder","Search..."),this._button=document.createElement("button"),this._button.id="search-control-button",this._button.className="control-button",this._button.title="Search flatmap",this._button.setAttribute("type","button"),this._button.setAttribute("aria-label","Search flatmap"),this._button.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" id="search-control-icon" viewBox="0 0 24 24">
1662
1662
  <path d="M21.172 24l-7.387-7.387c-1.388.874-3.024 1.387-4.785 1.387-4.971 0-9-4.029-9-9s4.029-9 9-9 9 4.029 9 9c0 1.761-.514 3.398-1.387 4.785l7.387 7.387-2.828 2.828zm-12.172-8c3.859 0 7-3.14 7-7s-3.141-7-7-7-7 3.14-7 7 3.141 7 7 7z"/>
1663
- </svg>`,this._container.appendChild(this._button),this._container.onclick=this.onClick_.bind(this),this._container}getDefaultPosition(){return"top-right"}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}searchMap_(e=!0){this._input=this._container.removeChild(this._input),this._input.setAttribute("visible","false");const r=this._input.value;if(e&&r!==""){const n=this.__flatmap.search(r);this.__flatmap.showSearchResults(n)}}onKeyDown_(e){e.key==="Enter"?this.searchMap_():e.key==="Escape"&&this.searchMap_(!1)}onClick_(e){const r="rangeTarget"in e?e.rangeTarget.id:e.target.id;["search-control-button","search-control-icon"].includes(r)&&(this._input.getAttribute("visible")==="false"?(this._container.appendChild(this._input),this._container.appendChild(this._button),this._input.setAttribute("visible","true"),this._input.onkeydown=this.onKeyDown_.bind(this),this._input.value="",this.__flatmap.clearSearchResults(),this._input.focus()):this.searchMap_())}}const OO={fillColor:"#DDD",fillOpacity:.3,lineColor:"#08F",lineOpacity:1,lineWidth:1,position:"bottom-left",width:320},Aht=[[18,14,16],[16,12,14],[14,10,12],[12,8,10],[10,6,8]];class Vht{constructor(e,r){this._flatmap=e,this._map=void 0,this._container=null,this._background=null,this._opacity=null,this._loaded=!1,this._options=Object.assign({},OO),typeof r=="object"&&("position"in r&&(this._options.position=r.position),"width"in r&&(this._options.width=r.width)),this._ticking=!1,this._lastMouseMoveEvent=null,this._isDragging=!1,this._isCursorOverFeature=!1,this._previousPoint=[0,0],this._currentPoint=[0,0],this._trackingRectCoordinates=[[[],[],[],[],[]]]}getDefaultPosition(){return this._options.position}onAdd(e){this._map=e;const r=document.createElement("div");r.className="maplibregl-ctrl-minimap maplibregl-ctrl",r.id="maplibre-minimap",this._container=r;const n=e.getCanvas();let i=OO.width;return typeof this._options.width=="string"?(i=parseInt(this._options.width),this._options.width.includes("%")&&(i=i*n.width/100)):typeof this._options.width=="number"&&(i=this._options.width),r.setAttribute("style",`width: ${i}px; height: ${i*n.height/n.width}px;`),r.addEventListener("contextmenu",this._preventDefault),this._miniMap=new Yi.Map({attributionControl:!1,container:r,style:e.getStyle(),bounds:e.getBounds()}),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0,this._container=null}initialise(){const e=this._options,r=this._map,n=this._miniMap;["dragPan","scrollZoom","boxZoom","dragRotate","keyboard","doubleClickZoom","touchZoomRotate"].forEach(o=>n[o].disable()),this._background!==null&&n.setPaintProperty("background","background-color",this._background),this._opacity!==null&&n.setPaintProperty("background","background-opacity",this._opacity),n.resize(),n.fitBounds(this._flatmap.bounds);const i=n.getBounds();this.convertBoundsToPoints_(i),n.addSource("trackingRect",{type:"geojson",data:{type:"Feature",properties:{name:"trackingRect"},geometry:{type:"Polygon",coordinates:this._trackingRectCoordinates}}}),n.addLayer({id:"trackingRectOutline",type:"line",source:"trackingRect",layout:{},paint:{"line-color":e.lineColor,"line-width":e.lineWidth,"line-opacity":e.lineOpacity}}),n.addLayer({id:"trackingRectFill",type:"fill",source:"trackingRect",layout:{},paint:{"fill-color":e.fillColor,"fill-opacity":e.fillOpacity}}),this._trackingRect=this._miniMap.getSource("trackingRect"),this.update_(),r.on("move",this.update_.bind(this)),n.on("mousemove",this.mouseMove_.bind(this)),n.on("mousedown",this.mouseDown_.bind(this)),n.on("mouseup",this.mouseUp_.bind(this)),n.on("touchmove",this.mouseMove_.bind(this)),n.on("touchstart",this.mouseDown_.bind(this)),n.on("touchend",this.mouseUp_.bind(this)),this._miniMapCanvas=n.getCanvasContainer(),this._miniMapCanvas.addEventListener("wheel",this.preventDefault_),this._miniMapCanvas.addEventListener("mousewheel",this.preventDefault_)}mouseDown_(e){this._isCursorOverFeature&&(this._isDragging=!0,this._previousPoint=this._currentPoint,this._currentPoint=[e.lngLat.lng,e.lngLat.lat])}mouseMove_(e){this._ticking=!1;const r=this._miniMap.queryRenderedFeatures(e.point,{layers:["trackingRectFill"]});if(this._isCursorOverFeature&&r.length>0||(this._isCursorOverFeature=r.length>0,this._miniMapCanvas.style.cursor=this._isCursorOverFeature?"move":""),this._isDragging){this._previousPoint=this._currentPoint,this._currentPoint=[e.lngLat.lng,e.lngLat.lat];const n=[this._previousPoint[0]-this._currentPoint[0],this._previousPoint[1]-this._currentPoint[1]],i=this.moveTrackingRect_(n);this._map.fitBounds(i,{duration:80,noMoveStart:!0})}}mouseUp_(){this._isDragging=!1,this._ticking=!1}moveTrackingRect_(e){const r=this._trackingRect,n=r._data,i=n.properties.bounds;return i._ne.lat-=e[1],i._ne.lng-=e[0],i._sw.lat-=e[1],i._sw.lng-=e[0],this.convertBoundsToPoints_(i),r.setData(n),i}setTrackingRectBounds_(e){const r=this._trackingRect,n=r._data;n.properties.bounds=e,this.convertBoundsToPoints_(e),r.setData(n)}convertBoundsToPoints_(e){const r=e._ne,n=e._sw,i=this._trackingRectCoordinates;i[0][0][0]=r.lng,i[0][0][1]=r.lat,i[0][1][0]=n.lng,i[0][1][1]=r.lat,i[0][2][0]=n.lng,i[0][2][1]=n.lat,i[0][3][0]=r.lng,i[0][3][1]=n.lat,i[0][4][0]=r.lng,i[0][4][1]=r.lat}update_(e){if(this._isDragging)return;const r=this._map.getBounds();this.setTrackingRectBounds_(r),this.zoomAdjust_()}zoomAdjust_(){const e=this._miniMap,r=this._map,n=parseInt(e.getZoom(),10),i=parseInt(r.getZoom(),10);let o=!1;Aht.forEach(function(a){!o&&i>=a[0]&&(n>=a[1]&&e.setZoom(a[2]),e.setCenter(r.getCenter()),o=!0)})}preventDefault_(e){e.preventDefault()}setBackgroundColour(e){this._loaded?this._miniMap.setPaintProperty("background","background-color",e):this._background=e}setBackgroundOpacity(e){this._loaded?this._miniMap.setPaintProperty("background","background-opacity",e):this._opacity=e}show(e){this._container&&(e?(this._container.style.display="block",this.update_()):this._container.style.display="none")}}class Oht extends CO{constructor(e,r){super(e,"system","systems"),this.__systems=r}_addControlDetails(){let e=0,r=0;for(const n of this.__systems){const i=this._addControlLine(`${this.__prefix}${n.id}`,n.name,`background: ${n.colour};`);n.enabled&&(i.checked=!0,r+=1),e+=1}return{enabled:r,total:e}}_enableAll(e){for(const r of this.__systems){const n=document.getElementById(`${this.__prefix}${r.id}`);n&&(n.checked=e,this.__flatmap.enableSystem(r.id,e))}}__enableControl(e,r){for(const n of this.__systems)e===n.id&&this.__flatmap.enableSystem(n.id,r)}}class kht extends CO{constructor(e){super(e,"taxon","taxons"),this.__taxonIds=e.taxonIdentifiers.sort()}_addControlDetails(){let e=0,r=0;for(const n of this.__taxonIds){const i=this._addControlLine(`${this.__prefix}${n}`,n);i.checked=!0,r+=1,e+=1}return{enabled:r,total:e}}_enableAll(e){for(const r of this.__taxonIds){const n=document.getElementById(`${this.__prefix}${r}`);n&&(n.checked=e,this.__flatmap.enableConnectivityByTaxonIds(r,e))}}__enableControl(e,r){for(const n of this.__taxonIds)e===n&&this.__flatmap.enableConnectivityByTaxonIds(n,r)}}var gh={},yh={};Object.defineProperty(yh,"__esModule",{value:!0}),yh.VERSION=void 0,yh.VERSION="3.2.2";var _h={},R3={};Object.defineProperty(R3,"__esModule",{value:!0}),R3.PrioritizedList=void 0;var Pht=function(){function t(){this.items=[],this.items=[]}return t.prototype[Symbol.iterator]=function(){var e=0,r=this.items;return{next:function(){return{value:r[e++],done:e>r.length}}}},t.prototype.add=function(e,r){r===void 0&&(r=t.DEFAULTPRIORITY);var n=this.items.length;do n--;while(n>=0&&r<this.items[n].priority);return this.items.splice(n+1,0,{item:e,priority:r}),e},t.prototype.remove=function(e){var r=this.items.length;do r--;while(r>=0&&this.items[r].item!==e);r>=0&&this.items.splice(r,1)},t.DEFAULTPRIORITY=5,t}();R3.PrioritizedList=Pht;var Iht=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rht=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(_h,"__esModule",{value:!0}),_h.HandlerList=void 0;var Nht=R3,Bht=function(t){Iht(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.register=function(r){return this.add(r,r.priority)},e.prototype.unregister=function(r){this.remove(r)},e.prototype.handlesDocument=function(r){var n,i;try{for(var o=Rht(this),a=o.next();!a.done;a=o.next()){var s=a.value,d=s.item;if(d.handlesDocument(r))return d}}catch(p){n={error:p}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new Error("Can't find handler for document")},e.prototype.document=function(r,n){return n===void 0&&(n=null),this.handlesDocument(r).create(r,n)},e}(Nht.PrioritizedList);_h.HandlerList=Bht;var N3={};Object.defineProperty(N3,"__esModule",{value:!0}),N3.retryAfter=N3.handleRetriesFor=void 0;function Dht(t){return new Promise(function e(r,n){try{r(t())}catch(i){i.retry&&i.retry instanceof Promise?i.retry.then(function(){return e(r,n)}).catch(function(o){return n(o)}):i.restart&&i.restart.isCallback?MathJax.Callback.After(function(){return e(r,n)},i.restart):n(i)}})}N3.handleRetriesFor=Dht;function Fht(t){var e=new Error("MathJax retry");throw e.retry=t,e}N3.retryAfter=Fht,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.mathjax=void 0;var e=yh,r=_h,n=N3;t.mathjax={version:e.VERSION,handlers:new r.HandlerList,document:function(i,o){return t.mathjax.handlers.document(i,o)},handleRetriesFor:n.handleRetriesFor,retryAfter:n.retryAfter,asyncLoad:null}}(gh);var Fy={},P7={},si={};(function(t){var e=P&&P.__values||function(V){var O=typeof Symbol=="function"&&Symbol.iterator,R=O&&V[O],j=0;if(R)return R.call(V);if(V&&typeof V.length=="number")return{next:function(){return V&&j>=V.length&&(V=void 0),{value:V&&V[j++],done:!V}}};throw new TypeError(O?"Object is not iterable.":"Symbol.iterator is not defined.")},r=P&&P.__read||function(V,O){var R=typeof Symbol=="function"&&V[Symbol.iterator];if(!R)return V;var j=R.call(V),G,z=[],J;try{for(;(O===void 0||O-- >0)&&!(G=j.next()).done;)z.push(G.value)}catch(tt){J={error:tt}}finally{try{G&&!G.done&&(R=j.return)&&R.call(j)}finally{if(J)throw J.error}}return z},n=P&&P.__spreadArray||function(V,O,R){if(R||arguments.length===2)for(var j=0,G=O.length,z;j<G;j++)(z||!(j in O))&&(z||(z=Array.prototype.slice.call(O,0,j)),z[j]=O[j]);return V.concat(z||Array.prototype.slice.call(O))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookup=t.separateOptions=t.selectOptionsFromKeys=t.selectOptions=t.userOptions=t.defaultOptions=t.insert=t.copy=t.keys=t.makeArray=t.expandable=t.Expandable=t.OPTIONS=t.REMOVE=t.APPEND=t.isObject=void 0;var i={}.constructor;function o(V){return typeof V=="object"&&V!==null&&(V.constructor===i||V.constructor===a)}t.isObject=o,t.APPEND="[+]",t.REMOVE="[-]",t.OPTIONS={invalidOption:"warn",optionError:function(V,O){if(t.OPTIONS.invalidOption==="fatal")throw new Error(V);console.warn("MathJax: "+V)}};var a=function(){function V(){}return V}();t.Expandable=a;function s(V){return Object.assign(Object.create(a.prototype),V)}t.expandable=s;function d(V){return Array.isArray(V)?V:[V]}t.makeArray=d;function p(V){return V?Object.keys(V).concat(Object.getOwnPropertySymbols(V)):[]}t.keys=p;function f(V){var O,R,j={};try{for(var G=e(p(V)),z=G.next();!z.done;z=G.next()){var J=z.value,tt=Object.getOwnPropertyDescriptor(V,J),ot=tt.value;Array.isArray(ot)?tt.value=Q([],ot,!1):o(ot)&&(tt.value=f(ot)),tt.enumerable&&(j[J]=tt)}}catch(et){O={error:et}}finally{try{z&&!z.done&&(R=G.return)&&R.call(G)}finally{if(O)throw O.error}}return Object.defineProperties(V.constructor===a?s({}):{},j)}t.copy=f;function Q(V,O,R){var j,G;R===void 0&&(R=!0);var z=function(et){if(R&&V[et]===void 0&&V.constructor!==a)return typeof et=="symbol"&&(et=et.toString()),t.OPTIONS.optionError('Invalid option "'.concat(et,'" (no default value).'),et),"continue";var Tt=O[et],At=V[et];if(o(Tt)&&At!==null&&(typeof At=="object"||typeof At=="function")){var Ut=p(Tt);Array.isArray(At)&&(Ut.length===1&&(Ut[0]===t.APPEND||Ut[0]===t.REMOVE)&&Array.isArray(Tt[Ut[0]])||Ut.length===2&&Ut.sort().join(",")===t.APPEND+","+t.REMOVE&&Array.isArray(Tt[t.APPEND])&&Array.isArray(Tt[t.REMOVE]))?(Tt[t.REMOVE]&&(At=V[et]=At.filter(function(ee){return Tt[t.REMOVE].indexOf(ee)<0})),Tt[t.APPEND]&&(V[et]=n(n([],r(At),!1),r(Tt[t.APPEND]),!1))):Q(At,Tt,R)}else Array.isArray(Tt)?(V[et]=[],Q(V[et],Tt,!1)):o(Tt)?V[et]=f(Tt):V[et]=Tt};try{for(var J=e(p(O)),tt=J.next();!tt.done;tt=J.next()){var ot=tt.value;z(ot)}}catch(et){j={error:et}}finally{try{tt&&!tt.done&&(G=J.return)&&G.call(J)}finally{if(j)throw j.error}}return V}t.insert=Q;function m(V){for(var O=[],R=1;R<arguments.length;R++)O[R-1]=arguments[R];return O.forEach(function(j){return Q(V,j,!1)}),V}t.defaultOptions=m;function _(V){for(var O=[],R=1;R<arguments.length;R++)O[R-1]=arguments[R];return O.forEach(function(j){return Q(V,j,!0)}),V}t.userOptions=_;function v(V){for(var O,R,j=[],G=1;G<arguments.length;G++)j[G-1]=arguments[G];var z={};try{for(var J=e(j),tt=J.next();!tt.done;tt=J.next()){var ot=tt.value;V.hasOwnProperty(ot)&&(z[ot]=V[ot])}}catch(et){O={error:et}}finally{try{tt&&!tt.done&&(R=J.return)&&R.call(J)}finally{if(O)throw O.error}}return z}t.selectOptions=v;function b(V,O){return v.apply(void 0,n([V],r(Object.keys(O)),!1))}t.selectOptionsFromKeys=b;function M(V){for(var O,R,j,G,z=[],J=1;J<arguments.length;J++)z[J-1]=arguments[J];var tt=[];try{for(var ot=e(z),et=ot.next();!et.done;et=ot.next()){var Tt=et.value,At={},Ut={};try{for(var ee=(j=void 0,e(Object.keys(V||{}))),ue=ee.next();!ue.done;ue=ee.next()){var Ft=ue.value;(Tt[Ft]===void 0?Ut:At)[Ft]=V[Ft]}}catch(pe){j={error:pe}}finally{try{ue&&!ue.done&&(G=ee.return)&&G.call(ee)}finally{if(j)throw j.error}}tt.push(At),V=Ut}}catch(pe){O={error:pe}}finally{try{et&&!et.done&&(R=ot.return)&&R.call(ot)}finally{if(O)throw O.error}}return tt.unshift(V),tt}t.separateOptions=M;function E(V,O,R){return R===void 0&&(R=null),O.hasOwnProperty(V)?O[V]:R}t.lookup=E})(si);var n6={},jht=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),zht=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},kO=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},PO=P&&P.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(n6,"__esModule",{value:!0}),n6.FunctionList=void 0;var Uht=R3,Ght=function(t){jht(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.execute=function(){for(var r,n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];try{for(var a=zht(this),s=a.next();!s.done;s=a.next()){var d=s.value,p=d.item.apply(d,PO([],kO(i),!1));if(p===!1)return!1}}catch(f){r={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!0},e.prototype.asyncExecute=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=-1,o=this.items;return new Promise(function(a,s){(function d(){for(var p;++i<o.length;){var f=(p=o[i]).item.apply(p,PO([],kO(r),!1));if(f instanceof Promise){f.then(d).catch(function(Q){return s(Q)});return}if(f===!1){a(!1);return}}a(!0)})()})},e}(Uht.PrioritizedList);n6.FunctionList=Ght,Object.defineProperty(P7,"__esModule",{value:!0}),P7.AbstractInputJax=void 0;var IO=si,RO=n6,Zht=function(){function t(e){e===void 0&&(e={}),this.adaptor=null,this.mmlFactory=null;var r=this.constructor;this.options=(0,IO.userOptions)((0,IO.defaultOptions)({},r.OPTIONS),e),this.preFilters=new RO.FunctionList,this.postFilters=new RO.FunctionList}return Object.defineProperty(t.prototype,"name",{get:function(){return this.constructor.NAME},enumerable:!1,configurable:!0}),t.prototype.setAdaptor=function(e){this.adaptor=e},t.prototype.setMmlFactory=function(e){this.mmlFactory=e},t.prototype.initialize=function(){},t.prototype.reset=function(){},Object.defineProperty(t.prototype,"processStrings",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.findMath=function(e,r){return[]},t.prototype.executeFilters=function(e,r,n,i){var o={math:r,document:n,data:i};return e.execute(o),o.data},t.NAME="generic",t.OPTIONS={},t}();P7.AbstractInputJax=Zht;var vh={},bh={};Object.defineProperty(bh,"__esModule",{value:!0}),bh.AbstractFindMath=void 0;var NO=si,$ht=function(){function t(e){var r=this.constructor;this.options=(0,NO.userOptions)((0,NO.defaultOptions)({},r.OPTIONS),e)}return t.OPTIONS={},t}();bh.AbstractFindMath=$ht;var s1={},qht=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Wht=P&&P.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(s1,"__esModule",{value:!0}),s1.split=s1.isPercent=s1.unicodeString=s1.unicodeChars=s1.quotePattern=s1.sortLength=void 0;function Xht(t,e){return t.length!==e.length?e.length-t.length:t===e?0:t<e?-1:1}s1.sortLength=Xht;function Kht(t){return t.replace(/([\^$(){}+*?\-|\[\]\:\\])/g,"\\$1")}s1.quotePattern=Kht;function Yht(t){return Array.from(t).map(function(e){return e.codePointAt(0)})}s1.unicodeChars=Yht;function Jht(t){return String.fromCodePoint.apply(String,Wht([],qht(t),!1))}s1.unicodeString=Jht;function tdt(t){return!!t.match(/%\s*$/)}s1.isPercent=tdt;function edt(t){return t.trim().split(/\s+/)}s1.split=edt;var U5={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.newState=t.STATE=t.AbstractMathItem=t.protoItem=void 0;function e(i,o,a,s,d,p,f){f===void 0&&(f=null);var Q={open:i,math:o,close:a,n:s,start:{n:d},end:{n:p},display:f};return Q}t.protoItem=e;var r=function(){function i(o,a,s,d,p){s===void 0&&(s=!0),d===void 0&&(d={i:0,n:0,delim:""}),p===void 0&&(p={i:0,n:0,delim:""}),this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={},this._state=t.STATE.UNPROCESSED,this.math=o,this.inputJax=a,this.display=s,this.start=d,this.end=p,this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={}}return Object.defineProperty(i.prototype,"isEscaped",{get:function(){return this.display===null},enumerable:!1,configurable:!0}),i.prototype.render=function(o){o.renderActions.renderMath(this,o)},i.prototype.rerender=function(o,a){a===void 0&&(a=t.STATE.RERENDER),this.state()>=a&&this.state(a-1),o.renderActions.renderMath(this,o,a)},i.prototype.convert=function(o,a){a===void 0&&(a=t.STATE.LAST),o.renderActions.renderConvert(this,o,a)},i.prototype.compile=function(o){this.state()<t.STATE.COMPILED&&(this.root=this.inputJax.compile(this,o),this.state(t.STATE.COMPILED))},i.prototype.typeset=function(o){this.state()<t.STATE.TYPESET&&(this.typesetRoot=o.outputJax[this.isEscaped?"escaped":"typeset"](this,o),this.state(t.STATE.TYPESET))},i.prototype.updateDocument=function(o){},i.prototype.removeFromDocument=function(o){},i.prototype.setMetrics=function(o,a,s,d,p){this.metrics={em:o,ex:a,containerWidth:s,lineWidth:d,scale:p}},i.prototype.state=function(o,a){return o===void 0&&(o=null),a===void 0&&(a=!1),o!=null&&(o<t.STATE.INSERTED&&this._state>=t.STATE.INSERTED&&this.removeFromDocument(a),o<t.STATE.TYPESET&&this._state>=t.STATE.TYPESET&&(this.outputData={}),o<t.STATE.COMPILED&&this._state>=t.STATE.COMPILED&&(this.inputData={}),this._state=o),this._state},i.prototype.reset=function(o){o===void 0&&(o=!1),this.state(t.STATE.UNPROCESSED,o)},i}();t.AbstractMathItem=r,t.STATE={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4};function n(i,o){if(i in t.STATE)throw Error("State "+i+" already exists");t.STATE[i]=o}t.newState=n})(U5);var rdt=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),BO=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o};Object.defineProperty(vh,"__esModule",{value:!0}),vh.FindTeX=void 0;var ndt=bh,Lh=s1,jy=U5,idt=function(t){rdt(e,t);function e(r){var n=t.call(this,r)||this;return n.getPatterns(),n}return e.prototype.getPatterns=function(){var r=this,n=this.options,i=[],o=[],a=[];this.end={},this.env=this.sub=0;var s=1;n.inlineMath.forEach(function(d){return r.addPattern(i,d,!1)}),n.displayMath.forEach(function(d){return r.addPattern(i,d,!0)}),i.length&&o.push(i.sort(Lh.sortLength).join("|")),n.processEnvironments&&(o.push("\\\\begin\\s*\\{([^}]*)\\}"),this.env=s,s++),n.processEscapes&&a.push("\\\\([\\\\$])"),n.processRefs&&a.push("(\\\\(?:eq)?ref\\s*\\{[^}]*\\})"),a.length&&(o.push("("+a.join("|")+")"),this.sub=s),this.start=new RegExp(o.join("|"),"g"),this.hasPatterns=o.length>0},e.prototype.addPattern=function(r,n,i){var o=BO(n,2),a=o[0],s=o[1];r.push((0,Lh.quotePattern)(a)),this.end[a]=[s,i,this.endPattern(s)]},e.prototype.endPattern=function(r,n){return new RegExp((n||(0,Lh.quotePattern)(r))+"|\\\\(?:[a-zA-Z]|.)|[{}]","g")},e.prototype.findEnd=function(r,n,i,o){for(var a=BO(o,3),s=a[0],d=a[1],p=a[2],f=p.lastIndex=i.index+i[0].length,Q,m=0;Q=p.exec(r);){if((Q[1]||Q[0])===s&&m===0)return(0,jy.protoItem)(i[0],r.substr(f,Q.index-f),Q[0],n,i.index,Q.index+Q[0].length,d);Q[0]==="{"?m++:Q[0]==="}"&&m&&m--}return null},e.prototype.findMathInString=function(r,n,i){var o,a;for(this.start.lastIndex=0;o=this.start.exec(i);){if(o[this.env]!==void 0&&this.env){var s="\\\\end\\s*(\\{"+(0,Lh.quotePattern)(o[this.env])+"\\})";a=this.findEnd(i,n,o,["{"+o[this.env]+"}",!0,this.endPattern(null,s)]),a&&(a.math=a.open+a.math+a.close,a.open=a.close="")}else if(o[this.sub]!==void 0&&this.sub){var d=o[this.sub],s=o.index+o[this.sub].length;d.length===2?a=(0,jy.protoItem)("",d.substr(1),"",n,o.index,s):a=(0,jy.protoItem)("",d,"",n,o.index,s,!1)}else a=this.findEnd(i,n,o,this.end[o[0]]);a&&(r.push(a),this.start.lastIndex=a.end.n)}},e.prototype.findMath=function(r){var n=[];if(this.hasPatterns)for(var i=0,o=r.length;i<o;i++)this.findMathInString(n,i,r[i]);return n},e.OPTIONS={inlineMath:[["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0,processRefs:!0},e}(ndt.AbstractFindMath);vh.FindTeX=idt;var zy={},fr={},G5={};(function(t){var e=P&&P.__values||function(n){var i=typeof Symbol=="function"&&Symbol.iterator,o=i&&n[i],a=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.Attributes=t.INHERIT=void 0,t.INHERIT="_inherit_";var r=function(){function n(i,o){this.global=o,this.defaults=Object.create(o),this.inherited=Object.create(this.defaults),this.attributes=Object.create(this.inherited),Object.assign(this.defaults,i)}return n.prototype.set=function(i,o){this.attributes[i]=o},n.prototype.setList=function(i){Object.assign(this.attributes,i)},n.prototype.get=function(i){var o=this.attributes[i];return o===t.INHERIT&&(o=this.global[i]),o},n.prototype.getExplicit=function(i){if(this.attributes.hasOwnProperty(i))return this.attributes[i]},n.prototype.getList=function(){for(var i,o,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var d={};try{for(var p=e(a),f=p.next();!f.done;f=p.next()){var Q=f.value;d[Q]=this.get(Q)}}catch(m){i={error:m}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}return d},n.prototype.setInherited=function(i,o){this.inherited[i]=o},n.prototype.getInherited=function(i){return this.inherited[i]},n.prototype.getDefault=function(i){return this.defaults[i]},n.prototype.isSet=function(i){return this.attributes.hasOwnProperty(i)||this.inherited.hasOwnProperty(i)},n.prototype.hasDefault=function(i){return i in this.defaults},n.prototype.getExplicitNames=function(){return Object.keys(this.attributes)},n.prototype.getInheritedNames=function(){return Object.keys(this.inherited)},n.prototype.getDefaultNames=function(){return Object.keys(this.defaults)},n.prototype.getGlobalNames=function(){return Object.keys(this.global)},n.prototype.getAllAttributes=function(){return this.attributes},n.prototype.getAllInherited=function(){return this.inherited},n.prototype.getAllDefaults=function(){return this.defaults},n.prototype.getAllGlobals=function(){return this.global},n}();t.Attributes=r})(G5);var Z5={},odt=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uy=P&&P.__assign||function(){return Uy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uy.apply(this,arguments)},I7=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Z5,"__esModule",{value:!0}),Z5.AbstractEmptyNode=Z5.AbstractNode=void 0;var DO=function(){function t(e,r,n){var i,o;r===void 0&&(r={}),n===void 0&&(n=[]),this.factory=e,this.parent=null,this.properties={},this.childNodes=[];try{for(var a=I7(Object.keys(r)),s=a.next();!s.done;s=a.next()){var d=s.value;this.setProperty(d,r[d])}}catch(p){i={error:p}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}n.length&&this.setChildren(n)}return Object.defineProperty(t.prototype,"kind",{get:function(){return"unknown"},enumerable:!1,configurable:!0}),t.prototype.setProperty=function(e,r){this.properties[e]=r},t.prototype.getProperty=function(e){return this.properties[e]},t.prototype.getPropertyNames=function(){return Object.keys(this.properties)},t.prototype.getAllProperties=function(){return this.properties},t.prototype.removeProperty=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{for(var o=I7(n),a=o.next();!a.done;a=o.next()){var s=a.value;delete this.properties[s]}}catch(d){e={error:d}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},t.prototype.isKind=function(e){return this.factory.nodeIsKind(this,e)},t.prototype.setChildren=function(e){var r,n;this.childNodes=[];try{for(var i=I7(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.appendChild(a)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},t.prototype.appendChild=function(e){return this.childNodes.push(e),e.parent=this,e},t.prototype.replaceChild=function(e,r){var n=this.childIndex(r);return n!==null&&(this.childNodes[n]=e,e.parent=this,r.parent=null),e},t.prototype.removeChild=function(e){var r=this.childIndex(e);return r!==null&&(this.childNodes.splice(r,1),e.parent=null),e},t.prototype.childIndex=function(e){var r=this.childNodes.indexOf(e);return r===-1?null:r},t.prototype.copy=function(){var e,r,n=this.factory.create(this.kind);n.properties=Uy({},this.properties);try{for(var i=I7(this.childNodes||[]),o=i.next();!o.done;o=i.next()){var a=o.value;a&&n.appendChild(a.copy())}}catch(s){e={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},t.prototype.findNodes=function(e){var r=[];return this.walkTree(function(n){n.isKind(e)&&r.push(n)}),r},t.prototype.walkTree=function(e,r){var n,i;e(this,r);try{for(var o=I7(this.childNodes),a=o.next();!a.done;a=o.next()){var s=a.value;s&&s.walkTree(e,r)}}catch(d){n={error:d}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r},t.prototype.toString=function(){return this.kind+"("+this.childNodes.join(",")+")"},t}();Z5.AbstractNode=DO;var adt=function(t){odt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.setChildren=function(r){},e.prototype.appendChild=function(r){return r},e.prototype.replaceChild=function(r,n){return n},e.prototype.childIndex=function(r){return null},e.prototype.walkTree=function(r,n){return r(this,n),n},e.prototype.toString=function(){return this.kind},e}(DO);Z5.AbstractEmptyNode=adt,function(t){var e=P&&P.__extends||function(){var M=function(E,V){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var j in R)Object.prototype.hasOwnProperty.call(R,j)&&(O[j]=R[j])},M(E,V)};return function(E,V){if(typeof V!="function"&&V!==null)throw new TypeError("Class extends value "+String(V)+" is not a constructor or null");M(E,V);function O(){this.constructor=E}E.prototype=V===null?Object.create(V):(O.prototype=V.prototype,new O)}}(),r=P&&P.__assign||function(){return r=Object.assign||function(M){for(var E,V=1,O=arguments.length;V<O;V++){E=arguments[V];for(var R in E)Object.prototype.hasOwnProperty.call(E,R)&&(M[R]=E[R])}return M},r.apply(this,arguments)},n=P&&P.__values||function(M){var E=typeof Symbol=="function"&&Symbol.iterator,V=E&&M[E],O=0;if(V)return V.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&O>=M.length&&(M=void 0),{value:M&&M[O++],done:!M}}};throw new TypeError(E?"Object is not iterable.":"Symbol.iterator is not defined.")},i=P&&P.__read||function(M,E){var V=typeof Symbol=="function"&&M[Symbol.iterator];if(!V)return M;var O=V.call(M),R,j=[],G;try{for(;(E===void 0||E-- >0)&&!(R=O.next()).done;)j.push(R.value)}catch(z){G={error:z}}finally{try{R&&!R.done&&(V=O.return)&&V.call(O)}finally{if(G)throw G.error}}return j};Object.defineProperty(t,"__esModule",{value:!0}),t.XMLNode=t.TextNode=t.AbstractMmlEmptyNode=t.AbstractMmlBaseNode=t.AbstractMmlLayoutNode=t.AbstractMmlTokenNode=t.AbstractMmlNode=t.indentAttributes=t.TEXCLASSNAMES=t.TEXCLASS=void 0;var o=G5,a=Z5;t.TEXCLASS={ORD:0,OP:1,BIN:2,REL:3,OPEN:4,CLOSE:5,PUNCT:6,INNER:7,VCENTER:8,NONE:-1},t.TEXCLASSNAMES=["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"];var s=["","thinmathspace","mediummathspace","thickmathspace"],d=[[0,-1,2,3,0,0,0,1],[-1,-1,0,3,0,0,0,1],[2,2,0,0,2,0,0,2],[3,3,0,0,3,0,0,3],[0,0,0,0,0,0,0,0],[0,-1,2,3,0,0,0,1],[1,1,0,1,1,1,1,1],[1,-1,2,3,1,0,1,1]];t.indentAttributes=["indentalign","indentalignfirst","indentshift","indentshiftfirst"];var p=function(M){e(E,M);function E(V,O,R){O===void 0&&(O={}),R===void 0&&(R=[]);var j=M.call(this,V)||this;return j.prevClass=null,j.prevLevel=null,j.texclass=null,j.arity<0&&(j.childNodes=[V.create("inferredMrow")],j.childNodes[0].parent=j),j.setChildren(R),j.attributes=new o.Attributes(V.getNodeClass(j.kind).defaults,V.getNodeClass("math").defaults),j.attributes.setList(O),j}return E.prototype.copy=function(V){var O,R,j,G;V===void 0&&(V=!1);var z=this.factory.create(this.kind);if(z.properties=r({},this.properties),this.attributes){var J=this.attributes.getAllAttributes();try{for(var tt=n(Object.keys(J)),ot=tt.next();!ot.done;ot=tt.next()){var et=ot.value;(et!=="id"||V)&&z.attributes.set(et,J[et])}}catch(ue){O={error:ue}}finally{try{ot&&!ot.done&&(R=tt.return)&&R.call(tt)}finally{if(O)throw O.error}}}if(this.childNodes&&this.childNodes.length){var Tt=this.childNodes;Tt.length===1&&Tt[0].isInferred&&(Tt=Tt[0].childNodes);try{for(var At=n(Tt),Ut=At.next();!Ut.done;Ut=At.next()){var ee=Ut.value;ee?z.appendChild(ee.copy()):z.childNodes.push(null)}}catch(ue){j={error:ue}}finally{try{Ut&&!Ut.done&&(G=At.return)&&G.call(At)}finally{if(j)throw j.error}}}return z},Object.defineProperty(E.prototype,"texClass",{get:function(){return this.texclass},set:function(V){this.texclass=V},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isToken",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isEmbellished",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isSpacelike",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"linebreakContainer",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"hasNewLine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"arity",{get:function(){return 1/0},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isInferred",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"Parent",{get:function(){for(var V=this.parent;V&&V.notParent;)V=V.Parent;return V},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"notParent",{get:function(){return!1},enumerable:!1,configurable:!0}),E.prototype.setChildren=function(V){return this.arity<0?this.childNodes[0].setChildren(V):M.prototype.setChildren.call(this,V)},E.prototype.appendChild=function(V){var O,R,j=this;if(this.arity<0)return this.childNodes[0].appendChild(V),V;if(V.isInferred){if(this.arity===1/0)return V.childNodes.forEach(function(ot){return M.prototype.appendChild.call(j,ot)}),V;var G=V;V=this.factory.create("mrow"),V.setChildren(G.childNodes),V.attributes=G.attributes;try{for(var z=n(G.getPropertyNames()),J=z.next();!J.done;J=z.next()){var tt=J.value;V.setProperty(tt,G.getProperty(tt))}}catch(ot){O={error:ot}}finally{try{J&&!J.done&&(R=z.return)&&R.call(z)}finally{if(O)throw O.error}}}return M.prototype.appendChild.call(this,V)},E.prototype.replaceChild=function(V,O){return this.arity<0?(this.childNodes[0].replaceChild(V,O),V):M.prototype.replaceChild.call(this,V,O)},E.prototype.core=function(){return this},E.prototype.coreMO=function(){return this},E.prototype.coreIndex=function(){return 0},E.prototype.childPosition=function(){for(var V,O,R=this,j=R.parent;j&&j.notParent;)R=j,j=j.parent;if(j){var G=0;try{for(var z=n(j.childNodes),J=z.next();!J.done;J=z.next()){var tt=J.value;if(tt===R)return G;G++}}catch(ot){V={error:ot}}finally{try{J&&!J.done&&(O=z.return)&&O.call(z)}finally{if(V)throw V.error}}}return null},E.prototype.setTeXclass=function(V){return this.getPrevClass(V),this.texClass!=null?this:V},E.prototype.updateTeXclass=function(V){V&&(this.prevClass=V.prevClass,this.prevLevel=V.prevLevel,V.prevClass=V.prevLevel=null,this.texClass=V.texClass)},E.prototype.getPrevClass=function(V){V&&(this.prevClass=V.texClass,this.prevLevel=V.attributes.get("scriptlevel"))},E.prototype.texSpacing=function(){var V=this.prevClass!=null?this.prevClass:t.TEXCLASS.NONE,O=this.texClass||t.TEXCLASS.ORD;if(V===t.TEXCLASS.NONE||O===t.TEXCLASS.NONE)return"";V===t.TEXCLASS.VCENTER&&(V=t.TEXCLASS.ORD),O===t.TEXCLASS.VCENTER&&(O=t.TEXCLASS.ORD);var R=d[V][O];return(this.prevLevel>0||this.attributes.get("scriptlevel")>0)&&R>=0?"":s[Math.abs(R)]},E.prototype.hasSpacingAttributes=function(){return this.isEmbellished&&this.coreMO().hasSpacingAttributes()},E.prototype.setInheritedAttributes=function(V,O,R,j){var G,z;V===void 0&&(V={}),O===void 0&&(O=!1),R===void 0&&(R=0),j===void 0&&(j=!1);var J=this.attributes.getAllDefaults();try{for(var tt=n(Object.keys(V)),ot=tt.next();!ot.done;ot=tt.next()){var et=ot.value;if(J.hasOwnProperty(et)||E.alwaysInherit.hasOwnProperty(et)){var Tt=i(V[et],2),At=Tt[0],Ut=Tt[1],ee=(E.noInherit[At]||{})[this.kind]||{};ee[et]||this.attributes.setInherited(et,Ut)}}}catch(lr){G={error:lr}}finally{try{ot&&!ot.done&&(z=tt.return)&&z.call(tt)}finally{if(G)throw G.error}}var ue=this.attributes.getExplicit("displaystyle");ue===void 0&&this.attributes.setInherited("displaystyle",O);var Ft=this.attributes.getExplicit("scriptlevel");Ft===void 0&&this.attributes.setInherited("scriptlevel",R),j&&this.setProperty("texprimestyle",j);var pe=this.arity;if(pe>=0&&pe!==1/0&&(pe===1&&this.childNodes.length===0||pe!==1&&this.childNodes.length!==pe))if(pe<this.childNodes.length)this.childNodes=this.childNodes.slice(0,pe);else for(;this.childNodes.length<pe;)this.appendChild(this.factory.create("mrow"));this.setChildInheritedAttributes(V,O,R,j)},E.prototype.setChildInheritedAttributes=function(V,O,R,j){var G,z;try{for(var J=n(this.childNodes),tt=J.next();!tt.done;tt=J.next()){var ot=tt.value;ot.setInheritedAttributes(V,O,R,j)}}catch(et){G={error:et}}finally{try{tt&&!tt.done&&(z=J.return)&&z.call(J)}finally{if(G)throw G.error}}},E.prototype.addInheritedAttributes=function(V,O){var R,j,G=r({},V);try{for(var z=n(Object.keys(O)),J=z.next();!J.done;J=z.next()){var tt=J.value;tt!=="displaystyle"&&tt!=="scriptlevel"&&tt!=="style"&&(G[tt]=[this.kind,O[tt]])}}catch(ot){R={error:ot}}finally{try{J&&!J.done&&(j=z.return)&&j.call(z)}finally{if(R)throw R.error}}return G},E.prototype.inheritAttributesFrom=function(V){var O=V.attributes,R=O.get("displaystyle"),j=O.get("scriptlevel"),G=O.isSet("mathsize")?{mathsize:["math",O.get("mathsize")]}:{},z=V.getProperty("texprimestyle")||!1;this.setInheritedAttributes(G,R,j,z)},E.prototype.verifyTree=function(V){if(V===void 0&&(V=null),V!==null){this.verifyAttributes(V);var O=this.arity;V.checkArity&&O>=0&&O!==1/0&&(O===1&&this.childNodes.length===0||O!==1&&this.childNodes.length!==O)&&this.mError('Wrong number of children for "'+this.kind+'" node',V,!0),this.verifyChildren(V)}},E.prototype.verifyAttributes=function(V){var O,R;if(V.checkAttributes){var j=this.attributes,G=[];try{for(var z=n(j.getExplicitNames()),J=z.next();!J.done;J=z.next()){var tt=J.value;tt.substr(0,5)!=="data-"&&j.getDefault(tt)===void 0&&!tt.match(/^(?:class|style|id|(?:xlink:)?href)$/)&&G.push(tt)}}catch(ot){O={error:ot}}finally{try{J&&!J.done&&(R=z.return)&&R.call(z)}finally{if(O)throw O.error}}G.length&&this.mError("Unknown attributes for "+this.kind+" node: "+G.join(", "),V)}},E.prototype.verifyChildren=function(V){var O,R;try{for(var j=n(this.childNodes),G=j.next();!G.done;G=j.next()){var z=G.value;z.verifyTree(V)}}catch(J){O={error:J}}finally{try{G&&!G.done&&(R=j.return)&&R.call(j)}finally{if(O)throw O.error}}},E.prototype.mError=function(V,O,R){if(R===void 0&&(R=!1),this.parent&&this.parent.isKind("merror"))return null;var j=this.factory.create("merror");if(j.attributes.set("data-mjx-message",V),O.fullErrors||R){var G=this.factory.create("mtext"),z=this.factory.create("text");z.setText(O.fullErrors?V:this.kind),G.appendChild(z),j.appendChild(G),this.parent.replaceChild(j,this)}else this.parent.replaceChild(j,this),j.appendChild(this);return j},E.defaults={mathbackground:o.INHERIT,mathcolor:o.INHERIT,mathsize:o.INHERIT,dir:o.INHERIT},E.noInherit={mstyle:{mpadded:{width:!0,height:!0,depth:!0,lspace:!0,voffset:!0},mtable:{width:!0,height:!0,depth:!0,align:!0}},maligngroup:{mrow:{groupalign:!0},mtable:{groupalign:!0}}},E.alwaysInherit={scriptminsize:!0,scriptsizemultiplier:!0},E.verifyDefaults={checkArity:!0,checkAttributes:!1,fullErrors:!1,fixMmultiscripts:!0,fixMtables:!0},E}(a.AbstractNode);t.AbstractMmlNode=p;var f=function(M){e(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return Object.defineProperty(E.prototype,"isToken",{get:function(){return!0},enumerable:!1,configurable:!0}),E.prototype.getText=function(){var V,O,R="";try{for(var j=n(this.childNodes),G=j.next();!G.done;G=j.next()){var z=G.value;z instanceof v&&(R+=z.getText())}}catch(J){V={error:J}}finally{try{G&&!G.done&&(O=j.return)&&O.call(j)}finally{if(V)throw V.error}}return R},E.prototype.setChildInheritedAttributes=function(V,O,R,j){var G,z;try{for(var J=n(this.childNodes),tt=J.next();!tt.done;tt=J.next()){var ot=tt.value;ot instanceof p&&ot.setInheritedAttributes(V,O,R,j)}}catch(et){G={error:et}}finally{try{tt&&!tt.done&&(z=J.return)&&z.call(J)}finally{if(G)throw G.error}}},E.prototype.walkTree=function(V,O){var R,j;V(this,O);try{for(var G=n(this.childNodes),z=G.next();!z.done;z=G.next()){var J=z.value;J instanceof p&&J.walkTree(V,O)}}catch(tt){R={error:tt}}finally{try{z&&!z.done&&(j=G.return)&&j.call(G)}finally{if(R)throw R.error}}return O},E.defaults=r(r({},p.defaults),{mathvariant:"normal",mathsize:o.INHERIT}),E}(p);t.AbstractMmlTokenNode=f;var Q=function(M){e(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return Object.defineProperty(E.prototype,"isSpacelike",{get:function(){return this.childNodes[0].isSpacelike},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isEmbellished",{get:function(){return this.childNodes[0].isEmbellished},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"arity",{get:function(){return-1},enumerable:!1,configurable:!0}),E.prototype.core=function(){return this.childNodes[0]},E.prototype.coreMO=function(){return this.childNodes[0].coreMO()},E.prototype.setTeXclass=function(V){return V=this.childNodes[0].setTeXclass(V),this.updateTeXclass(this.childNodes[0]),V},E.defaults=p.defaults,E}(p);t.AbstractMmlLayoutNode=Q;var m=function(M){e(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return Object.defineProperty(E.prototype,"isEmbellished",{get:function(){return this.childNodes[0].isEmbellished},enumerable:!1,configurable:!0}),E.prototype.core=function(){return this.childNodes[0]},E.prototype.coreMO=function(){return this.childNodes[0].coreMO()},E.prototype.setTeXclass=function(V){var O,R;this.getPrevClass(V),this.texClass=t.TEXCLASS.ORD;var j=this.childNodes[0];j?this.isEmbellished||j.isKind("mi")?(V=j.setTeXclass(V),this.updateTeXclass(this.core())):(j.setTeXclass(null),V=this):V=this;try{for(var G=n(this.childNodes.slice(1)),z=G.next();!z.done;z=G.next()){var J=z.value;J&&J.setTeXclass(null)}}catch(tt){O={error:tt}}finally{try{z&&!z.done&&(R=G.return)&&R.call(G)}finally{if(O)throw O.error}}return V},E.defaults=p.defaults,E}(p);t.AbstractMmlBaseNode=m;var _=function(M){e(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return Object.defineProperty(E.prototype,"isToken",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isEmbellished",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isSpacelike",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"linebreakContainer",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"hasNewLine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"arity",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isInferred",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"notParent",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"Parent",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"texClass",{get:function(){return t.TEXCLASS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"prevClass",{get:function(){return t.TEXCLASS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"prevLevel",{get:function(){return 0},enumerable:!1,configurable:!0}),E.prototype.hasSpacingAttributes=function(){return!1},Object.defineProperty(E.prototype,"attributes",{get:function(){return null},enumerable:!1,configurable:!0}),E.prototype.core=function(){return this},E.prototype.coreMO=function(){return this},E.prototype.coreIndex=function(){return 0},E.prototype.childPosition=function(){return 0},E.prototype.setTeXclass=function(V){return V},E.prototype.texSpacing=function(){return""},E.prototype.setInheritedAttributes=function(V,O,R,j){},E.prototype.inheritAttributesFrom=function(V){},E.prototype.verifyTree=function(V){},E.prototype.mError=function(V,O,R){return null},E}(a.AbstractEmptyNode);t.AbstractMmlEmptyNode=_;var v=function(M){e(E,M);function E(){var V=M!==null&&M.apply(this,arguments)||this;return V.text="",V}return Object.defineProperty(E.prototype,"kind",{get:function(){return"text"},enumerable:!1,configurable:!0}),E.prototype.getText=function(){return this.text},E.prototype.setText=function(V){return this.text=V,this},E.prototype.copy=function(){return this.factory.create(this.kind).setText(this.getText())},E.prototype.toString=function(){return this.text},E}(_);t.TextNode=v;var b=function(M){e(E,M);function E(){var V=M!==null&&M.apply(this,arguments)||this;return V.xml=null,V.adaptor=null,V}return Object.defineProperty(E.prototype,"kind",{get:function(){return"XML"},enumerable:!1,configurable:!0}),E.prototype.getXML=function(){return this.xml},E.prototype.setXML=function(V,O){return O===void 0&&(O=null),this.xml=V,this.adaptor=O,this},E.prototype.getSerializedXML=function(){return this.adaptor.serializeXML(this.xml)},E.prototype.copy=function(){return this.factory.create(this.kind).setXML(this.adaptor.clone(this.xml))},E.prototype.toString=function(){return"XML data"},E}(_);t.XMLNode=b}(fr);var Pn={},i6={},Gy={};(function(t){var e=P&&P.__values||function(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],d=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&d>=o.length&&(o=void 0),{value:o&&o[d++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.OPTABLE=t.MMLSPACING=t.getRange=t.RANGES=t.MO=t.OPDEF=void 0;var r=fr;function n(o,a,s,d){return s===void 0&&(s=r.TEXCLASS.BIN),d===void 0&&(d=null),[o,a,s,d]}t.OPDEF=n,t.MO={ORD:n(0,0,r.TEXCLASS.ORD),ORD11:n(1,1,r.TEXCLASS.ORD),ORD21:n(2,1,r.TEXCLASS.ORD),ORD02:n(0,2,r.TEXCLASS.ORD),ORD55:n(5,5,r.TEXCLASS.ORD),NONE:n(0,0,r.TEXCLASS.NONE),OP:n(1,2,r.TEXCLASS.OP,{largeop:!0,movablelimits:!0,symmetric:!0}),OPFIXED:n(1,2,r.TEXCLASS.OP,{largeop:!0,movablelimits:!0}),INTEGRAL:n(0,1,r.TEXCLASS.OP,{largeop:!0,symmetric:!0}),INTEGRAL2:n(1,2,r.TEXCLASS.OP,{largeop:!0,symmetric:!0}),BIN3:n(3,3,r.TEXCLASS.BIN),BIN4:n(4,4,r.TEXCLASS.BIN),BIN01:n(0,1,r.TEXCLASS.BIN),BIN5:n(5,5,r.TEXCLASS.BIN),TALLBIN:n(4,4,r.TEXCLASS.BIN,{stretchy:!0}),BINOP:n(4,4,r.TEXCLASS.BIN,{largeop:!0,movablelimits:!0}),REL:n(5,5,r.TEXCLASS.REL),REL1:n(1,1,r.TEXCLASS.REL,{stretchy:!0}),REL4:n(4,4,r.TEXCLASS.REL),RELSTRETCH:n(5,5,r.TEXCLASS.REL,{stretchy:!0}),RELACCENT:n(5,5,r.TEXCLASS.REL,{accent:!0}),WIDEREL:n(5,5,r.TEXCLASS.REL,{accent:!0,stretchy:!0}),OPEN:n(0,0,r.TEXCLASS.OPEN,{fence:!0,stretchy:!0,symmetric:!0}),CLOSE:n(0,0,r.TEXCLASS.CLOSE,{fence:!0,stretchy:!0,symmetric:!0}),INNER:n(0,0,r.TEXCLASS.INNER),PUNCT:n(0,3,r.TEXCLASS.PUNCT),ACCENT:n(0,0,r.TEXCLASS.ORD,{accent:!0}),WIDEACCENT:n(0,0,r.TEXCLASS.ORD,{accent:!0,stretchy:!0})},t.RANGES=[[32,127,r.TEXCLASS.REL,"mo"],[160,191,r.TEXCLASS.ORD,"mo"],[192,591,r.TEXCLASS.ORD,"mi"],[688,879,r.TEXCLASS.ORD,"mo"],[880,6688,r.TEXCLASS.ORD,"mi"],[6832,6911,r.TEXCLASS.ORD,"mo"],[6912,7615,r.TEXCLASS.ORD,"mi"],[7616,7679,r.TEXCLASS.ORD,"mo"],[7680,8191,r.TEXCLASS.ORD,"mi"],[8192,8303,r.TEXCLASS.ORD,"mo"],[8304,8351,r.TEXCLASS.ORD,"mo"],[8448,8527,r.TEXCLASS.ORD,"mi"],[8528,8591,r.TEXCLASS.ORD,"mn"],[8592,8703,r.TEXCLASS.REL,"mo"],[8704,8959,r.TEXCLASS.BIN,"mo"],[8960,9215,r.TEXCLASS.ORD,"mo"],[9312,9471,r.TEXCLASS.ORD,"mn"],[9472,10223,r.TEXCLASS.ORD,"mo"],[10224,10239,r.TEXCLASS.REL,"mo"],[10240,10495,r.TEXCLASS.ORD,"mtext"],[10496,10623,r.TEXCLASS.REL,"mo"],[10624,10751,r.TEXCLASS.ORD,"mo"],[10752,11007,r.TEXCLASS.BIN,"mo"],[11008,11055,r.TEXCLASS.ORD,"mo"],[11056,11087,r.TEXCLASS.REL,"mo"],[11088,11263,r.TEXCLASS.ORD,"mo"],[11264,11744,r.TEXCLASS.ORD,"mi"],[11776,11903,r.TEXCLASS.ORD,"mo"],[11904,12255,r.TEXCLASS.ORD,"mi","normal"],[12272,12351,r.TEXCLASS.ORD,"mo"],[12352,42143,r.TEXCLASS.ORD,"mi","normal"],[42192,43055,r.TEXCLASS.ORD,"mi"],[43056,43071,r.TEXCLASS.ORD,"mn"],[43072,55295,r.TEXCLASS.ORD,"mi"],[63744,64255,r.TEXCLASS.ORD,"mi","normal"],[64256,65023,r.TEXCLASS.ORD,"mi"],[65024,65135,r.TEXCLASS.ORD,"mo"],[65136,65791,r.TEXCLASS.ORD,"mi"],[65792,65935,r.TEXCLASS.ORD,"mn"],[65936,74751,r.TEXCLASS.ORD,"mi","normal"],[74752,74879,r.TEXCLASS.ORD,"mn"],[74880,113823,r.TEXCLASS.ORD,"mi","normal"],[113824,119391,r.TEXCLASS.ORD,"mo"],[119648,119679,r.TEXCLASS.ORD,"mn"],[119808,120781,r.TEXCLASS.ORD,"mi"],[120782,120831,r.TEXCLASS.ORD,"mn"],[122624,129023,r.TEXCLASS.ORD,"mo"],[129024,129279,r.TEXCLASS.REL,"mo"],[129280,129535,r.TEXCLASS.ORD,"mo"],[131072,195103,r.TEXCLASS.ORD,"mi","normnal"]];function i(o){var a,s,d=o.codePointAt(0);try{for(var p=e(t.RANGES),f=p.next();!f.done;f=p.next()){var Q=f.value;if(d<=Q[1]){if(d>=Q[0])return Q;break}}}catch(m){a={error:m}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return null}t.getRange=i,t.MMLSPACING=[[0,0],[1,2],[3,3],[4,4],[0,0],[0,0],[0,3]],t.OPTABLE={prefix:{"(":t.MO.OPEN,"+":t.MO.BIN01,"-":t.MO.BIN01,"[":t.MO.OPEN,"{":t.MO.OPEN,"|":t.MO.OPEN,"||":[0,0,r.TEXCLASS.BIN,{fence:!0,stretchy:!0,symmetric:!0}],"|||":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0,symmetric:!0}],"¬":t.MO.ORD21,"±":t.MO.BIN01,"‖":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0}],"‘":[0,0,r.TEXCLASS.OPEN,{fence:!0}],"“":[0,0,r.TEXCLASS.OPEN,{fence:!0}],"ⅅ":t.MO.ORD21,"ⅆ":n(2,0,r.TEXCLASS.ORD),"∀":t.MO.ORD21,"∂":t.MO.ORD21,"∃":t.MO.ORD21,"∄":t.MO.ORD21,"∇":t.MO.ORD21,"∏":t.MO.OP,"∐":t.MO.OP,"∑":t.MO.OP,"−":t.MO.BIN01,"∓":t.MO.BIN01,"√":[1,1,r.TEXCLASS.ORD,{stretchy:!0}],"∛":t.MO.ORD11,"∜":t.MO.ORD11,"∠":t.MO.ORD,"∡":t.MO.ORD,"∢":t.MO.ORD,"∫":t.MO.INTEGRAL,"∬":t.MO.INTEGRAL,"∭":t.MO.INTEGRAL,"∮":t.MO.INTEGRAL,"∯":t.MO.INTEGRAL,"∰":t.MO.INTEGRAL,"∱":t.MO.INTEGRAL,"∲":t.MO.INTEGRAL,"∳":t.MO.INTEGRAL,"⋀":t.MO.OP,"⋁":t.MO.OP,"⋂":t.MO.OP,"⋃":t.MO.OP,"⌈":t.MO.OPEN,"⌊":t.MO.OPEN,"〈":t.MO.OPEN,"❲":t.MO.OPEN,"⟦":t.MO.OPEN,"⟨":t.MO.OPEN,"⟪":t.MO.OPEN,"⟬":t.MO.OPEN,"⟮":t.MO.OPEN,"⦀":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0}],"⦃":t.MO.OPEN,"⦅":t.MO.OPEN,"⦇":t.MO.OPEN,"⦉":t.MO.OPEN,"⦋":t.MO.OPEN,"⦍":t.MO.OPEN,"⦏":t.MO.OPEN,"⦑":t.MO.OPEN,"⦓":t.MO.OPEN,"⦕":t.MO.OPEN,"⦗":t.MO.OPEN,"⧼":t.MO.OPEN,"⨀":t.MO.OP,"⨁":t.MO.OP,"⨂":t.MO.OP,"⨃":t.MO.OP,"⨄":t.MO.OP,"⨅":t.MO.OP,"⨆":t.MO.OP,"⨇":t.MO.OP,"⨈":t.MO.OP,"⨉":t.MO.OP,"⨊":t.MO.OP,"⨋":t.MO.INTEGRAL2,"⨌":t.MO.INTEGRAL,"⨍":t.MO.INTEGRAL2,"⨎":t.MO.INTEGRAL2,"⨏":t.MO.INTEGRAL2,"⨐":t.MO.OP,"⨑":t.MO.OP,"⨒":t.MO.OP,"⨓":t.MO.OP,"⨔":t.MO.OP,"⨕":t.MO.INTEGRAL2,"⨖":t.MO.INTEGRAL2,"⨗":t.MO.INTEGRAL2,"⨘":t.MO.INTEGRAL2,"⨙":t.MO.INTEGRAL2,"⨚":t.MO.INTEGRAL2,"⨛":t.MO.INTEGRAL2,"⨜":t.MO.INTEGRAL2,"⫼":t.MO.OP,"⫿":t.MO.OP},postfix:{"!!":n(1,0),"!":[1,0,r.TEXCLASS.CLOSE,null],'"':t.MO.ACCENT,"&":t.MO.ORD,")":t.MO.CLOSE,"++":n(0,0),"--":n(0,0),"..":n(0,0),"...":t.MO.ORD,"'":t.MO.ACCENT,"]":t.MO.CLOSE,"^":t.MO.WIDEACCENT,_:t.MO.WIDEACCENT,"`":t.MO.ACCENT,"|":t.MO.CLOSE,"}":t.MO.CLOSE,"~":t.MO.WIDEACCENT,"||":[0,0,r.TEXCLASS.BIN,{fence:!0,stretchy:!0,symmetric:!0}],"|||":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0,symmetric:!0}],"¨":t.MO.ACCENT,ª:t.MO.ACCENT,"¯":t.MO.WIDEACCENT,"°":t.MO.ORD,"²":t.MO.ACCENT,"³":t.MO.ACCENT,"´":t.MO.ACCENT,"¸":t.MO.ACCENT,"¹":t.MO.ACCENT,º:t.MO.ACCENT,"ˆ":t.MO.WIDEACCENT,"ˇ":t.MO.WIDEACCENT,"ˉ":t.MO.WIDEACCENT,"ˊ":t.MO.ACCENT,"ˋ":t.MO.ACCENT,"ˍ":t.MO.WIDEACCENT,"˘":t.MO.ACCENT,"˙":t.MO.ACCENT,"˚":t.MO.ACCENT,"˜":t.MO.WIDEACCENT,"˝":t.MO.ACCENT,"˷":t.MO.WIDEACCENT,"̂":t.MO.WIDEACCENT,"̑":t.MO.ACCENT,"϶":t.MO.REL,"‖":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0}],"’":[0,0,r.TEXCLASS.CLOSE,{fence:!0}],"‚":t.MO.ACCENT,"‛":t.MO.ACCENT,"”":[0,0,r.TEXCLASS.CLOSE,{fence:!0}],"„":t.MO.ACCENT,"‟":t.MO.ACCENT,"′":t.MO.ORD,"″":t.MO.ACCENT,"‴":t.MO.ACCENT,"‵":t.MO.ACCENT,"‶":t.MO.ACCENT,"‷":t.MO.ACCENT,"‾":t.MO.WIDEACCENT,"⁗":t.MO.ACCENT,"⃛":t.MO.ACCENT,"⃜":t.MO.ACCENT,"⌉":t.MO.CLOSE,"⌋":t.MO.CLOSE,"〉":t.MO.CLOSE,"⎴":t.MO.WIDEACCENT,"⎵":t.MO.WIDEACCENT,"⏜":t.MO.WIDEACCENT,"⏝":t.MO.WIDEACCENT,"⏞":t.MO.WIDEACCENT,"⏟":t.MO.WIDEACCENT,"⏠":t.MO.WIDEACCENT,"⏡":t.MO.WIDEACCENT,"■":t.MO.BIN3,"□":t.MO.BIN3,"▪":t.MO.BIN3,"▫":t.MO.BIN3,"▭":t.MO.BIN3,"▮":t.MO.BIN3,"▯":t.MO.BIN3,"▰":t.MO.BIN3,"▱":t.MO.BIN3,"▲":t.MO.BIN4,"▴":t.MO.BIN4,"▶":t.MO.BIN4,"▷":t.MO.BIN4,"▸":t.MO.BIN4,"▼":t.MO.BIN4,"▾":t.MO.BIN4,"◀":t.MO.BIN4,"◁":t.MO.BIN4,"◂":t.MO.BIN4,"◄":t.MO.BIN4,"◅":t.MO.BIN4,"◆":t.MO.BIN4,"◇":t.MO.BIN4,"◈":t.MO.BIN4,"◉":t.MO.BIN4,"◌":t.MO.BIN4,"◍":t.MO.BIN4,"◎":t.MO.BIN4,"●":t.MO.BIN4,"◖":t.MO.BIN4,"◗":t.MO.BIN4,"◦":t.MO.BIN4,"♭":t.MO.ORD02,"♮":t.MO.ORD02,"♯":t.MO.ORD02,"❳":t.MO.CLOSE,"⟧":t.MO.CLOSE,"⟩":t.MO.CLOSE,"⟫":t.MO.CLOSE,"⟭":t.MO.CLOSE,"⟯":t.MO.CLOSE,"⦀":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0}],"⦄":t.MO.CLOSE,"⦆":t.MO.CLOSE,"⦈":t.MO.CLOSE,"⦊":t.MO.CLOSE,"⦌":t.MO.CLOSE,"⦎":t.MO.CLOSE,"⦐":t.MO.CLOSE,"⦒":t.MO.CLOSE,"⦔":t.MO.CLOSE,"⦖":t.MO.CLOSE,"⦘":t.MO.CLOSE,"⧽":t.MO.CLOSE},infix:{"!=":t.MO.BIN4,"#":t.MO.ORD,$:t.MO.ORD,"%":[3,3,r.TEXCLASS.ORD,null],"&&":t.MO.BIN4,"":t.MO.ORD,"*":t.MO.BIN3,"**":n(1,1),"*=":t.MO.BIN4,"+":t.MO.BIN4,"+=":t.MO.BIN4,",":[0,3,r.TEXCLASS.PUNCT,{linebreakstyle:"after",separator:!0}],"-":t.MO.BIN4,"-=":t.MO.BIN4,"->":t.MO.BIN5,".":[0,3,r.TEXCLASS.PUNCT,{separator:!0}],"/":t.MO.ORD11,"//":n(1,1),"/=":t.MO.BIN4,":":[1,2,r.TEXCLASS.REL,null],":=":t.MO.BIN4,";":[0,3,r.TEXCLASS.PUNCT,{linebreakstyle:"after",separator:!0}],"<":t.MO.REL,"<=":t.MO.BIN5,"<>":n(1,1),"=":t.MO.REL,"==":t.MO.BIN4,">":t.MO.REL,">=":t.MO.BIN5,"?":[1,1,r.TEXCLASS.CLOSE,null],"@":t.MO.ORD11,"\\":t.MO.ORD,"^":t.MO.ORD11,_:t.MO.ORD11,"|":[2,2,r.TEXCLASS.ORD,{fence:!0,stretchy:!0,symmetric:!0}],"||":[2,2,r.TEXCLASS.BIN,{fence:!0,stretchy:!0,symmetric:!0}],"|||":[2,2,r.TEXCLASS.ORD,{fence:!0,stretchy:!0,symmetric:!0}],"±":t.MO.BIN4,"·":t.MO.BIN4,"×":t.MO.BIN4,"÷":t.MO.BIN4,"ʹ":t.MO.ORD,"̀":t.MO.ACCENT,"́":t.MO.ACCENT,"̃":t.MO.WIDEACCENT,"̄":t.MO.ACCENT,"̆":t.MO.ACCENT,"̇":t.MO.ACCENT,"̈":t.MO.ACCENT,"̌":t.MO.ACCENT,"̲":t.MO.WIDEACCENT,"̸":t.MO.REL4,"―":[0,0,r.TEXCLASS.ORD,{stretchy:!0}],"‗":[0,0,r.TEXCLASS.ORD,{stretchy:!0}],"†":t.MO.BIN3,"‡":t.MO.BIN3,"•":t.MO.BIN4,"…":t.MO.INNER,"⁃":t.MO.BIN4,"⁄":t.MO.TALLBIN,"⁡":t.MO.NONE,"⁢":t.MO.NONE,"⁣":[0,0,r.TEXCLASS.NONE,{linebreakstyle:"after",separator:!0}],"⁤":t.MO.NONE,"⃗":t.MO.ACCENT,ℑ:t.MO.ORD,ℓ:t.MO.ORD,"℘":t.MO.ORD,ℜ:t.MO.ORD,"←":t.MO.WIDEREL,"↑":t.MO.RELSTRETCH,"→":t.MO.WIDEREL,"↓":t.MO.RELSTRETCH,"↔":t.MO.WIDEREL,"↕":t.MO.RELSTRETCH,"↖":t.MO.RELSTRETCH,"↗":t.MO.RELSTRETCH,"↘":t.MO.RELSTRETCH,"↙":t.MO.RELSTRETCH,"↚":t.MO.RELACCENT,"↛":t.MO.RELACCENT,"↜":t.MO.WIDEREL,"↝":t.MO.WIDEREL,"↞":t.MO.WIDEREL,"↟":t.MO.WIDEREL,"↠":t.MO.WIDEREL,"↡":t.MO.RELSTRETCH,"↢":t.MO.WIDEREL,"↣":t.MO.WIDEREL,"↤":t.MO.WIDEREL,"↥":t.MO.RELSTRETCH,"↦":t.MO.WIDEREL,"↧":t.MO.RELSTRETCH,"↨":t.MO.RELSTRETCH,"↩":t.MO.WIDEREL,"↪":t.MO.WIDEREL,"↫":t.MO.WIDEREL,"↬":t.MO.WIDEREL,"↭":t.MO.WIDEREL,"↮":t.MO.RELACCENT,"↯":t.MO.RELSTRETCH,"↰":t.MO.RELSTRETCH,"↱":t.MO.RELSTRETCH,"↲":t.MO.RELSTRETCH,"↳":t.MO.RELSTRETCH,"↴":t.MO.RELSTRETCH,"↵":t.MO.RELSTRETCH,"↶":t.MO.RELACCENT,"↷":t.MO.RELACCENT,"↸":t.MO.REL,"↹":t.MO.WIDEREL,"↺":t.MO.REL,"↻":t.MO.REL,"↼":t.MO.WIDEREL,"↽":t.MO.WIDEREL,"↾":t.MO.RELSTRETCH,"↿":t.MO.RELSTRETCH,"⇀":t.MO.WIDEREL,"⇁":t.MO.WIDEREL,"⇂":t.MO.RELSTRETCH,"⇃":t.MO.RELSTRETCH,"⇄":t.MO.WIDEREL,"⇅":t.MO.RELSTRETCH,"⇆":t.MO.WIDEREL,"⇇":t.MO.WIDEREL,"⇈":t.MO.RELSTRETCH,"⇉":t.MO.WIDEREL,"⇊":t.MO.RELSTRETCH,"⇋":t.MO.WIDEREL,"⇌":t.MO.WIDEREL,"⇍":t.MO.RELACCENT,"⇎":t.MO.RELACCENT,"⇏":t.MO.RELACCENT,"⇐":t.MO.WIDEREL,"⇑":t.MO.RELSTRETCH,"⇒":t.MO.WIDEREL,"⇓":t.MO.RELSTRETCH,"⇔":t.MO.WIDEREL,"⇕":t.MO.RELSTRETCH,"⇖":t.MO.RELSTRETCH,"⇗":t.MO.RELSTRETCH,"⇘":t.MO.RELSTRETCH,"⇙":t.MO.RELSTRETCH,"⇚":t.MO.WIDEREL,"⇛":t.MO.WIDEREL,"⇜":t.MO.WIDEREL,"⇝":t.MO.WIDEREL,"⇞":t.MO.REL,"⇟":t.MO.REL,"⇠":t.MO.WIDEREL,"⇡":t.MO.RELSTRETCH,"⇢":t.MO.WIDEREL,"⇣":t.MO.RELSTRETCH,"⇤":t.MO.WIDEREL,"⇥":t.MO.WIDEREL,"⇦":t.MO.WIDEREL,"⇧":t.MO.RELSTRETCH,"⇨":t.MO.WIDEREL,"⇩":t.MO.RELSTRETCH,"⇪":t.MO.RELSTRETCH,"⇫":t.MO.RELSTRETCH,"⇬":t.MO.RELSTRETCH,"⇭":t.MO.RELSTRETCH,"⇮":t.MO.RELSTRETCH,"⇯":t.MO.RELSTRETCH,"⇰":t.MO.WIDEREL,"⇱":t.MO.REL,"⇲":t.MO.REL,"⇳":t.MO.RELSTRETCH,"⇴":t.MO.RELACCENT,"⇵":t.MO.RELSTRETCH,"⇶":t.MO.WIDEREL,"⇷":t.MO.RELACCENT,"⇸":t.MO.RELACCENT,"⇹":t.MO.RELACCENT,"⇺":t.MO.RELACCENT,"⇻":t.MO.RELACCENT,"⇼":t.MO.RELACCENT,"⇽":t.MO.WIDEREL,"⇾":t.MO.WIDEREL,"⇿":t.MO.WIDEREL,"∁":n(1,2,r.TEXCLASS.ORD),"∅":t.MO.ORD,"∆":t.MO.BIN3,"∈":t.MO.REL,"∉":t.MO.REL,"∊":t.MO.REL,"∋":t.MO.REL,"∌":t.MO.REL,"∍":t.MO.REL,"∎":t.MO.BIN3,"−":t.MO.BIN4,"∓":t.MO.BIN4,"∔":t.MO.BIN4,"∕":t.MO.TALLBIN,"∖":t.MO.BIN4,"∗":t.MO.BIN4,"∘":t.MO.BIN4,"∙":t.MO.BIN4,"∝":t.MO.REL,"∞":t.MO.ORD,"∟":t.MO.REL,"∣":t.MO.REL,"∤":t.MO.REL,"∥":t.MO.REL,"∦":t.MO.REL,"∧":t.MO.BIN4,"∨":t.MO.BIN4,"∩":t.MO.BIN4,"∪":t.MO.BIN4,"∴":t.MO.REL,"∵":t.MO.REL,"∶":t.MO.REL,"∷":t.MO.REL,"∸":t.MO.BIN4,"∹":t.MO.REL,"∺":t.MO.BIN4,"∻":t.MO.REL,"∼":t.MO.REL,"∽":t.MO.REL,"∽̱":t.MO.BIN3,"∾":t.MO.REL,"∿":t.MO.BIN3,"≀":t.MO.BIN4,"≁":t.MO.REL,"≂":t.MO.REL,"≂̸":t.MO.REL,"≃":t.MO.REL,"≄":t.MO.REL,"≅":t.MO.REL,"≆":t.MO.REL,"≇":t.MO.REL,"≈":t.MO.REL,"≉":t.MO.REL,"≊":t.MO.REL,"≋":t.MO.REL,"≌":t.MO.REL,"≍":t.MO.REL,"≎":t.MO.REL,"≎̸":t.MO.REL,"≏":t.MO.REL,"≏̸":t.MO.REL,"≐":t.MO.REL,"≑":t.MO.REL,"≒":t.MO.REL,"≓":t.MO.REL,"≔":t.MO.REL,"≕":t.MO.REL,"≖":t.MO.REL,"≗":t.MO.REL,"≘":t.MO.REL,"≙":t.MO.REL,"≚":t.MO.REL,"≛":t.MO.REL,"≜":t.MO.REL,"≝":t.MO.REL,"≞":t.MO.REL,"≟":t.MO.REL,"≠":t.MO.REL,"≡":t.MO.REL,"≢":t.MO.REL,"≣":t.MO.REL,"≤":t.MO.REL,"≥":t.MO.REL,"≦":t.MO.REL,"≦̸":t.MO.REL,"≧":t.MO.REL,"≨":t.MO.REL,"≩":t.MO.REL,"≪":t.MO.REL,"≪̸":t.MO.REL,"≫":t.MO.REL,"≫̸":t.MO.REL,"≬":t.MO.REL,"≭":t.MO.REL,"≮":t.MO.REL,"≯":t.MO.REL,"≰":t.MO.REL,"≱":t.MO.REL,"≲":t.MO.REL,"≳":t.MO.REL,"≴":t.MO.REL,"≵":t.MO.REL,"≶":t.MO.REL,"≷":t.MO.REL,"≸":t.MO.REL,"≹":t.MO.REL,"≺":t.MO.REL,"≻":t.MO.REL,"≼":t.MO.REL,"≽":t.MO.REL,"≾":t.MO.REL,"≿":t.MO.REL,"≿̸":t.MO.REL,"⊀":t.MO.REL,"⊁":t.MO.REL,"⊂":t.MO.REL,"⊂⃒":t.MO.REL,"⊃":t.MO.REL,"⊃⃒":t.MO.REL,"⊄":t.MO.REL,"⊅":t.MO.REL,"⊆":t.MO.REL,"⊇":t.MO.REL,"⊈":t.MO.REL,"⊉":t.MO.REL,"⊊":t.MO.REL,"⊋":t.MO.REL,"⊌":t.MO.BIN4,"⊍":t.MO.BIN4,"⊎":t.MO.BIN4,"⊏":t.MO.REL,"⊏̸":t.MO.REL,"⊐":t.MO.REL,"⊐̸":t.MO.REL,"⊑":t.MO.REL,"⊒":t.MO.REL,"⊓":t.MO.BIN4,"⊔":t.MO.BIN4,"⊕":t.MO.BIN4,"⊖":t.MO.BIN4,"⊗":t.MO.BIN4,"⊘":t.MO.BIN4,"⊙":t.MO.BIN4,"⊚":t.MO.BIN4,"⊛":t.MO.BIN4,"⊜":t.MO.BIN4,"⊝":t.MO.BIN4,"⊞":t.MO.BIN4,"⊟":t.MO.BIN4,"⊠":t.MO.BIN4,"⊡":t.MO.BIN4,"⊢":t.MO.REL,"⊣":t.MO.REL,"⊤":t.MO.ORD55,"⊥":t.MO.REL,"⊦":t.MO.REL,"⊧":t.MO.REL,"⊨":t.MO.REL,"⊩":t.MO.REL,"⊪":t.MO.REL,"⊫":t.MO.REL,"⊬":t.MO.REL,"⊭":t.MO.REL,"⊮":t.MO.REL,"⊯":t.MO.REL,"⊰":t.MO.REL,"⊱":t.MO.REL,"⊲":t.MO.REL,"⊳":t.MO.REL,"⊴":t.MO.REL,"⊵":t.MO.REL,"⊶":t.MO.REL,"⊷":t.MO.REL,"⊸":t.MO.REL,"⊹":t.MO.REL,"⊺":t.MO.BIN4,"⊻":t.MO.BIN4,"⊼":t.MO.BIN4,"⊽":t.MO.BIN4,"⊾":t.MO.BIN3,"⊿":t.MO.BIN3,"⋄":t.MO.BIN4,"⋅":t.MO.BIN4,"⋆":t.MO.BIN4,"⋇":t.MO.BIN4,"⋈":t.MO.REL,"⋉":t.MO.BIN4,"⋊":t.MO.BIN4,"⋋":t.MO.BIN4,"⋌":t.MO.BIN4,"⋍":t.MO.REL,"⋎":t.MO.BIN4,"⋏":t.MO.BIN4,"⋐":t.MO.REL,"⋑":t.MO.REL,"⋒":t.MO.BIN4,"⋓":t.MO.BIN4,"⋔":t.MO.REL,"⋕":t.MO.REL,"⋖":t.MO.REL,"⋗":t.MO.REL,"⋘":t.MO.REL,"⋙":t.MO.REL,"⋚":t.MO.REL,"⋛":t.MO.REL,"⋜":t.MO.REL,"⋝":t.MO.REL,"⋞":t.MO.REL,"⋟":t.MO.REL,"⋠":t.MO.REL,"⋡":t.MO.REL,"⋢":t.MO.REL,"⋣":t.MO.REL,"⋤":t.MO.REL,"⋥":t.MO.REL,"⋦":t.MO.REL,"⋧":t.MO.REL,"⋨":t.MO.REL,"⋩":t.MO.REL,"⋪":t.MO.REL,"⋫":t.MO.REL,"⋬":t.MO.REL,"⋭":t.MO.REL,"⋮":t.MO.ORD55,"⋯":t.MO.INNER,"⋰":t.MO.REL,"⋱":[5,5,r.TEXCLASS.INNER,null],"⋲":t.MO.REL,"⋳":t.MO.REL,"⋴":t.MO.REL,"⋵":t.MO.REL,"⋶":t.MO.REL,"⋷":t.MO.REL,"⋸":t.MO.REL,"⋹":t.MO.REL,"⋺":t.MO.REL,"⋻":t.MO.REL,"⋼":t.MO.REL,"⋽":t.MO.REL,"⋾":t.MO.REL,"⋿":t.MO.REL,"⌅":t.MO.BIN3,"⌆":t.MO.BIN3,"⌢":t.MO.REL4,"⌣":t.MO.REL4,"〈":t.MO.OPEN,"〉":t.MO.CLOSE,"⎪":t.MO.ORD,"⎯":[0,0,r.TEXCLASS.ORD,{stretchy:!0}],"⎰":t.MO.OPEN,"⎱":t.MO.CLOSE,"─":t.MO.ORD,"△":t.MO.BIN4,"▵":t.MO.BIN4,"▹":t.MO.BIN4,"▽":t.MO.BIN4,"▿":t.MO.BIN4,"◃":t.MO.BIN4,"◯":t.MO.BIN3,"♠":t.MO.ORD,"♡":t.MO.ORD,"♢":t.MO.ORD,"♣":t.MO.ORD,"❘":t.MO.REL,"⟰":t.MO.RELSTRETCH,"⟱":t.MO.RELSTRETCH,"⟵":t.MO.WIDEREL,"⟶":t.MO.WIDEREL,"⟷":t.MO.WIDEREL,"⟸":t.MO.WIDEREL,"⟹":t.MO.WIDEREL,"⟺":t.MO.WIDEREL,"⟻":t.MO.WIDEREL,"⟼":t.MO.WIDEREL,"⟽":t.MO.WIDEREL,"⟾":t.MO.WIDEREL,"⟿":t.MO.WIDEREL,"⤀":t.MO.RELACCENT,"⤁":t.MO.RELACCENT,"⤂":t.MO.RELACCENT,"⤃":t.MO.RELACCENT,"⤄":t.MO.RELACCENT,"⤅":t.MO.RELACCENT,"⤆":t.MO.RELACCENT,"⤇":t.MO.RELACCENT,"⤈":t.MO.REL,"⤉":t.MO.REL,"⤊":t.MO.RELSTRETCH,"⤋":t.MO.RELSTRETCH,"⤌":t.MO.WIDEREL,"⤍":t.MO.WIDEREL,"⤎":t.MO.WIDEREL,"⤏":t.MO.WIDEREL,"⤐":t.MO.WIDEREL,"⤑":t.MO.RELACCENT,"⤒":t.MO.RELSTRETCH,"⤓":t.MO.RELSTRETCH,"⤔":t.MO.RELACCENT,"⤕":t.MO.RELACCENT,"⤖":t.MO.RELACCENT,"⤗":t.MO.RELACCENT,"⤘":t.MO.RELACCENT,"⤙":t.MO.RELACCENT,"⤚":t.MO.RELACCENT,"⤛":t.MO.RELACCENT,"⤜":t.MO.RELACCENT,"⤝":t.MO.RELACCENT,"⤞":t.MO.RELACCENT,"⤟":t.MO.RELACCENT,"⤠":t.MO.RELACCENT,"⤡":t.MO.RELSTRETCH,"⤢":t.MO.RELSTRETCH,"⤣":t.MO.REL,"⤤":t.MO.REL,"⤥":t.MO.REL,"⤦":t.MO.REL,"⤧":t.MO.REL,"⤨":t.MO.REL,"⤩":t.MO.REL,"⤪":t.MO.REL,"⤫":t.MO.REL,"⤬":t.MO.REL,"⤭":t.MO.REL,"⤮":t.MO.REL,"⤯":t.MO.REL,"⤰":t.MO.REL,"⤱":t.MO.REL,"⤲":t.MO.REL,"⤳":t.MO.RELACCENT,"⤴":t.MO.REL,"⤵":t.MO.REL,"⤶":t.MO.REL,"⤷":t.MO.REL,"⤸":t.MO.REL,"⤹":t.MO.REL,"⤺":t.MO.RELACCENT,"⤻":t.MO.RELACCENT,"⤼":t.MO.RELACCENT,"⤽":t.MO.RELACCENT,"⤾":t.MO.REL,"⤿":t.MO.REL,"⥀":t.MO.REL,"⥁":t.MO.REL,"⥂":t.MO.RELACCENT,"⥃":t.MO.RELACCENT,"⥄":t.MO.RELACCENT,"⥅":t.MO.RELACCENT,"⥆":t.MO.RELACCENT,"⥇":t.MO.RELACCENT,"⥈":t.MO.RELACCENT,"⥉":t.MO.REL,"⥊":t.MO.RELACCENT,"⥋":t.MO.RELACCENT,"⥌":t.MO.REL,"⥍":t.MO.REL,"⥎":t.MO.WIDEREL,"⥏":t.MO.RELSTRETCH,"⥐":t.MO.WIDEREL,"⥑":t.MO.RELSTRETCH,"⥒":t.MO.WIDEREL,"⥓":t.MO.WIDEREL,"⥔":t.MO.RELSTRETCH,"⥕":t.MO.RELSTRETCH,"⥖":t.MO.RELSTRETCH,"⥗":t.MO.RELSTRETCH,"⥘":t.MO.RELSTRETCH,"⥙":t.MO.RELSTRETCH,"⥚":t.MO.WIDEREL,"⥛":t.MO.WIDEREL,"⥜":t.MO.RELSTRETCH,"⥝":t.MO.RELSTRETCH,"⥞":t.MO.WIDEREL,"⥟":t.MO.WIDEREL,"⥠":t.MO.RELSTRETCH,"⥡":t.MO.RELSTRETCH,"⥢":t.MO.RELACCENT,"⥣":t.MO.REL,"⥤":t.MO.RELACCENT,"⥥":t.MO.REL,"⥦":t.MO.RELACCENT,"⥧":t.MO.RELACCENT,"⥨":t.MO.RELACCENT,"⥩":t.MO.RELACCENT,"⥪":t.MO.RELACCENT,"⥫":t.MO.RELACCENT,"⥬":t.MO.RELACCENT,"⥭":t.MO.RELACCENT,"⥮":t.MO.RELSTRETCH,"⥯":t.MO.RELSTRETCH,"⥰":t.MO.RELACCENT,"⥱":t.MO.RELACCENT,"⥲":t.MO.RELACCENT,"⥳":t.MO.RELACCENT,"⥴":t.MO.RELACCENT,"⥵":t.MO.RELACCENT,"⥶":t.MO.RELACCENT,"⥷":t.MO.RELACCENT,"⥸":t.MO.RELACCENT,"⥹":t.MO.RELACCENT,"⥺":t.MO.RELACCENT,"⥻":t.MO.RELACCENT,"⥼":t.MO.RELACCENT,"⥽":t.MO.RELACCENT,"⥾":t.MO.REL,"⥿":t.MO.REL,"⦁":t.MO.BIN3,"⦂":t.MO.BIN3,"⦙":t.MO.BIN3,"⦚":t.MO.BIN3,"⦛":t.MO.BIN3,"⦜":t.MO.BIN3,"⦝":t.MO.BIN3,"⦞":t.MO.BIN3,"⦟":t.MO.BIN3,"⦠":t.MO.BIN3,"⦡":t.MO.BIN3,"⦢":t.MO.BIN3,"⦣":t.MO.BIN3,"⦤":t.MO.BIN3,"⦥":t.MO.BIN3,"⦦":t.MO.BIN3,"⦧":t.MO.BIN3,"⦨":t.MO.BIN3,"⦩":t.MO.BIN3,"⦪":t.MO.BIN3,"⦫":t.MO.BIN3,"⦬":t.MO.BIN3,"⦭":t.MO.BIN3,"⦮":t.MO.BIN3,"⦯":t.MO.BIN3,"⦰":t.MO.BIN3,"⦱":t.MO.BIN3,"⦲":t.MO.BIN3,"⦳":t.MO.BIN3,"⦴":t.MO.BIN3,"⦵":t.MO.BIN3,"⦶":t.MO.BIN4,"⦷":t.MO.BIN4,"⦸":t.MO.BIN4,"⦹":t.MO.BIN4,"⦺":t.MO.BIN4,"⦻":t.MO.BIN4,"⦼":t.MO.BIN4,"⦽":t.MO.BIN4,"⦾":t.MO.BIN4,"⦿":t.MO.BIN4,"⧀":t.MO.REL,"⧁":t.MO.REL,"⧂":t.MO.BIN3,"⧃":t.MO.BIN3,"⧄":t.MO.BIN4,"⧅":t.MO.BIN4,"⧆":t.MO.BIN4,"⧇":t.MO.BIN4,"⧈":t.MO.BIN4,"⧉":t.MO.BIN3,"⧊":t.MO.BIN3,"⧋":t.MO.BIN3,"⧌":t.MO.BIN3,"⧍":t.MO.BIN3,"⧎":t.MO.REL,"⧏":t.MO.REL,"⧏̸":t.MO.REL,"⧐":t.MO.REL,"⧐̸":t.MO.REL,"⧑":t.MO.REL,"⧒":t.MO.REL,"⧓":t.MO.REL,"⧔":t.MO.REL,"⧕":t.MO.REL,"⧖":t.MO.BIN4,"⧗":t.MO.BIN4,"⧘":t.MO.BIN3,"⧙":t.MO.BIN3,"⧛":t.MO.BIN3,"⧜":t.MO.BIN3,"⧝":t.MO.BIN3,"⧞":t.MO.REL,"⧟":t.MO.BIN3,"⧠":t.MO.BIN3,"⧡":t.MO.REL,"⧢":t.MO.BIN4,"⧣":t.MO.REL,"⧤":t.MO.REL,"⧥":t.MO.REL,"⧦":t.MO.REL,"⧧":t.MO.BIN3,"⧨":t.MO.BIN3,"⧩":t.MO.BIN3,"⧪":t.MO.BIN3,"⧫":t.MO.BIN3,"⧬":t.MO.BIN3,"⧭":t.MO.BIN3,"⧮":t.MO.BIN3,"⧯":t.MO.BIN3,"⧰":t.MO.BIN3,"⧱":t.MO.BIN3,"⧲":t.MO.BIN3,"⧳":t.MO.BIN3,"⧴":t.MO.REL,"⧵":t.MO.BIN4,"⧶":t.MO.BIN4,"⧷":t.MO.BIN4,"⧸":t.MO.BIN3,"⧹":t.MO.BIN3,"⧺":t.MO.BIN3,"⧻":t.MO.BIN3,"⧾":t.MO.BIN4,"⧿":t.MO.BIN4,"⨝":t.MO.BIN3,"⨞":t.MO.BIN3,"⨟":t.MO.BIN3,"⨠":t.MO.BIN3,"⨡":t.MO.BIN3,"⨢":t.MO.BIN4,"⨣":t.MO.BIN4,"⨤":t.MO.BIN4,"⨥":t.MO.BIN4,"⨦":t.MO.BIN4,"⨧":t.MO.BIN4,"⨨":t.MO.BIN4,"⨩":t.MO.BIN4,"⨪":t.MO.BIN4,"⨫":t.MO.BIN4,"⨬":t.MO.BIN4,"⨭":t.MO.BIN4,"⨮":t.MO.BIN4,"⨯":t.MO.BIN4,"⨰":t.MO.BIN4,"⨱":t.MO.BIN4,"⨲":t.MO.BIN4,"⨳":t.MO.BIN4,"⨴":t.MO.BIN4,"⨵":t.MO.BIN4,"⨶":t.MO.BIN4,"⨷":t.MO.BIN4,"⨸":t.MO.BIN4,"⨹":t.MO.BIN4,"⨺":t.MO.BIN4,"⨻":t.MO.BIN4,"⨼":t.MO.BIN4,"⨽":t.MO.BIN4,"⨾":t.MO.BIN4,"⨿":t.MO.BIN4,"⩀":t.MO.BIN4,"⩁":t.MO.BIN4,"⩂":t.MO.BIN4,"⩃":t.MO.BIN4,"⩄":t.MO.BIN4,"⩅":t.MO.BIN4,"⩆":t.MO.BIN4,"⩇":t.MO.BIN4,"⩈":t.MO.BIN4,"⩉":t.MO.BIN4,"⩊":t.MO.BIN4,"⩋":t.MO.BIN4,"⩌":t.MO.BIN4,"⩍":t.MO.BIN4,"⩎":t.MO.BIN4,"⩏":t.MO.BIN4,"⩐":t.MO.BIN4,"⩑":t.MO.BIN4,"⩒":t.MO.BIN4,"⩓":t.MO.BIN4,"⩔":t.MO.BIN4,"⩕":t.MO.BIN4,"⩖":t.MO.BIN4,"⩗":t.MO.BIN4,"⩘":t.MO.BIN4,"⩙":t.MO.REL,"⩚":t.MO.BIN4,"⩛":t.MO.BIN4,"⩜":t.MO.BIN4,"⩝":t.MO.BIN4,"⩞":t.MO.BIN4,"⩟":t.MO.BIN4,"⩠":t.MO.BIN4,"⩡":t.MO.BIN4,"⩢":t.MO.BIN4,"⩣":t.MO.BIN4,"⩤":t.MO.BIN4,"⩥":t.MO.BIN4,"⩦":t.MO.REL,"⩧":t.MO.REL,"⩨":t.MO.REL,"⩩":t.MO.REL,"⩪":t.MO.REL,"⩫":t.MO.REL,"⩬":t.MO.REL,"⩭":t.MO.REL,"⩮":t.MO.REL,"⩯":t.MO.REL,"⩰":t.MO.REL,"⩱":t.MO.BIN4,"⩲":t.MO.BIN4,"⩳":t.MO.REL,"⩴":t.MO.REL,"⩵":t.MO.REL,"⩶":t.MO.REL,"⩷":t.MO.REL,"⩸":t.MO.REL,"⩹":t.MO.REL,"⩺":t.MO.REL,"⩻":t.MO.REL,"⩼":t.MO.REL,"⩽":t.MO.REL,"⩽̸":t.MO.REL,"⩾":t.MO.REL,"⩾̸":t.MO.REL,"⩿":t.MO.REL,"⪀":t.MO.REL,"⪁":t.MO.REL,"⪂":t.MO.REL,"⪃":t.MO.REL,"⪄":t.MO.REL,"⪅":t.MO.REL,"⪆":t.MO.REL,"⪇":t.MO.REL,"⪈":t.MO.REL,"⪉":t.MO.REL,"⪊":t.MO.REL,"⪋":t.MO.REL,"⪌":t.MO.REL,"⪍":t.MO.REL,"⪎":t.MO.REL,"⪏":t.MO.REL,"⪐":t.MO.REL,"⪑":t.MO.REL,"⪒":t.MO.REL,"⪓":t.MO.REL,"⪔":t.MO.REL,"⪕":t.MO.REL,"⪖":t.MO.REL,"⪗":t.MO.REL,"⪘":t.MO.REL,"⪙":t.MO.REL,"⪚":t.MO.REL,"⪛":t.MO.REL,"⪜":t.MO.REL,"⪝":t.MO.REL,"⪞":t.MO.REL,"⪟":t.MO.REL,"⪠":t.MO.REL,"⪡":t.MO.REL,"⪡̸":t.MO.REL,"⪢":t.MO.REL,"⪢̸":t.MO.REL,"⪣":t.MO.REL,"⪤":t.MO.REL,"⪥":t.MO.REL,"⪦":t.MO.REL,"⪧":t.MO.REL,"⪨":t.MO.REL,"⪩":t.MO.REL,"⪪":t.MO.REL,"⪫":t.MO.REL,"⪬":t.MO.REL,"⪭":t.MO.REL,"⪮":t.MO.REL,"⪯":t.MO.REL,"⪯̸":t.MO.REL,"⪰":t.MO.REL,"⪰̸":t.MO.REL,"⪱":t.MO.REL,"⪲":t.MO.REL,"⪳":t.MO.REL,"⪴":t.MO.REL,"⪵":t.MO.REL,"⪶":t.MO.REL,"⪷":t.MO.REL,"⪸":t.MO.REL,"⪹":t.MO.REL,"⪺":t.MO.REL,"⪻":t.MO.REL,"⪼":t.MO.REL,"⪽":t.MO.REL,"⪾":t.MO.REL,"⪿":t.MO.REL,"⫀":t.MO.REL,"⫁":t.MO.REL,"⫂":t.MO.REL,"⫃":t.MO.REL,"⫄":t.MO.REL,"⫅":t.MO.REL,"⫆":t.MO.REL,"⫇":t.MO.REL,"⫈":t.MO.REL,"⫉":t.MO.REL,"⫊":t.MO.REL,"⫋":t.MO.REL,"⫌":t.MO.REL,"⫍":t.MO.REL,"⫎":t.MO.REL,"⫏":t.MO.REL,"⫐":t.MO.REL,"⫑":t.MO.REL,"⫒":t.MO.REL,"⫓":t.MO.REL,"⫔":t.MO.REL,"⫕":t.MO.REL,"⫖":t.MO.REL,"⫗":t.MO.REL,"⫘":t.MO.REL,"⫙":t.MO.REL,"⫚":t.MO.REL,"⫛":t.MO.REL,"⫝":t.MO.REL,"⫝̸":t.MO.REL,"⫞":t.MO.REL,"⫟":t.MO.REL,"⫠":t.MO.REL,"⫡":t.MO.REL,"⫢":t.MO.REL,"⫣":t.MO.REL,"⫤":t.MO.REL,"⫥":t.MO.REL,"⫦":t.MO.REL,"⫧":t.MO.REL,"⫨":t.MO.REL,"⫩":t.MO.REL,"⫪":t.MO.REL,"⫫":t.MO.REL,"⫬":t.MO.REL,"⫭":t.MO.REL,"⫮":t.MO.REL,"⫯":t.MO.REL,"⫰":t.MO.REL,"⫱":t.MO.REL,"⫲":t.MO.REL,"⫳":t.MO.REL,"⫴":t.MO.BIN4,"⫵":t.MO.BIN4,"⫶":t.MO.BIN4,"⫷":t.MO.REL,"⫸":t.MO.REL,"⫹":t.MO.REL,"⫺":t.MO.REL,"⫻":t.MO.BIN4,"⫽":t.MO.BIN4,"⫾":t.MO.BIN3,"⭅":t.MO.RELSTRETCH,"⭆":t.MO.RELSTRETCH,"〈":t.MO.OPEN,"〉":t.MO.CLOSE,"︷":t.MO.WIDEACCENT,"︸":t.MO.WIDEACCENT}},t.OPTABLE.infix["^"]=t.MO.WIDEREL,t.OPTABLE.infix._=t.MO.WIDEREL,t.OPTABLE.infix["⫝̸"]=t.MO.REL})(Gy);var sdt=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),xh=P&&P.__assign||function(){return xh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xh.apply(this,arguments)},FO=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},ldt=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(i6,"__esModule",{value:!0}),i6.MmlMo=void 0;var xn=fr,Zy=Gy,jO=s1,cdt=function(t){sdt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._texClass=null,r.lspace=5/18,r.rspace=5/18,r}return Object.defineProperty(e.prototype,"texClass",{get:function(){if(this._texClass===null){var r=this.getText(),n=FO(this.handleExplicitForm(this.getForms()),3),i=n[0],o=n[1],a=n[2],s=this.constructor.OPTABLE,d=s[i][r]||s[o][r]||s[a][r];return d?d[2]:xn.TEXCLASS.REL}return this._texClass},set:function(r){this._texClass=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"kind",{get:function(){return"mo"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmbellished",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNewLine",{get:function(){return this.attributes.get("linebreak")==="newline"},enumerable:!1,configurable:!0}),e.prototype.coreParent=function(){for(var r=this,n=this,i=this.factory.getNodeClass("math");n&&n.isEmbellished&&n.coreMO()===this&&!(n instanceof i);)r=n,n=n.parent;return r},e.prototype.coreText=function(r){if(!r)return"";if(r.isEmbellished)return r.coreMO().getText();for(;((r.isKind("mrow")||r.isKind("TeXAtom")&&r.texClass!==xn.TEXCLASS.VCENTER||r.isKind("mstyle")||r.isKind("mphantom"))&&r.childNodes.length===1||r.isKind("munderover"))&&r.childNodes[0];)r=r.childNodes[0];return r.isToken?r.getText():""},e.prototype.hasSpacingAttributes=function(){return this.attributes.isSet("lspace")||this.attributes.isSet("rspace")},Object.defineProperty(e.prototype,"isAccent",{get:function(){var r=!1,n=this.coreParent().parent;if(n){var i=n.isKind("mover")?n.childNodes[n.over].coreMO()?"accent":"":n.isKind("munder")?n.childNodes[n.under].coreMO()?"accentunder":"":n.isKind("munderover")?this===n.childNodes[n.over].coreMO()?"accent":this===n.childNodes[n.under].coreMO()?"accentunder":"":"";if(i){var o=n.attributes.getExplicit(i);r=o!==void 0?r:this.attributes.get("accent")}}return r},enumerable:!1,configurable:!0}),e.prototype.setTeXclass=function(r){var n=this.attributes.getList("form","fence"),i=n.form,o=n.fence;return this.getProperty("texClass")===void 0&&(this.attributes.isSet("lspace")||this.attributes.isSet("rspace"))?null:(o&&this.texClass===xn.TEXCLASS.REL&&(i==="prefix"&&(this.texClass=xn.TEXCLASS.OPEN),i==="postfix"&&(this.texClass=xn.TEXCLASS.CLOSE)),this.adjustTeXclass(r))},e.prototype.adjustTeXclass=function(r){var n=this.texClass,i=this.prevClass;if(n===xn.TEXCLASS.NONE)return r;if(r?(r.getProperty("autoOP")&&(n===xn.TEXCLASS.BIN||n===xn.TEXCLASS.REL)&&(i=r.texClass=xn.TEXCLASS.ORD),i=this.prevClass=r.texClass||xn.TEXCLASS.ORD,this.prevLevel=this.attributes.getInherited("scriptlevel")):i=this.prevClass=xn.TEXCLASS.NONE,n===xn.TEXCLASS.BIN&&(i===xn.TEXCLASS.NONE||i===xn.TEXCLASS.BIN||i===xn.TEXCLASS.OP||i===xn.TEXCLASS.REL||i===xn.TEXCLASS.OPEN||i===xn.TEXCLASS.PUNCT))this.texClass=xn.TEXCLASS.ORD;else if(i===xn.TEXCLASS.BIN&&(n===xn.TEXCLASS.REL||n===xn.TEXCLASS.CLOSE||n===xn.TEXCLASS.PUNCT))r.texClass=this.prevClass=xn.TEXCLASS.ORD;else if(n===xn.TEXCLASS.BIN){for(var o=this,a=this.parent;a&&a.parent&&a.isEmbellished&&(a.childNodes.length===1||!a.isKind("mrow")&&a.core()===o);)o=a,a=a.parent;a.childNodes[a.childNodes.length-1]===o&&(this.texClass=xn.TEXCLASS.ORD)}return this},e.prototype.setInheritedAttributes=function(r,n,i,o){r===void 0&&(r={}),n===void 0&&(n=!1),i===void 0&&(i=0),o===void 0&&(o=!1),t.prototype.setInheritedAttributes.call(this,r,n,i,o);var a=this.getText();this.checkOperatorTable(a),this.checkPseudoScripts(a),this.checkPrimes(a),this.checkMathAccent(a)},e.prototype.checkOperatorTable=function(r){var n,i,o=FO(this.handleExplicitForm(this.getForms()),3),a=o[0],s=o[1],d=o[2];this.attributes.setInherited("form",a);var p=this.constructor.OPTABLE,f=p[a][r]||p[s][r]||p[d][r];if(f){this.getProperty("texClass")===void 0&&(this.texClass=f[2]);try{for(var Q=ldt(Object.keys(f[3]||{})),m=Q.next();!m.done;m=Q.next()){var _=m.value;this.attributes.setInherited(_,f[3][_])}}catch(M){n={error:M}}finally{try{m&&!m.done&&(i=Q.return)&&i.call(Q)}finally{if(n)throw n.error}}this.lspace=(f[0]+1)/18,this.rspace=(f[1]+1)/18}else{var v=(0,Zy.getRange)(r);if(v){this.getProperty("texClass")===void 0&&(this.texClass=v[2]);var b=this.constructor.MMLSPACING[v[2]];this.lspace=(b[0]+1)/18,this.rspace=(b[1]+1)/18}}},e.prototype.getForms=function(){for(var r=this,n=this.parent,i=this.Parent;i&&i.isEmbellished;)r=n,n=i.parent,i=i.Parent;if(n&&n.isKind("mrow")&&n.nonSpaceLength()!==1){if(n.firstNonSpace()===r)return["prefix","infix","postfix"];if(n.lastNonSpace()===r)return["postfix","infix","prefix"]}return["infix","prefix","postfix"]},e.prototype.handleExplicitForm=function(r){if(this.attributes.isSet("form")){var n=this.attributes.get("form");r=[n].concat(r.filter(function(i){return i!==n}))}return r},e.prototype.checkPseudoScripts=function(r){var n=this.constructor.pseudoScripts;if(r.match(n)){var i=this.coreParent().Parent,o=!i||!(i.isKind("msubsup")&&!i.isKind("msub"));this.setProperty("pseudoscript",o),o&&(this.attributes.setInherited("lspace",0),this.attributes.setInherited("rspace",0))}},e.prototype.checkPrimes=function(r){var n=this.constructor.primes;if(r.match(n)){var i=this.constructor.remapPrimes,o=(0,jO.unicodeString)((0,jO.unicodeChars)(r).map(function(a){return i[a]}));this.setProperty("primes",o)}},e.prototype.checkMathAccent=function(r){var n=this.Parent;if(!(this.getProperty("mathaccent")!==void 0||!n||!n.isKind("munderover"))){var i=n.childNodes[0];if(!(i.isEmbellished&&i.coreMO()===this)){var o=this.constructor.mathaccents;r.match(o)&&this.setProperty("mathaccent",!0)}}},e.defaults=xh(xh({},xn.AbstractMmlTokenNode.defaults),{form:"infix",fence:!1,separator:!1,lspace:"thickmathspace",rspace:"thickmathspace",stretchy:!1,symmetric:!1,maxsize:"infinity",minsize:"0em",largeop:!1,movablelimits:!1,accent:!1,linebreak:"auto",lineleading:"1ex",linebreakstyle:"before",indentalign:"auto",indentshift:"0",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"}),e.MMLSPACING=Zy.MMLSPACING,e.OPTABLE=Zy.OPTABLE,e.pseudoScripts=new RegExp(["^[\"'*`","ª","°","²-´","¹","º","‘-‟","′-‷⁗","⁰ⁱ","⁴-ⁿ","₀-₎","]+$"].join("")),e.primes=new RegExp(["^[\"'`","‘-‟","]+$"].join("")),e.remapPrimes={34:8243,39:8242,96:8245,8216:8245,8217:8242,8218:8242,8219:8245,8220:8246,8221:8243,8222:8243,8223:8246},e.mathaccents=new RegExp(["^[","´́ˊ","`̀ˋ","¨̈","~̃˜","¯̄ˉ","˘̆","ˇ̌","^̂ˆ","→⃗","˙̇","˚̊","⃛","⃜","]$"].join("")),e}(xn.AbstractMmlTokenNode);i6.MmlMo=cdt;var $y=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},udt=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},hdt=P&&P.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(Pn,"__esModule",{value:!0});var zO=fr,ddt=i6,qy;(function(t){var e=new Map([["autoOP",!0],["fnOP",!0],["movesupsub",!0],["subsupOK",!0],["texprimestyle",!0],["useHeight",!0],["variantForm",!0],["withDelims",!0],["mathaccent",!0],["open",!0],["close",!0]]);function r(z){return String.fromCodePoint(parseInt(z,16))}t.createEntity=r;function n(z){return z.childNodes}t.getChildren=n;function i(z){return z.getText()}t.getText=i;function o(z,J){var tt,ot;try{for(var et=$y(J),Tt=et.next();!Tt.done;Tt=et.next()){var At=Tt.value;z.appendChild(At)}}catch(Ut){tt={error:Ut}}finally{try{Tt&&!Tt.done&&(ot=et.return)&&ot.call(et)}finally{if(tt)throw tt.error}}}t.appendChildren=o;function a(z,J,tt){z.attributes.set(J,tt)}t.setAttribute=a;function s(z,J,tt){z.setProperty(J,tt)}t.setProperty=s;function d(z,J){var tt,ot;try{for(var et=$y(Object.keys(J)),Tt=et.next();!Tt.done;Tt=et.next()){var At=Tt.value,Ut=J[At];At==="texClass"?(z.texClass=Ut,z.setProperty(At,Ut)):At==="movablelimits"?(z.setProperty("movablelimits",Ut),(z.isKind("mo")||z.isKind("mstyle"))&&z.attributes.set("movablelimits",Ut)):At==="inferred"||(e.has(At)?z.setProperty(At,Ut):z.attributes.set(At,Ut))}}catch(ee){tt={error:ee}}finally{try{Tt&&!Tt.done&&(ot=et.return)&&ot.call(et)}finally{if(tt)throw tt.error}}}t.setProperties=d;function p(z,J){return z.getProperty(J)}t.getProperty=p;function f(z,J){return z.attributes.get(J)}t.getAttribute=f;function Q(z){for(var J=[],tt=1;tt<arguments.length;tt++)J[tt-1]=arguments[tt];z.removeProperty.apply(z,hdt([],udt(J),!1))}t.removeProperties=Q;function m(z,J){return z.childNodes[J]}t.getChildAt=m;function _(z,J,tt){var ot=z.childNodes;ot[J]=tt,tt&&(tt.parent=z)}t.setChild=_;function v(z,J){for(var tt=z.childNodes,ot=0;ot<tt.length;ot++)_(J,ot,tt[ot])}t.copyChildren=v;function b(z,J){J.attributes=z.attributes,d(J,z.getAllProperties())}t.copyAttributes=b;function M(z,J){return z.isKind(J)}t.isType=M;function E(z){return z.isEmbellished}t.isEmbellished=E;function V(z){return z.texClass}t.getTexClass=V;function O(z){return z.coreMO()}t.getCoreMO=O;function R(z){return z instanceof zO.AbstractMmlNode||z instanceof zO.AbstractMmlEmptyNode}t.isNode=R;function j(z){return z.isInferred}t.isInferred=j;function G(z){var J,tt;if(!M(z,"mo"))return null;var ot=z,et=ot.getForms();try{for(var Tt=$y(et),At=Tt.next();!At.done;At=Tt.next()){var Ut=At.value,ee=ddt.MmlMo.OPTABLE[Ut][ot.getText()];if(ee)return ee}}catch(ue){J={error:ue}}finally{try{At&&!At.done&&(tt=Tt.return)&&tt.call(Tt)}finally{if(J)throw J.error}}return null}t.getForm=G})(qy||(qy={})),Pn.default=qy;var o6=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pdt=P&&P.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zy,"__esModule",{value:!0});var UO=fr,vi=pdt(Pn),Wy;(function(t){t.cleanStretchy=function(o){var a,s,d=o.data;try{for(var p=o6(d.getList("fixStretchy")),f=p.next();!f.done;f=p.next()){var Q=f.value;if(vi.default.getProperty(Q,"fixStretchy")){var m=vi.default.getForm(Q);m&&m[3]&&m[3].stretchy&&vi.default.setAttribute(Q,"stretchy",!1);var _=Q.parent;if(!vi.default.getTexClass(Q)&&(!m||!m[2])){var v=d.nodeFactory.create("node","TeXAtom",[Q]);_.replaceChild(v,Q),v.inheritAttributesFrom(Q)}vi.default.removeProperties(Q,"fixStretchy")}}}catch(b){a={error:b}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}},t.cleanAttributes=function(o){var a=o.data.root;a.walkTree(function(s,d){var p,f,Q=s.attributes;if(Q){var m=new Set((Q.get("mjx-keep-attrs")||"").split(/ /));delete Q.getAllAttributes()["mjx-keep-attrs"];try{for(var _=o6(Q.getExplicitNames()),v=_.next();!v.done;v=_.next()){var b=v.value;!m.has(b)&&Q.attributes[b]===s.attributes.getInherited(b)&&delete Q.attributes[b]}}catch(M){p={error:M}}finally{try{v&&!v.done&&(f=_.return)&&f.call(_)}finally{if(p)throw p.error}}}},{})},t.combineRelations=function(o){var a,s,d,p,f=[];try{for(var Q=o6(o.data.getList("mo")),m=Q.next();!m.done;m=Q.next()){var _=m.value;if(!(_.getProperty("relationsCombined")||!_.parent||_.parent&&!vi.default.isType(_.parent,"mrow")||vi.default.getTexClass(_)!==UO.TEXCLASS.REL)){for(var v=_.parent,b=void 0,M=v.childNodes,E=M.indexOf(_)+1,V=vi.default.getProperty(_,"variantForm");E<M.length&&(b=M[E])&&vi.default.isType(b,"mo")&&vi.default.getTexClass(b)===UO.TEXCLASS.REL;)if(V===vi.default.getProperty(b,"variantForm")&&r(_,b)){vi.default.appendChildren(_,vi.default.getChildren(b)),e(["stretchy","rspace"],_,b);try{for(var O=(d=void 0,o6(b.getPropertyNames())),R=O.next();!R.done;R=O.next()){var j=R.value;_.setProperty(j,b.getProperty(j))}}catch(G){d={error:G}}finally{try{R&&!R.done&&(p=O.return)&&p.call(O)}finally{if(d)throw d.error}}M.splice(E,1),f.push(b),b.parent=null,b.setProperty("relationsCombined",!0)}else{_.attributes.getExplicit("rspace")==null&&vi.default.setAttribute(_,"rspace","0pt"),b.attributes.getExplicit("lspace")==null&&vi.default.setAttribute(b,"lspace","0pt");break}_.attributes.setInherited("form",_.getForms()[0])}}}catch(G){a={error:G}}finally{try{m&&!m.done&&(s=Q.return)&&s.call(Q)}finally{if(a)throw a.error}}o.data.removeFromList("mo",f)};var e=function(o,a,s){var d=a.attributes,p=s.attributes;o.forEach(function(f){var Q=p.getExplicit(f);Q!=null&&d.set(f,Q)})},r=function(o,a){var s,d,p=function(E,V){var O=E.getExplicitNames();return O.filter(function(R){return R!==V&&(R!=="stretchy"||E.getExplicit("stretchy"))})},f=o.attributes,Q=a.attributes,m=p(f,"lspace"),_=p(Q,"rspace");if(m.length!==_.length)return!1;try{for(var v=o6(m),b=v.next();!b.done;b=v.next()){var M=b.value;if(f.getExplicit(M)!==Q.getExplicit(M))return!1}}catch(E){s={error:E}}finally{try{b&&!b.done&&(d=v.return)&&d.call(v)}finally{if(s)throw s.error}}return!0},n=function(o,a,s){var d,p,f=[];try{for(var Q=o6(o.getList("m"+a+s)),m=Q.next();!m.done;m=Q.next()){var _=m.value,v=_.childNodes;if(!(v[_[a]]&&v[_[s]])){var b=_.parent,M=v[_[a]]?o.nodeFactory.create("node","m"+a,[v[_.base],v[_[a]]]):o.nodeFactory.create("node","m"+s,[v[_.base],v[_[s]]]);vi.default.copyAttributes(_,M),b?b.replaceChild(M,_):o.root=M,f.push(_)}}}catch(E){d={error:E}}finally{try{m&&!m.done&&(p=Q.return)&&p.call(Q)}finally{if(d)throw d.error}}o.removeFromList("m"+a+s,f)};t.cleanSubSup=function(o){var a=o.data;a.error||(n(a,"sub","sup"),n(a,"under","over"))};var i=function(o,a,s){var d,p,f=[];try{for(var Q=o6(o.getList(a)),m=Q.next();!m.done;m=Q.next()){var _=m.value;if(!_.attributes.get("displaystyle")){var v=_.childNodes[_.base],b=v.coreMO();if(v.getProperty("movablelimits")&&!b.attributes.getExplicit("movablelimits")){var M=o.nodeFactory.create("node",s,_.childNodes);vi.default.copyAttributes(_,M),_.parent?_.parent.replaceChild(M,_):o.root=M,f.push(_)}}}}catch(E){d={error:E}}finally{try{m&&!m.done&&(p=Q.return)&&p.call(Q)}finally{if(d)throw d.error}}o.removeFromList(a,f)};t.moveLimits=function(o){var a=o.data;i(a,"munderover","msubsup"),i(a,"munder","msub"),i(a,"mover","msup")},t.setInherited=function(o){o.data.root.setInheritedAttributes({},o.math.display,0,!1)}})(Wy||(Wy={})),zy.default=Wy;var wh={},Eh={},hn={};Object.defineProperty(hn,"__esModule",{value:!0});var Tdt=function(){function t(e,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.id=e,this.message=t.processString(r,n)}return t.processString=function(e,r){for(var n=e.split(t.pattern),i=1,o=n.length;i<o;i+=2){var a=n[i].charAt(0);if(a>="0"&&a<="9")n[i]=r[parseInt(n[i],10)-1],typeof n[i]=="number"&&(n[i]=n[i].toString());else if(a==="{")if(a=n[i].substr(1),a>="0"&&a<="9")n[i]=r[parseInt(n[i].substr(1,n[i].length-2),10)-1],typeof n[i]=="number"&&(n[i]=n[i].toString());else{var s=n[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);s&&(n[i]="%"+n[i])}n[i]==null&&(n[i]="???")}return n.join("")},t.pattern=/%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g,t}();hn.default=Tdt;var R7={},Mh={};Object.defineProperty(Mh,"__esModule",{value:!0}),Mh.asyncLoad=void 0;var GO=gh;function fdt(t){return GO.mathjax.asyncLoad?new Promise(function(e,r){var n=GO.mathjax.asyncLoad(t);n instanceof Promise?n.then(function(i){return e(i)}).catch(function(i){return r(i)}):e(n)}):Promise.reject("Can't load '".concat(t,"': No asyncLoad method specified"))}Mh.asyncLoad=fdt,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.numeric=t.translate=t.remove=t.add=t.entities=t.options=void 0;var e=N3,r=Mh;t.options={loadMissingEntities:!0},t.entities={ApplyFunction:"⁡",Backslash:"∖",Because:"∵",Breve:"˘",Cap:"⋒",CenterDot:"·",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",Congruent:"≡",ContourIntegral:"∮",Coproduct:"∐",Cross:"⨯",Cup:"⋓",CupCap:"≍",Dagger:"‡",Del:"∇",Delta:"Δ",Diamond:"⋄",DifferentialD:"ⅆ",DotEqual:"≐",DoubleDot:"¨",DoubleRightTee:"⊨",DoubleVerticalBar:"∥",DownArrow:"↓",DownLeftVector:"↽",DownRightVector:"⇁",DownTee:"⊤",Downarrow:"⇓",Element:"∈",EqualTilde:"≂",Equilibrium:"⇌",Exists:"∃",ExponentialE:"ⅇ",FilledVerySmallSquare:"▪",ForAll:"∀",Gamma:"Γ",Gg:"⋙",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Hacek:"ˇ",Hat:"^",HumpDownHump:"≎",HumpEqual:"≏",Im:"ℑ",ImaginaryI:"ⅈ",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Lambda:"Λ",Larr:"↞",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDownVector:"⇃",LeftFloor:"⌊",LeftRightArrow:"↔",LeftTee:"⊣",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpVector:"↿",LeftVector:"↼",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessSlantEqual:"⩽",LessTilde:"≲",Ll:"⋘",Lleftarrow:"⇚",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lsh:"↰",MinusPlus:"∓",NestedGreaterGreater:"≫",NestedLessLess:"≪",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotPrecedes:"⊀",NotPrecedesSlantEqual:"⋠",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsSlantEqual:"⋡",NotSupersetEqual:"⊉",NotTilde:"≁",NotVerticalBar:"∤",Omega:"Ω",OverBar:"‾",OverBrace:"⏞",PartialD:"∂",Phi:"Φ",Pi:"Π",PlusMinus:"±",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Product:"∏",Proportional:"∝",Psi:"Ψ",Rarr:"↠",Re:"ℜ",ReverseEquilibrium:"⇋",RightAngleBracket:"⟩",RightArrow:"→",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDownVector:"⇂",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpVector:"↾",RightVector:"⇀",Rightarrow:"⇒",Rrightarrow:"⇛",Rsh:"↱",Sigma:"Σ",SmallCircle:"∘",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Star:"⋆",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",Therefore:"∴",Theta:"Θ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",UnderBar:"_",UnderBrace:"⏟",Union:"⋃",UnionPlus:"⊎",UpArrow:"↑",UpDownArrow:"↕",UpTee:"⊥",Uparrow:"⇑",Updownarrow:"⇕",Upsilon:"Υ",Vdash:"⊩",Vee:"⋁",VerticalBar:"∣",VerticalTilde:"≀",Vvdash:"⊪",Wedge:"⋀",Xi:"Ξ",amp:"&",acute:"´",aleph:"ℵ",alpha:"α",amalg:"⨿",and:"∧",ang:"∠",angmsd:"∡",angsph:"∢",ape:"≊",backprime:"‵",backsim:"∽",backsimeq:"⋍",beta:"β",beth:"ℶ",between:"≬",bigcirc:"◯",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",blacklozenge:"⧫",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",bowtie:"⋈",boxdl:"┐",boxdr:"┌",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxur:"└",bsol:"\\",bull:"•",cap:"∩",check:"✓",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",clubs:"♣",colon:":",comp:"∁",ctdot:"⋯",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cup:"∪",curarr:"↷",curlyvee:"⋎",curlywedge:"⋏",dagger:"†",daleth:"ℸ",ddarr:"⇊",deg:"°",delta:"δ",digamma:"ϝ",div:"÷",divideontimes:"⋇",dot:"˙",doteqdot:"≑",dotplus:"∔",dotsquare:"⊡",dtdot:"⋱",ecir:"≖",efDot:"≒",egs:"⪖",ell:"ℓ",els:"⪕",empty:"∅",epsi:"ε",epsiv:"ϵ",erDot:"≓",eta:"η",eth:"ð",flat:"♭",fork:"⋔",frown:"⌢",gEl:"⪌",gamma:"γ",gap:"⪆",gimel:"ℷ",gnE:"≩",gnap:"⪊",gne:"⪈",gnsim:"⋧",gt:">",gtdot:"⋗",harrw:"↭",hbar:"ℏ",hellip:"…",hookleftarrow:"↩",hookrightarrow:"↪",imath:"ı",infin:"∞",intcal:"⊺",iota:"ι",jmath:"ȷ",kappa:"κ",kappav:"ϰ",lEg:"⪋",lambda:"λ",lap:"⪅",larrlp:"↫",larrtl:"↢",lbrace:"{",lbrack:"[",le:"≤",leftleftarrows:"⇇",leftthreetimes:"⋋",lessdot:"⋖",lmoust:"⎰",lnE:"≨",lnap:"⪉",lne:"⪇",lnsim:"⋦",longmapsto:"⟼",looparrowright:"↬",lowast:"∗",loz:"◊",lt:"<",ltimes:"⋉",ltri:"◃",macr:"¯",malt:"✠",mho:"℧",mu:"μ",multimap:"⊸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",natur:"♮",nearr:"↗",nharr:"↮",nlarr:"↚",not:"¬",nrarr:"↛",nu:"ν",nvDash:"⊭",nvdash:"⊬",nwarr:"↖",omega:"ω",omicron:"ο",or:"∨",osol:"⊘",period:".",phi:"φ",phiv:"ϕ",pi:"π",piv:"ϖ",prap:"⪷",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",prime:"′",psi:"ψ",quot:'"',rarrtl:"↣",rbrace:"}",rbrack:"]",rho:"ρ",rhov:"ϱ",rightrightarrows:"⇉",rightthreetimes:"⋌",ring:"˚",rmoust:"⎱",rtimes:"⋊",rtri:"▹",scap:"⪸",scnE:"⪶",scnap:"⪺",scnsim:"⋩",sdot:"⋅",searr:"↘",sect:"§",sharp:"♯",sigma:"σ",sigmav:"ς",simne:"≆",smile:"⌣",spades:"♠",sub:"⊂",subE:"⫅",subnE:"⫋",subne:"⊊",supE:"⫆",supnE:"⫌",supne:"⊋",swarr:"↙",tau:"τ",theta:"θ",thetav:"ϑ",tilde:"˜",times:"×",triangle:"▵",triangleq:"≜",upsi:"υ",upuparrows:"⇈",veebar:"⊻",vellip:"⋮",weierp:"℘",xi:"ξ",yen:"¥",zeta:"ζ",zigrarr:"⇝",nbsp:" ",rsquo:"’",lsquo:"‘"};var n={};function i(p,f){Object.assign(t.entities,p),n[f]=!0}t.add=i;function o(p){delete t.entities[p]}t.remove=o;function a(p){return p.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/ig,s)}t.translate=a;function s(p,f){if(f.charAt(0)==="#")return d(f.slice(1));if(t.entities[f])return t.entities[f];if(t.options.loadMissingEntities){var Q=f.match(/^[a-zA-Z](fr|scr|opf)$/)?RegExp.$1:f.charAt(0).toLowerCase();n[Q]||(n[Q]=!0,(0,e.retryAfter)((0,r.asyncLoad)("./util/entities/"+Q+".js")))}return p}function d(p){var f=p.charAt(0)==="x"?parseInt(p.slice(1),16):parseInt(p);return String.fromCodePoint(f)}t.numeric=d}(R7);var ZO;function In(){if(ZO)return Eh;ZO=1;var t=P&&P.__read||function(p,f){var Q=typeof Symbol=="function"&&p[Symbol.iterator];if(!Q)return p;var m=Q.call(p),_,v=[],b;try{for(;(f===void 0||f-- >0)&&!(_=m.next()).done;)v.push(_.value)}catch(M){b={error:M}}finally{try{_&&!_.done&&(Q=m.return)&&Q.call(m)}finally{if(b)throw b.error}}return v},e=P&&P.__values||function(p){var f=typeof Symbol=="function"&&Symbol.iterator,Q=f&&p[f],m=0;if(Q)return Q.call(p);if(p&&typeof p.length=="number")return{next:function(){return p&&m>=p.length&&(p=void 0),{value:p&&p[m++],done:!p}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},r=P&&P.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Eh,"__esModule",{value:!0});var n=fr,i=r(Pn),o=r(Pi()),a=r(hn),s=R7,d;return function(p){var f=7.2,Q=72,m={em:function(Bt){return Bt},ex:function(Bt){return Bt*.43},pt:function(Bt){return Bt/10},pc:function(Bt){return Bt*1.2},px:function(Bt){return Bt*f/Q},in:function(Bt){return Bt*f},cm:function(Bt){return Bt*f/2.54},mm:function(Bt){return Bt*f/25.4},mu:function(Bt){return Bt/18}},_="([-+]?([.,]\\d+|\\d+([.,]\\d*)?))",v="(pt|em|ex|mu|px|mm|cm|in|pc)",b=RegExp("^\\s*"+_+"\\s*"+v+"\\s*$"),M=RegExp("^\\s*"+_+"\\s*"+v+" ?");function E(Bt,qt){qt===void 0&&(qt=!1);var he=Bt.match(qt?M:b);return he?V([he[1].replace(/,/,"."),he[4],he[0].length]):[null,null,0]}p.matchDimen=E;function V(Bt){var qt=t(Bt,3),he=qt[0],jt=qt[1],fe=qt[2];if(jt!=="mu")return[he,jt,fe];var Ne=R(m[jt](parseFloat(he||"1")));return[Ne.slice(0,-2),"em",fe]}function O(Bt){var qt=t(E(Bt),2),he=qt[0],jt=qt[1],fe=parseFloat(he||"1"),Ne=m[jt];return Ne?Ne(fe):0}p.dimen2em=O;function R(Bt){return Math.abs(Bt)<6e-4?"0em":Bt.toFixed(3).replace(/\.?0+$/,"")+"em"}p.Em=R;function j(){for(var Bt=[],qt=0;qt<arguments.length;qt++)Bt[qt]=arguments[qt];return Bt.map(function(he){return R(he)}).join(" ")}p.cols=j;function G(Bt,qt,he,jt,fe,Ne){fe===void 0&&(fe=""),Ne===void 0&&(Ne="");var Ae=Bt.nodeFactory,Ve=Ae.create("node","mrow",[],{open:qt,close:jt,texClass:n.TEXCLASS.INNER}),ke;if(fe)ke=new o.default("\\"+fe+"l"+qt,Bt.parser.stack.env,Bt).mml();else{var ze=Ae.create("text",qt);ke=Ae.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:n.TEXCLASS.OPEN},ze)}if(i.default.appendChildren(Ve,[ke,he]),fe)ke=new o.default("\\"+fe+"r"+jt,Bt.parser.stack.env,Bt).mml();else{var zt=Ae.create("text",jt);ke=Ae.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:n.TEXCLASS.CLOSE},zt)}return Ne&&ke.attributes.set("mathcolor",Ne),i.default.appendChildren(Ve,[ke]),Ve}p.fenced=G;function z(Bt,qt,he,jt){var fe=Bt.nodeFactory.create("node","mrow",[],{open:qt,close:jt,texClass:n.TEXCLASS.ORD});return qt&&i.default.appendChildren(fe,[J(Bt,qt,"l")]),i.default.isType(he,"mrow")?i.default.appendChildren(fe,i.default.getChildren(he)):i.default.appendChildren(fe,[he]),jt&&i.default.appendChildren(fe,[J(Bt,jt,"r")]),fe}p.fixedFence=z;function J(Bt,qt,he){(qt==="{"||qt==="}")&&(qt="\\"+qt);var jt="{\\bigg"+he+" "+qt+"}",fe="{\\big"+he+" "+qt+"}";return new o.default("\\mathchoice"+jt+fe+fe+fe,{},Bt).mml()}p.mathPalette=J;function tt(Bt,qt){for(var he=0,jt=qt.length;he<jt;he++){var fe=qt[he];if(fe&&!i.default.isType(fe,"mspace")&&(!i.default.isType(fe,"TeXAtom")||i.default.getChildren(fe)[0]&&i.default.getChildren(i.default.getChildren(fe)[0]).length)){if(i.default.isEmbellished(fe)||i.default.isType(fe,"TeXAtom")&&i.default.getTexClass(fe)===n.TEXCLASS.REL){var Ne=Bt.nodeFactory.create("node","mi");qt.unshift(Ne)}break}}}p.fixInitialMO=tt;function ot(Bt,qt,he,jt){if(Bt.configuration.options.internalMath)return Bt.configuration.options.internalMath(Bt,qt,he,jt);var fe=jt||Bt.stack.env.font,Ne=fe?{mathvariant:fe}:{},Ae=[],Ve=0,ke=0,ze,zt,Pr="",mn=0;if(qt.match(/\\?[${}\\]|\\\(|\\(eq)?ref\s*\{/)){for(;Ve<qt.length;)if(ze=qt.charAt(Ve++),ze==="$")Pr==="$"&&mn===0?(zt=Bt.create("node","TeXAtom",[new o.default(qt.slice(ke,Ve-1),{},Bt.configuration).mml()]),Ae.push(zt),Pr="",ke=Ve):Pr===""&&(ke<Ve-1&&Ae.push(et(Bt,qt.slice(ke,Ve-1),Ne)),Pr="$",ke=Ve);else if(ze==="{"&&Pr!=="")mn++;else if(ze==="}")if(Pr==="}"&&mn===0){var We=new o.default(qt.slice(ke,Ve),{},Bt.configuration).mml();zt=Bt.create("node","TeXAtom",[We],Ne),Ae.push(zt),Pr="",ke=Ve}else Pr!==""&&mn&&mn--;else if(ze==="\\")if(Pr===""&&qt.substr(Ve).match(/^(eq)?ref\s*\{/)){var vr=RegExp["$&"].length;ke<Ve-1&&Ae.push(et(Bt,qt.slice(ke,Ve-1),Ne)),Pr="}",ke=Ve-1,Ve+=vr}else ze=qt.charAt(Ve++),ze==="("&&Pr===""?(ke<Ve-2&&Ae.push(et(Bt,qt.slice(ke,Ve-2),Ne)),Pr=")",ke=Ve):ze===")"&&Pr===")"&&mn===0?(zt=Bt.create("node","TeXAtom",[new o.default(qt.slice(ke,Ve-2),{},Bt.configuration).mml()]),Ae.push(zt),Pr="",ke=Ve):ze.match(/[${}\\]/)&&Pr===""&&(Ve--,qt=qt.substr(0,Ve-1)+qt.substr(Ve));if(Pr!=="")throw new a.default("MathNotTerminated","Math not terminated in text box")}return ke<qt.length&&Ae.push(et(Bt,qt.slice(ke),Ne)),he!=null?Ae=[Bt.create("node","mstyle",Ae,{displaystyle:!1,scriptlevel:he})]:Ae.length>1&&(Ae=[Bt.create("node","mrow",Ae)]),Ae}p.internalMath=ot;function et(Bt,qt,he){qt=qt.replace(/^\s+/,s.entities.nbsp).replace(/\s+$/,s.entities.nbsp);var jt=Bt.create("text",qt);return Bt.create("node","mtext",[],he,jt)}p.internalText=et;function Tt(Bt,qt,he,jt,fe){if(p.checkMovableLimits(qt),i.default.isType(qt,"munderover")&&i.default.isEmbellished(qt)){i.default.setProperties(i.default.getCoreMO(qt),{lspace:0,rspace:0});var Ne=Bt.create("node","mo",[],{rspace:0});qt=Bt.create("node","mrow",[Ne,qt])}var Ae=Bt.create("node","munderover",[qt]);i.default.setChild(Ae,jt==="over"?Ae.over:Ae.under,he);var Ve=Ae;return fe&&(Ve=Bt.create("node","TeXAtom",[Ae],{texClass:n.TEXCLASS.OP,movesupsub:!0})),i.default.setProperty(Ve,"subsupOK",!0),Ve}p.underOver=Tt;function At(Bt){var qt=i.default.isType(Bt,"mo")?i.default.getForm(Bt):null;(i.default.getProperty(Bt,"movablelimits")||qt&&qt[3]&&qt[3].movablelimits)&&i.default.setProperties(Bt,{movablelimits:!1})}p.checkMovableLimits=At;function Ut(Bt){if(typeof Bt!="string")return Bt;var qt=Bt.trim();return qt.match(/\\$/)&&Bt.match(/ $/)&&(qt+=" "),qt}p.trimSpaces=Ut;function ee(Bt,qt){return qt=p.trimSpaces(qt||""),qt==="t"?Bt.arraydef.align="baseline 1":qt==="b"?Bt.arraydef.align="baseline -1":qt==="c"?Bt.arraydef.align="axis":qt&&(Bt.arraydef.align=qt),Bt}p.setArrayAlign=ee;function ue(Bt,qt,he){for(var jt="",fe="",Ne=0;Ne<he.length;){var Ae=he.charAt(Ne++);if(Ae==="\\")jt+=Ae+he.charAt(Ne++);else if(Ae==="#")if(Ae=he.charAt(Ne++),Ae==="#")jt+=Ae;else{if(!Ae.match(/[1-9]/)||parseInt(Ae,10)>qt.length)throw new a.default("IllegalMacroParam","Illegal macro parameter reference");fe=Ft(Bt,Ft(Bt,fe,jt),qt[parseInt(Ae,10)-1]),jt=""}else jt+=Ae}return Ft(Bt,fe,jt)}p.substituteArgs=ue;function Ft(Bt,qt,he){if(he.match(/^[a-z]/i)&&qt.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)&&(qt+=" "),qt.length+he.length>Bt.configuration.options.maxBuffer)throw new a.default("MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?");return qt+he}p.addArgs=Ft;function pe(Bt,qt){if(qt===void 0&&(qt=!0),!(++Bt.macroCount<=Bt.configuration.options.maxMacros))throw qt?new a.default("MaxMacroSub1","MathJax maximum macro substitution count exceeded; is here a recursive macro call?"):new a.default("MaxMacroSub2","MathJax maximum substitution count exceeded; is there a recursive latex environment?")}p.checkMaxMacros=pe;function lr(Bt){if(Bt.stack.global.eqnenv)throw new a.default("ErroneousNestingEq","Erroneous nesting of equation structures");Bt.stack.global.eqnenv=!0}p.checkEqnEnv=lr;function Xt(Bt,qt){var he=Bt.copy(),jt=qt.configuration;return he.walkTree(function(fe){var Ne,Ae;jt.addNode(fe.kind,fe);var Ve=(fe.getProperty("in-lists")||"").split(/,/);try{for(var ke=e(Ve),ze=ke.next();!ze.done;ze=ke.next()){var zt=ze.value;zt&&jt.addNode(zt,fe)}}catch(Pr){Ne={error:Pr}}finally{try{ze&&!ze.done&&(Ae=ke.return)&&Ae.call(ke)}finally{if(Ne)throw Ne.error}}}),he}p.copyNode=Xt;function le(Bt,qt,he){return he}p.MmlFilterAttribute=le;function ge(Bt){var qt=Bt.stack.env.font;return qt?{mathvariant:qt}:{}}p.getFontDef=ge;function Le(Bt,qt,he){var jt,fe;qt===void 0&&(qt=null),he===void 0&&(he=!1);var Ne=Fe(Bt);if(qt)try{for(var Ae=e(Object.keys(Ne)),Ve=Ae.next();!Ve.done;Ve=Ae.next()){var ke=Ve.value;if(!qt.hasOwnProperty(ke)){if(he)throw new a.default("InvalidOption","Invalid option: %1",ke);delete Ne[ke]}}}catch(ze){jt={error:ze}}finally{try{Ve&&!Ve.done&&(fe=Ae.return)&&fe.call(Ae)}finally{if(jt)throw jt.error}}return Ne}p.keyvalOptions=Le;function Fe(Bt){for(var qt,he,jt={},fe=Bt,Ne,Ae,Ve;fe;)qt=t(je(fe,["=",","]),3),Ae=qt[0],Ne=qt[1],fe=qt[2],Ne==="="?(he=t(je(fe,[","]),3),Ve=he[0],Ne=he[1],fe=he[2],Ve=Ve==="false"||Ve==="true"?JSON.parse(Ve):Ve,jt[Ae]=Ve):Ae&&(jt[Ae]=!0);return jt}function Ge(Bt,qt){for(;qt>0;)Bt=Bt.trim().slice(1,-1),qt--;return Bt.trim()}function je(Bt,qt){for(var he=Bt.length,jt=0,fe="",Ne=0,Ae=0,Ve=!0,ke=!1;Ne<he;){var ze=Bt[Ne++];switch(ze){case" ":break;case"{":Ve?Ae++:(ke=!1,Ae>jt&&(Ae=jt)),jt++;break;case"}":jt&&jt--,(Ve||ke)&&(Ae--,ke=!0),Ve=!1;break;default:if(!jt&&qt.indexOf(ze)!==-1)return[ke?"true":Ge(fe,Ae),ze,Bt.slice(Ne)];Ve=!1,ke=!1}fe+=ze}if(jt)throw new a.default("ExtraOpenMissingClose","Extra open brace or missing close brace");return[ke?"true":Ge(fe,Ae),"",Bt.slice(Ne)]}}(d||(d={})),Eh.default=d,Eh}var Hh={},Qdt=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$O=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},mdt=P&&P.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},gdt=P&&P.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hh,"__esModule",{value:!0});var ydt=gdt(Pn),_dt=function(){function t(e,r,n){this._factory=e,this._env=r,this.global={},this.stack=[],this.global={isInner:n},this.stack=[this._factory.create("start",this.global)],r&&(this.stack[0].env=r),this.env=this.stack[0].env}return Object.defineProperty(t.prototype,"env",{get:function(){return this._env},set:function(e){this._env=e},enumerable:!1,configurable:!0}),t.prototype.Push=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{for(var o=Qdt(n),a=o.next();!a.done;a=o.next()){var s=a.value;if(s){var d=ydt.default.isNode(s)?this._factory.create("mml",s):s;d.global=this.global;var p=$O(this.stack.length?this.Top().checkItem(d):[null,!0],2),f=p[0],Q=p[1];if(Q){if(f){this.Pop(),this.Push.apply(this,mdt([],$O(f),!1));continue}this.stack.push(d),d.env?(d.copyEnv&&Object.assign(d.env,this.env),this.env=d.env):d.env=this.env}}}}catch(m){e={error:m}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},t.prototype.Pop=function(){var e=this.stack.pop();return e.isOpen||delete e.env,this.env=this.stack.length?this.Top().env:{},e},t.prototype.Top=function(e){return e===void 0&&(e=1),this.stack.length<e?null:this.stack[this.stack.length-e]},t.prototype.Prev=function(e){var r=this.Top();return e?r.First:r.Pop()},t.prototype.toString=function(){return`stack[
1663
+ </svg>`,this._container.appendChild(this._button),this._container.onclick=this.onClick_.bind(this),this._container}getDefaultPosition(){return"top-right"}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0}searchMap_(e=!0){this._input=this._container.removeChild(this._input),this._input.setAttribute("visible","false");const r=this._input.value;if(e&&r!==""){const n=this.__flatmap.search(r);this.__flatmap.showSearchResults(n)}}onKeyDown_(e){e.key==="Enter"?this.searchMap_():e.key==="Escape"&&this.searchMap_(!1)}onClick_(e){const r="rangeTarget"in e?e.rangeTarget.id:e.target.id;["search-control-button","search-control-icon"].includes(r)&&(this._input.getAttribute("visible")==="false"?(this._container.appendChild(this._input),this._container.appendChild(this._button),this._input.setAttribute("visible","true"),this._input.onkeydown=this.onKeyDown_.bind(this),this._input.value="",this.__flatmap.clearSearchResults(),this._input.focus()):this.searchMap_())}}const OO={fillColor:"#DDD",fillOpacity:.3,lineColor:"#08F",lineOpacity:1,lineWidth:1,position:"bottom-left",width:320},Aht=[[18,14,16],[16,12,14],[14,10,12],[12,8,10],[10,6,8]];class Vht{constructor(e,r){this._flatmap=e,this._map=void 0,this._container=null,this._background=null,this._opacity=null,this._loaded=!1,this._options=Object.assign({},OO),typeof r=="object"&&("position"in r&&(this._options.position=r.position),"width"in r&&(this._options.width=r.width)),this._ticking=!1,this._lastMouseMoveEvent=null,this._isDragging=!1,this._isCursorOverFeature=!1,this._previousPoint=[0,0],this._currentPoint=[0,0],this._trackingRectCoordinates=[[[],[],[],[],[]]]}getDefaultPosition(){return this._options.position}onAdd(e){this._map=e;const r=document.createElement("div");r.className="maplibregl-ctrl-minimap maplibregl-ctrl",r.id="maplibre-minimap",this._container=r;const n=e.getCanvas();let i=OO.width;return typeof this._options.width=="string"?(i=parseInt(this._options.width),this._options.width.includes("%")&&(i=i*n.width/100)):typeof this._options.width=="number"&&(i=this._options.width),r.setAttribute("style",`width: ${i}px; height: ${i*n.height/n.width}px;`),r.addEventListener("contextmenu",this._preventDefault),this._miniMap=new Yi.Map({attributionControl:!1,container:r,style:e.getStyle(),bounds:e.getBounds()}),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0,this._container=null}initialise(){const e=this._options,r=this._map,n=this._miniMap;["dragPan","scrollZoom","boxZoom","dragRotate","keyboard","doubleClickZoom","touchZoomRotate"].forEach(o=>n[o].disable()),this._background!==null&&n.setPaintProperty("background","background-color",this._background),this._opacity!==null&&n.setPaintProperty("background","background-opacity",this._opacity),n.resize(),n.fitBounds(this._flatmap.bounds);const i=n.getBounds();this.convertBoundsToPoints_(i),n.addSource("trackingRect",{type:"geojson",data:{type:"Feature",properties:{name:"trackingRect"},geometry:{type:"Polygon",coordinates:this._trackingRectCoordinates}}}),n.addLayer({id:"trackingRectOutline",type:"line",source:"trackingRect",layout:{},paint:{"line-color":e.lineColor,"line-width":e.lineWidth,"line-opacity":e.lineOpacity}}),n.addLayer({id:"trackingRectFill",type:"fill",source:"trackingRect",layout:{},paint:{"fill-color":e.fillColor,"fill-opacity":e.fillOpacity}}),this._trackingRect=this._miniMap.getSource("trackingRect"),this.update_(),r.on("move",this.update_.bind(this)),n.on("mousemove",this.mouseMove_.bind(this)),n.on("mousedown",this.mouseDown_.bind(this)),n.on("mouseup",this.mouseUp_.bind(this)),n.on("touchmove",this.mouseMove_.bind(this)),n.on("touchstart",this.mouseDown_.bind(this)),n.on("touchend",this.mouseUp_.bind(this)),this._miniMapCanvas=n.getCanvasContainer(),this._miniMapCanvas.addEventListener("wheel",this.preventDefault_),this._miniMapCanvas.addEventListener("mousewheel",this.preventDefault_)}mouseDown_(e){this._isCursorOverFeature&&(this._isDragging=!0,this._previousPoint=this._currentPoint,this._currentPoint=[e.lngLat.lng,e.lngLat.lat])}mouseMove_(e){this._ticking=!1;const r=this._miniMap.queryRenderedFeatures(e.point,{layers:["trackingRectFill"]});if(this._isCursorOverFeature&&r.length>0||(this._isCursorOverFeature=r.length>0,this._miniMapCanvas.style.cursor=this._isCursorOverFeature?"move":""),this._isDragging){this._previousPoint=this._currentPoint,this._currentPoint=[e.lngLat.lng,e.lngLat.lat];const n=[this._previousPoint[0]-this._currentPoint[0],this._previousPoint[1]-this._currentPoint[1]],i=this.moveTrackingRect_(n);this._map.fitBounds(i,{duration:80,noMoveStart:!0})}}mouseUp_(){this._isDragging=!1,this._ticking=!1}moveTrackingRect_(e){const r=this._trackingRect,n=r._data,i=n.properties.bounds;return i._ne.lat-=e[1],i._ne.lng-=e[0],i._sw.lat-=e[1],i._sw.lng-=e[0],this.convertBoundsToPoints_(i),r.setData(n),i}setTrackingRectBounds_(e){const r=this._trackingRect,n=r._data;n.properties.bounds=e,this.convertBoundsToPoints_(e),r.setData(n)}convertBoundsToPoints_(e){const r=e._ne,n=e._sw,i=this._trackingRectCoordinates;i[0][0][0]=r.lng,i[0][0][1]=r.lat,i[0][1][0]=n.lng,i[0][1][1]=r.lat,i[0][2][0]=n.lng,i[0][2][1]=n.lat,i[0][3][0]=r.lng,i[0][3][1]=n.lat,i[0][4][0]=r.lng,i[0][4][1]=r.lat}update_(e){if(this._isDragging)return;const r=this._map.getBounds();this.setTrackingRectBounds_(r),this.zoomAdjust_()}zoomAdjust_(){const e=this._miniMap,r=this._map,n=parseInt(e.getZoom(),10),i=parseInt(r.getZoom(),10);let o=!1;Aht.forEach(function(a){!o&&i>=a[0]&&(n>=a[1]&&e.setZoom(a[2]),e.setCenter(r.getCenter()),o=!0)})}preventDefault_(e){e.preventDefault()}setBackgroundColour(e){this._loaded?this._miniMap.setPaintProperty("background","background-color",e):this._background=e}setBackgroundOpacity(e){this._loaded?this._miniMap.setPaintProperty("background","background-opacity",e):this._opacity=e}show(e){this._container&&(e?(this._container.style.display="block",this.update_()):this._container.style.display="none")}}class Oht extends CO{constructor(e,r){super(e,"system","systems"),this.__systems=r}_addControlDetails(){let e=0,r=0;for(const n of this.__systems){const i=this._addControlLine(`${this.__prefix}${n.id}`,n.name,`background: ${n.colour};`);n.enabled&&(i.checked=!0,r+=1),e+=1}return{enabled:r,total:e}}_enableAll(e){for(const r of this.__systems){const n=document.getElementById(`${this.__prefix}${r.id}`);n&&(n.checked=e,this.__flatmap.enableSystem(r.id,e))}}__enableControl(e,r){for(const n of this.__systems)e===n.id&&this.__flatmap.enableSystem(n.id,r)}}class kht extends CO{constructor(e){super(e,"taxon","taxons"),this.__taxonIds=e.taxonIdentifiers.sort()}_addControlDetails(){let e=0,r=0;for(const n of this.__taxonIds){const i=this._addControlLine(`${this.__prefix}${n}`,`xx-${n}`);i.checked=!0,r+=1,e+=1}return{enabled:r,total:e}}_enableAll(e){for(const r of this.__taxonIds){const n=document.getElementById(`${this.__prefix}${r}`);n&&(n.checked=e,this.__flatmap.enableConnectivityByTaxonIds(r,e))}}__enableControl(e,r){for(const n of this.__taxonIds)e===n&&this.__flatmap.enableConnectivityByTaxonIds(n,r)}}var gh={},yh={};Object.defineProperty(yh,"__esModule",{value:!0}),yh.VERSION=void 0,yh.VERSION="3.2.2";var _h={},R3={};Object.defineProperty(R3,"__esModule",{value:!0}),R3.PrioritizedList=void 0;var Pht=function(){function t(){this.items=[],this.items=[]}return t.prototype[Symbol.iterator]=function(){var e=0,r=this.items;return{next:function(){return{value:r[e++],done:e>r.length}}}},t.prototype.add=function(e,r){r===void 0&&(r=t.DEFAULTPRIORITY);var n=this.items.length;do n--;while(n>=0&&r<this.items[n].priority);return this.items.splice(n+1,0,{item:e,priority:r}),e},t.prototype.remove=function(e){var r=this.items.length;do r--;while(r>=0&&this.items[r].item!==e);r>=0&&this.items.splice(r,1)},t.DEFAULTPRIORITY=5,t}();R3.PrioritizedList=Pht;var Iht=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rht=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(_h,"__esModule",{value:!0}),_h.HandlerList=void 0;var Nht=R3,Bht=function(t){Iht(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.register=function(r){return this.add(r,r.priority)},e.prototype.unregister=function(r){this.remove(r)},e.prototype.handlesDocument=function(r){var n,i;try{for(var o=Rht(this),a=o.next();!a.done;a=o.next()){var s=a.value,d=s.item;if(d.handlesDocument(r))return d}}catch(p){n={error:p}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new Error("Can't find handler for document")},e.prototype.document=function(r,n){return n===void 0&&(n=null),this.handlesDocument(r).create(r,n)},e}(Nht.PrioritizedList);_h.HandlerList=Bht;var N3={};Object.defineProperty(N3,"__esModule",{value:!0}),N3.retryAfter=N3.handleRetriesFor=void 0;function Dht(t){return new Promise(function e(r,n){try{r(t())}catch(i){i.retry&&i.retry instanceof Promise?i.retry.then(function(){return e(r,n)}).catch(function(o){return n(o)}):i.restart&&i.restart.isCallback?MathJax.Callback.After(function(){return e(r,n)},i.restart):n(i)}})}N3.handleRetriesFor=Dht;function Fht(t){var e=new Error("MathJax retry");throw e.retry=t,e}N3.retryAfter=Fht,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.mathjax=void 0;var e=yh,r=_h,n=N3;t.mathjax={version:e.VERSION,handlers:new r.HandlerList,document:function(i,o){return t.mathjax.handlers.document(i,o)},handleRetriesFor:n.handleRetriesFor,retryAfter:n.retryAfter,asyncLoad:null}}(gh);var Fy={},P7={},si={};(function(t){var e=P&&P.__values||function(V){var O=typeof Symbol=="function"&&Symbol.iterator,R=O&&V[O],j=0;if(R)return R.call(V);if(V&&typeof V.length=="number")return{next:function(){return V&&j>=V.length&&(V=void 0),{value:V&&V[j++],done:!V}}};throw new TypeError(O?"Object is not iterable.":"Symbol.iterator is not defined.")},r=P&&P.__read||function(V,O){var R=typeof Symbol=="function"&&V[Symbol.iterator];if(!R)return V;var j=R.call(V),G,z=[],J;try{for(;(O===void 0||O-- >0)&&!(G=j.next()).done;)z.push(G.value)}catch(tt){J={error:tt}}finally{try{G&&!G.done&&(R=j.return)&&R.call(j)}finally{if(J)throw J.error}}return z},n=P&&P.__spreadArray||function(V,O,R){if(R||arguments.length===2)for(var j=0,G=O.length,z;j<G;j++)(z||!(j in O))&&(z||(z=Array.prototype.slice.call(O,0,j)),z[j]=O[j]);return V.concat(z||Array.prototype.slice.call(O))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookup=t.separateOptions=t.selectOptionsFromKeys=t.selectOptions=t.userOptions=t.defaultOptions=t.insert=t.copy=t.keys=t.makeArray=t.expandable=t.Expandable=t.OPTIONS=t.REMOVE=t.APPEND=t.isObject=void 0;var i={}.constructor;function o(V){return typeof V=="object"&&V!==null&&(V.constructor===i||V.constructor===a)}t.isObject=o,t.APPEND="[+]",t.REMOVE="[-]",t.OPTIONS={invalidOption:"warn",optionError:function(V,O){if(t.OPTIONS.invalidOption==="fatal")throw new Error(V);console.warn("MathJax: "+V)}};var a=function(){function V(){}return V}();t.Expandable=a;function s(V){return Object.assign(Object.create(a.prototype),V)}t.expandable=s;function d(V){return Array.isArray(V)?V:[V]}t.makeArray=d;function p(V){return V?Object.keys(V).concat(Object.getOwnPropertySymbols(V)):[]}t.keys=p;function f(V){var O,R,j={};try{for(var G=e(p(V)),z=G.next();!z.done;z=G.next()){var J=z.value,tt=Object.getOwnPropertyDescriptor(V,J),ot=tt.value;Array.isArray(ot)?tt.value=Q([],ot,!1):o(ot)&&(tt.value=f(ot)),tt.enumerable&&(j[J]=tt)}}catch(et){O={error:et}}finally{try{z&&!z.done&&(R=G.return)&&R.call(G)}finally{if(O)throw O.error}}return Object.defineProperties(V.constructor===a?s({}):{},j)}t.copy=f;function Q(V,O,R){var j,G;R===void 0&&(R=!0);var z=function(et){if(R&&V[et]===void 0&&V.constructor!==a)return typeof et=="symbol"&&(et=et.toString()),t.OPTIONS.optionError('Invalid option "'.concat(et,'" (no default value).'),et),"continue";var Tt=O[et],At=V[et];if(o(Tt)&&At!==null&&(typeof At=="object"||typeof At=="function")){var Ut=p(Tt);Array.isArray(At)&&(Ut.length===1&&(Ut[0]===t.APPEND||Ut[0]===t.REMOVE)&&Array.isArray(Tt[Ut[0]])||Ut.length===2&&Ut.sort().join(",")===t.APPEND+","+t.REMOVE&&Array.isArray(Tt[t.APPEND])&&Array.isArray(Tt[t.REMOVE]))?(Tt[t.REMOVE]&&(At=V[et]=At.filter(function(ee){return Tt[t.REMOVE].indexOf(ee)<0})),Tt[t.APPEND]&&(V[et]=n(n([],r(At),!1),r(Tt[t.APPEND]),!1))):Q(At,Tt,R)}else Array.isArray(Tt)?(V[et]=[],Q(V[et],Tt,!1)):o(Tt)?V[et]=f(Tt):V[et]=Tt};try{for(var J=e(p(O)),tt=J.next();!tt.done;tt=J.next()){var ot=tt.value;z(ot)}}catch(et){j={error:et}}finally{try{tt&&!tt.done&&(G=J.return)&&G.call(J)}finally{if(j)throw j.error}}return V}t.insert=Q;function m(V){for(var O=[],R=1;R<arguments.length;R++)O[R-1]=arguments[R];return O.forEach(function(j){return Q(V,j,!1)}),V}t.defaultOptions=m;function _(V){for(var O=[],R=1;R<arguments.length;R++)O[R-1]=arguments[R];return O.forEach(function(j){return Q(V,j,!0)}),V}t.userOptions=_;function v(V){for(var O,R,j=[],G=1;G<arguments.length;G++)j[G-1]=arguments[G];var z={};try{for(var J=e(j),tt=J.next();!tt.done;tt=J.next()){var ot=tt.value;V.hasOwnProperty(ot)&&(z[ot]=V[ot])}}catch(et){O={error:et}}finally{try{tt&&!tt.done&&(R=J.return)&&R.call(J)}finally{if(O)throw O.error}}return z}t.selectOptions=v;function b(V,O){return v.apply(void 0,n([V],r(Object.keys(O)),!1))}t.selectOptionsFromKeys=b;function M(V){for(var O,R,j,G,z=[],J=1;J<arguments.length;J++)z[J-1]=arguments[J];var tt=[];try{for(var ot=e(z),et=ot.next();!et.done;et=ot.next()){var Tt=et.value,At={},Ut={};try{for(var ee=(j=void 0,e(Object.keys(V||{}))),ue=ee.next();!ue.done;ue=ee.next()){var Ft=ue.value;(Tt[Ft]===void 0?Ut:At)[Ft]=V[Ft]}}catch(pe){j={error:pe}}finally{try{ue&&!ue.done&&(G=ee.return)&&G.call(ee)}finally{if(j)throw j.error}}tt.push(At),V=Ut}}catch(pe){O={error:pe}}finally{try{et&&!et.done&&(R=ot.return)&&R.call(ot)}finally{if(O)throw O.error}}return tt.unshift(V),tt}t.separateOptions=M;function E(V,O,R){return R===void 0&&(R=null),O.hasOwnProperty(V)?O[V]:R}t.lookup=E})(si);var n6={},jht=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),zht=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},kO=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},PO=P&&P.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(n6,"__esModule",{value:!0}),n6.FunctionList=void 0;var Uht=R3,Ght=function(t){jht(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.execute=function(){for(var r,n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];try{for(var a=zht(this),s=a.next();!s.done;s=a.next()){var d=s.value,p=d.item.apply(d,PO([],kO(i),!1));if(p===!1)return!1}}catch(f){r={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!0},e.prototype.asyncExecute=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=-1,o=this.items;return new Promise(function(a,s){(function d(){for(var p;++i<o.length;){var f=(p=o[i]).item.apply(p,PO([],kO(r),!1));if(f instanceof Promise){f.then(d).catch(function(Q){return s(Q)});return}if(f===!1){a(!1);return}}a(!0)})()})},e}(Uht.PrioritizedList);n6.FunctionList=Ght,Object.defineProperty(P7,"__esModule",{value:!0}),P7.AbstractInputJax=void 0;var IO=si,RO=n6,Zht=function(){function t(e){e===void 0&&(e={}),this.adaptor=null,this.mmlFactory=null;var r=this.constructor;this.options=(0,IO.userOptions)((0,IO.defaultOptions)({},r.OPTIONS),e),this.preFilters=new RO.FunctionList,this.postFilters=new RO.FunctionList}return Object.defineProperty(t.prototype,"name",{get:function(){return this.constructor.NAME},enumerable:!1,configurable:!0}),t.prototype.setAdaptor=function(e){this.adaptor=e},t.prototype.setMmlFactory=function(e){this.mmlFactory=e},t.prototype.initialize=function(){},t.prototype.reset=function(){},Object.defineProperty(t.prototype,"processStrings",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.findMath=function(e,r){return[]},t.prototype.executeFilters=function(e,r,n,i){var o={math:r,document:n,data:i};return e.execute(o),o.data},t.NAME="generic",t.OPTIONS={},t}();P7.AbstractInputJax=Zht;var vh={},bh={};Object.defineProperty(bh,"__esModule",{value:!0}),bh.AbstractFindMath=void 0;var NO=si,$ht=function(){function t(e){var r=this.constructor;this.options=(0,NO.userOptions)((0,NO.defaultOptions)({},r.OPTIONS),e)}return t.OPTIONS={},t}();bh.AbstractFindMath=$ht;var s1={},qht=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Wht=P&&P.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(s1,"__esModule",{value:!0}),s1.split=s1.isPercent=s1.unicodeString=s1.unicodeChars=s1.quotePattern=s1.sortLength=void 0;function Xht(t,e){return t.length!==e.length?e.length-t.length:t===e?0:t<e?-1:1}s1.sortLength=Xht;function Kht(t){return t.replace(/([\^$(){}+*?\-|\[\]\:\\])/g,"\\$1")}s1.quotePattern=Kht;function Yht(t){return Array.from(t).map(function(e){return e.codePointAt(0)})}s1.unicodeChars=Yht;function Jht(t){return String.fromCodePoint.apply(String,Wht([],qht(t),!1))}s1.unicodeString=Jht;function tdt(t){return!!t.match(/%\s*$/)}s1.isPercent=tdt;function edt(t){return t.trim().split(/\s+/)}s1.split=edt;var U5={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.newState=t.STATE=t.AbstractMathItem=t.protoItem=void 0;function e(i,o,a,s,d,p,f){f===void 0&&(f=null);var Q={open:i,math:o,close:a,n:s,start:{n:d},end:{n:p},display:f};return Q}t.protoItem=e;var r=function(){function i(o,a,s,d,p){s===void 0&&(s=!0),d===void 0&&(d={i:0,n:0,delim:""}),p===void 0&&(p={i:0,n:0,delim:""}),this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={},this._state=t.STATE.UNPROCESSED,this.math=o,this.inputJax=a,this.display=s,this.start=d,this.end=p,this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={}}return Object.defineProperty(i.prototype,"isEscaped",{get:function(){return this.display===null},enumerable:!1,configurable:!0}),i.prototype.render=function(o){o.renderActions.renderMath(this,o)},i.prototype.rerender=function(o,a){a===void 0&&(a=t.STATE.RERENDER),this.state()>=a&&this.state(a-1),o.renderActions.renderMath(this,o,a)},i.prototype.convert=function(o,a){a===void 0&&(a=t.STATE.LAST),o.renderActions.renderConvert(this,o,a)},i.prototype.compile=function(o){this.state()<t.STATE.COMPILED&&(this.root=this.inputJax.compile(this,o),this.state(t.STATE.COMPILED))},i.prototype.typeset=function(o){this.state()<t.STATE.TYPESET&&(this.typesetRoot=o.outputJax[this.isEscaped?"escaped":"typeset"](this,o),this.state(t.STATE.TYPESET))},i.prototype.updateDocument=function(o){},i.prototype.removeFromDocument=function(o){},i.prototype.setMetrics=function(o,a,s,d,p){this.metrics={em:o,ex:a,containerWidth:s,lineWidth:d,scale:p}},i.prototype.state=function(o,a){return o===void 0&&(o=null),a===void 0&&(a=!1),o!=null&&(o<t.STATE.INSERTED&&this._state>=t.STATE.INSERTED&&this.removeFromDocument(a),o<t.STATE.TYPESET&&this._state>=t.STATE.TYPESET&&(this.outputData={}),o<t.STATE.COMPILED&&this._state>=t.STATE.COMPILED&&(this.inputData={}),this._state=o),this._state},i.prototype.reset=function(o){o===void 0&&(o=!1),this.state(t.STATE.UNPROCESSED,o)},i}();t.AbstractMathItem=r,t.STATE={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4};function n(i,o){if(i in t.STATE)throw Error("State "+i+" already exists");t.STATE[i]=o}t.newState=n})(U5);var rdt=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),BO=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o};Object.defineProperty(vh,"__esModule",{value:!0}),vh.FindTeX=void 0;var ndt=bh,Lh=s1,jy=U5,idt=function(t){rdt(e,t);function e(r){var n=t.call(this,r)||this;return n.getPatterns(),n}return e.prototype.getPatterns=function(){var r=this,n=this.options,i=[],o=[],a=[];this.end={},this.env=this.sub=0;var s=1;n.inlineMath.forEach(function(d){return r.addPattern(i,d,!1)}),n.displayMath.forEach(function(d){return r.addPattern(i,d,!0)}),i.length&&o.push(i.sort(Lh.sortLength).join("|")),n.processEnvironments&&(o.push("\\\\begin\\s*\\{([^}]*)\\}"),this.env=s,s++),n.processEscapes&&a.push("\\\\([\\\\$])"),n.processRefs&&a.push("(\\\\(?:eq)?ref\\s*\\{[^}]*\\})"),a.length&&(o.push("("+a.join("|")+")"),this.sub=s),this.start=new RegExp(o.join("|"),"g"),this.hasPatterns=o.length>0},e.prototype.addPattern=function(r,n,i){var o=BO(n,2),a=o[0],s=o[1];r.push((0,Lh.quotePattern)(a)),this.end[a]=[s,i,this.endPattern(s)]},e.prototype.endPattern=function(r,n){return new RegExp((n||(0,Lh.quotePattern)(r))+"|\\\\(?:[a-zA-Z]|.)|[{}]","g")},e.prototype.findEnd=function(r,n,i,o){for(var a=BO(o,3),s=a[0],d=a[1],p=a[2],f=p.lastIndex=i.index+i[0].length,Q,m=0;Q=p.exec(r);){if((Q[1]||Q[0])===s&&m===0)return(0,jy.protoItem)(i[0],r.substr(f,Q.index-f),Q[0],n,i.index,Q.index+Q[0].length,d);Q[0]==="{"?m++:Q[0]==="}"&&m&&m--}return null},e.prototype.findMathInString=function(r,n,i){var o,a;for(this.start.lastIndex=0;o=this.start.exec(i);){if(o[this.env]!==void 0&&this.env){var s="\\\\end\\s*(\\{"+(0,Lh.quotePattern)(o[this.env])+"\\})";a=this.findEnd(i,n,o,["{"+o[this.env]+"}",!0,this.endPattern(null,s)]),a&&(a.math=a.open+a.math+a.close,a.open=a.close="")}else if(o[this.sub]!==void 0&&this.sub){var d=o[this.sub],s=o.index+o[this.sub].length;d.length===2?a=(0,jy.protoItem)("",d.substr(1),"",n,o.index,s):a=(0,jy.protoItem)("",d,"",n,o.index,s,!1)}else a=this.findEnd(i,n,o,this.end[o[0]]);a&&(r.push(a),this.start.lastIndex=a.end.n)}},e.prototype.findMath=function(r){var n=[];if(this.hasPatterns)for(var i=0,o=r.length;i<o;i++)this.findMathInString(n,i,r[i]);return n},e.OPTIONS={inlineMath:[["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0,processRefs:!0},e}(ndt.AbstractFindMath);vh.FindTeX=idt;var zy={},fr={},G5={};(function(t){var e=P&&P.__values||function(n){var i=typeof Symbol=="function"&&Symbol.iterator,o=i&&n[i],a=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.Attributes=t.INHERIT=void 0,t.INHERIT="_inherit_";var r=function(){function n(i,o){this.global=o,this.defaults=Object.create(o),this.inherited=Object.create(this.defaults),this.attributes=Object.create(this.inherited),Object.assign(this.defaults,i)}return n.prototype.set=function(i,o){this.attributes[i]=o},n.prototype.setList=function(i){Object.assign(this.attributes,i)},n.prototype.get=function(i){var o=this.attributes[i];return o===t.INHERIT&&(o=this.global[i]),o},n.prototype.getExplicit=function(i){if(this.attributes.hasOwnProperty(i))return this.attributes[i]},n.prototype.getList=function(){for(var i,o,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var d={};try{for(var p=e(a),f=p.next();!f.done;f=p.next()){var Q=f.value;d[Q]=this.get(Q)}}catch(m){i={error:m}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}return d},n.prototype.setInherited=function(i,o){this.inherited[i]=o},n.prototype.getInherited=function(i){return this.inherited[i]},n.prototype.getDefault=function(i){return this.defaults[i]},n.prototype.isSet=function(i){return this.attributes.hasOwnProperty(i)||this.inherited.hasOwnProperty(i)},n.prototype.hasDefault=function(i){return i in this.defaults},n.prototype.getExplicitNames=function(){return Object.keys(this.attributes)},n.prototype.getInheritedNames=function(){return Object.keys(this.inherited)},n.prototype.getDefaultNames=function(){return Object.keys(this.defaults)},n.prototype.getGlobalNames=function(){return Object.keys(this.global)},n.prototype.getAllAttributes=function(){return this.attributes},n.prototype.getAllInherited=function(){return this.inherited},n.prototype.getAllDefaults=function(){return this.defaults},n.prototype.getAllGlobals=function(){return this.global},n}();t.Attributes=r})(G5);var Z5={},odt=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uy=P&&P.__assign||function(){return Uy=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uy.apply(this,arguments)},I7=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Z5,"__esModule",{value:!0}),Z5.AbstractEmptyNode=Z5.AbstractNode=void 0;var DO=function(){function t(e,r,n){var i,o;r===void 0&&(r={}),n===void 0&&(n=[]),this.factory=e,this.parent=null,this.properties={},this.childNodes=[];try{for(var a=I7(Object.keys(r)),s=a.next();!s.done;s=a.next()){var d=s.value;this.setProperty(d,r[d])}}catch(p){i={error:p}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}n.length&&this.setChildren(n)}return Object.defineProperty(t.prototype,"kind",{get:function(){return"unknown"},enumerable:!1,configurable:!0}),t.prototype.setProperty=function(e,r){this.properties[e]=r},t.prototype.getProperty=function(e){return this.properties[e]},t.prototype.getPropertyNames=function(){return Object.keys(this.properties)},t.prototype.getAllProperties=function(){return this.properties},t.prototype.removeProperty=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{for(var o=I7(n),a=o.next();!a.done;a=o.next()){var s=a.value;delete this.properties[s]}}catch(d){e={error:d}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},t.prototype.isKind=function(e){return this.factory.nodeIsKind(this,e)},t.prototype.setChildren=function(e){var r,n;this.childNodes=[];try{for(var i=I7(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.appendChild(a)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},t.prototype.appendChild=function(e){return this.childNodes.push(e),e.parent=this,e},t.prototype.replaceChild=function(e,r){var n=this.childIndex(r);return n!==null&&(this.childNodes[n]=e,e.parent=this,r.parent=null),e},t.prototype.removeChild=function(e){var r=this.childIndex(e);return r!==null&&(this.childNodes.splice(r,1),e.parent=null),e},t.prototype.childIndex=function(e){var r=this.childNodes.indexOf(e);return r===-1?null:r},t.prototype.copy=function(){var e,r,n=this.factory.create(this.kind);n.properties=Uy({},this.properties);try{for(var i=I7(this.childNodes||[]),o=i.next();!o.done;o=i.next()){var a=o.value;a&&n.appendChild(a.copy())}}catch(s){e={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n},t.prototype.findNodes=function(e){var r=[];return this.walkTree(function(n){n.isKind(e)&&r.push(n)}),r},t.prototype.walkTree=function(e,r){var n,i;e(this,r);try{for(var o=I7(this.childNodes),a=o.next();!a.done;a=o.next()){var s=a.value;s&&s.walkTree(e,r)}}catch(d){n={error:d}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r},t.prototype.toString=function(){return this.kind+"("+this.childNodes.join(",")+")"},t}();Z5.AbstractNode=DO;var adt=function(t){odt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.setChildren=function(r){},e.prototype.appendChild=function(r){return r},e.prototype.replaceChild=function(r,n){return n},e.prototype.childIndex=function(r){return null},e.prototype.walkTree=function(r,n){return r(this,n),n},e.prototype.toString=function(){return this.kind},e}(DO);Z5.AbstractEmptyNode=adt,function(t){var e=P&&P.__extends||function(){var M=function(E,V){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var j in R)Object.prototype.hasOwnProperty.call(R,j)&&(O[j]=R[j])},M(E,V)};return function(E,V){if(typeof V!="function"&&V!==null)throw new TypeError("Class extends value "+String(V)+" is not a constructor or null");M(E,V);function O(){this.constructor=E}E.prototype=V===null?Object.create(V):(O.prototype=V.prototype,new O)}}(),r=P&&P.__assign||function(){return r=Object.assign||function(M){for(var E,V=1,O=arguments.length;V<O;V++){E=arguments[V];for(var R in E)Object.prototype.hasOwnProperty.call(E,R)&&(M[R]=E[R])}return M},r.apply(this,arguments)},n=P&&P.__values||function(M){var E=typeof Symbol=="function"&&Symbol.iterator,V=E&&M[E],O=0;if(V)return V.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&O>=M.length&&(M=void 0),{value:M&&M[O++],done:!M}}};throw new TypeError(E?"Object is not iterable.":"Symbol.iterator is not defined.")},i=P&&P.__read||function(M,E){var V=typeof Symbol=="function"&&M[Symbol.iterator];if(!V)return M;var O=V.call(M),R,j=[],G;try{for(;(E===void 0||E-- >0)&&!(R=O.next()).done;)j.push(R.value)}catch(z){G={error:z}}finally{try{R&&!R.done&&(V=O.return)&&V.call(O)}finally{if(G)throw G.error}}return j};Object.defineProperty(t,"__esModule",{value:!0}),t.XMLNode=t.TextNode=t.AbstractMmlEmptyNode=t.AbstractMmlBaseNode=t.AbstractMmlLayoutNode=t.AbstractMmlTokenNode=t.AbstractMmlNode=t.indentAttributes=t.TEXCLASSNAMES=t.TEXCLASS=void 0;var o=G5,a=Z5;t.TEXCLASS={ORD:0,OP:1,BIN:2,REL:3,OPEN:4,CLOSE:5,PUNCT:6,INNER:7,VCENTER:8,NONE:-1},t.TEXCLASSNAMES=["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"];var s=["","thinmathspace","mediummathspace","thickmathspace"],d=[[0,-1,2,3,0,0,0,1],[-1,-1,0,3,0,0,0,1],[2,2,0,0,2,0,0,2],[3,3,0,0,3,0,0,3],[0,0,0,0,0,0,0,0],[0,-1,2,3,0,0,0,1],[1,1,0,1,1,1,1,1],[1,-1,2,3,1,0,1,1]];t.indentAttributes=["indentalign","indentalignfirst","indentshift","indentshiftfirst"];var p=function(M){e(E,M);function E(V,O,R){O===void 0&&(O={}),R===void 0&&(R=[]);var j=M.call(this,V)||this;return j.prevClass=null,j.prevLevel=null,j.texclass=null,j.arity<0&&(j.childNodes=[V.create("inferredMrow")],j.childNodes[0].parent=j),j.setChildren(R),j.attributes=new o.Attributes(V.getNodeClass(j.kind).defaults,V.getNodeClass("math").defaults),j.attributes.setList(O),j}return E.prototype.copy=function(V){var O,R,j,G;V===void 0&&(V=!1);var z=this.factory.create(this.kind);if(z.properties=r({},this.properties),this.attributes){var J=this.attributes.getAllAttributes();try{for(var tt=n(Object.keys(J)),ot=tt.next();!ot.done;ot=tt.next()){var et=ot.value;(et!=="id"||V)&&z.attributes.set(et,J[et])}}catch(ue){O={error:ue}}finally{try{ot&&!ot.done&&(R=tt.return)&&R.call(tt)}finally{if(O)throw O.error}}}if(this.childNodes&&this.childNodes.length){var Tt=this.childNodes;Tt.length===1&&Tt[0].isInferred&&(Tt=Tt[0].childNodes);try{for(var At=n(Tt),Ut=At.next();!Ut.done;Ut=At.next()){var ee=Ut.value;ee?z.appendChild(ee.copy()):z.childNodes.push(null)}}catch(ue){j={error:ue}}finally{try{Ut&&!Ut.done&&(G=At.return)&&G.call(At)}finally{if(j)throw j.error}}}return z},Object.defineProperty(E.prototype,"texClass",{get:function(){return this.texclass},set:function(V){this.texclass=V},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isToken",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isEmbellished",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isSpacelike",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"linebreakContainer",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"hasNewLine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"arity",{get:function(){return 1/0},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isInferred",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"Parent",{get:function(){for(var V=this.parent;V&&V.notParent;)V=V.Parent;return V},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"notParent",{get:function(){return!1},enumerable:!1,configurable:!0}),E.prototype.setChildren=function(V){return this.arity<0?this.childNodes[0].setChildren(V):M.prototype.setChildren.call(this,V)},E.prototype.appendChild=function(V){var O,R,j=this;if(this.arity<0)return this.childNodes[0].appendChild(V),V;if(V.isInferred){if(this.arity===1/0)return V.childNodes.forEach(function(ot){return M.prototype.appendChild.call(j,ot)}),V;var G=V;V=this.factory.create("mrow"),V.setChildren(G.childNodes),V.attributes=G.attributes;try{for(var z=n(G.getPropertyNames()),J=z.next();!J.done;J=z.next()){var tt=J.value;V.setProperty(tt,G.getProperty(tt))}}catch(ot){O={error:ot}}finally{try{J&&!J.done&&(R=z.return)&&R.call(z)}finally{if(O)throw O.error}}}return M.prototype.appendChild.call(this,V)},E.prototype.replaceChild=function(V,O){return this.arity<0?(this.childNodes[0].replaceChild(V,O),V):M.prototype.replaceChild.call(this,V,O)},E.prototype.core=function(){return this},E.prototype.coreMO=function(){return this},E.prototype.coreIndex=function(){return 0},E.prototype.childPosition=function(){for(var V,O,R=this,j=R.parent;j&&j.notParent;)R=j,j=j.parent;if(j){var G=0;try{for(var z=n(j.childNodes),J=z.next();!J.done;J=z.next()){var tt=J.value;if(tt===R)return G;G++}}catch(ot){V={error:ot}}finally{try{J&&!J.done&&(O=z.return)&&O.call(z)}finally{if(V)throw V.error}}}return null},E.prototype.setTeXclass=function(V){return this.getPrevClass(V),this.texClass!=null?this:V},E.prototype.updateTeXclass=function(V){V&&(this.prevClass=V.prevClass,this.prevLevel=V.prevLevel,V.prevClass=V.prevLevel=null,this.texClass=V.texClass)},E.prototype.getPrevClass=function(V){V&&(this.prevClass=V.texClass,this.prevLevel=V.attributes.get("scriptlevel"))},E.prototype.texSpacing=function(){var V=this.prevClass!=null?this.prevClass:t.TEXCLASS.NONE,O=this.texClass||t.TEXCLASS.ORD;if(V===t.TEXCLASS.NONE||O===t.TEXCLASS.NONE)return"";V===t.TEXCLASS.VCENTER&&(V=t.TEXCLASS.ORD),O===t.TEXCLASS.VCENTER&&(O=t.TEXCLASS.ORD);var R=d[V][O];return(this.prevLevel>0||this.attributes.get("scriptlevel")>0)&&R>=0?"":s[Math.abs(R)]},E.prototype.hasSpacingAttributes=function(){return this.isEmbellished&&this.coreMO().hasSpacingAttributes()},E.prototype.setInheritedAttributes=function(V,O,R,j){var G,z;V===void 0&&(V={}),O===void 0&&(O=!1),R===void 0&&(R=0),j===void 0&&(j=!1);var J=this.attributes.getAllDefaults();try{for(var tt=n(Object.keys(V)),ot=tt.next();!ot.done;ot=tt.next()){var et=ot.value;if(J.hasOwnProperty(et)||E.alwaysInherit.hasOwnProperty(et)){var Tt=i(V[et],2),At=Tt[0],Ut=Tt[1],ee=(E.noInherit[At]||{})[this.kind]||{};ee[et]||this.attributes.setInherited(et,Ut)}}}catch(lr){G={error:lr}}finally{try{ot&&!ot.done&&(z=tt.return)&&z.call(tt)}finally{if(G)throw G.error}}var ue=this.attributes.getExplicit("displaystyle");ue===void 0&&this.attributes.setInherited("displaystyle",O);var Ft=this.attributes.getExplicit("scriptlevel");Ft===void 0&&this.attributes.setInherited("scriptlevel",R),j&&this.setProperty("texprimestyle",j);var pe=this.arity;if(pe>=0&&pe!==1/0&&(pe===1&&this.childNodes.length===0||pe!==1&&this.childNodes.length!==pe))if(pe<this.childNodes.length)this.childNodes=this.childNodes.slice(0,pe);else for(;this.childNodes.length<pe;)this.appendChild(this.factory.create("mrow"));this.setChildInheritedAttributes(V,O,R,j)},E.prototype.setChildInheritedAttributes=function(V,O,R,j){var G,z;try{for(var J=n(this.childNodes),tt=J.next();!tt.done;tt=J.next()){var ot=tt.value;ot.setInheritedAttributes(V,O,R,j)}}catch(et){G={error:et}}finally{try{tt&&!tt.done&&(z=J.return)&&z.call(J)}finally{if(G)throw G.error}}},E.prototype.addInheritedAttributes=function(V,O){var R,j,G=r({},V);try{for(var z=n(Object.keys(O)),J=z.next();!J.done;J=z.next()){var tt=J.value;tt!=="displaystyle"&&tt!=="scriptlevel"&&tt!=="style"&&(G[tt]=[this.kind,O[tt]])}}catch(ot){R={error:ot}}finally{try{J&&!J.done&&(j=z.return)&&j.call(z)}finally{if(R)throw R.error}}return G},E.prototype.inheritAttributesFrom=function(V){var O=V.attributes,R=O.get("displaystyle"),j=O.get("scriptlevel"),G=O.isSet("mathsize")?{mathsize:["math",O.get("mathsize")]}:{},z=V.getProperty("texprimestyle")||!1;this.setInheritedAttributes(G,R,j,z)},E.prototype.verifyTree=function(V){if(V===void 0&&(V=null),V!==null){this.verifyAttributes(V);var O=this.arity;V.checkArity&&O>=0&&O!==1/0&&(O===1&&this.childNodes.length===0||O!==1&&this.childNodes.length!==O)&&this.mError('Wrong number of children for "'+this.kind+'" node',V,!0),this.verifyChildren(V)}},E.prototype.verifyAttributes=function(V){var O,R;if(V.checkAttributes){var j=this.attributes,G=[];try{for(var z=n(j.getExplicitNames()),J=z.next();!J.done;J=z.next()){var tt=J.value;tt.substr(0,5)!=="data-"&&j.getDefault(tt)===void 0&&!tt.match(/^(?:class|style|id|(?:xlink:)?href)$/)&&G.push(tt)}}catch(ot){O={error:ot}}finally{try{J&&!J.done&&(R=z.return)&&R.call(z)}finally{if(O)throw O.error}}G.length&&this.mError("Unknown attributes for "+this.kind+" node: "+G.join(", "),V)}},E.prototype.verifyChildren=function(V){var O,R;try{for(var j=n(this.childNodes),G=j.next();!G.done;G=j.next()){var z=G.value;z.verifyTree(V)}}catch(J){O={error:J}}finally{try{G&&!G.done&&(R=j.return)&&R.call(j)}finally{if(O)throw O.error}}},E.prototype.mError=function(V,O,R){if(R===void 0&&(R=!1),this.parent&&this.parent.isKind("merror"))return null;var j=this.factory.create("merror");if(j.attributes.set("data-mjx-message",V),O.fullErrors||R){var G=this.factory.create("mtext"),z=this.factory.create("text");z.setText(O.fullErrors?V:this.kind),G.appendChild(z),j.appendChild(G),this.parent.replaceChild(j,this)}else this.parent.replaceChild(j,this),j.appendChild(this);return j},E.defaults={mathbackground:o.INHERIT,mathcolor:o.INHERIT,mathsize:o.INHERIT,dir:o.INHERIT},E.noInherit={mstyle:{mpadded:{width:!0,height:!0,depth:!0,lspace:!0,voffset:!0},mtable:{width:!0,height:!0,depth:!0,align:!0}},maligngroup:{mrow:{groupalign:!0},mtable:{groupalign:!0}}},E.alwaysInherit={scriptminsize:!0,scriptsizemultiplier:!0},E.verifyDefaults={checkArity:!0,checkAttributes:!1,fullErrors:!1,fixMmultiscripts:!0,fixMtables:!0},E}(a.AbstractNode);t.AbstractMmlNode=p;var f=function(M){e(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return Object.defineProperty(E.prototype,"isToken",{get:function(){return!0},enumerable:!1,configurable:!0}),E.prototype.getText=function(){var V,O,R="";try{for(var j=n(this.childNodes),G=j.next();!G.done;G=j.next()){var z=G.value;z instanceof v&&(R+=z.getText())}}catch(J){V={error:J}}finally{try{G&&!G.done&&(O=j.return)&&O.call(j)}finally{if(V)throw V.error}}return R},E.prototype.setChildInheritedAttributes=function(V,O,R,j){var G,z;try{for(var J=n(this.childNodes),tt=J.next();!tt.done;tt=J.next()){var ot=tt.value;ot instanceof p&&ot.setInheritedAttributes(V,O,R,j)}}catch(et){G={error:et}}finally{try{tt&&!tt.done&&(z=J.return)&&z.call(J)}finally{if(G)throw G.error}}},E.prototype.walkTree=function(V,O){var R,j;V(this,O);try{for(var G=n(this.childNodes),z=G.next();!z.done;z=G.next()){var J=z.value;J instanceof p&&J.walkTree(V,O)}}catch(tt){R={error:tt}}finally{try{z&&!z.done&&(j=G.return)&&j.call(G)}finally{if(R)throw R.error}}return O},E.defaults=r(r({},p.defaults),{mathvariant:"normal",mathsize:o.INHERIT}),E}(p);t.AbstractMmlTokenNode=f;var Q=function(M){e(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return Object.defineProperty(E.prototype,"isSpacelike",{get:function(){return this.childNodes[0].isSpacelike},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isEmbellished",{get:function(){return this.childNodes[0].isEmbellished},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"arity",{get:function(){return-1},enumerable:!1,configurable:!0}),E.prototype.core=function(){return this.childNodes[0]},E.prototype.coreMO=function(){return this.childNodes[0].coreMO()},E.prototype.setTeXclass=function(V){return V=this.childNodes[0].setTeXclass(V),this.updateTeXclass(this.childNodes[0]),V},E.defaults=p.defaults,E}(p);t.AbstractMmlLayoutNode=Q;var m=function(M){e(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return Object.defineProperty(E.prototype,"isEmbellished",{get:function(){return this.childNodes[0].isEmbellished},enumerable:!1,configurable:!0}),E.prototype.core=function(){return this.childNodes[0]},E.prototype.coreMO=function(){return this.childNodes[0].coreMO()},E.prototype.setTeXclass=function(V){var O,R;this.getPrevClass(V),this.texClass=t.TEXCLASS.ORD;var j=this.childNodes[0];j?this.isEmbellished||j.isKind("mi")?(V=j.setTeXclass(V),this.updateTeXclass(this.core())):(j.setTeXclass(null),V=this):V=this;try{for(var G=n(this.childNodes.slice(1)),z=G.next();!z.done;z=G.next()){var J=z.value;J&&J.setTeXclass(null)}}catch(tt){O={error:tt}}finally{try{z&&!z.done&&(R=G.return)&&R.call(G)}finally{if(O)throw O.error}}return V},E.defaults=p.defaults,E}(p);t.AbstractMmlBaseNode=m;var _=function(M){e(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return Object.defineProperty(E.prototype,"isToken",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isEmbellished",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isSpacelike",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"linebreakContainer",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"hasNewLine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"arity",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"isInferred",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"notParent",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"Parent",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"texClass",{get:function(){return t.TEXCLASS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"prevClass",{get:function(){return t.TEXCLASS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"prevLevel",{get:function(){return 0},enumerable:!1,configurable:!0}),E.prototype.hasSpacingAttributes=function(){return!1},Object.defineProperty(E.prototype,"attributes",{get:function(){return null},enumerable:!1,configurable:!0}),E.prototype.core=function(){return this},E.prototype.coreMO=function(){return this},E.prototype.coreIndex=function(){return 0},E.prototype.childPosition=function(){return 0},E.prototype.setTeXclass=function(V){return V},E.prototype.texSpacing=function(){return""},E.prototype.setInheritedAttributes=function(V,O,R,j){},E.prototype.inheritAttributesFrom=function(V){},E.prototype.verifyTree=function(V){},E.prototype.mError=function(V,O,R){return null},E}(a.AbstractEmptyNode);t.AbstractMmlEmptyNode=_;var v=function(M){e(E,M);function E(){var V=M!==null&&M.apply(this,arguments)||this;return V.text="",V}return Object.defineProperty(E.prototype,"kind",{get:function(){return"text"},enumerable:!1,configurable:!0}),E.prototype.getText=function(){return this.text},E.prototype.setText=function(V){return this.text=V,this},E.prototype.copy=function(){return this.factory.create(this.kind).setText(this.getText())},E.prototype.toString=function(){return this.text},E}(_);t.TextNode=v;var b=function(M){e(E,M);function E(){var V=M!==null&&M.apply(this,arguments)||this;return V.xml=null,V.adaptor=null,V}return Object.defineProperty(E.prototype,"kind",{get:function(){return"XML"},enumerable:!1,configurable:!0}),E.prototype.getXML=function(){return this.xml},E.prototype.setXML=function(V,O){return O===void 0&&(O=null),this.xml=V,this.adaptor=O,this},E.prototype.getSerializedXML=function(){return this.adaptor.serializeXML(this.xml)},E.prototype.copy=function(){return this.factory.create(this.kind).setXML(this.adaptor.clone(this.xml))},E.prototype.toString=function(){return"XML data"},E}(_);t.XMLNode=b}(fr);var Pn={},i6={},Gy={};(function(t){var e=P&&P.__values||function(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],d=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&d>=o.length&&(o=void 0),{value:o&&o[d++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.OPTABLE=t.MMLSPACING=t.getRange=t.RANGES=t.MO=t.OPDEF=void 0;var r=fr;function n(o,a,s,d){return s===void 0&&(s=r.TEXCLASS.BIN),d===void 0&&(d=null),[o,a,s,d]}t.OPDEF=n,t.MO={ORD:n(0,0,r.TEXCLASS.ORD),ORD11:n(1,1,r.TEXCLASS.ORD),ORD21:n(2,1,r.TEXCLASS.ORD),ORD02:n(0,2,r.TEXCLASS.ORD),ORD55:n(5,5,r.TEXCLASS.ORD),NONE:n(0,0,r.TEXCLASS.NONE),OP:n(1,2,r.TEXCLASS.OP,{largeop:!0,movablelimits:!0,symmetric:!0}),OPFIXED:n(1,2,r.TEXCLASS.OP,{largeop:!0,movablelimits:!0}),INTEGRAL:n(0,1,r.TEXCLASS.OP,{largeop:!0,symmetric:!0}),INTEGRAL2:n(1,2,r.TEXCLASS.OP,{largeop:!0,symmetric:!0}),BIN3:n(3,3,r.TEXCLASS.BIN),BIN4:n(4,4,r.TEXCLASS.BIN),BIN01:n(0,1,r.TEXCLASS.BIN),BIN5:n(5,5,r.TEXCLASS.BIN),TALLBIN:n(4,4,r.TEXCLASS.BIN,{stretchy:!0}),BINOP:n(4,4,r.TEXCLASS.BIN,{largeop:!0,movablelimits:!0}),REL:n(5,5,r.TEXCLASS.REL),REL1:n(1,1,r.TEXCLASS.REL,{stretchy:!0}),REL4:n(4,4,r.TEXCLASS.REL),RELSTRETCH:n(5,5,r.TEXCLASS.REL,{stretchy:!0}),RELACCENT:n(5,5,r.TEXCLASS.REL,{accent:!0}),WIDEREL:n(5,5,r.TEXCLASS.REL,{accent:!0,stretchy:!0}),OPEN:n(0,0,r.TEXCLASS.OPEN,{fence:!0,stretchy:!0,symmetric:!0}),CLOSE:n(0,0,r.TEXCLASS.CLOSE,{fence:!0,stretchy:!0,symmetric:!0}),INNER:n(0,0,r.TEXCLASS.INNER),PUNCT:n(0,3,r.TEXCLASS.PUNCT),ACCENT:n(0,0,r.TEXCLASS.ORD,{accent:!0}),WIDEACCENT:n(0,0,r.TEXCLASS.ORD,{accent:!0,stretchy:!0})},t.RANGES=[[32,127,r.TEXCLASS.REL,"mo"],[160,191,r.TEXCLASS.ORD,"mo"],[192,591,r.TEXCLASS.ORD,"mi"],[688,879,r.TEXCLASS.ORD,"mo"],[880,6688,r.TEXCLASS.ORD,"mi"],[6832,6911,r.TEXCLASS.ORD,"mo"],[6912,7615,r.TEXCLASS.ORD,"mi"],[7616,7679,r.TEXCLASS.ORD,"mo"],[7680,8191,r.TEXCLASS.ORD,"mi"],[8192,8303,r.TEXCLASS.ORD,"mo"],[8304,8351,r.TEXCLASS.ORD,"mo"],[8448,8527,r.TEXCLASS.ORD,"mi"],[8528,8591,r.TEXCLASS.ORD,"mn"],[8592,8703,r.TEXCLASS.REL,"mo"],[8704,8959,r.TEXCLASS.BIN,"mo"],[8960,9215,r.TEXCLASS.ORD,"mo"],[9312,9471,r.TEXCLASS.ORD,"mn"],[9472,10223,r.TEXCLASS.ORD,"mo"],[10224,10239,r.TEXCLASS.REL,"mo"],[10240,10495,r.TEXCLASS.ORD,"mtext"],[10496,10623,r.TEXCLASS.REL,"mo"],[10624,10751,r.TEXCLASS.ORD,"mo"],[10752,11007,r.TEXCLASS.BIN,"mo"],[11008,11055,r.TEXCLASS.ORD,"mo"],[11056,11087,r.TEXCLASS.REL,"mo"],[11088,11263,r.TEXCLASS.ORD,"mo"],[11264,11744,r.TEXCLASS.ORD,"mi"],[11776,11903,r.TEXCLASS.ORD,"mo"],[11904,12255,r.TEXCLASS.ORD,"mi","normal"],[12272,12351,r.TEXCLASS.ORD,"mo"],[12352,42143,r.TEXCLASS.ORD,"mi","normal"],[42192,43055,r.TEXCLASS.ORD,"mi"],[43056,43071,r.TEXCLASS.ORD,"mn"],[43072,55295,r.TEXCLASS.ORD,"mi"],[63744,64255,r.TEXCLASS.ORD,"mi","normal"],[64256,65023,r.TEXCLASS.ORD,"mi"],[65024,65135,r.TEXCLASS.ORD,"mo"],[65136,65791,r.TEXCLASS.ORD,"mi"],[65792,65935,r.TEXCLASS.ORD,"mn"],[65936,74751,r.TEXCLASS.ORD,"mi","normal"],[74752,74879,r.TEXCLASS.ORD,"mn"],[74880,113823,r.TEXCLASS.ORD,"mi","normal"],[113824,119391,r.TEXCLASS.ORD,"mo"],[119648,119679,r.TEXCLASS.ORD,"mn"],[119808,120781,r.TEXCLASS.ORD,"mi"],[120782,120831,r.TEXCLASS.ORD,"mn"],[122624,129023,r.TEXCLASS.ORD,"mo"],[129024,129279,r.TEXCLASS.REL,"mo"],[129280,129535,r.TEXCLASS.ORD,"mo"],[131072,195103,r.TEXCLASS.ORD,"mi","normnal"]];function i(o){var a,s,d=o.codePointAt(0);try{for(var p=e(t.RANGES),f=p.next();!f.done;f=p.next()){var Q=f.value;if(d<=Q[1]){if(d>=Q[0])return Q;break}}}catch(m){a={error:m}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return null}t.getRange=i,t.MMLSPACING=[[0,0],[1,2],[3,3],[4,4],[0,0],[0,0],[0,3]],t.OPTABLE={prefix:{"(":t.MO.OPEN,"+":t.MO.BIN01,"-":t.MO.BIN01,"[":t.MO.OPEN,"{":t.MO.OPEN,"|":t.MO.OPEN,"||":[0,0,r.TEXCLASS.BIN,{fence:!0,stretchy:!0,symmetric:!0}],"|||":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0,symmetric:!0}],"¬":t.MO.ORD21,"±":t.MO.BIN01,"‖":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0}],"‘":[0,0,r.TEXCLASS.OPEN,{fence:!0}],"“":[0,0,r.TEXCLASS.OPEN,{fence:!0}],"ⅅ":t.MO.ORD21,"ⅆ":n(2,0,r.TEXCLASS.ORD),"∀":t.MO.ORD21,"∂":t.MO.ORD21,"∃":t.MO.ORD21,"∄":t.MO.ORD21,"∇":t.MO.ORD21,"∏":t.MO.OP,"∐":t.MO.OP,"∑":t.MO.OP,"−":t.MO.BIN01,"∓":t.MO.BIN01,"√":[1,1,r.TEXCLASS.ORD,{stretchy:!0}],"∛":t.MO.ORD11,"∜":t.MO.ORD11,"∠":t.MO.ORD,"∡":t.MO.ORD,"∢":t.MO.ORD,"∫":t.MO.INTEGRAL,"∬":t.MO.INTEGRAL,"∭":t.MO.INTEGRAL,"∮":t.MO.INTEGRAL,"∯":t.MO.INTEGRAL,"∰":t.MO.INTEGRAL,"∱":t.MO.INTEGRAL,"∲":t.MO.INTEGRAL,"∳":t.MO.INTEGRAL,"⋀":t.MO.OP,"⋁":t.MO.OP,"⋂":t.MO.OP,"⋃":t.MO.OP,"⌈":t.MO.OPEN,"⌊":t.MO.OPEN,"〈":t.MO.OPEN,"❲":t.MO.OPEN,"⟦":t.MO.OPEN,"⟨":t.MO.OPEN,"⟪":t.MO.OPEN,"⟬":t.MO.OPEN,"⟮":t.MO.OPEN,"⦀":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0}],"⦃":t.MO.OPEN,"⦅":t.MO.OPEN,"⦇":t.MO.OPEN,"⦉":t.MO.OPEN,"⦋":t.MO.OPEN,"⦍":t.MO.OPEN,"⦏":t.MO.OPEN,"⦑":t.MO.OPEN,"⦓":t.MO.OPEN,"⦕":t.MO.OPEN,"⦗":t.MO.OPEN,"⧼":t.MO.OPEN,"⨀":t.MO.OP,"⨁":t.MO.OP,"⨂":t.MO.OP,"⨃":t.MO.OP,"⨄":t.MO.OP,"⨅":t.MO.OP,"⨆":t.MO.OP,"⨇":t.MO.OP,"⨈":t.MO.OP,"⨉":t.MO.OP,"⨊":t.MO.OP,"⨋":t.MO.INTEGRAL2,"⨌":t.MO.INTEGRAL,"⨍":t.MO.INTEGRAL2,"⨎":t.MO.INTEGRAL2,"⨏":t.MO.INTEGRAL2,"⨐":t.MO.OP,"⨑":t.MO.OP,"⨒":t.MO.OP,"⨓":t.MO.OP,"⨔":t.MO.OP,"⨕":t.MO.INTEGRAL2,"⨖":t.MO.INTEGRAL2,"⨗":t.MO.INTEGRAL2,"⨘":t.MO.INTEGRAL2,"⨙":t.MO.INTEGRAL2,"⨚":t.MO.INTEGRAL2,"⨛":t.MO.INTEGRAL2,"⨜":t.MO.INTEGRAL2,"⫼":t.MO.OP,"⫿":t.MO.OP},postfix:{"!!":n(1,0),"!":[1,0,r.TEXCLASS.CLOSE,null],'"':t.MO.ACCENT,"&":t.MO.ORD,")":t.MO.CLOSE,"++":n(0,0),"--":n(0,0),"..":n(0,0),"...":t.MO.ORD,"'":t.MO.ACCENT,"]":t.MO.CLOSE,"^":t.MO.WIDEACCENT,_:t.MO.WIDEACCENT,"`":t.MO.ACCENT,"|":t.MO.CLOSE,"}":t.MO.CLOSE,"~":t.MO.WIDEACCENT,"||":[0,0,r.TEXCLASS.BIN,{fence:!0,stretchy:!0,symmetric:!0}],"|||":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0,symmetric:!0}],"¨":t.MO.ACCENT,ª:t.MO.ACCENT,"¯":t.MO.WIDEACCENT,"°":t.MO.ORD,"²":t.MO.ACCENT,"³":t.MO.ACCENT,"´":t.MO.ACCENT,"¸":t.MO.ACCENT,"¹":t.MO.ACCENT,º:t.MO.ACCENT,"ˆ":t.MO.WIDEACCENT,"ˇ":t.MO.WIDEACCENT,"ˉ":t.MO.WIDEACCENT,"ˊ":t.MO.ACCENT,"ˋ":t.MO.ACCENT,"ˍ":t.MO.WIDEACCENT,"˘":t.MO.ACCENT,"˙":t.MO.ACCENT,"˚":t.MO.ACCENT,"˜":t.MO.WIDEACCENT,"˝":t.MO.ACCENT,"˷":t.MO.WIDEACCENT,"̂":t.MO.WIDEACCENT,"̑":t.MO.ACCENT,"϶":t.MO.REL,"‖":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0}],"’":[0,0,r.TEXCLASS.CLOSE,{fence:!0}],"‚":t.MO.ACCENT,"‛":t.MO.ACCENT,"”":[0,0,r.TEXCLASS.CLOSE,{fence:!0}],"„":t.MO.ACCENT,"‟":t.MO.ACCENT,"′":t.MO.ORD,"″":t.MO.ACCENT,"‴":t.MO.ACCENT,"‵":t.MO.ACCENT,"‶":t.MO.ACCENT,"‷":t.MO.ACCENT,"‾":t.MO.WIDEACCENT,"⁗":t.MO.ACCENT,"⃛":t.MO.ACCENT,"⃜":t.MO.ACCENT,"⌉":t.MO.CLOSE,"⌋":t.MO.CLOSE,"〉":t.MO.CLOSE,"⎴":t.MO.WIDEACCENT,"⎵":t.MO.WIDEACCENT,"⏜":t.MO.WIDEACCENT,"⏝":t.MO.WIDEACCENT,"⏞":t.MO.WIDEACCENT,"⏟":t.MO.WIDEACCENT,"⏠":t.MO.WIDEACCENT,"⏡":t.MO.WIDEACCENT,"■":t.MO.BIN3,"□":t.MO.BIN3,"▪":t.MO.BIN3,"▫":t.MO.BIN3,"▭":t.MO.BIN3,"▮":t.MO.BIN3,"▯":t.MO.BIN3,"▰":t.MO.BIN3,"▱":t.MO.BIN3,"▲":t.MO.BIN4,"▴":t.MO.BIN4,"▶":t.MO.BIN4,"▷":t.MO.BIN4,"▸":t.MO.BIN4,"▼":t.MO.BIN4,"▾":t.MO.BIN4,"◀":t.MO.BIN4,"◁":t.MO.BIN4,"◂":t.MO.BIN4,"◄":t.MO.BIN4,"◅":t.MO.BIN4,"◆":t.MO.BIN4,"◇":t.MO.BIN4,"◈":t.MO.BIN4,"◉":t.MO.BIN4,"◌":t.MO.BIN4,"◍":t.MO.BIN4,"◎":t.MO.BIN4,"●":t.MO.BIN4,"◖":t.MO.BIN4,"◗":t.MO.BIN4,"◦":t.MO.BIN4,"♭":t.MO.ORD02,"♮":t.MO.ORD02,"♯":t.MO.ORD02,"❳":t.MO.CLOSE,"⟧":t.MO.CLOSE,"⟩":t.MO.CLOSE,"⟫":t.MO.CLOSE,"⟭":t.MO.CLOSE,"⟯":t.MO.CLOSE,"⦀":[0,0,r.TEXCLASS.ORD,{fence:!0,stretchy:!0}],"⦄":t.MO.CLOSE,"⦆":t.MO.CLOSE,"⦈":t.MO.CLOSE,"⦊":t.MO.CLOSE,"⦌":t.MO.CLOSE,"⦎":t.MO.CLOSE,"⦐":t.MO.CLOSE,"⦒":t.MO.CLOSE,"⦔":t.MO.CLOSE,"⦖":t.MO.CLOSE,"⦘":t.MO.CLOSE,"⧽":t.MO.CLOSE},infix:{"!=":t.MO.BIN4,"#":t.MO.ORD,$:t.MO.ORD,"%":[3,3,r.TEXCLASS.ORD,null],"&&":t.MO.BIN4,"":t.MO.ORD,"*":t.MO.BIN3,"**":n(1,1),"*=":t.MO.BIN4,"+":t.MO.BIN4,"+=":t.MO.BIN4,",":[0,3,r.TEXCLASS.PUNCT,{linebreakstyle:"after",separator:!0}],"-":t.MO.BIN4,"-=":t.MO.BIN4,"->":t.MO.BIN5,".":[0,3,r.TEXCLASS.PUNCT,{separator:!0}],"/":t.MO.ORD11,"//":n(1,1),"/=":t.MO.BIN4,":":[1,2,r.TEXCLASS.REL,null],":=":t.MO.BIN4,";":[0,3,r.TEXCLASS.PUNCT,{linebreakstyle:"after",separator:!0}],"<":t.MO.REL,"<=":t.MO.BIN5,"<>":n(1,1),"=":t.MO.REL,"==":t.MO.BIN4,">":t.MO.REL,">=":t.MO.BIN5,"?":[1,1,r.TEXCLASS.CLOSE,null],"@":t.MO.ORD11,"\\":t.MO.ORD,"^":t.MO.ORD11,_:t.MO.ORD11,"|":[2,2,r.TEXCLASS.ORD,{fence:!0,stretchy:!0,symmetric:!0}],"||":[2,2,r.TEXCLASS.BIN,{fence:!0,stretchy:!0,symmetric:!0}],"|||":[2,2,r.TEXCLASS.ORD,{fence:!0,stretchy:!0,symmetric:!0}],"±":t.MO.BIN4,"·":t.MO.BIN4,"×":t.MO.BIN4,"÷":t.MO.BIN4,"ʹ":t.MO.ORD,"̀":t.MO.ACCENT,"́":t.MO.ACCENT,"̃":t.MO.WIDEACCENT,"̄":t.MO.ACCENT,"̆":t.MO.ACCENT,"̇":t.MO.ACCENT,"̈":t.MO.ACCENT,"̌":t.MO.ACCENT,"̲":t.MO.WIDEACCENT,"̸":t.MO.REL4,"―":[0,0,r.TEXCLASS.ORD,{stretchy:!0}],"‗":[0,0,r.TEXCLASS.ORD,{stretchy:!0}],"†":t.MO.BIN3,"‡":t.MO.BIN3,"•":t.MO.BIN4,"…":t.MO.INNER,"⁃":t.MO.BIN4,"⁄":t.MO.TALLBIN,"⁡":t.MO.NONE,"⁢":t.MO.NONE,"⁣":[0,0,r.TEXCLASS.NONE,{linebreakstyle:"after",separator:!0}],"⁤":t.MO.NONE,"⃗":t.MO.ACCENT,ℑ:t.MO.ORD,ℓ:t.MO.ORD,"℘":t.MO.ORD,ℜ:t.MO.ORD,"←":t.MO.WIDEREL,"↑":t.MO.RELSTRETCH,"→":t.MO.WIDEREL,"↓":t.MO.RELSTRETCH,"↔":t.MO.WIDEREL,"↕":t.MO.RELSTRETCH,"↖":t.MO.RELSTRETCH,"↗":t.MO.RELSTRETCH,"↘":t.MO.RELSTRETCH,"↙":t.MO.RELSTRETCH,"↚":t.MO.RELACCENT,"↛":t.MO.RELACCENT,"↜":t.MO.WIDEREL,"↝":t.MO.WIDEREL,"↞":t.MO.WIDEREL,"↟":t.MO.WIDEREL,"↠":t.MO.WIDEREL,"↡":t.MO.RELSTRETCH,"↢":t.MO.WIDEREL,"↣":t.MO.WIDEREL,"↤":t.MO.WIDEREL,"↥":t.MO.RELSTRETCH,"↦":t.MO.WIDEREL,"↧":t.MO.RELSTRETCH,"↨":t.MO.RELSTRETCH,"↩":t.MO.WIDEREL,"↪":t.MO.WIDEREL,"↫":t.MO.WIDEREL,"↬":t.MO.WIDEREL,"↭":t.MO.WIDEREL,"↮":t.MO.RELACCENT,"↯":t.MO.RELSTRETCH,"↰":t.MO.RELSTRETCH,"↱":t.MO.RELSTRETCH,"↲":t.MO.RELSTRETCH,"↳":t.MO.RELSTRETCH,"↴":t.MO.RELSTRETCH,"↵":t.MO.RELSTRETCH,"↶":t.MO.RELACCENT,"↷":t.MO.RELACCENT,"↸":t.MO.REL,"↹":t.MO.WIDEREL,"↺":t.MO.REL,"↻":t.MO.REL,"↼":t.MO.WIDEREL,"↽":t.MO.WIDEREL,"↾":t.MO.RELSTRETCH,"↿":t.MO.RELSTRETCH,"⇀":t.MO.WIDEREL,"⇁":t.MO.WIDEREL,"⇂":t.MO.RELSTRETCH,"⇃":t.MO.RELSTRETCH,"⇄":t.MO.WIDEREL,"⇅":t.MO.RELSTRETCH,"⇆":t.MO.WIDEREL,"⇇":t.MO.WIDEREL,"⇈":t.MO.RELSTRETCH,"⇉":t.MO.WIDEREL,"⇊":t.MO.RELSTRETCH,"⇋":t.MO.WIDEREL,"⇌":t.MO.WIDEREL,"⇍":t.MO.RELACCENT,"⇎":t.MO.RELACCENT,"⇏":t.MO.RELACCENT,"⇐":t.MO.WIDEREL,"⇑":t.MO.RELSTRETCH,"⇒":t.MO.WIDEREL,"⇓":t.MO.RELSTRETCH,"⇔":t.MO.WIDEREL,"⇕":t.MO.RELSTRETCH,"⇖":t.MO.RELSTRETCH,"⇗":t.MO.RELSTRETCH,"⇘":t.MO.RELSTRETCH,"⇙":t.MO.RELSTRETCH,"⇚":t.MO.WIDEREL,"⇛":t.MO.WIDEREL,"⇜":t.MO.WIDEREL,"⇝":t.MO.WIDEREL,"⇞":t.MO.REL,"⇟":t.MO.REL,"⇠":t.MO.WIDEREL,"⇡":t.MO.RELSTRETCH,"⇢":t.MO.WIDEREL,"⇣":t.MO.RELSTRETCH,"⇤":t.MO.WIDEREL,"⇥":t.MO.WIDEREL,"⇦":t.MO.WIDEREL,"⇧":t.MO.RELSTRETCH,"⇨":t.MO.WIDEREL,"⇩":t.MO.RELSTRETCH,"⇪":t.MO.RELSTRETCH,"⇫":t.MO.RELSTRETCH,"⇬":t.MO.RELSTRETCH,"⇭":t.MO.RELSTRETCH,"⇮":t.MO.RELSTRETCH,"⇯":t.MO.RELSTRETCH,"⇰":t.MO.WIDEREL,"⇱":t.MO.REL,"⇲":t.MO.REL,"⇳":t.MO.RELSTRETCH,"⇴":t.MO.RELACCENT,"⇵":t.MO.RELSTRETCH,"⇶":t.MO.WIDEREL,"⇷":t.MO.RELACCENT,"⇸":t.MO.RELACCENT,"⇹":t.MO.RELACCENT,"⇺":t.MO.RELACCENT,"⇻":t.MO.RELACCENT,"⇼":t.MO.RELACCENT,"⇽":t.MO.WIDEREL,"⇾":t.MO.WIDEREL,"⇿":t.MO.WIDEREL,"∁":n(1,2,r.TEXCLASS.ORD),"∅":t.MO.ORD,"∆":t.MO.BIN3,"∈":t.MO.REL,"∉":t.MO.REL,"∊":t.MO.REL,"∋":t.MO.REL,"∌":t.MO.REL,"∍":t.MO.REL,"∎":t.MO.BIN3,"−":t.MO.BIN4,"∓":t.MO.BIN4,"∔":t.MO.BIN4,"∕":t.MO.TALLBIN,"∖":t.MO.BIN4,"∗":t.MO.BIN4,"∘":t.MO.BIN4,"∙":t.MO.BIN4,"∝":t.MO.REL,"∞":t.MO.ORD,"∟":t.MO.REL,"∣":t.MO.REL,"∤":t.MO.REL,"∥":t.MO.REL,"∦":t.MO.REL,"∧":t.MO.BIN4,"∨":t.MO.BIN4,"∩":t.MO.BIN4,"∪":t.MO.BIN4,"∴":t.MO.REL,"∵":t.MO.REL,"∶":t.MO.REL,"∷":t.MO.REL,"∸":t.MO.BIN4,"∹":t.MO.REL,"∺":t.MO.BIN4,"∻":t.MO.REL,"∼":t.MO.REL,"∽":t.MO.REL,"∽̱":t.MO.BIN3,"∾":t.MO.REL,"∿":t.MO.BIN3,"≀":t.MO.BIN4,"≁":t.MO.REL,"≂":t.MO.REL,"≂̸":t.MO.REL,"≃":t.MO.REL,"≄":t.MO.REL,"≅":t.MO.REL,"≆":t.MO.REL,"≇":t.MO.REL,"≈":t.MO.REL,"≉":t.MO.REL,"≊":t.MO.REL,"≋":t.MO.REL,"≌":t.MO.REL,"≍":t.MO.REL,"≎":t.MO.REL,"≎̸":t.MO.REL,"≏":t.MO.REL,"≏̸":t.MO.REL,"≐":t.MO.REL,"≑":t.MO.REL,"≒":t.MO.REL,"≓":t.MO.REL,"≔":t.MO.REL,"≕":t.MO.REL,"≖":t.MO.REL,"≗":t.MO.REL,"≘":t.MO.REL,"≙":t.MO.REL,"≚":t.MO.REL,"≛":t.MO.REL,"≜":t.MO.REL,"≝":t.MO.REL,"≞":t.MO.REL,"≟":t.MO.REL,"≠":t.MO.REL,"≡":t.MO.REL,"≢":t.MO.REL,"≣":t.MO.REL,"≤":t.MO.REL,"≥":t.MO.REL,"≦":t.MO.REL,"≦̸":t.MO.REL,"≧":t.MO.REL,"≨":t.MO.REL,"≩":t.MO.REL,"≪":t.MO.REL,"≪̸":t.MO.REL,"≫":t.MO.REL,"≫̸":t.MO.REL,"≬":t.MO.REL,"≭":t.MO.REL,"≮":t.MO.REL,"≯":t.MO.REL,"≰":t.MO.REL,"≱":t.MO.REL,"≲":t.MO.REL,"≳":t.MO.REL,"≴":t.MO.REL,"≵":t.MO.REL,"≶":t.MO.REL,"≷":t.MO.REL,"≸":t.MO.REL,"≹":t.MO.REL,"≺":t.MO.REL,"≻":t.MO.REL,"≼":t.MO.REL,"≽":t.MO.REL,"≾":t.MO.REL,"≿":t.MO.REL,"≿̸":t.MO.REL,"⊀":t.MO.REL,"⊁":t.MO.REL,"⊂":t.MO.REL,"⊂⃒":t.MO.REL,"⊃":t.MO.REL,"⊃⃒":t.MO.REL,"⊄":t.MO.REL,"⊅":t.MO.REL,"⊆":t.MO.REL,"⊇":t.MO.REL,"⊈":t.MO.REL,"⊉":t.MO.REL,"⊊":t.MO.REL,"⊋":t.MO.REL,"⊌":t.MO.BIN4,"⊍":t.MO.BIN4,"⊎":t.MO.BIN4,"⊏":t.MO.REL,"⊏̸":t.MO.REL,"⊐":t.MO.REL,"⊐̸":t.MO.REL,"⊑":t.MO.REL,"⊒":t.MO.REL,"⊓":t.MO.BIN4,"⊔":t.MO.BIN4,"⊕":t.MO.BIN4,"⊖":t.MO.BIN4,"⊗":t.MO.BIN4,"⊘":t.MO.BIN4,"⊙":t.MO.BIN4,"⊚":t.MO.BIN4,"⊛":t.MO.BIN4,"⊜":t.MO.BIN4,"⊝":t.MO.BIN4,"⊞":t.MO.BIN4,"⊟":t.MO.BIN4,"⊠":t.MO.BIN4,"⊡":t.MO.BIN4,"⊢":t.MO.REL,"⊣":t.MO.REL,"⊤":t.MO.ORD55,"⊥":t.MO.REL,"⊦":t.MO.REL,"⊧":t.MO.REL,"⊨":t.MO.REL,"⊩":t.MO.REL,"⊪":t.MO.REL,"⊫":t.MO.REL,"⊬":t.MO.REL,"⊭":t.MO.REL,"⊮":t.MO.REL,"⊯":t.MO.REL,"⊰":t.MO.REL,"⊱":t.MO.REL,"⊲":t.MO.REL,"⊳":t.MO.REL,"⊴":t.MO.REL,"⊵":t.MO.REL,"⊶":t.MO.REL,"⊷":t.MO.REL,"⊸":t.MO.REL,"⊹":t.MO.REL,"⊺":t.MO.BIN4,"⊻":t.MO.BIN4,"⊼":t.MO.BIN4,"⊽":t.MO.BIN4,"⊾":t.MO.BIN3,"⊿":t.MO.BIN3,"⋄":t.MO.BIN4,"⋅":t.MO.BIN4,"⋆":t.MO.BIN4,"⋇":t.MO.BIN4,"⋈":t.MO.REL,"⋉":t.MO.BIN4,"⋊":t.MO.BIN4,"⋋":t.MO.BIN4,"⋌":t.MO.BIN4,"⋍":t.MO.REL,"⋎":t.MO.BIN4,"⋏":t.MO.BIN4,"⋐":t.MO.REL,"⋑":t.MO.REL,"⋒":t.MO.BIN4,"⋓":t.MO.BIN4,"⋔":t.MO.REL,"⋕":t.MO.REL,"⋖":t.MO.REL,"⋗":t.MO.REL,"⋘":t.MO.REL,"⋙":t.MO.REL,"⋚":t.MO.REL,"⋛":t.MO.REL,"⋜":t.MO.REL,"⋝":t.MO.REL,"⋞":t.MO.REL,"⋟":t.MO.REL,"⋠":t.MO.REL,"⋡":t.MO.REL,"⋢":t.MO.REL,"⋣":t.MO.REL,"⋤":t.MO.REL,"⋥":t.MO.REL,"⋦":t.MO.REL,"⋧":t.MO.REL,"⋨":t.MO.REL,"⋩":t.MO.REL,"⋪":t.MO.REL,"⋫":t.MO.REL,"⋬":t.MO.REL,"⋭":t.MO.REL,"⋮":t.MO.ORD55,"⋯":t.MO.INNER,"⋰":t.MO.REL,"⋱":[5,5,r.TEXCLASS.INNER,null],"⋲":t.MO.REL,"⋳":t.MO.REL,"⋴":t.MO.REL,"⋵":t.MO.REL,"⋶":t.MO.REL,"⋷":t.MO.REL,"⋸":t.MO.REL,"⋹":t.MO.REL,"⋺":t.MO.REL,"⋻":t.MO.REL,"⋼":t.MO.REL,"⋽":t.MO.REL,"⋾":t.MO.REL,"⋿":t.MO.REL,"⌅":t.MO.BIN3,"⌆":t.MO.BIN3,"⌢":t.MO.REL4,"⌣":t.MO.REL4,"〈":t.MO.OPEN,"〉":t.MO.CLOSE,"⎪":t.MO.ORD,"⎯":[0,0,r.TEXCLASS.ORD,{stretchy:!0}],"⎰":t.MO.OPEN,"⎱":t.MO.CLOSE,"─":t.MO.ORD,"△":t.MO.BIN4,"▵":t.MO.BIN4,"▹":t.MO.BIN4,"▽":t.MO.BIN4,"▿":t.MO.BIN4,"◃":t.MO.BIN4,"◯":t.MO.BIN3,"♠":t.MO.ORD,"♡":t.MO.ORD,"♢":t.MO.ORD,"♣":t.MO.ORD,"❘":t.MO.REL,"⟰":t.MO.RELSTRETCH,"⟱":t.MO.RELSTRETCH,"⟵":t.MO.WIDEREL,"⟶":t.MO.WIDEREL,"⟷":t.MO.WIDEREL,"⟸":t.MO.WIDEREL,"⟹":t.MO.WIDEREL,"⟺":t.MO.WIDEREL,"⟻":t.MO.WIDEREL,"⟼":t.MO.WIDEREL,"⟽":t.MO.WIDEREL,"⟾":t.MO.WIDEREL,"⟿":t.MO.WIDEREL,"⤀":t.MO.RELACCENT,"⤁":t.MO.RELACCENT,"⤂":t.MO.RELACCENT,"⤃":t.MO.RELACCENT,"⤄":t.MO.RELACCENT,"⤅":t.MO.RELACCENT,"⤆":t.MO.RELACCENT,"⤇":t.MO.RELACCENT,"⤈":t.MO.REL,"⤉":t.MO.REL,"⤊":t.MO.RELSTRETCH,"⤋":t.MO.RELSTRETCH,"⤌":t.MO.WIDEREL,"⤍":t.MO.WIDEREL,"⤎":t.MO.WIDEREL,"⤏":t.MO.WIDEREL,"⤐":t.MO.WIDEREL,"⤑":t.MO.RELACCENT,"⤒":t.MO.RELSTRETCH,"⤓":t.MO.RELSTRETCH,"⤔":t.MO.RELACCENT,"⤕":t.MO.RELACCENT,"⤖":t.MO.RELACCENT,"⤗":t.MO.RELACCENT,"⤘":t.MO.RELACCENT,"⤙":t.MO.RELACCENT,"⤚":t.MO.RELACCENT,"⤛":t.MO.RELACCENT,"⤜":t.MO.RELACCENT,"⤝":t.MO.RELACCENT,"⤞":t.MO.RELACCENT,"⤟":t.MO.RELACCENT,"⤠":t.MO.RELACCENT,"⤡":t.MO.RELSTRETCH,"⤢":t.MO.RELSTRETCH,"⤣":t.MO.REL,"⤤":t.MO.REL,"⤥":t.MO.REL,"⤦":t.MO.REL,"⤧":t.MO.REL,"⤨":t.MO.REL,"⤩":t.MO.REL,"⤪":t.MO.REL,"⤫":t.MO.REL,"⤬":t.MO.REL,"⤭":t.MO.REL,"⤮":t.MO.REL,"⤯":t.MO.REL,"⤰":t.MO.REL,"⤱":t.MO.REL,"⤲":t.MO.REL,"⤳":t.MO.RELACCENT,"⤴":t.MO.REL,"⤵":t.MO.REL,"⤶":t.MO.REL,"⤷":t.MO.REL,"⤸":t.MO.REL,"⤹":t.MO.REL,"⤺":t.MO.RELACCENT,"⤻":t.MO.RELACCENT,"⤼":t.MO.RELACCENT,"⤽":t.MO.RELACCENT,"⤾":t.MO.REL,"⤿":t.MO.REL,"⥀":t.MO.REL,"⥁":t.MO.REL,"⥂":t.MO.RELACCENT,"⥃":t.MO.RELACCENT,"⥄":t.MO.RELACCENT,"⥅":t.MO.RELACCENT,"⥆":t.MO.RELACCENT,"⥇":t.MO.RELACCENT,"⥈":t.MO.RELACCENT,"⥉":t.MO.REL,"⥊":t.MO.RELACCENT,"⥋":t.MO.RELACCENT,"⥌":t.MO.REL,"⥍":t.MO.REL,"⥎":t.MO.WIDEREL,"⥏":t.MO.RELSTRETCH,"⥐":t.MO.WIDEREL,"⥑":t.MO.RELSTRETCH,"⥒":t.MO.WIDEREL,"⥓":t.MO.WIDEREL,"⥔":t.MO.RELSTRETCH,"⥕":t.MO.RELSTRETCH,"⥖":t.MO.RELSTRETCH,"⥗":t.MO.RELSTRETCH,"⥘":t.MO.RELSTRETCH,"⥙":t.MO.RELSTRETCH,"⥚":t.MO.WIDEREL,"⥛":t.MO.WIDEREL,"⥜":t.MO.RELSTRETCH,"⥝":t.MO.RELSTRETCH,"⥞":t.MO.WIDEREL,"⥟":t.MO.WIDEREL,"⥠":t.MO.RELSTRETCH,"⥡":t.MO.RELSTRETCH,"⥢":t.MO.RELACCENT,"⥣":t.MO.REL,"⥤":t.MO.RELACCENT,"⥥":t.MO.REL,"⥦":t.MO.RELACCENT,"⥧":t.MO.RELACCENT,"⥨":t.MO.RELACCENT,"⥩":t.MO.RELACCENT,"⥪":t.MO.RELACCENT,"⥫":t.MO.RELACCENT,"⥬":t.MO.RELACCENT,"⥭":t.MO.RELACCENT,"⥮":t.MO.RELSTRETCH,"⥯":t.MO.RELSTRETCH,"⥰":t.MO.RELACCENT,"⥱":t.MO.RELACCENT,"⥲":t.MO.RELACCENT,"⥳":t.MO.RELACCENT,"⥴":t.MO.RELACCENT,"⥵":t.MO.RELACCENT,"⥶":t.MO.RELACCENT,"⥷":t.MO.RELACCENT,"⥸":t.MO.RELACCENT,"⥹":t.MO.RELACCENT,"⥺":t.MO.RELACCENT,"⥻":t.MO.RELACCENT,"⥼":t.MO.RELACCENT,"⥽":t.MO.RELACCENT,"⥾":t.MO.REL,"⥿":t.MO.REL,"⦁":t.MO.BIN3,"⦂":t.MO.BIN3,"⦙":t.MO.BIN3,"⦚":t.MO.BIN3,"⦛":t.MO.BIN3,"⦜":t.MO.BIN3,"⦝":t.MO.BIN3,"⦞":t.MO.BIN3,"⦟":t.MO.BIN3,"⦠":t.MO.BIN3,"⦡":t.MO.BIN3,"⦢":t.MO.BIN3,"⦣":t.MO.BIN3,"⦤":t.MO.BIN3,"⦥":t.MO.BIN3,"⦦":t.MO.BIN3,"⦧":t.MO.BIN3,"⦨":t.MO.BIN3,"⦩":t.MO.BIN3,"⦪":t.MO.BIN3,"⦫":t.MO.BIN3,"⦬":t.MO.BIN3,"⦭":t.MO.BIN3,"⦮":t.MO.BIN3,"⦯":t.MO.BIN3,"⦰":t.MO.BIN3,"⦱":t.MO.BIN3,"⦲":t.MO.BIN3,"⦳":t.MO.BIN3,"⦴":t.MO.BIN3,"⦵":t.MO.BIN3,"⦶":t.MO.BIN4,"⦷":t.MO.BIN4,"⦸":t.MO.BIN4,"⦹":t.MO.BIN4,"⦺":t.MO.BIN4,"⦻":t.MO.BIN4,"⦼":t.MO.BIN4,"⦽":t.MO.BIN4,"⦾":t.MO.BIN4,"⦿":t.MO.BIN4,"⧀":t.MO.REL,"⧁":t.MO.REL,"⧂":t.MO.BIN3,"⧃":t.MO.BIN3,"⧄":t.MO.BIN4,"⧅":t.MO.BIN4,"⧆":t.MO.BIN4,"⧇":t.MO.BIN4,"⧈":t.MO.BIN4,"⧉":t.MO.BIN3,"⧊":t.MO.BIN3,"⧋":t.MO.BIN3,"⧌":t.MO.BIN3,"⧍":t.MO.BIN3,"⧎":t.MO.REL,"⧏":t.MO.REL,"⧏̸":t.MO.REL,"⧐":t.MO.REL,"⧐̸":t.MO.REL,"⧑":t.MO.REL,"⧒":t.MO.REL,"⧓":t.MO.REL,"⧔":t.MO.REL,"⧕":t.MO.REL,"⧖":t.MO.BIN4,"⧗":t.MO.BIN4,"⧘":t.MO.BIN3,"⧙":t.MO.BIN3,"⧛":t.MO.BIN3,"⧜":t.MO.BIN3,"⧝":t.MO.BIN3,"⧞":t.MO.REL,"⧟":t.MO.BIN3,"⧠":t.MO.BIN3,"⧡":t.MO.REL,"⧢":t.MO.BIN4,"⧣":t.MO.REL,"⧤":t.MO.REL,"⧥":t.MO.REL,"⧦":t.MO.REL,"⧧":t.MO.BIN3,"⧨":t.MO.BIN3,"⧩":t.MO.BIN3,"⧪":t.MO.BIN3,"⧫":t.MO.BIN3,"⧬":t.MO.BIN3,"⧭":t.MO.BIN3,"⧮":t.MO.BIN3,"⧯":t.MO.BIN3,"⧰":t.MO.BIN3,"⧱":t.MO.BIN3,"⧲":t.MO.BIN3,"⧳":t.MO.BIN3,"⧴":t.MO.REL,"⧵":t.MO.BIN4,"⧶":t.MO.BIN4,"⧷":t.MO.BIN4,"⧸":t.MO.BIN3,"⧹":t.MO.BIN3,"⧺":t.MO.BIN3,"⧻":t.MO.BIN3,"⧾":t.MO.BIN4,"⧿":t.MO.BIN4,"⨝":t.MO.BIN3,"⨞":t.MO.BIN3,"⨟":t.MO.BIN3,"⨠":t.MO.BIN3,"⨡":t.MO.BIN3,"⨢":t.MO.BIN4,"⨣":t.MO.BIN4,"⨤":t.MO.BIN4,"⨥":t.MO.BIN4,"⨦":t.MO.BIN4,"⨧":t.MO.BIN4,"⨨":t.MO.BIN4,"⨩":t.MO.BIN4,"⨪":t.MO.BIN4,"⨫":t.MO.BIN4,"⨬":t.MO.BIN4,"⨭":t.MO.BIN4,"⨮":t.MO.BIN4,"⨯":t.MO.BIN4,"⨰":t.MO.BIN4,"⨱":t.MO.BIN4,"⨲":t.MO.BIN4,"⨳":t.MO.BIN4,"⨴":t.MO.BIN4,"⨵":t.MO.BIN4,"⨶":t.MO.BIN4,"⨷":t.MO.BIN4,"⨸":t.MO.BIN4,"⨹":t.MO.BIN4,"⨺":t.MO.BIN4,"⨻":t.MO.BIN4,"⨼":t.MO.BIN4,"⨽":t.MO.BIN4,"⨾":t.MO.BIN4,"⨿":t.MO.BIN4,"⩀":t.MO.BIN4,"⩁":t.MO.BIN4,"⩂":t.MO.BIN4,"⩃":t.MO.BIN4,"⩄":t.MO.BIN4,"⩅":t.MO.BIN4,"⩆":t.MO.BIN4,"⩇":t.MO.BIN4,"⩈":t.MO.BIN4,"⩉":t.MO.BIN4,"⩊":t.MO.BIN4,"⩋":t.MO.BIN4,"⩌":t.MO.BIN4,"⩍":t.MO.BIN4,"⩎":t.MO.BIN4,"⩏":t.MO.BIN4,"⩐":t.MO.BIN4,"⩑":t.MO.BIN4,"⩒":t.MO.BIN4,"⩓":t.MO.BIN4,"⩔":t.MO.BIN4,"⩕":t.MO.BIN4,"⩖":t.MO.BIN4,"⩗":t.MO.BIN4,"⩘":t.MO.BIN4,"⩙":t.MO.REL,"⩚":t.MO.BIN4,"⩛":t.MO.BIN4,"⩜":t.MO.BIN4,"⩝":t.MO.BIN4,"⩞":t.MO.BIN4,"⩟":t.MO.BIN4,"⩠":t.MO.BIN4,"⩡":t.MO.BIN4,"⩢":t.MO.BIN4,"⩣":t.MO.BIN4,"⩤":t.MO.BIN4,"⩥":t.MO.BIN4,"⩦":t.MO.REL,"⩧":t.MO.REL,"⩨":t.MO.REL,"⩩":t.MO.REL,"⩪":t.MO.REL,"⩫":t.MO.REL,"⩬":t.MO.REL,"⩭":t.MO.REL,"⩮":t.MO.REL,"⩯":t.MO.REL,"⩰":t.MO.REL,"⩱":t.MO.BIN4,"⩲":t.MO.BIN4,"⩳":t.MO.REL,"⩴":t.MO.REL,"⩵":t.MO.REL,"⩶":t.MO.REL,"⩷":t.MO.REL,"⩸":t.MO.REL,"⩹":t.MO.REL,"⩺":t.MO.REL,"⩻":t.MO.REL,"⩼":t.MO.REL,"⩽":t.MO.REL,"⩽̸":t.MO.REL,"⩾":t.MO.REL,"⩾̸":t.MO.REL,"⩿":t.MO.REL,"⪀":t.MO.REL,"⪁":t.MO.REL,"⪂":t.MO.REL,"⪃":t.MO.REL,"⪄":t.MO.REL,"⪅":t.MO.REL,"⪆":t.MO.REL,"⪇":t.MO.REL,"⪈":t.MO.REL,"⪉":t.MO.REL,"⪊":t.MO.REL,"⪋":t.MO.REL,"⪌":t.MO.REL,"⪍":t.MO.REL,"⪎":t.MO.REL,"⪏":t.MO.REL,"⪐":t.MO.REL,"⪑":t.MO.REL,"⪒":t.MO.REL,"⪓":t.MO.REL,"⪔":t.MO.REL,"⪕":t.MO.REL,"⪖":t.MO.REL,"⪗":t.MO.REL,"⪘":t.MO.REL,"⪙":t.MO.REL,"⪚":t.MO.REL,"⪛":t.MO.REL,"⪜":t.MO.REL,"⪝":t.MO.REL,"⪞":t.MO.REL,"⪟":t.MO.REL,"⪠":t.MO.REL,"⪡":t.MO.REL,"⪡̸":t.MO.REL,"⪢":t.MO.REL,"⪢̸":t.MO.REL,"⪣":t.MO.REL,"⪤":t.MO.REL,"⪥":t.MO.REL,"⪦":t.MO.REL,"⪧":t.MO.REL,"⪨":t.MO.REL,"⪩":t.MO.REL,"⪪":t.MO.REL,"⪫":t.MO.REL,"⪬":t.MO.REL,"⪭":t.MO.REL,"⪮":t.MO.REL,"⪯":t.MO.REL,"⪯̸":t.MO.REL,"⪰":t.MO.REL,"⪰̸":t.MO.REL,"⪱":t.MO.REL,"⪲":t.MO.REL,"⪳":t.MO.REL,"⪴":t.MO.REL,"⪵":t.MO.REL,"⪶":t.MO.REL,"⪷":t.MO.REL,"⪸":t.MO.REL,"⪹":t.MO.REL,"⪺":t.MO.REL,"⪻":t.MO.REL,"⪼":t.MO.REL,"⪽":t.MO.REL,"⪾":t.MO.REL,"⪿":t.MO.REL,"⫀":t.MO.REL,"⫁":t.MO.REL,"⫂":t.MO.REL,"⫃":t.MO.REL,"⫄":t.MO.REL,"⫅":t.MO.REL,"⫆":t.MO.REL,"⫇":t.MO.REL,"⫈":t.MO.REL,"⫉":t.MO.REL,"⫊":t.MO.REL,"⫋":t.MO.REL,"⫌":t.MO.REL,"⫍":t.MO.REL,"⫎":t.MO.REL,"⫏":t.MO.REL,"⫐":t.MO.REL,"⫑":t.MO.REL,"⫒":t.MO.REL,"⫓":t.MO.REL,"⫔":t.MO.REL,"⫕":t.MO.REL,"⫖":t.MO.REL,"⫗":t.MO.REL,"⫘":t.MO.REL,"⫙":t.MO.REL,"⫚":t.MO.REL,"⫛":t.MO.REL,"⫝":t.MO.REL,"⫝̸":t.MO.REL,"⫞":t.MO.REL,"⫟":t.MO.REL,"⫠":t.MO.REL,"⫡":t.MO.REL,"⫢":t.MO.REL,"⫣":t.MO.REL,"⫤":t.MO.REL,"⫥":t.MO.REL,"⫦":t.MO.REL,"⫧":t.MO.REL,"⫨":t.MO.REL,"⫩":t.MO.REL,"⫪":t.MO.REL,"⫫":t.MO.REL,"⫬":t.MO.REL,"⫭":t.MO.REL,"⫮":t.MO.REL,"⫯":t.MO.REL,"⫰":t.MO.REL,"⫱":t.MO.REL,"⫲":t.MO.REL,"⫳":t.MO.REL,"⫴":t.MO.BIN4,"⫵":t.MO.BIN4,"⫶":t.MO.BIN4,"⫷":t.MO.REL,"⫸":t.MO.REL,"⫹":t.MO.REL,"⫺":t.MO.REL,"⫻":t.MO.BIN4,"⫽":t.MO.BIN4,"⫾":t.MO.BIN3,"⭅":t.MO.RELSTRETCH,"⭆":t.MO.RELSTRETCH,"〈":t.MO.OPEN,"〉":t.MO.CLOSE,"︷":t.MO.WIDEACCENT,"︸":t.MO.WIDEACCENT}},t.OPTABLE.infix["^"]=t.MO.WIDEREL,t.OPTABLE.infix._=t.MO.WIDEREL,t.OPTABLE.infix["⫝̸"]=t.MO.REL})(Gy);var sdt=P&&P.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),xh=P&&P.__assign||function(){return xh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xh.apply(this,arguments)},FO=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},ldt=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(i6,"__esModule",{value:!0}),i6.MmlMo=void 0;var xn=fr,Zy=Gy,jO=s1,cdt=function(t){sdt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._texClass=null,r.lspace=5/18,r.rspace=5/18,r}return Object.defineProperty(e.prototype,"texClass",{get:function(){if(this._texClass===null){var r=this.getText(),n=FO(this.handleExplicitForm(this.getForms()),3),i=n[0],o=n[1],a=n[2],s=this.constructor.OPTABLE,d=s[i][r]||s[o][r]||s[a][r];return d?d[2]:xn.TEXCLASS.REL}return this._texClass},set:function(r){this._texClass=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"kind",{get:function(){return"mo"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmbellished",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNewLine",{get:function(){return this.attributes.get("linebreak")==="newline"},enumerable:!1,configurable:!0}),e.prototype.coreParent=function(){for(var r=this,n=this,i=this.factory.getNodeClass("math");n&&n.isEmbellished&&n.coreMO()===this&&!(n instanceof i);)r=n,n=n.parent;return r},e.prototype.coreText=function(r){if(!r)return"";if(r.isEmbellished)return r.coreMO().getText();for(;((r.isKind("mrow")||r.isKind("TeXAtom")&&r.texClass!==xn.TEXCLASS.VCENTER||r.isKind("mstyle")||r.isKind("mphantom"))&&r.childNodes.length===1||r.isKind("munderover"))&&r.childNodes[0];)r=r.childNodes[0];return r.isToken?r.getText():""},e.prototype.hasSpacingAttributes=function(){return this.attributes.isSet("lspace")||this.attributes.isSet("rspace")},Object.defineProperty(e.prototype,"isAccent",{get:function(){var r=!1,n=this.coreParent().parent;if(n){var i=n.isKind("mover")?n.childNodes[n.over].coreMO()?"accent":"":n.isKind("munder")?n.childNodes[n.under].coreMO()?"accentunder":"":n.isKind("munderover")?this===n.childNodes[n.over].coreMO()?"accent":this===n.childNodes[n.under].coreMO()?"accentunder":"":"";if(i){var o=n.attributes.getExplicit(i);r=o!==void 0?r:this.attributes.get("accent")}}return r},enumerable:!1,configurable:!0}),e.prototype.setTeXclass=function(r){var n=this.attributes.getList("form","fence"),i=n.form,o=n.fence;return this.getProperty("texClass")===void 0&&(this.attributes.isSet("lspace")||this.attributes.isSet("rspace"))?null:(o&&this.texClass===xn.TEXCLASS.REL&&(i==="prefix"&&(this.texClass=xn.TEXCLASS.OPEN),i==="postfix"&&(this.texClass=xn.TEXCLASS.CLOSE)),this.adjustTeXclass(r))},e.prototype.adjustTeXclass=function(r){var n=this.texClass,i=this.prevClass;if(n===xn.TEXCLASS.NONE)return r;if(r?(r.getProperty("autoOP")&&(n===xn.TEXCLASS.BIN||n===xn.TEXCLASS.REL)&&(i=r.texClass=xn.TEXCLASS.ORD),i=this.prevClass=r.texClass||xn.TEXCLASS.ORD,this.prevLevel=this.attributes.getInherited("scriptlevel")):i=this.prevClass=xn.TEXCLASS.NONE,n===xn.TEXCLASS.BIN&&(i===xn.TEXCLASS.NONE||i===xn.TEXCLASS.BIN||i===xn.TEXCLASS.OP||i===xn.TEXCLASS.REL||i===xn.TEXCLASS.OPEN||i===xn.TEXCLASS.PUNCT))this.texClass=xn.TEXCLASS.ORD;else if(i===xn.TEXCLASS.BIN&&(n===xn.TEXCLASS.REL||n===xn.TEXCLASS.CLOSE||n===xn.TEXCLASS.PUNCT))r.texClass=this.prevClass=xn.TEXCLASS.ORD;else if(n===xn.TEXCLASS.BIN){for(var o=this,a=this.parent;a&&a.parent&&a.isEmbellished&&(a.childNodes.length===1||!a.isKind("mrow")&&a.core()===o);)o=a,a=a.parent;a.childNodes[a.childNodes.length-1]===o&&(this.texClass=xn.TEXCLASS.ORD)}return this},e.prototype.setInheritedAttributes=function(r,n,i,o){r===void 0&&(r={}),n===void 0&&(n=!1),i===void 0&&(i=0),o===void 0&&(o=!1),t.prototype.setInheritedAttributes.call(this,r,n,i,o);var a=this.getText();this.checkOperatorTable(a),this.checkPseudoScripts(a),this.checkPrimes(a),this.checkMathAccent(a)},e.prototype.checkOperatorTable=function(r){var n,i,o=FO(this.handleExplicitForm(this.getForms()),3),a=o[0],s=o[1],d=o[2];this.attributes.setInherited("form",a);var p=this.constructor.OPTABLE,f=p[a][r]||p[s][r]||p[d][r];if(f){this.getProperty("texClass")===void 0&&(this.texClass=f[2]);try{for(var Q=ldt(Object.keys(f[3]||{})),m=Q.next();!m.done;m=Q.next()){var _=m.value;this.attributes.setInherited(_,f[3][_])}}catch(M){n={error:M}}finally{try{m&&!m.done&&(i=Q.return)&&i.call(Q)}finally{if(n)throw n.error}}this.lspace=(f[0]+1)/18,this.rspace=(f[1]+1)/18}else{var v=(0,Zy.getRange)(r);if(v){this.getProperty("texClass")===void 0&&(this.texClass=v[2]);var b=this.constructor.MMLSPACING[v[2]];this.lspace=(b[0]+1)/18,this.rspace=(b[1]+1)/18}}},e.prototype.getForms=function(){for(var r=this,n=this.parent,i=this.Parent;i&&i.isEmbellished;)r=n,n=i.parent,i=i.Parent;if(n&&n.isKind("mrow")&&n.nonSpaceLength()!==1){if(n.firstNonSpace()===r)return["prefix","infix","postfix"];if(n.lastNonSpace()===r)return["postfix","infix","prefix"]}return["infix","prefix","postfix"]},e.prototype.handleExplicitForm=function(r){if(this.attributes.isSet("form")){var n=this.attributes.get("form");r=[n].concat(r.filter(function(i){return i!==n}))}return r},e.prototype.checkPseudoScripts=function(r){var n=this.constructor.pseudoScripts;if(r.match(n)){var i=this.coreParent().Parent,o=!i||!(i.isKind("msubsup")&&!i.isKind("msub"));this.setProperty("pseudoscript",o),o&&(this.attributes.setInherited("lspace",0),this.attributes.setInherited("rspace",0))}},e.prototype.checkPrimes=function(r){var n=this.constructor.primes;if(r.match(n)){var i=this.constructor.remapPrimes,o=(0,jO.unicodeString)((0,jO.unicodeChars)(r).map(function(a){return i[a]}));this.setProperty("primes",o)}},e.prototype.checkMathAccent=function(r){var n=this.Parent;if(!(this.getProperty("mathaccent")!==void 0||!n||!n.isKind("munderover"))){var i=n.childNodes[0];if(!(i.isEmbellished&&i.coreMO()===this)){var o=this.constructor.mathaccents;r.match(o)&&this.setProperty("mathaccent",!0)}}},e.defaults=xh(xh({},xn.AbstractMmlTokenNode.defaults),{form:"infix",fence:!1,separator:!1,lspace:"thickmathspace",rspace:"thickmathspace",stretchy:!1,symmetric:!1,maxsize:"infinity",minsize:"0em",largeop:!1,movablelimits:!1,accent:!1,linebreak:"auto",lineleading:"1ex",linebreakstyle:"before",indentalign:"auto",indentshift:"0",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"}),e.MMLSPACING=Zy.MMLSPACING,e.OPTABLE=Zy.OPTABLE,e.pseudoScripts=new RegExp(["^[\"'*`","ª","°","²-´","¹","º","‘-‟","′-‷⁗","⁰ⁱ","⁴-ⁿ","₀-₎","]+$"].join("")),e.primes=new RegExp(["^[\"'`","‘-‟","]+$"].join("")),e.remapPrimes={34:8243,39:8242,96:8245,8216:8245,8217:8242,8218:8242,8219:8245,8220:8246,8221:8243,8222:8243,8223:8246},e.mathaccents=new RegExp(["^[","´́ˊ","`̀ˋ","¨̈","~̃˜","¯̄ˉ","˘̆","ˇ̌","^̂ˆ","→⃗","˙̇","˚̊","⃛","⃜","]$"].join("")),e}(xn.AbstractMmlTokenNode);i6.MmlMo=cdt;var $y=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},udt=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},hdt=P&&P.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(Pn,"__esModule",{value:!0});var zO=fr,ddt=i6,qy;(function(t){var e=new Map([["autoOP",!0],["fnOP",!0],["movesupsub",!0],["subsupOK",!0],["texprimestyle",!0],["useHeight",!0],["variantForm",!0],["withDelims",!0],["mathaccent",!0],["open",!0],["close",!0]]);function r(z){return String.fromCodePoint(parseInt(z,16))}t.createEntity=r;function n(z){return z.childNodes}t.getChildren=n;function i(z){return z.getText()}t.getText=i;function o(z,J){var tt,ot;try{for(var et=$y(J),Tt=et.next();!Tt.done;Tt=et.next()){var At=Tt.value;z.appendChild(At)}}catch(Ut){tt={error:Ut}}finally{try{Tt&&!Tt.done&&(ot=et.return)&&ot.call(et)}finally{if(tt)throw tt.error}}}t.appendChildren=o;function a(z,J,tt){z.attributes.set(J,tt)}t.setAttribute=a;function s(z,J,tt){z.setProperty(J,tt)}t.setProperty=s;function d(z,J){var tt,ot;try{for(var et=$y(Object.keys(J)),Tt=et.next();!Tt.done;Tt=et.next()){var At=Tt.value,Ut=J[At];At==="texClass"?(z.texClass=Ut,z.setProperty(At,Ut)):At==="movablelimits"?(z.setProperty("movablelimits",Ut),(z.isKind("mo")||z.isKind("mstyle"))&&z.attributes.set("movablelimits",Ut)):At==="inferred"||(e.has(At)?z.setProperty(At,Ut):z.attributes.set(At,Ut))}}catch(ee){tt={error:ee}}finally{try{Tt&&!Tt.done&&(ot=et.return)&&ot.call(et)}finally{if(tt)throw tt.error}}}t.setProperties=d;function p(z,J){return z.getProperty(J)}t.getProperty=p;function f(z,J){return z.attributes.get(J)}t.getAttribute=f;function Q(z){for(var J=[],tt=1;tt<arguments.length;tt++)J[tt-1]=arguments[tt];z.removeProperty.apply(z,hdt([],udt(J),!1))}t.removeProperties=Q;function m(z,J){return z.childNodes[J]}t.getChildAt=m;function _(z,J,tt){var ot=z.childNodes;ot[J]=tt,tt&&(tt.parent=z)}t.setChild=_;function v(z,J){for(var tt=z.childNodes,ot=0;ot<tt.length;ot++)_(J,ot,tt[ot])}t.copyChildren=v;function b(z,J){J.attributes=z.attributes,d(J,z.getAllProperties())}t.copyAttributes=b;function M(z,J){return z.isKind(J)}t.isType=M;function E(z){return z.isEmbellished}t.isEmbellished=E;function V(z){return z.texClass}t.getTexClass=V;function O(z){return z.coreMO()}t.getCoreMO=O;function R(z){return z instanceof zO.AbstractMmlNode||z instanceof zO.AbstractMmlEmptyNode}t.isNode=R;function j(z){return z.isInferred}t.isInferred=j;function G(z){var J,tt;if(!M(z,"mo"))return null;var ot=z,et=ot.getForms();try{for(var Tt=$y(et),At=Tt.next();!At.done;At=Tt.next()){var Ut=At.value,ee=ddt.MmlMo.OPTABLE[Ut][ot.getText()];if(ee)return ee}}catch(ue){J={error:ue}}finally{try{At&&!At.done&&(tt=Tt.return)&&tt.call(Tt)}finally{if(J)throw J.error}}return null}t.getForm=G})(qy||(qy={})),Pn.default=qy;var o6=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pdt=P&&P.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zy,"__esModule",{value:!0});var UO=fr,vi=pdt(Pn),Wy;(function(t){t.cleanStretchy=function(o){var a,s,d=o.data;try{for(var p=o6(d.getList("fixStretchy")),f=p.next();!f.done;f=p.next()){var Q=f.value;if(vi.default.getProperty(Q,"fixStretchy")){var m=vi.default.getForm(Q);m&&m[3]&&m[3].stretchy&&vi.default.setAttribute(Q,"stretchy",!1);var _=Q.parent;if(!vi.default.getTexClass(Q)&&(!m||!m[2])){var v=d.nodeFactory.create("node","TeXAtom",[Q]);_.replaceChild(v,Q),v.inheritAttributesFrom(Q)}vi.default.removeProperties(Q,"fixStretchy")}}}catch(b){a={error:b}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}},t.cleanAttributes=function(o){var a=o.data.root;a.walkTree(function(s,d){var p,f,Q=s.attributes;if(Q){var m=new Set((Q.get("mjx-keep-attrs")||"").split(/ /));delete Q.getAllAttributes()["mjx-keep-attrs"];try{for(var _=o6(Q.getExplicitNames()),v=_.next();!v.done;v=_.next()){var b=v.value;!m.has(b)&&Q.attributes[b]===s.attributes.getInherited(b)&&delete Q.attributes[b]}}catch(M){p={error:M}}finally{try{v&&!v.done&&(f=_.return)&&f.call(_)}finally{if(p)throw p.error}}}},{})},t.combineRelations=function(o){var a,s,d,p,f=[];try{for(var Q=o6(o.data.getList("mo")),m=Q.next();!m.done;m=Q.next()){var _=m.value;if(!(_.getProperty("relationsCombined")||!_.parent||_.parent&&!vi.default.isType(_.parent,"mrow")||vi.default.getTexClass(_)!==UO.TEXCLASS.REL)){for(var v=_.parent,b=void 0,M=v.childNodes,E=M.indexOf(_)+1,V=vi.default.getProperty(_,"variantForm");E<M.length&&(b=M[E])&&vi.default.isType(b,"mo")&&vi.default.getTexClass(b)===UO.TEXCLASS.REL;)if(V===vi.default.getProperty(b,"variantForm")&&r(_,b)){vi.default.appendChildren(_,vi.default.getChildren(b)),e(["stretchy","rspace"],_,b);try{for(var O=(d=void 0,o6(b.getPropertyNames())),R=O.next();!R.done;R=O.next()){var j=R.value;_.setProperty(j,b.getProperty(j))}}catch(G){d={error:G}}finally{try{R&&!R.done&&(p=O.return)&&p.call(O)}finally{if(d)throw d.error}}M.splice(E,1),f.push(b),b.parent=null,b.setProperty("relationsCombined",!0)}else{_.attributes.getExplicit("rspace")==null&&vi.default.setAttribute(_,"rspace","0pt"),b.attributes.getExplicit("lspace")==null&&vi.default.setAttribute(b,"lspace","0pt");break}_.attributes.setInherited("form",_.getForms()[0])}}}catch(G){a={error:G}}finally{try{m&&!m.done&&(s=Q.return)&&s.call(Q)}finally{if(a)throw a.error}}o.data.removeFromList("mo",f)};var e=function(o,a,s){var d=a.attributes,p=s.attributes;o.forEach(function(f){var Q=p.getExplicit(f);Q!=null&&d.set(f,Q)})},r=function(o,a){var s,d,p=function(E,V){var O=E.getExplicitNames();return O.filter(function(R){return R!==V&&(R!=="stretchy"||E.getExplicit("stretchy"))})},f=o.attributes,Q=a.attributes,m=p(f,"lspace"),_=p(Q,"rspace");if(m.length!==_.length)return!1;try{for(var v=o6(m),b=v.next();!b.done;b=v.next()){var M=b.value;if(f.getExplicit(M)!==Q.getExplicit(M))return!1}}catch(E){s={error:E}}finally{try{b&&!b.done&&(d=v.return)&&d.call(v)}finally{if(s)throw s.error}}return!0},n=function(o,a,s){var d,p,f=[];try{for(var Q=o6(o.getList("m"+a+s)),m=Q.next();!m.done;m=Q.next()){var _=m.value,v=_.childNodes;if(!(v[_[a]]&&v[_[s]])){var b=_.parent,M=v[_[a]]?o.nodeFactory.create("node","m"+a,[v[_.base],v[_[a]]]):o.nodeFactory.create("node","m"+s,[v[_.base],v[_[s]]]);vi.default.copyAttributes(_,M),b?b.replaceChild(M,_):o.root=M,f.push(_)}}}catch(E){d={error:E}}finally{try{m&&!m.done&&(p=Q.return)&&p.call(Q)}finally{if(d)throw d.error}}o.removeFromList("m"+a+s,f)};t.cleanSubSup=function(o){var a=o.data;a.error||(n(a,"sub","sup"),n(a,"under","over"))};var i=function(o,a,s){var d,p,f=[];try{for(var Q=o6(o.getList(a)),m=Q.next();!m.done;m=Q.next()){var _=m.value;if(!_.attributes.get("displaystyle")){var v=_.childNodes[_.base],b=v.coreMO();if(v.getProperty("movablelimits")&&!b.attributes.getExplicit("movablelimits")){var M=o.nodeFactory.create("node",s,_.childNodes);vi.default.copyAttributes(_,M),_.parent?_.parent.replaceChild(M,_):o.root=M,f.push(_)}}}}catch(E){d={error:E}}finally{try{m&&!m.done&&(p=Q.return)&&p.call(Q)}finally{if(d)throw d.error}}o.removeFromList(a,f)};t.moveLimits=function(o){var a=o.data;i(a,"munderover","msubsup"),i(a,"munder","msub"),i(a,"mover","msup")},t.setInherited=function(o){o.data.root.setInheritedAttributes({},o.math.display,0,!1)}})(Wy||(Wy={})),zy.default=Wy;var wh={},Eh={},hn={};Object.defineProperty(hn,"__esModule",{value:!0});var Tdt=function(){function t(e,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.id=e,this.message=t.processString(r,n)}return t.processString=function(e,r){for(var n=e.split(t.pattern),i=1,o=n.length;i<o;i+=2){var a=n[i].charAt(0);if(a>="0"&&a<="9")n[i]=r[parseInt(n[i],10)-1],typeof n[i]=="number"&&(n[i]=n[i].toString());else if(a==="{")if(a=n[i].substr(1),a>="0"&&a<="9")n[i]=r[parseInt(n[i].substr(1,n[i].length-2),10)-1],typeof n[i]=="number"&&(n[i]=n[i].toString());else{var s=n[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);s&&(n[i]="%"+n[i])}n[i]==null&&(n[i]="???")}return n.join("")},t.pattern=/%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g,t}();hn.default=Tdt;var R7={},Mh={};Object.defineProperty(Mh,"__esModule",{value:!0}),Mh.asyncLoad=void 0;var GO=gh;function fdt(t){return GO.mathjax.asyncLoad?new Promise(function(e,r){var n=GO.mathjax.asyncLoad(t);n instanceof Promise?n.then(function(i){return e(i)}).catch(function(i){return r(i)}):e(n)}):Promise.reject("Can't load '".concat(t,"': No asyncLoad method specified"))}Mh.asyncLoad=fdt,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.numeric=t.translate=t.remove=t.add=t.entities=t.options=void 0;var e=N3,r=Mh;t.options={loadMissingEntities:!0},t.entities={ApplyFunction:"⁡",Backslash:"∖",Because:"∵",Breve:"˘",Cap:"⋒",CenterDot:"·",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",Congruent:"≡",ContourIntegral:"∮",Coproduct:"∐",Cross:"⨯",Cup:"⋓",CupCap:"≍",Dagger:"‡",Del:"∇",Delta:"Δ",Diamond:"⋄",DifferentialD:"ⅆ",DotEqual:"≐",DoubleDot:"¨",DoubleRightTee:"⊨",DoubleVerticalBar:"∥",DownArrow:"↓",DownLeftVector:"↽",DownRightVector:"⇁",DownTee:"⊤",Downarrow:"⇓",Element:"∈",EqualTilde:"≂",Equilibrium:"⇌",Exists:"∃",ExponentialE:"ⅇ",FilledVerySmallSquare:"▪",ForAll:"∀",Gamma:"Γ",Gg:"⋙",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Hacek:"ˇ",Hat:"^",HumpDownHump:"≎",HumpEqual:"≏",Im:"ℑ",ImaginaryI:"ⅈ",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Lambda:"Λ",Larr:"↞",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDownVector:"⇃",LeftFloor:"⌊",LeftRightArrow:"↔",LeftTee:"⊣",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpVector:"↿",LeftVector:"↼",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessSlantEqual:"⩽",LessTilde:"≲",Ll:"⋘",Lleftarrow:"⇚",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lsh:"↰",MinusPlus:"∓",NestedGreaterGreater:"≫",NestedLessLess:"≪",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotPrecedes:"⊀",NotPrecedesSlantEqual:"⋠",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsSlantEqual:"⋡",NotSupersetEqual:"⊉",NotTilde:"≁",NotVerticalBar:"∤",Omega:"Ω",OverBar:"‾",OverBrace:"⏞",PartialD:"∂",Phi:"Φ",Pi:"Π",PlusMinus:"±",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Product:"∏",Proportional:"∝",Psi:"Ψ",Rarr:"↠",Re:"ℜ",ReverseEquilibrium:"⇋",RightAngleBracket:"⟩",RightArrow:"→",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDownVector:"⇂",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpVector:"↾",RightVector:"⇀",Rightarrow:"⇒",Rrightarrow:"⇛",Rsh:"↱",Sigma:"Σ",SmallCircle:"∘",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Star:"⋆",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",Therefore:"∴",Theta:"Θ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",UnderBar:"_",UnderBrace:"⏟",Union:"⋃",UnionPlus:"⊎",UpArrow:"↑",UpDownArrow:"↕",UpTee:"⊥",Uparrow:"⇑",Updownarrow:"⇕",Upsilon:"Υ",Vdash:"⊩",Vee:"⋁",VerticalBar:"∣",VerticalTilde:"≀",Vvdash:"⊪",Wedge:"⋀",Xi:"Ξ",amp:"&",acute:"´",aleph:"ℵ",alpha:"α",amalg:"⨿",and:"∧",ang:"∠",angmsd:"∡",angsph:"∢",ape:"≊",backprime:"‵",backsim:"∽",backsimeq:"⋍",beta:"β",beth:"ℶ",between:"≬",bigcirc:"◯",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",blacklozenge:"⧫",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",bowtie:"⋈",boxdl:"┐",boxdr:"┌",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxur:"└",bsol:"\\",bull:"•",cap:"∩",check:"✓",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",clubs:"♣",colon:":",comp:"∁",ctdot:"⋯",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cup:"∪",curarr:"↷",curlyvee:"⋎",curlywedge:"⋏",dagger:"†",daleth:"ℸ",ddarr:"⇊",deg:"°",delta:"δ",digamma:"ϝ",div:"÷",divideontimes:"⋇",dot:"˙",doteqdot:"≑",dotplus:"∔",dotsquare:"⊡",dtdot:"⋱",ecir:"≖",efDot:"≒",egs:"⪖",ell:"ℓ",els:"⪕",empty:"∅",epsi:"ε",epsiv:"ϵ",erDot:"≓",eta:"η",eth:"ð",flat:"♭",fork:"⋔",frown:"⌢",gEl:"⪌",gamma:"γ",gap:"⪆",gimel:"ℷ",gnE:"≩",gnap:"⪊",gne:"⪈",gnsim:"⋧",gt:">",gtdot:"⋗",harrw:"↭",hbar:"ℏ",hellip:"…",hookleftarrow:"↩",hookrightarrow:"↪",imath:"ı",infin:"∞",intcal:"⊺",iota:"ι",jmath:"ȷ",kappa:"κ",kappav:"ϰ",lEg:"⪋",lambda:"λ",lap:"⪅",larrlp:"↫",larrtl:"↢",lbrace:"{",lbrack:"[",le:"≤",leftleftarrows:"⇇",leftthreetimes:"⋋",lessdot:"⋖",lmoust:"⎰",lnE:"≨",lnap:"⪉",lne:"⪇",lnsim:"⋦",longmapsto:"⟼",looparrowright:"↬",lowast:"∗",loz:"◊",lt:"<",ltimes:"⋉",ltri:"◃",macr:"¯",malt:"✠",mho:"℧",mu:"μ",multimap:"⊸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",natur:"♮",nearr:"↗",nharr:"↮",nlarr:"↚",not:"¬",nrarr:"↛",nu:"ν",nvDash:"⊭",nvdash:"⊬",nwarr:"↖",omega:"ω",omicron:"ο",or:"∨",osol:"⊘",period:".",phi:"φ",phiv:"ϕ",pi:"π",piv:"ϖ",prap:"⪷",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",prime:"′",psi:"ψ",quot:'"',rarrtl:"↣",rbrace:"}",rbrack:"]",rho:"ρ",rhov:"ϱ",rightrightarrows:"⇉",rightthreetimes:"⋌",ring:"˚",rmoust:"⎱",rtimes:"⋊",rtri:"▹",scap:"⪸",scnE:"⪶",scnap:"⪺",scnsim:"⋩",sdot:"⋅",searr:"↘",sect:"§",sharp:"♯",sigma:"σ",sigmav:"ς",simne:"≆",smile:"⌣",spades:"♠",sub:"⊂",subE:"⫅",subnE:"⫋",subne:"⊊",supE:"⫆",supnE:"⫌",supne:"⊋",swarr:"↙",tau:"τ",theta:"θ",thetav:"ϑ",tilde:"˜",times:"×",triangle:"▵",triangleq:"≜",upsi:"υ",upuparrows:"⇈",veebar:"⊻",vellip:"⋮",weierp:"℘",xi:"ξ",yen:"¥",zeta:"ζ",zigrarr:"⇝",nbsp:" ",rsquo:"’",lsquo:"‘"};var n={};function i(p,f){Object.assign(t.entities,p),n[f]=!0}t.add=i;function o(p){delete t.entities[p]}t.remove=o;function a(p){return p.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/ig,s)}t.translate=a;function s(p,f){if(f.charAt(0)==="#")return d(f.slice(1));if(t.entities[f])return t.entities[f];if(t.options.loadMissingEntities){var Q=f.match(/^[a-zA-Z](fr|scr|opf)$/)?RegExp.$1:f.charAt(0).toLowerCase();n[Q]||(n[Q]=!0,(0,e.retryAfter)((0,r.asyncLoad)("./util/entities/"+Q+".js")))}return p}function d(p){var f=p.charAt(0)==="x"?parseInt(p.slice(1),16):parseInt(p);return String.fromCodePoint(f)}t.numeric=d}(R7);var ZO;function In(){if(ZO)return Eh;ZO=1;var t=P&&P.__read||function(p,f){var Q=typeof Symbol=="function"&&p[Symbol.iterator];if(!Q)return p;var m=Q.call(p),_,v=[],b;try{for(;(f===void 0||f-- >0)&&!(_=m.next()).done;)v.push(_.value)}catch(M){b={error:M}}finally{try{_&&!_.done&&(Q=m.return)&&Q.call(m)}finally{if(b)throw b.error}}return v},e=P&&P.__values||function(p){var f=typeof Symbol=="function"&&Symbol.iterator,Q=f&&p[f],m=0;if(Q)return Q.call(p);if(p&&typeof p.length=="number")return{next:function(){return p&&m>=p.length&&(p=void 0),{value:p&&p[m++],done:!p}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},r=P&&P.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Eh,"__esModule",{value:!0});var n=fr,i=r(Pn),o=r(Pi()),a=r(hn),s=R7,d;return function(p){var f=7.2,Q=72,m={em:function(Bt){return Bt},ex:function(Bt){return Bt*.43},pt:function(Bt){return Bt/10},pc:function(Bt){return Bt*1.2},px:function(Bt){return Bt*f/Q},in:function(Bt){return Bt*f},cm:function(Bt){return Bt*f/2.54},mm:function(Bt){return Bt*f/25.4},mu:function(Bt){return Bt/18}},_="([-+]?([.,]\\d+|\\d+([.,]\\d*)?))",v="(pt|em|ex|mu|px|mm|cm|in|pc)",b=RegExp("^\\s*"+_+"\\s*"+v+"\\s*$"),M=RegExp("^\\s*"+_+"\\s*"+v+" ?");function E(Bt,qt){qt===void 0&&(qt=!1);var he=Bt.match(qt?M:b);return he?V([he[1].replace(/,/,"."),he[4],he[0].length]):[null,null,0]}p.matchDimen=E;function V(Bt){var qt=t(Bt,3),he=qt[0],jt=qt[1],fe=qt[2];if(jt!=="mu")return[he,jt,fe];var Ne=R(m[jt](parseFloat(he||"1")));return[Ne.slice(0,-2),"em",fe]}function O(Bt){var qt=t(E(Bt),2),he=qt[0],jt=qt[1],fe=parseFloat(he||"1"),Ne=m[jt];return Ne?Ne(fe):0}p.dimen2em=O;function R(Bt){return Math.abs(Bt)<6e-4?"0em":Bt.toFixed(3).replace(/\.?0+$/,"")+"em"}p.Em=R;function j(){for(var Bt=[],qt=0;qt<arguments.length;qt++)Bt[qt]=arguments[qt];return Bt.map(function(he){return R(he)}).join(" ")}p.cols=j;function G(Bt,qt,he,jt,fe,Ne){fe===void 0&&(fe=""),Ne===void 0&&(Ne="");var Ae=Bt.nodeFactory,Ve=Ae.create("node","mrow",[],{open:qt,close:jt,texClass:n.TEXCLASS.INNER}),ke;if(fe)ke=new o.default("\\"+fe+"l"+qt,Bt.parser.stack.env,Bt).mml();else{var ze=Ae.create("text",qt);ke=Ae.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:n.TEXCLASS.OPEN},ze)}if(i.default.appendChildren(Ve,[ke,he]),fe)ke=new o.default("\\"+fe+"r"+jt,Bt.parser.stack.env,Bt).mml();else{var zt=Ae.create("text",jt);ke=Ae.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:n.TEXCLASS.CLOSE},zt)}return Ne&&ke.attributes.set("mathcolor",Ne),i.default.appendChildren(Ve,[ke]),Ve}p.fenced=G;function z(Bt,qt,he,jt){var fe=Bt.nodeFactory.create("node","mrow",[],{open:qt,close:jt,texClass:n.TEXCLASS.ORD});return qt&&i.default.appendChildren(fe,[J(Bt,qt,"l")]),i.default.isType(he,"mrow")?i.default.appendChildren(fe,i.default.getChildren(he)):i.default.appendChildren(fe,[he]),jt&&i.default.appendChildren(fe,[J(Bt,jt,"r")]),fe}p.fixedFence=z;function J(Bt,qt,he){(qt==="{"||qt==="}")&&(qt="\\"+qt);var jt="{\\bigg"+he+" "+qt+"}",fe="{\\big"+he+" "+qt+"}";return new o.default("\\mathchoice"+jt+fe+fe+fe,{},Bt).mml()}p.mathPalette=J;function tt(Bt,qt){for(var he=0,jt=qt.length;he<jt;he++){var fe=qt[he];if(fe&&!i.default.isType(fe,"mspace")&&(!i.default.isType(fe,"TeXAtom")||i.default.getChildren(fe)[0]&&i.default.getChildren(i.default.getChildren(fe)[0]).length)){if(i.default.isEmbellished(fe)||i.default.isType(fe,"TeXAtom")&&i.default.getTexClass(fe)===n.TEXCLASS.REL){var Ne=Bt.nodeFactory.create("node","mi");qt.unshift(Ne)}break}}}p.fixInitialMO=tt;function ot(Bt,qt,he,jt){if(Bt.configuration.options.internalMath)return Bt.configuration.options.internalMath(Bt,qt,he,jt);var fe=jt||Bt.stack.env.font,Ne=fe?{mathvariant:fe}:{},Ae=[],Ve=0,ke=0,ze,zt,Pr="",mn=0;if(qt.match(/\\?[${}\\]|\\\(|\\(eq)?ref\s*\{/)){for(;Ve<qt.length;)if(ze=qt.charAt(Ve++),ze==="$")Pr==="$"&&mn===0?(zt=Bt.create("node","TeXAtom",[new o.default(qt.slice(ke,Ve-1),{},Bt.configuration).mml()]),Ae.push(zt),Pr="",ke=Ve):Pr===""&&(ke<Ve-1&&Ae.push(et(Bt,qt.slice(ke,Ve-1),Ne)),Pr="$",ke=Ve);else if(ze==="{"&&Pr!=="")mn++;else if(ze==="}")if(Pr==="}"&&mn===0){var We=new o.default(qt.slice(ke,Ve),{},Bt.configuration).mml();zt=Bt.create("node","TeXAtom",[We],Ne),Ae.push(zt),Pr="",ke=Ve}else Pr!==""&&mn&&mn--;else if(ze==="\\")if(Pr===""&&qt.substr(Ve).match(/^(eq)?ref\s*\{/)){var vr=RegExp["$&"].length;ke<Ve-1&&Ae.push(et(Bt,qt.slice(ke,Ve-1),Ne)),Pr="}",ke=Ve-1,Ve+=vr}else ze=qt.charAt(Ve++),ze==="("&&Pr===""?(ke<Ve-2&&Ae.push(et(Bt,qt.slice(ke,Ve-2),Ne)),Pr=")",ke=Ve):ze===")"&&Pr===")"&&mn===0?(zt=Bt.create("node","TeXAtom",[new o.default(qt.slice(ke,Ve-2),{},Bt.configuration).mml()]),Ae.push(zt),Pr="",ke=Ve):ze.match(/[${}\\]/)&&Pr===""&&(Ve--,qt=qt.substr(0,Ve-1)+qt.substr(Ve));if(Pr!=="")throw new a.default("MathNotTerminated","Math not terminated in text box")}return ke<qt.length&&Ae.push(et(Bt,qt.slice(ke),Ne)),he!=null?Ae=[Bt.create("node","mstyle",Ae,{displaystyle:!1,scriptlevel:he})]:Ae.length>1&&(Ae=[Bt.create("node","mrow",Ae)]),Ae}p.internalMath=ot;function et(Bt,qt,he){qt=qt.replace(/^\s+/,s.entities.nbsp).replace(/\s+$/,s.entities.nbsp);var jt=Bt.create("text",qt);return Bt.create("node","mtext",[],he,jt)}p.internalText=et;function Tt(Bt,qt,he,jt,fe){if(p.checkMovableLimits(qt),i.default.isType(qt,"munderover")&&i.default.isEmbellished(qt)){i.default.setProperties(i.default.getCoreMO(qt),{lspace:0,rspace:0});var Ne=Bt.create("node","mo",[],{rspace:0});qt=Bt.create("node","mrow",[Ne,qt])}var Ae=Bt.create("node","munderover",[qt]);i.default.setChild(Ae,jt==="over"?Ae.over:Ae.under,he);var Ve=Ae;return fe&&(Ve=Bt.create("node","TeXAtom",[Ae],{texClass:n.TEXCLASS.OP,movesupsub:!0})),i.default.setProperty(Ve,"subsupOK",!0),Ve}p.underOver=Tt;function At(Bt){var qt=i.default.isType(Bt,"mo")?i.default.getForm(Bt):null;(i.default.getProperty(Bt,"movablelimits")||qt&&qt[3]&&qt[3].movablelimits)&&i.default.setProperties(Bt,{movablelimits:!1})}p.checkMovableLimits=At;function Ut(Bt){if(typeof Bt!="string")return Bt;var qt=Bt.trim();return qt.match(/\\$/)&&Bt.match(/ $/)&&(qt+=" "),qt}p.trimSpaces=Ut;function ee(Bt,qt){return qt=p.trimSpaces(qt||""),qt==="t"?Bt.arraydef.align="baseline 1":qt==="b"?Bt.arraydef.align="baseline -1":qt==="c"?Bt.arraydef.align="axis":qt&&(Bt.arraydef.align=qt),Bt}p.setArrayAlign=ee;function ue(Bt,qt,he){for(var jt="",fe="",Ne=0;Ne<he.length;){var Ae=he.charAt(Ne++);if(Ae==="\\")jt+=Ae+he.charAt(Ne++);else if(Ae==="#")if(Ae=he.charAt(Ne++),Ae==="#")jt+=Ae;else{if(!Ae.match(/[1-9]/)||parseInt(Ae,10)>qt.length)throw new a.default("IllegalMacroParam","Illegal macro parameter reference");fe=Ft(Bt,Ft(Bt,fe,jt),qt[parseInt(Ae,10)-1]),jt=""}else jt+=Ae}return Ft(Bt,fe,jt)}p.substituteArgs=ue;function Ft(Bt,qt,he){if(he.match(/^[a-z]/i)&&qt.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)&&(qt+=" "),qt.length+he.length>Bt.configuration.options.maxBuffer)throw new a.default("MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?");return qt+he}p.addArgs=Ft;function pe(Bt,qt){if(qt===void 0&&(qt=!0),!(++Bt.macroCount<=Bt.configuration.options.maxMacros))throw qt?new a.default("MaxMacroSub1","MathJax maximum macro substitution count exceeded; is here a recursive macro call?"):new a.default("MaxMacroSub2","MathJax maximum substitution count exceeded; is there a recursive latex environment?")}p.checkMaxMacros=pe;function lr(Bt){if(Bt.stack.global.eqnenv)throw new a.default("ErroneousNestingEq","Erroneous nesting of equation structures");Bt.stack.global.eqnenv=!0}p.checkEqnEnv=lr;function Xt(Bt,qt){var he=Bt.copy(),jt=qt.configuration;return he.walkTree(function(fe){var Ne,Ae;jt.addNode(fe.kind,fe);var Ve=(fe.getProperty("in-lists")||"").split(/,/);try{for(var ke=e(Ve),ze=ke.next();!ze.done;ze=ke.next()){var zt=ze.value;zt&&jt.addNode(zt,fe)}}catch(Pr){Ne={error:Pr}}finally{try{ze&&!ze.done&&(Ae=ke.return)&&Ae.call(ke)}finally{if(Ne)throw Ne.error}}}),he}p.copyNode=Xt;function le(Bt,qt,he){return he}p.MmlFilterAttribute=le;function ge(Bt){var qt=Bt.stack.env.font;return qt?{mathvariant:qt}:{}}p.getFontDef=ge;function Le(Bt,qt,he){var jt,fe;qt===void 0&&(qt=null),he===void 0&&(he=!1);var Ne=Fe(Bt);if(qt)try{for(var Ae=e(Object.keys(Ne)),Ve=Ae.next();!Ve.done;Ve=Ae.next()){var ke=Ve.value;if(!qt.hasOwnProperty(ke)){if(he)throw new a.default("InvalidOption","Invalid option: %1",ke);delete Ne[ke]}}}catch(ze){jt={error:ze}}finally{try{Ve&&!Ve.done&&(fe=Ae.return)&&fe.call(Ae)}finally{if(jt)throw jt.error}}return Ne}p.keyvalOptions=Le;function Fe(Bt){for(var qt,he,jt={},fe=Bt,Ne,Ae,Ve;fe;)qt=t(je(fe,["=",","]),3),Ae=qt[0],Ne=qt[1],fe=qt[2],Ne==="="?(he=t(je(fe,[","]),3),Ve=he[0],Ne=he[1],fe=he[2],Ve=Ve==="false"||Ve==="true"?JSON.parse(Ve):Ve,jt[Ae]=Ve):Ae&&(jt[Ae]=!0);return jt}function Ge(Bt,qt){for(;qt>0;)Bt=Bt.trim().slice(1,-1),qt--;return Bt.trim()}function je(Bt,qt){for(var he=Bt.length,jt=0,fe="",Ne=0,Ae=0,Ve=!0,ke=!1;Ne<he;){var ze=Bt[Ne++];switch(ze){case" ":break;case"{":Ve?Ae++:(ke=!1,Ae>jt&&(Ae=jt)),jt++;break;case"}":jt&&jt--,(Ve||ke)&&(Ae--,ke=!0),Ve=!1;break;default:if(!jt&&qt.indexOf(ze)!==-1)return[ke?"true":Ge(fe,Ae),ze,Bt.slice(Ne)];Ve=!1,ke=!1}fe+=ze}if(jt)throw new a.default("ExtraOpenMissingClose","Extra open brace or missing close brace");return[ke?"true":Ge(fe,Ae),"",Bt.slice(Ne)]}}(d||(d={})),Eh.default=d,Eh}var Hh={},Qdt=P&&P.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$O=P&&P.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},mdt=P&&P.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},gdt=P&&P.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hh,"__esModule",{value:!0});var ydt=gdt(Pn),_dt=function(){function t(e,r,n){this._factory=e,this._env=r,this.global={},this.stack=[],this.global={isInner:n},this.stack=[this._factory.create("start",this.global)],r&&(this.stack[0].env=r),this.env=this.stack[0].env}return Object.defineProperty(t.prototype,"env",{get:function(){return this._env},set:function(e){this._env=e},enumerable:!1,configurable:!0}),t.prototype.Push=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{for(var o=Qdt(n),a=o.next();!a.done;a=o.next()){var s=a.value;if(s){var d=ydt.default.isNode(s)?this._factory.create("mml",s):s;d.global=this.global;var p=$O(this.stack.length?this.Top().checkItem(d):[null,!0],2),f=p[0],Q=p[1];if(Q){if(f){this.Pop(),this.Push.apply(this,mdt([],$O(f),!1));continue}this.stack.push(d),d.env?(d.copyEnv&&Object.assign(d.env,this.env),this.env=d.env):d.env=this.env}}}}catch(m){e={error:m}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},t.prototype.Pop=function(){var e=this.stack.pop();return e.isOpen||delete e.env,this.env=this.stack.length?this.Top().env:{},e},t.prototype.Top=function(e){return e===void 0&&(e=1),this.stack.length<e?null:this.stack[this.stack.length-e]},t.prototype.Prev=function(e){var r=this.Top();return e?r.First:r.Pop()},t.prototype.toString=function(){return`stack[
1664
1664
  `+this.stack.join(`
1665
1665
  `)+`
1666
1666
  ]`},t}();Hh.default=_dt;var qO;function Pi(){if(qO)return wh;qO=1;var t=P&&P.__values||function(p){var f=typeof Symbol=="function"&&Symbol.iterator,Q=f&&p[f],m=0;if(Q)return Q.call(p);if(p&&typeof p.length=="number")return{next:function(){return p&&m>=p.length&&(p=void 0),{value:p&&p[m++],done:!p}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},e=P&&P.__read||function(p,f){var Q=typeof Symbol=="function"&&p[Symbol.iterator];if(!Q)return p;var m=Q.call(p),_,v=[],b;try{for(;(f===void 0||f-- >0)&&!(_=m.next()).done;)v.push(_.value)}catch(M){b={error:M}}finally{try{_&&!_.done&&(Q=m.return)&&Q.call(m)}finally{if(b)throw b.error}}return v},r=P&&P.__spreadArray||function(p,f,Q){if(Q||arguments.length===2)for(var m=0,_=f.length,v;m<_;m++)(v||!(m in f))&&(v||(v=Array.prototype.slice.call(f,0,m)),v[m]=f[m]);return p.concat(v||Array.prototype.slice.call(f))},n=P&&P.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(wh,"__esModule",{value:!0});var i=n(In()),o=n(Hh),a=n(hn),s=fr,d=function(){function p(f,Q,m){var _,v;this._string=f,this.configuration=m,this.macroCount=0,this.i=0,this.currentCS="";var b=Q.hasOwnProperty("isInner"),M=Q.isInner;delete Q.isInner;var E;if(Q){E={};try{for(var V=t(Object.keys(Q)),O=V.next();!O.done;O=V.next()){var R=O.value;E[R]=Q[R]}}catch(j){_={error:j}}finally{try{O&&!O.done&&(v=V.return)&&v.call(V)}finally{if(_)throw _.error}}}this.configuration.pushParser(this),this.stack=new o.default(this.itemFactory,E,b?M:!0),this.Parse(),this.Push(this.itemFactory.create("stop"))}return Object.defineProperty(p.prototype,"options",{get:function(){return this.configuration.options},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"itemFactory",{get:function(){return this.configuration.itemFactory},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"tags",{get:function(){return this.configuration.tags},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"string",{get:function(){return this._string},set:function(f){this._string=f},enumerable:!1,configurable:!0}),p.prototype.parse=function(f,Q){return this.configuration.handlers.get(f).parse(Q)},p.prototype.lookup=function(f,Q){return this.configuration.handlers.get(f).lookup(Q)},p.prototype.contains=function(f,Q){return this.configuration.handlers.get(f).contains(Q)},p.prototype.toString=function(){var f,Q,m="";try{for(var _=t(Array.from(this.configuration.handlers.keys())),v=_.next();!v.done;v=_.next()){var b=v.value;m+=b+": "+this.configuration.handlers.get(b)+`
@@ -1716,4 +1716,4 @@ ${e.vs}`,e}setDataProperty(e,r,n){const i=Dt(this,F5).get(+e);i&&(!(r in i)||i[r
1716
1716
  state: () => new MyClass()
1717
1717
  Found in store "${z.$id}".`),v&&o&&r.hydrate&&r.hydrate(z.$state,v),p=!0,f=!0,z}function mLt(t,e,r){let n,i;const o=typeof e=="function";n=t,i=o?r:e;function a(s,d){const p=h.hasInjectionContext();if(s=(process.env.NODE_ENV==="test"&&lc&&lc._testing?null:s)||(p?h.inject(pLt,null):null),s&&ET(s),process.env.NODE_ENV!=="production"&&!lc)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
1718
1718
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
1719
- This will fail in production.`);s=lc,s._s.has(n)||(o?fb(n,e,i,s):nN(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const f=s._s.get(n);if(process.env.NODE_ENV!=="production"&&d){const Q="__hot:"+n,m=o?fb(Q,e,i,s,!0):nN(Q,g2({},i),s,!0);d._hotUpdate(m),delete s.state.value[Q],s._s.delete(Q)}if(process.env.NODE_ENV!=="production"&&db){const Q=h.getCurrentInstance();if(Q&&Q.proxy&&!d){const m=Q.proxy,_="_pStores"in m?m._pStores:m._pStores={};_[n]=f}}return f}return a.$id=n,a}function gLt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const yLt=mLt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),_Lt=(t,e)=>{let r,n,i,o,a,s;e.style.left="",e.style.top="",e.addEventListener("mousedown",p=>{p.preventDefault(),r=e.offsetLeft,n=e.offsetTop,i=p.clientX,o=p.clientY,e.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",d,!1)},!1)},!1);function d(p){p.preventDefault(),a=r-(i-p.clientX),s=n-(o-p.clientY),e.style.left=`${a}px`,e.style.top=`${s}px`}},vLt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?r=t.coordinates[0]:r=t.coordinates,t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1])),e},iN=(t,e)=>{const r=[];let n=t.organs?t.organs:t.ftus;const i=n?n.filter((o,a)=>n.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${e}.${o.label}`},s=iN(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},bLt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},LLt={name:"FlatmapVuer",components:{Button:O2,Col:ma,Loading:QK,Radio:Ww,RadioGroup:Xw,Row:k2,Select:d5,Dialog:gX,MapSvgIcon:nL.MapSvgIcon,MapSvgSpriteColor:nL.MapSvgSpriteColor,Tooltip:hQ,TreeControls:EE,SelectionsGroup:wE,SvgLegends:ME,ElIconWarningFilled:px,ElIconArrowDown:d3,ElIconArrowLeft:hx},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},setup(t){return{annotator:h.markRaw(new hLt(`${t.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.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},displayConnectedFeatureTooltip:function(t){if(this.mapImp){const e=this.mapImp.featureProperties(t);this.checkAndCreatePopups({feature:e})}},confirmDrawnFeature:function(){this.createdEvent&&(this.checkAndCreatePopups(this.createdEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},initialiseDialog:function(){this.connectionDisplay=!1,this.connectionEntry={}},connectionDialogPopup:function(){!this.$el.querySelector(".drawConnection").classList.contains("inactive")&&!this.inDrawing&&(this.closePopup(),this.connectionDisplay=!this.connectionDisplay)},drawingEvent:function(t){if(this.closePopup(),this.drawnTypes.includes(t)&&!this.activeDrawMode&&!this.connectionDisplay){if(t==="Point"){const e=this.$el.querySelector(".mapbox-gl-draw_point");this.$el.querySelector(".mapbox-gl-draw_point").click(),this.activeDrawTool=e.classList.contains("active")?"Point":void 0}else if(t==="LineString"){const e=this.$el.querySelector(".mapbox-gl-draw_line");this.$el.querySelector(".mapbox-gl-draw_line").click(),this.activeDrawTool=e.classList.contains("active")?"LineString":void 0}else if(t==="Polygon"){const e=this.$el.querySelector(".mapbox-gl-draw_polygon");this.$el.querySelector(".mapbox-gl-draw_polygon").click(),this.activeDrawTool=e.classList.contains("active")?"Polygon":void 0}}else this.drawModes.includes(t)&&!this.activeDrawTool&&(t==="Delete"?(this.currentDrawnFeature&&(!this.activeDrawMode||this.activeDrawMode==="Edit")&&(this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[this.currentDrawnFeature.id]}}),this.deleteOrEditAnnotationFeature()),this.activeDrawMode=this.activeDrawMode==="Delete"?void 0:"Delete",this.activeDrawMode||(this.currentDrawnFeature=void 0)):t==="Edit"&&(this.activeDrawMode=this.activeDrawMode==="Edit"?void 0:"Edit"))},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},clearAnnotationFeature:function(){this.mapImp&&this.drawnAnnotationFeatures&&this.drawnAnnotationFeatures.length>0&&this.mapImp.clearAnnotationFeature()},deleteOrEditAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&this.drawnAnnotationEvent.includes(this.annotationEntry.type)&&this.mapImp.rollbackAnnotationEvent(this.annotationEntry)},commitAnnotationEvent:function(t){this.mapImp&&this.drawnAnnotationEvent.includes(this.annotationEntry.type)&&t&&(this.annotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?this.closePopup():this.addAnnotationFeature())},setFeatureAnnotated:function(){this.mapImp&&this.annotator.annotatedItemIds(this.userToken,this.serverURL).then(t=>{"resource"in t&&(t=t.itemIds);for(const e of t)this.mapImp.setFeatureAnnotated(e)}).catch(t=>{console.log(t)})},addAnnotationFeature:function(){if(this.mapImp&&(this.annotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None")){this.annotationSubmitted||(this.loading=!0);const t=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me";this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e).then(r=>{"resource"in r&&(r=r.itemIds),this.annotator.drawnFeatures(this.userToken,this.serverURL,r).then(n=>{if("resource"in n&&(n=n.features),this.drawnType!=="All tools"&&(n=n.filter(i=>i.geometry.type===this.drawnType)),this.drawnAnnotationFeatures=n,this.loading=!1,!this.annotationSubmitted)for(const i of n)this.mapImp.addAnnotationFeature(i)}).catch(n=>{console.log(n)})}).catch(r=>{console.log(r)})}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(t){this.drawnType=t,this.mapImp&&this.addAnnotationFeature()},setAnnotatedType:function(t){this.annotatedType=t,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=iN(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,e.forEach(r=>{HE(t,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setColour({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlineRadio=t,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:t})},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(t){this.mapImp&&this.mapImp.enableCentrelines(t.value)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(p=>this.mapImp.featureProperties(p)),o=await this.flatmapQueries.queryForConnectivity(t),a=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat();i=i.filter(p=>!a.includes(p.models));let s=[],d=!1;i.forEach(p=>{this.mapImp.nodePathModels(p.featureId).forEach(f=>{d=!0,this.mapImp.pathModelNodes(f).forEach(m=>{let _=this.mapImp.featureProperties([m]);if(a.includes(_.models)){d=!1;return}}),d&&s.push(f)})}),this.mapImp.zoomToFeatures(s,{noZoomIn:!0})}},alertSelected:function(t){if(this.mapImp)if(t.value)this.mapImp.clearVisibilityFilter();else{const e={NOT:{HAS:"alert"}};this.mapImp.setVisibilityFilter(e)}},systemSelected:function(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},checkboxMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.mapImp.selectGeoJSONFeatures("-1"),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},checkAllTaxons:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableConnectivityByTaxonIds(e,t.value))},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.annotationSubmitted?this.annotationSubmitted=!1:this.rollbackAnnotationEvent();else if(e.type==="modeChanged")e.feature.mode.startsWith("draw_")?(this.initialiseDialog(),this.inDrawing=!0):e.feature.mode==="simple_select"&&this.inDrawing?this.createdEvent?this.connectionDisplay=!0:this.initialiseDrawing():e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(e.type==="selectionChanged"){if(this.currentDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.currentDrawnFeature,!this.inDrawing&&(this.initialiseDialog(),this.currentDrawnFeature)){let r=this.drawnAnnotationFeatures.filter(n=>n.id===this.currentDrawnFeature.id)[0];r&&r.connection&&(this.connectionEntry=r.connection),this.drawModeEvent(t)}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.createdEvent=t:this.checkAndCreatePopups(t)}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){this.featuresAlert=e.alert;const n=e.label,i=[e.models],o=this.entry,a=this.biologicalSex;let s;e.taxons&&(typeof e.taxons!="object"?s=JSON.parse(e.taxons):s=e.taxons);const d={dataset:e.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:s};if(t==="click"){if(this.viewingMode==="Network Discovery")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.inDrawing&&!this.connectionDisplay){let p=e.label?e.label:`Feature ${e.id}`;this.activeDrawTool==="LineString"&&(this.connectionEntry[e.featureId]=Object.assign({label:p},Object.fromEntries(Object.entries(e).filter(([f])=>["featureId","models"].includes(f)).map(([f,Q])=>[f==="featureId"?"id":f,Q]))))}}else t==="mouseenter"&&this.viewingMode!=="Network Discovery"&&(this.currentHover=e.models?e.models:"");e&&e.type!=="marker"&&t==="click"&&this.viewingMode!=="Network Discovery"&&!this.inDrawing&&this.checkAndCreatePopups(d),this.$emit("resource-selected",d)}else this.$emit("pan-zoom-callback",e)}},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");_Lt(this.$el,t);let e,r;const n=this.$el.getBoundingClientRect(),i=t.getBoundingClientRect();this.dialogPosition.x>n.width/2?e=this.dialogPosition.x-i.width:e=this.dialogPosition.x,this.dialogPosition.y>n.height/2?r=this.dialogPosition.y-i.height:r=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${r-this.dialogPosition.offsetY}px)`})},drawIconCssHacks:function(){(this.$el.querySelector(".iconSelected")||!this.connectionDisplay)&&(this.drawnTypes.map(t=>{const e=this.$el.querySelector(`.draw${t}`);e&&(e.classList.remove("iconSelected"),e.classList.remove("inactive"))}),this.drawModes.map(t=>{this.$el.querySelector(`.draw${t}`).classList.remove("iconSelected"),this.$el.querySelector(`.draw${t}`).classList.remove("inactive")})),this.activeDrawTool?(this.$el.querySelector(`.draw${this.activeDrawTool}`).classList.add("iconSelected"),this.drawModes.map(t=>{this.$el.querySelector(`.draw${t}`).classList.add("inactive")})):(this.activeDrawMode||this.connectionDisplay)&&(this.activeDrawMode&&this.$el.querySelector(`.draw${this.activeDrawMode}`).classList.add("iconSelected"),this.drawnTypes.map(t=>{const e=this.$el.querySelector(`.draw${t}`);e&&e.classList.add("inactive")}))},drawModeEvent:function(t){this.activeDrawMode&&(this.doubleClickedFeature?(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.deleteOrEditAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.deleteOrEditAnnotationFeature()))},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.slice(1,-1)};this.annotationEntry.body=e}},changeViewingMode:function(){this.closeTooltip()},checkAndCreatePopups:async function(t){if(this.viewingMode==="Annotation")t.feature?(this.annotationEntry={...t.feature,resourceId:this.serverURL},t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.inDrawing||this.activeDrawMode?(this.annotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,vLt(t.feature.feature.geometry))):t.feature.type==="updated"&&this.rollbackAnnotationEvent(),(t.feature.type==="updated"||t.feature.type==="deleted")&&this.initialiseDialog())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(t);(e[0]||e[1]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{t&&(t.style.display="block")}},closePopup:function(){let t=document.querySelector(".maplibregl-popup-close-button");t&&t.click()},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.tooltipEntry=await this.flatmapQueries.createTooltipData(t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){t?(this.inHelp=!0,this.hoverVisibilities.forEach(e=>{e.value=!0}),this.openFlatmapHelpPopup()):(this.inHelp=!1,this.hoverVisibilities.forEach(e=>{e.value=!1}),this.closeFlatmapHelpPopup())},showToolitip:function(t){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0},500))},hideToolitip:function(t){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},500))},displayTooltip:function(t,e=void 0){this.tooltipDisplay=!0;let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.inDrawing||(n.positionAtLastClick=!0)),this.disableUI||this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()})},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&this.mapImp.showPopup(t[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"})}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?t.viewport&&this.mapImp.setState(t.viewport):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){t&&(t.viewport&&this.mapImp.setState(t.viewport),t.searchTerm&&this.searchAndShowResult(t.searchTerm,!0))},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry,t.biologicalSex?r.biologicalSex=t.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:e}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(t)})}else t&&(this._stateToBeSet={viewport:t.viewport,searchTerm:t.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.clientHeight-r;this.pathwaysMaxHeight=n-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 zY(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.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.$emit("ready",this)},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),e&&r.results[0].featureId&&r.results[0].text){const n=this.mapImp.annotation(r.results[0].featureId);this.mapImp.showPopup(r.results[0].featureId,n.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(t){return this.mapImp?this.mapImp.search(t):[]}},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/"},disableUI:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,$annotator:this.annotator,userApiKey:this.userToken,getFeaturesAlert:()=>this.featuresAlert}},data:function(){return{annotationEntry:{},tooltipDisplay:!1,serverURL: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:FY,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:BY,tooltipEntry:bLt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,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:"Anyone",annotatedTypes:["Anyone","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,connectionDisplay:!1,connectionEntry:{},drawnAnnotationFeatures:void 0,doubleClickedFeature:!1,activeDrawMode:void 0,drawModes:["Delete","Edit"],dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0},containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0}]}},computed:{...gLt(yLt,["userToken"]),connection:function(){return Object.keys(this.connectionEntry).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(val)},state:{handler:function(t,e){t!==e&&(this.mapManager?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},activeDrawTool:function(){this.drawIconCssHacks()},activeDrawMode:function(){this.drawIconCssHacks()},connection:function(t){const e=this.$el.querySelector(".drawConnection");t?e.classList.remove("inactive"):(this.connectionDisplay=!1,e.classList.add("inactive"))},connectionDisplay:function(t){const e=this.$el.querySelector(".drawConnection");t?(e.classList.add("iconSelected"),this.dialogCssHacks()):e.classList.remove("iconSelected"),this.drawIconCssHacks()},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0},viewingMode:function(t){t==="Annotation"?(this.$el.querySelector(".maplibregl-canvas").addEventListener("click",e=>{e.preventDefault(),this.dialogPosition.x=e.clientX,this.dialogPosition.y=e.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()},!1),this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.drawnAnnotationFeatures||this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()}},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 YR(this.flatmapAPI),this.flatmapQueries=new DY,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},W2=t=>(h.pushScopeId("data-v-e5b7ccd4"),t=t(),h.popScopeId(),t),xLt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},wLt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},ELt={style:{height:"100%",width:"100%"},ref:"display"},MLt={class:"beta-popovers"},HLt=W2(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),SLt=W2(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),CLt=W2(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),ALt=W2(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),VLt=W2(()=>h.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),OLt={key:1,class:"warning-text"},kLt=W2(()=>h.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),PLt=W2(()=>h.createElementVNode("b",null,"Network discovery mode",-1)),ILt=W2(()=>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)),RLt=W2(()=>h.createElementVNode("b",null,"Now can display up to 6 panes",-1)),NLt=W2(()=>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)),BLt={class:"bottom-draw-control"},DLt={class:"bottom-right-control"},FLt=W2(()=>h.createElementVNode("div",null,[h.createTextVNode(" Fit to "),h.createElementVNode("br"),h.createTextVNode(" window ")],-1)),jLt=["innerHTML"],zLt=["innerHTML"],ULt=["onClick"];function GLt(t,e,r,n,i,o){const a=h.resolveComponent("map-svg-sprite-color"),s=px,d=X1,p=C9,f=d3,Q=h.resolveComponent("map-svg-icon"),m=ME,_=EE,v=wE,b=hx,M=O2,E=k2,V=ma,O=S9,R=d5,j=Ww,G=Xw,z=hQ,J=xK,tt=fE,ot=I9;return h.withDirectives((h.openBlock(),h.createElementBlock("div",xLt,[h.createVNode(a),h.createElementVNode("div",wLt,[h.createElementVNode("div",ELt,null,512),h.withDirectives(h.createElementVNode("div",MLt,[h.createElementVNode("div",null,[h.createVNode(p,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[6].value,ref:"warningPopover"},{reference:h.withCtx(()=>[r.displayWarning?(h.openBlock(),h.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:e[7]||(e[7]=et=>o.showToolitip(6)),onMouseout:e[8]||(e[8]=et=>o.hideToolitip(6))},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(s)]),_:1}),r.isLegacy?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[VLt,h.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...et)=>o.viewLatestMap&&o.viewLatestMap(...et))}," Click here for the latest map ")],64)):(h.openBlock(),h.createElementBlock("span",OLt,"Beta"))],32)):h.createCommentVNode("",!0)]),default:h.withCtx(()=>[r.isLegacy?(h.openBlock(),h.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=et=>o.showToolitip(6)),onMouseout:e[1]||(e[1]=et=>o.hideToolitip(6))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(h.openBlock(),h.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=et=>o.showToolitip(6)),onMouseout:e[3]||(e[3]=et=>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 "),HLt,h.createTextVNode(" models available in "),SLt,h.createTextVNode(". ")],32)):(h.openBlock(),h.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=et=>o.showToolitip(6)),onMouseout:e[5]||(e[5]=et=>o.hideToolitip(6))},[h.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),CLt,h.createTextVNode(" models available in "),ALt,h.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(h.openBlock(),h.createBlock(p,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[7].value},{reference:h.withCtx(()=>[r.displayLatestChanges?(h.openBlock(),h.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=et=>o.showToolitip(7)),onMouseout:e[10]||(e[10]=et=>o.hideToolitip(7))},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(s)]),_:1}),kLt],32)):h.createCommentVNode("",!0)]),default:h.withCtx(()=>[PLt,ILt,RLt,NLt]),_:1},8,["visible"])):h.createCommentVNode("",!0)],512),[[h.vShow,!r.disableUI]]),h.withDirectives(h.createVNode(d,{class:h.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:h.withCtx(()=>[h.createVNode(f)]),_:1},8,["class","onClick"]),[[h.vShow,t.minimapResizeShow]]),h.withDirectives(h.createElementVNode("div",BLt,[h.createVNode(p,{content:"Draw Connection",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[10].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"connection",class:"icon-button drawConnection inactive",onClick:o.connectionDialogPopup,onMouseover:e[11]||(e[11]=et=>o.showToolitip(10)),onMouseout:e[12]||(e[12]=et=>o.hideToolitip(10))},null,8,["onClick"])]),_:1},8,["visible"]),t.drawnType!=="LineString"&&t.drawnType!=="Polygon"?(h.openBlock(),h.createBlock(p,{key:0,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[11].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"drawPoint",class:"icon-button drawPoint",onClick:e[13]||(e[13]=et=>o.drawingEvent("Point")),onMouseover:e[14]||(e[14]=et=>o.showToolitip(11)),onMouseout:e[15]||(e[15]=et=>o.hideToolitip(11))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),t.drawnType!=="Point"&&t.drawnType!=="Polygon"?(h.openBlock(),h.createBlock(p,{key:1,content:"Draw Line",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[12].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"drawLine",class:"icon-button drawLineString",onClick:e[16]||(e[16]=et=>o.drawingEvent("LineString")),onMouseover:e[17]||(e[17]=et=>o.showToolitip(12)),onMouseout:e[18]||(e[18]=et=>o.hideToolitip(12))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),t.drawnType!=="Point"&&t.drawnType!=="LineString"?(h.openBlock(),h.createBlock(p,{key:2,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[13].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:e[19]||(e[19]=et=>o.drawingEvent("Polygon")),onMouseover:e[20]||(e[20]=et=>o.showToolitip(13)),onMouseout:e[21]||(e[21]=et=>o.hideToolitip(13))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),h.createVNode(p,{content:"Delete",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[14].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"drawTrash",class:"icon-button drawDelete",onClick:e[22]||(e[22]=et=>o.drawingEvent("Delete")),onMouseover:e[23]||(e[23]=et=>o.showToolitip(14)),onMouseout:e[24]||(e[24]=et=>o.hideToolitip(14))})]),_:1},8,["visible"]),h.createVNode(p,{content:"Edit",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[15].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"comment",class:"icon-button drawEdit",onClick:e[25]||(e[25]=et=>o.drawingEvent("Edit")),onMouseover:e[26]||(e[26]=et=>o.showToolitip(15)),onMouseout:e[27]||(e[27]=et=>o.hideToolitip(15))})]),_:1},8,["visible"])],512),[[h.vShow,t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI]]),h.withDirectives(h.createElementVNode("div",DLt,[h.createVNode(p,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[0].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[28]||(e[28]=et=>o.zoomIn()),onMouseover:e[29]||(e[29]=et=>o.showToolitip(0)),onMouseout:e[30]||(e[30]=et=>o.hideToolitip(0))})]),_:1},8,["visible"]),h.createVNode(p,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[31]||(e[31]=et=>o.zoomOut()),onMouseover:e[32]||(e[32]=et=>o.showToolitip(1)),onMouseout:e[33]||(e[33]=et=>o.hideToolitip(1))})]),_:1},8,["visible"]),h.createVNode(p,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[34]||(e[34]=et=>o.resetView()),onMouseover:e[35]||(e[35]=et=>o.showToolitip(2)),onMouseout:e[36]||(e[36]=et=>o.hideToolitip(2))})]),default:h.withCtx(()=>[FLt]),_:1},8,["visible"])],512),[[h.vShow,!r.disableUI]]),h.createVNode(p,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper",visible:t.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:h.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:h.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(m,{key:0,class:"svg-legends-container"})),h.createVNode(p,{content:"Location of the featured dataset",placement:"right",teleported:!1,trigger:"hover","popper-class":"flatmap-popper popper-bump-right",visible:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar},null,8,jLt),[[h.vShow,r.showStarInLegend],[tt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),h.createVNode(p,{content:"Find these markers for data",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper popper-bump-right",visible:t.hoverVisibilities[5].value,ref:"markerPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,zLt),[[h.vShow,t.hoverVisibilities[5].value],[tt,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(h.openBlock(),h.createBlock(_,{key:1,active:t.currentActive,hover:t.currentHover,"tree-data":t.systems,ref:"treeControls",onChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):h.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(h.openBlock(),h.createBlock(v,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged"])):h.createCommentVNode("",!0),!t.isFC&&t.centreLines&&t.centreLines.length>0?(h.openBlock(),h.createBlock(v,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged"])):h.createCommentVNode("",!0),!t.isFC&&t.taxonConnectivity&&t.taxonConnectivity.length>0?(h.openBlock(),h.createBlock(v,{title:"Observed in",labelKey:"label",identifierKey:"taxon",selections:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.checkboxMouseEnterEmitted,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onCheckAll"])):h.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(h.openBlock(),h.createBlock(v,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.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:e[37]||(e[37]=(...et)=>o.toggleDrawer&&o.toggleDrawer(...et)),class:h.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(b)]),_:1})],2)],2),[[h.vShow,!r.disableUI]])]),_:1},8,["visible"]),t.openMapRef?(h.openBlock(),h.createBlock(p,{key:0,ref:"open-map-popover","virtual-ref":t.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(r.openMapOptions,et=>(h.openBlock(),h.createBlock(E,{key:et.key},{default:h.withCtx(()=>[h.createVNode(M,{type:"primary",plain:"",onClick:Tt=>t.$emit("open-map",et.key)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(et.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):h.createCommentVNode("",!0),h.createVNode(p,{ref:"backgroundPopover","virtual-ref":t.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(R,{teleported:!1,modelValue:t.viewingMode,"onUpdate:modelValue":e[38]||(e[38]=et=>t.viewingMode=et),onChange:o.changeViewingMode,placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.viewingModes,(et,Tt)=>(h.openBlock(),h.createBlock(O,{key:et+Tt,label:et,value:et},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(V,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(et),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),t.viewingMode==="Annotation"&&t.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(R,{teleported:!1,modelValue:t.drawnType,"onUpdate:modelValue":e[39]||(e[39]=et=>t.drawnType=et),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(t.drawnTypes,et=>(h.openBlock(),h.createBlock(O,{key:et,label:et,value:et},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(V,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(et),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(R,{teleported:!1,modelValue:t.annotatedType,"onUpdate:modelValue":e[40]||(e[40]=et=>t.annotatedType=et),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(t.annotatedTypes,et=>(h.openBlock(),h.createBlock(O,{key:et,label:et,value:et},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(V,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(et),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):h.createCommentVNode("",!0),t.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:1,class:"backgroundSpacer"})):h.createCommentVNode("",!0),t.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:2,class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Flight path display")]),_:1})):h.createCommentVNode("",!0),t.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:3,class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(G,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[41]||(e[41]=et=>t.flightPath3DRadio=et),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(G,{modelValue:t.colourRadio,"onUpdate:modelValue":e[42]||(e[42]=et=>t.colourRadio=et),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(G,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[43]||(e[43]=et=>t.outlinesRadio=et),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(t.availableBackground,et=>(h.openBlock(),h.createElementBlock("div",{key:et,class:h.normalizeClass(["backgroundChoice",et,et==t.currentBackground?"active":""]),onClick:Tt=>o.backgroundChangeCallback(et)},null,10,ULt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),h.withDirectives(h.createElementVNode("div",{class:h.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(p,{visible:t.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper"},{reference:h.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(h.openBlock(),h.createBlock(Q,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[44]||(e[44]=et=>o.showToolitip(8)),onMouseout:e[45]||(e[45]=et=>o.hideToolitip(8))},null,512)):h.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(p,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper"},{reference:h.withCtx(()=>[h.createVNode(Q,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[46]||(e[46]=et=>o.showToolitip(3)),onMouseout:e[47]||(e[47]=et=>o.hideToolitip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[h.vShow,!r.disableUI]]),h.withDirectives(h.createVNode(z,{ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,entry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","entry","annotationDisplay","onAnnotation"]),[[h.vShow,t.tooltipDisplay]]),h.withDirectives(h.createVNode(J,{class:"connection-dialog",entry:t.connectionEntry,drawing:t.inDrawing,connection:o.connection,onDisplay:o.connectionDialogPopup,onConfirm:o.confirmDrawnFeature,onCancel:o.cancelDrawnFeature,onPopup:o.closePopup,onTooltip:o.displayConnectedFeatureTooltip},null,8,["entry","drawing","connection","onDisplay","onConfirm","onCancel","onPopup","onTooltip"]),[[h.vShow,t.connectionDisplay]])])])),[[ot,t.loading]])}const Qb=ga(LLt,[["render",GLt],["__scopeId","data-v-e5b7ccd4"]]),oN={"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"},ZLt={name:"MultiFlatmapVuer",components:{Col:ma,Row:k2,Option:S9,Select:d5,Popover:C9,FlatmapVuer:Qb},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),R9.on("onActionClick",t=>{this.resourceSelected(t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=h.reactive(this.availableSpecies[n]);else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=h.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=h.reactive(this.availableSpecies[n]);break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this._initialised=!0,t(),this._resolveList.forEach(n=>{n()})})):this._initialised?t():this._resolveList.push(t)})},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]=h.reactive({taxo:e,isLegacy:!0,displayWarning:!0}),{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new YR(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(o=>{if(o.uuid!==r.uuid)return this.createLegacyEntry(t,r.entry,r.uuid)}).then(o=>{e(o||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in oN?oN[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.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/"},disableUI:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},$Lt=t=>(h.pushScopeId("data-v-5550e1f2"),t=t(),h.popScopeId(),t),qLt={class:"multi-container",ref:"multiContainer"},WLt={key:0,style:{position:"absolute","z-index":"10"}},XLt=$Lt(()=>h.createElementVNode("div",{class:"species-display-text"},"Species",-1)),KLt={class:"select-box-icon"};function YLt(t,e,r,n,i,o){const a=S9,s=d5,d=C9,p=Qb;return h.openBlock(),h.createElementBlock("div",qLt,[r.disableUI?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",WLt,[XLt,h.createVNode(d,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper right-popper",visible:r.helpMode,teleported:!1,ref:"selectPopover"},{reference:h.withCtx(()=>[h.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),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(t.speciesList,(f,Q)=>(h.openBlock(),h.createBlock(a,{key:Q,label:Q,value:Q},{default:h.withCtx(()=>[h.createElementVNode("span",KLt,[h.createElementVNode("i",{class:h.normalizeClass(f.iconClass)},null,2)]),h.createTextVNode(" "+h.toDisplayString(Q),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.speciesList,(f,Q)=>h.withDirectives((h.openBlock(),h.createBlock(p,{key:Q,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:Q,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,onOpenMap:e[1]||(e[1]=m=>t.$emit("open-map",m)),minZoom:r.minZoom,helpMode:r.helpMode,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","minZoom","helpMode","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[h.vShow,t.activeSpecies==Q]])),128))],512)}const JLt=ga(ZLt,[["render",YLt],["__scopeId","data-v-5550e1f2"]]);ii.FlatmapVuer=Qb,ii.MultiFlatmapVuer=JLt,ii.Tooltip=hQ,Object.defineProperty(ii,Symbol.toStringTag,{value:"Module"})});
1719
+ This will fail in production.`);s=lc,s._s.has(n)||(o?fb(n,e,i,s):nN(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const f=s._s.get(n);if(process.env.NODE_ENV!=="production"&&d){const Q="__hot:"+n,m=o?fb(Q,e,i,s,!0):nN(Q,g2({},i),s,!0);d._hotUpdate(m),delete s.state.value[Q],s._s.delete(Q)}if(process.env.NODE_ENV!=="production"&&db){const Q=h.getCurrentInstance();if(Q&&Q.proxy&&!d){const m=Q.proxy,_="_pStores"in m?m._pStores:m._pStores={};_[n]=f}}return f}return a.$id=n,a}function gLt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const yLt=mLt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),_Lt=(t,e)=>{let r,n,i,o,a,s;e.style.left="",e.style.top="",e.addEventListener("mousedown",p=>{p.preventDefault(),r=e.offsetLeft,n=e.offsetTop,i=p.clientX,o=p.clientY,e.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",d,!1)},!1)},!1);function d(p){p.preventDefault(),a=r-(i-p.clientX),s=n-(o-p.clientY),e.style.left=`${a}px`,e.style.top=`${s}px`}},vLt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?r=t.coordinates[0]:r=t.coordinates,t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1])),e},iN=(t,e)=>{const r=[];let n=t.organs?t.organs:t.ftus;const i=n?n.filter((o,a)=>n.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${e}.${o.label}`},s=iN(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},bLt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},LLt={name:"FlatmapVuer",components:{Button:O2,Col:ma,Loading:QK,Radio:Ww,RadioGroup:Xw,Row:k2,Select:d5,Dialog:gX,MapSvgIcon:nL.MapSvgIcon,MapSvgSpriteColor:nL.MapSvgSpriteColor,Tooltip:hQ,TreeControls:EE,SelectionsGroup:wE,SvgLegends:ME,ElIconWarningFilled:px,ElIconArrowDown:d3,ElIconArrowLeft:hx},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},setup(t){return{annotator:h.markRaw(new hLt(`${t.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.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},displayConnectedFeatureTooltip:function(t){if(this.mapImp){const e=this.mapImp.featureProperties(t);this.checkAndCreatePopups({feature:e})}},confirmDrawnFeature:function(){this.createdEvent&&(this.checkAndCreatePopups(this.createdEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},initialiseDialog:function(){this.connectionDisplay=!1,this.connectionEntry={}},connectionDialogPopup:function(){!this.$el.querySelector(".drawConnection").classList.contains("inactive")&&!this.inDrawing&&(this.closePopup(),this.connectionDisplay=!this.connectionDisplay)},drawingEvent:function(t){if(this.closePopup(),this.drawnTypes.includes(t)&&!this.activeDrawMode&&!this.connectionDisplay){if(t==="Point"){const e=this.$el.querySelector(".mapbox-gl-draw_point");this.$el.querySelector(".mapbox-gl-draw_point").click(),this.activeDrawTool=e.classList.contains("active")?"Point":void 0}else if(t==="LineString"){const e=this.$el.querySelector(".mapbox-gl-draw_line");this.$el.querySelector(".mapbox-gl-draw_line").click(),this.activeDrawTool=e.classList.contains("active")?"LineString":void 0}else if(t==="Polygon"){const e=this.$el.querySelector(".mapbox-gl-draw_polygon");this.$el.querySelector(".mapbox-gl-draw_polygon").click(),this.activeDrawTool=e.classList.contains("active")?"Polygon":void 0}}else this.drawModes.includes(t)&&!this.activeDrawTool&&(t==="Delete"?(this.currentDrawnFeature&&(!this.activeDrawMode||this.activeDrawMode==="Edit")&&(this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[this.currentDrawnFeature.id]}}),this.deleteOrEditAnnotationFeature()),this.activeDrawMode=this.activeDrawMode==="Delete"?void 0:"Delete",this.activeDrawMode||(this.currentDrawnFeature=void 0)):t==="Edit"&&(this.activeDrawMode=this.activeDrawMode==="Edit"?void 0:"Edit"))},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},clearAnnotationFeature:function(){this.mapImp&&this.drawnAnnotationFeatures&&this.drawnAnnotationFeatures.length>0&&this.mapImp.clearAnnotationFeature()},deleteOrEditAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&this.drawnAnnotationEvent.includes(this.annotationEntry.type)&&this.mapImp.rollbackAnnotationEvent(this.annotationEntry)},commitAnnotationEvent:function(t){this.mapImp&&this.drawnAnnotationEvent.includes(this.annotationEntry.type)&&t&&(this.annotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?this.closePopup():this.addAnnotationFeature())},setFeatureAnnotated:function(){this.mapImp&&this.annotator.annotatedItemIds(this.userToken,this.serverURL).then(t=>{"resource"in t&&(t=t.itemIds);for(const e of t)this.mapImp.setFeatureAnnotated(e)}).catch(t=>{console.log(t)})},addAnnotationFeature:function(){if(this.mapImp&&(this.annotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None")){this.annotationSubmitted||(this.loading=!0);const t=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me";this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e).then(r=>{"resource"in r&&(r=r.itemIds),this.annotator.drawnFeatures(this.userToken,this.serverURL,r).then(n=>{if("resource"in n&&(n=n.features),this.drawnType!=="All tools"&&(n=n.filter(i=>i.geometry.type===this.drawnType)),this.drawnAnnotationFeatures=n,this.loading=!1,!this.annotationSubmitted)for(const i of n)this.mapImp.addAnnotationFeature(i)}).catch(n=>{console.log(n)})}).catch(r=>{console.log(r)})}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(t){this.drawnType=t,this.mapImp&&this.addAnnotationFeature()},setAnnotatedType:function(t){this.annotatedType=t,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=iN(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,e.forEach(r=>{HE(t,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setColour({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlineRadio=t,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:t})},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(t){this.mapImp&&this.mapImp.enableCentrelines(t.value)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(p=>this.mapImp.featureProperties(p)),o=await this.flatmapQueries.queryForConnectivity(t),a=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat();i=i.filter(p=>!a.includes(p.models));let s=[],d=!1;i.forEach(p=>{this.mapImp.nodePathModels(p.featureId).forEach(f=>{d=!0,this.mapImp.pathModelNodes(f).forEach(m=>{let _=this.mapImp.featureProperties([m]);if(a.includes(_.models)){d=!1;return}}),d&&s.push(f)})}),this.mapImp.zoomToFeatures(s,{noZoomIn:!0})}},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){const e={HAS:"alert"};this.mapImp.setVisibilityFilter(e)}else this.mapImp.clearVisibilityFilter(),this.alertSelected({value:t.checked.length>0})},alertSelected:function(t){if(this.mapImp)if(t.value)this.mapImp.clearVisibilityFilter();else{const e={NOT:{HAS:"alert"}};this.mapImp.setVisibilityFilter(e)}},systemSelected:function(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.mapImp.selectGeoJSONFeatures("-1"),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},checkAllTaxons:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableConnectivityByTaxonIds(e,t.value))},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.annotationSubmitted?this.annotationSubmitted=!1:this.rollbackAnnotationEvent();else if(e.type==="modeChanged")e.feature.mode.startsWith("draw_")?(this.initialiseDialog(),this.inDrawing=!0):e.feature.mode==="simple_select"&&this.inDrawing?this.createdEvent?this.connectionDisplay=!0:this.initialiseDrawing():e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(e.type==="selectionChanged"){if(this.currentDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.currentDrawnFeature,!this.inDrawing&&(this.initialiseDialog(),this.currentDrawnFeature)){let r=this.drawnAnnotationFeatures.filter(n=>n.id===this.currentDrawnFeature.id)[0];r&&r.connection&&(this.connectionEntry=r.connection),this.drawModeEvent(t)}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.createdEvent=t:this.checkAndCreatePopups(t)}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){this.featuresAlert=e.alert;const n=e.label,i=[e.models],o=this.entry,a=this.biologicalSex;let s;e.taxons&&(typeof e.taxons!="object"?s=JSON.parse(e.taxons):s=e.taxons);const d={dataset:e.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:s};if(t==="click"){if(this.viewingMode==="Network Discovery")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.inDrawing&&!this.connectionDisplay){let p=e.label?e.label:`Feature ${e.id}`;this.activeDrawTool==="LineString"&&(this.connectionEntry[e.featureId]=Object.assign({label:p},Object.fromEntries(Object.entries(e).filter(([f])=>["featureId","models"].includes(f)).map(([f,Q])=>[f==="featureId"?"id":f,Q]))))}}else t==="mouseenter"&&this.viewingMode!=="Network Discovery"&&(this.currentHover=e.models?e.models:"");e&&e.type!=="marker"&&t==="click"&&this.viewingMode!=="Network Discovery"&&!this.inDrawing&&this.checkAndCreatePopups(d),this.$emit("resource-selected",d)}else this.$emit("pan-zoom-callback",e)}},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");_Lt(this.$el,t);let e,r;const n=this.$el.getBoundingClientRect(),i=t.getBoundingClientRect();this.dialogPosition.x>n.width/2?e=this.dialogPosition.x-i.width:e=this.dialogPosition.x,this.dialogPosition.y>n.height/2?r=this.dialogPosition.y-i.height:r=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${r-this.dialogPosition.offsetY}px)`})},drawIconCssHacks:function(){(this.$el.querySelector(".iconSelected")||!this.connectionDisplay)&&(this.drawnTypes.map(t=>{const e=this.$el.querySelector(`.draw${t}`);e&&(e.classList.remove("iconSelected"),e.classList.remove("inactive"))}),this.drawModes.map(t=>{this.$el.querySelector(`.draw${t}`).classList.remove("iconSelected"),this.$el.querySelector(`.draw${t}`).classList.remove("inactive")})),this.activeDrawTool?(this.$el.querySelector(`.draw${this.activeDrawTool}`).classList.add("iconSelected"),this.drawModes.map(t=>{this.$el.querySelector(`.draw${t}`).classList.add("inactive")})):(this.activeDrawMode||this.connectionDisplay)&&(this.activeDrawMode&&this.$el.querySelector(`.draw${this.activeDrawMode}`).classList.add("iconSelected"),this.drawnTypes.map(t=>{const e=this.$el.querySelector(`.draw${t}`);e&&e.classList.add("inactive")}))},drawModeEvent:function(t){this.activeDrawMode&&(this.doubleClickedFeature?(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.deleteOrEditAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.deleteOrEditAnnotationFeature()))},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.slice(1,-1)};this.annotationEntry.body=e}},changeViewingMode:function(){this.closeTooltip()},checkAndCreatePopups:async function(t){if(this.viewingMode==="Annotation")t.feature?(this.annotationEntry={...t.feature,resourceId:this.serverURL},t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.inDrawing||this.activeDrawMode?(this.annotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,vLt(t.feature.feature.geometry))):t.feature.type==="updated"&&this.rollbackAnnotationEvent(),(t.feature.type==="updated"||t.feature.type==="deleted")&&this.initialiseDialog())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(t);(e[0]||e[1]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{t&&(t.style.display="block")}},closePopup:function(){let t=document.querySelector(".maplibregl-popup-close-button");t&&t.click()},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.tooltipEntry=await this.flatmapQueries.createTooltipData(t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){t?(this.inHelp=!0,this.hoverVisibilities.forEach(e=>{e.value=!0}),this.openFlatmapHelpPopup()):(this.inHelp=!1,this.hoverVisibilities.forEach(e=>{e.value=!1}),this.closeFlatmapHelpPopup())},showToolitip:function(t){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0},500))},hideToolitip:function(t){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},500))},displayTooltip:function(t,e=void 0){this.tooltipDisplay=!0;let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.inDrawing||(n.positionAtLastClick=!0)),this.disableUI||this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()})},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&this.mapImp.showPopup(t[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"})}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?t.viewport&&this.mapImp.setState(t.viewport):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){t&&(t.viewport&&this.mapImp.setState(t.viewport),t.searchTerm&&this.searchAndShowResult(t.searchTerm,!0))},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry,t.biologicalSex?r.biologicalSex=t.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:e}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(t)})}else t&&(this._stateToBeSet={viewport:t.viewport,searchTerm:t.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.clientHeight-r;this.pathwaysMaxHeight=n-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 zY(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.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.$emit("ready",this)},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),e&&r.results[0].featureId&&r.results[0].text){const n=this.mapImp.annotation(r.results[0].featureId);this.mapImp.showPopup(r.results[0].featureId,n.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(t){return this.mapImp?this.mapImp.search(t):[]}},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/"},disableUI:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,$annotator:this.annotator,userApiKey:this.userToken,getFeaturesAlert:()=>this.featuresAlert}},data:function(){return{annotationEntry:{},tooltipDisplay:!1,serverURL: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:FY,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:BY,tooltipEntry:bLt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,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:"Anyone",annotatedTypes:["Anyone","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,connectionDisplay:!1,connectionEntry:{},drawnAnnotationFeatures:void 0,doubleClickedFeature:!1,activeDrawMode:void 0,drawModes:["Delete","Edit"],dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0},containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0}]}},computed:{...gLt(yLt,["userToken"]),connection:function(){return Object.keys(this.connectionEntry).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(val)},state:{handler:function(t,e){t!==e&&(this.mapManager?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},activeDrawTool:function(){this.drawIconCssHacks()},activeDrawMode:function(){this.drawIconCssHacks()},connection:function(t){const e=this.$el.querySelector(".drawConnection");t?e.classList.remove("inactive"):(this.connectionDisplay=!1,e.classList.add("inactive"))},connectionDisplay:function(t){const e=this.$el.querySelector(".drawConnection");t?(e.classList.add("iconSelected"),this.dialogCssHacks()):e.classList.remove("iconSelected"),this.drawIconCssHacks()},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0},viewingMode:function(t){t==="Annotation"?(this.$el.querySelector(".maplibregl-canvas").addEventListener("click",e=>{e.preventDefault(),this.dialogPosition.x=e.clientX,this.dialogPosition.y=e.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()},!1),this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.drawnAnnotationFeatures||this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()}},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 YR(this.flatmapAPI),this.flatmapQueries=new DY,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},W2=t=>(h.pushScopeId("data-v-116c481b"),t=t(),h.popScopeId(),t),xLt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},wLt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},ELt={style:{height:"100%",width:"100%"},ref:"display"},MLt={class:"beta-popovers"},HLt=W2(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),SLt=W2(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),CLt=W2(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),ALt=W2(()=>h.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),VLt=W2(()=>h.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),OLt={key:1,class:"warning-text"},kLt=W2(()=>h.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),PLt=W2(()=>h.createElementVNode("b",null,"Network discovery mode",-1)),ILt=W2(()=>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)),RLt=W2(()=>h.createElementVNode("b",null,"Now can display up to 6 panes",-1)),NLt=W2(()=>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)),BLt={class:"bottom-draw-control"},DLt={class:"bottom-right-control"},FLt=W2(()=>h.createElementVNode("div",null,[h.createTextVNode(" Fit to "),h.createElementVNode("br"),h.createTextVNode(" window ")],-1)),jLt=["innerHTML"],zLt=["innerHTML"],ULt=["onClick"];function GLt(t,e,r,n,i,o){const a=h.resolveComponent("map-svg-sprite-color"),s=px,d=X1,p=C9,f=d3,Q=h.resolveComponent("map-svg-icon"),m=ME,_=EE,v=wE,b=hx,M=O2,E=k2,V=ma,O=S9,R=d5,j=Ww,G=Xw,z=hQ,J=xK,tt=fE,ot=I9;return h.withDirectives((h.openBlock(),h.createElementBlock("div",xLt,[h.createVNode(a),h.createElementVNode("div",wLt,[h.createElementVNode("div",ELt,null,512),h.withDirectives(h.createElementVNode("div",MLt,[h.createElementVNode("div",null,[h.createVNode(p,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[6].value,ref:"warningPopover"},{reference:h.withCtx(()=>[r.displayWarning?(h.openBlock(),h.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:e[7]||(e[7]=et=>o.showToolitip(6)),onMouseout:e[8]||(e[8]=et=>o.hideToolitip(6))},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(s)]),_:1}),r.isLegacy?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[VLt,h.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...et)=>o.viewLatestMap&&o.viewLatestMap(...et))}," Click here for the latest map ")],64)):(h.openBlock(),h.createElementBlock("span",OLt,"Beta"))],32)):h.createCommentVNode("",!0)]),default:h.withCtx(()=>[r.isLegacy?(h.openBlock(),h.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=et=>o.showToolitip(6)),onMouseout:e[1]||(e[1]=et=>o.hideToolitip(6))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(h.openBlock(),h.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=et=>o.showToolitip(6)),onMouseout:e[3]||(e[3]=et=>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 "),HLt,h.createTextVNode(" models available in "),SLt,h.createTextVNode(". ")],32)):(h.openBlock(),h.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=et=>o.showToolitip(6)),onMouseout:e[5]||(e[5]=et=>o.hideToolitip(6))},[h.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),CLt,h.createTextVNode(" models available in "),ALt,h.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(h.openBlock(),h.createBlock(p,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[7].value},{reference:h.withCtx(()=>[r.displayLatestChanges?(h.openBlock(),h.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=et=>o.showToolitip(7)),onMouseout:e[10]||(e[10]=et=>o.hideToolitip(7))},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(s)]),_:1}),kLt],32)):h.createCommentVNode("",!0)]),default:h.withCtx(()=>[PLt,ILt,RLt,NLt]),_:1},8,["visible"])):h.createCommentVNode("",!0)],512),[[h.vShow,!r.disableUI]]),h.withDirectives(h.createVNode(d,{class:h.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:h.withCtx(()=>[h.createVNode(f)]),_:1},8,["class","onClick"]),[[h.vShow,t.minimapResizeShow]]),h.withDirectives(h.createElementVNode("div",BLt,[h.createVNode(p,{content:"Draw Connection",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[10].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"connection",class:"icon-button drawConnection inactive",onClick:o.connectionDialogPopup,onMouseover:e[11]||(e[11]=et=>o.showToolitip(10)),onMouseout:e[12]||(e[12]=et=>o.hideToolitip(10))},null,8,["onClick"])]),_:1},8,["visible"]),t.drawnType!=="LineString"&&t.drawnType!=="Polygon"?(h.openBlock(),h.createBlock(p,{key:0,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[11].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"drawPoint",class:"icon-button drawPoint",onClick:e[13]||(e[13]=et=>o.drawingEvent("Point")),onMouseover:e[14]||(e[14]=et=>o.showToolitip(11)),onMouseout:e[15]||(e[15]=et=>o.hideToolitip(11))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),t.drawnType!=="Point"&&t.drawnType!=="Polygon"?(h.openBlock(),h.createBlock(p,{key:1,content:"Draw Line",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[12].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"drawLine",class:"icon-button drawLineString",onClick:e[16]||(e[16]=et=>o.drawingEvent("LineString")),onMouseover:e[17]||(e[17]=et=>o.showToolitip(12)),onMouseout:e[18]||(e[18]=et=>o.hideToolitip(12))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),t.drawnType!=="Point"&&t.drawnType!=="LineString"?(h.openBlock(),h.createBlock(p,{key:2,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[13].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:e[19]||(e[19]=et=>o.drawingEvent("Polygon")),onMouseover:e[20]||(e[20]=et=>o.showToolitip(13)),onMouseout:e[21]||(e[21]=et=>o.hideToolitip(13))})]),_:1},8,["visible"])):h.createCommentVNode("",!0),h.createVNode(p,{content:"Delete",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[14].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"drawTrash",class:"icon-button drawDelete",onClick:e[22]||(e[22]=et=>o.drawingEvent("Delete")),onMouseover:e[23]||(e[23]=et=>o.showToolitip(14)),onMouseout:e[24]||(e[24]=et=>o.hideToolitip(14))})]),_:1},8,["visible"]),h.createVNode(p,{content:"Edit",placement:"top",teleported:!1,trigger:"manual",width:"80","popper-class":"flatmap-popper",visible:t.hoverVisibilities[15].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"comment",class:"icon-button drawEdit",onClick:e[25]||(e[25]=et=>o.drawingEvent("Edit")),onMouseover:e[26]||(e[26]=et=>o.showToolitip(15)),onMouseout:e[27]||(e[27]=et=>o.hideToolitip(15))})]),_:1},8,["visible"])],512),[[h.vShow,t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI]]),h.withDirectives(h.createElementVNode("div",DLt,[h.createVNode(p,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[0].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[28]||(e[28]=et=>o.zoomIn()),onMouseover:e[29]||(e[29]=et=>o.showToolitip(0)),onMouseout:e[30]||(e[30]=et=>o.hideToolitip(0))})]),_:1},8,["visible"]),h.createVNode(p,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[31]||(e[31]=et=>o.zoomOut()),onMouseover:e[32]||(e[32]=et=>o.showToolitip(1)),onMouseout:e[33]||(e[33]=et=>o.hideToolitip(1))})]),_:1},8,["visible"]),h.createVNode(p,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value},{reference:h.withCtx(()=>[h.createVNode(Q,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[34]||(e[34]=et=>o.resetView()),onMouseover:e[35]||(e[35]=et=>o.showToolitip(2)),onMouseout:e[36]||(e[36]=et=>o.hideToolitip(2))})]),default:h.withCtx(()=>[FLt]),_:1},8,["visible"])],512),[[h.vShow,!r.disableUI]]),h.createVNode(p,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper",visible:t.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:h.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[h.withDirectives((h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:h.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(m,{key:0,class:"svg-legends-container"})),h.createVNode(p,{content:"Location of the featured dataset",placement:"right",teleported:!1,trigger:"hover","popper-class":"flatmap-popper popper-bump-right",visible:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar},null,8,jLt),[[h.vShow,r.showStarInLegend],[tt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),h.createVNode(p,{content:"Find these markers for data",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper popper-bump-right",visible:t.hoverVisibilities[5].value,ref:"markerPopover"},{reference:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,zLt),[[h.vShow,t.hoverVisibilities[5].value],[tt,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(h.openBlock(),h.createBlock(_,{key:1,active:t.currentActive,hover:t.currentHover,"tree-data":t.systems,ref:"treeControls",onChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):h.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(h.openBlock(),h.createBlock(v,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter"])):h.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(h.openBlock(),h.createBlock(v,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onCheckAll"])):h.createCommentVNode("",!0),!t.isFC&&t.taxonConnectivity&&t.taxonConnectivity.length>0?(h.openBlock(),h.createBlock(v,{title:"Observed in",labelKey:"label",identifierKey:"taxon",selections:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onCheckAll"])):h.createCommentVNode("",!0),!t.isFC&&t.centreLines&&t.centreLines.length>0?(h.openBlock(),h.createBlock(v,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged"])):h.createCommentVNode("",!0)],6)),[[tt,void 0,"checkBoxPopover"]]),h.createElementVNode("div",{onClick:e[37]||(e[37]=(...et)=>o.toggleDrawer&&o.toggleDrawer(...et)),class:h.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[h.createVNode(d,null,{default:h.withCtx(()=>[h.createVNode(b)]),_:1})],2)],2),[[h.vShow,!r.disableUI]])]),_:1},8,["visible"]),t.openMapRef?(h.openBlock(),h.createBlock(p,{key:0,ref:"open-map-popover","virtual-ref":t.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(r.openMapOptions,et=>(h.openBlock(),h.createBlock(E,{key:et.key},{default:h.withCtx(()=>[h.createVNode(M,{type:"primary",plain:"",onClick:Tt=>t.$emit("open-map",et.key)},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(et.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):h.createCommentVNode("",!0),h.createVNode(p,{ref:"backgroundPopover","virtual-ref":t.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(R,{teleported:!1,modelValue:t.viewingMode,"onUpdate:modelValue":e[38]||(e[38]=et=>t.viewingMode=et),onChange:o.changeViewingMode,placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:h.withCtx(()=>[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.viewingModes,(et,Tt)=>(h.openBlock(),h.createBlock(O,{key:et+Tt,label:et,value:et},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(V,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(et),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),t.viewingMode==="Annotation"&&t.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(R,{teleported:!1,modelValue:t.drawnType,"onUpdate:modelValue":e[39]||(e[39]=et=>t.drawnType=et),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(t.drawnTypes,et=>(h.openBlock(),h.createBlock(O,{key:et,label:et,value:et},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(V,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(et),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(R,{teleported:!1,modelValue:t.annotatedType,"onUpdate:modelValue":e[40]||(e[40]=et=>t.annotatedType=et),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(t.annotatedTypes,et=>(h.openBlock(),h.createBlock(O,{key:et,label:et,value:et},{default:h.withCtx(()=>[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(V,{span:12},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(et),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):h.createCommentVNode("",!0),t.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:1,class:"backgroundSpacer"})):h.createCommentVNode("",!0),t.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:2,class:"backgroundText"},{default:h.withCtx(()=>[h.createTextVNode("Flight path display")]),_:1})):h.createCommentVNode("",!0),t.displayFlightPathOption?(h.openBlock(),h.createBlock(E,{key:3,class:"backgroundControl"},{default:h.withCtx(()=>[h.createVNode(G,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[41]||(e[41]=et=>t.flightPath3DRadio=et),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(G,{modelValue:t.colourRadio,"onUpdate:modelValue":e[42]||(e[42]=et=>t.colourRadio=et),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(G,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[43]||(e[43]=et=>t.outlinesRadio=et),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(t.availableBackground,et=>(h.openBlock(),h.createElementBlock("div",{key:et,class:h.normalizeClass(["backgroundChoice",et,et==t.currentBackground?"active":""]),onClick:Tt=>o.backgroundChangeCallback(et)},null,10,ULt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),h.withDirectives(h.createElementVNode("div",{class:h.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(p,{visible:t.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper"},{reference:h.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(h.openBlock(),h.createBlock(Q,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[44]||(e[44]=et=>o.showToolitip(8)),onMouseout:e[45]||(e[45]=et=>o.hideToolitip(8))},null,512)):h.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),h.createVNode(E,null,{default:h.withCtx(()=>[h.createVNode(p,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper"},{reference:h.withCtx(()=>[h.createVNode(Q,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[46]||(e[46]=et=>o.showToolitip(3)),onMouseout:e[47]||(e[47]=et=>o.hideToolitip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[h.vShow,!r.disableUI]]),h.withDirectives(h.createVNode(z,{ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,entry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","entry","annotationDisplay","onAnnotation"]),[[h.vShow,t.tooltipDisplay]]),h.withDirectives(h.createVNode(J,{class:"connection-dialog",entry:t.connectionEntry,drawing:t.inDrawing,connection:o.connection,onDisplay:o.connectionDialogPopup,onConfirm:o.confirmDrawnFeature,onCancel:o.cancelDrawnFeature,onPopup:o.closePopup,onTooltip:o.displayConnectedFeatureTooltip},null,8,["entry","drawing","connection","onDisplay","onConfirm","onCancel","onPopup","onTooltip"]),[[h.vShow,t.connectionDisplay]])])])),[[ot,t.loading]])}const Qb=ga(LLt,[["render",GLt],["__scopeId","data-v-116c481b"]]),oN={"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"},ZLt={name:"MultiFlatmapVuer",components:{Col:ma,Row:k2,Option:S9,Select:d5,Popover:C9,FlatmapVuer:Qb},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),R9.on("onActionClick",t=>{this.resourceSelected(t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=h.reactive(this.availableSpecies[n]);else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=h.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=h.reactive(this.availableSpecies[n]);break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this._initialised=!0,t(),this._resolveList.forEach(n=>{n()})})):this._initialised?t():this._resolveList.push(t)})},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]=h.reactive({taxo:e,isLegacy:!0,displayWarning:!0}),{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new YR(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(o=>{if(o.uuid!==r.uuid)return this.createLegacyEntry(t,r.entry,r.uuid)}).then(o=>{e(o||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in oN?oN[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.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/"},disableUI:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},$Lt=t=>(h.pushScopeId("data-v-5550e1f2"),t=t(),h.popScopeId(),t),qLt={class:"multi-container",ref:"multiContainer"},WLt={key:0,style:{position:"absolute","z-index":"10"}},XLt=$Lt(()=>h.createElementVNode("div",{class:"species-display-text"},"Species",-1)),KLt={class:"select-box-icon"};function YLt(t,e,r,n,i,o){const a=S9,s=d5,d=C9,p=Qb;return h.openBlock(),h.createElementBlock("div",qLt,[r.disableUI?h.createCommentVNode("",!0):(h.openBlock(),h.createElementBlock("div",WLt,[XLt,h.createVNode(d,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper right-popper",visible:r.helpMode,teleported:!1,ref:"selectPopover"},{reference:h.withCtx(()=>[h.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),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(t.speciesList,(f,Q)=>(h.openBlock(),h.createBlock(a,{key:Q,label:Q,value:Q},{default:h.withCtx(()=>[h.createElementVNode("span",KLt,[h.createElementVNode("i",{class:h.normalizeClass(f.iconClass)},null,2)]),h.createTextVNode(" "+h.toDisplayString(Q),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(t.speciesList,(f,Q)=>h.withDirectives((h.openBlock(),h.createBlock(p,{key:Q,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:Q,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,onOpenMap:e[1]||(e[1]=m=>t.$emit("open-map",m)),minZoom:r.minZoom,helpMode:r.helpMode,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","minZoom","helpMode","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[h.vShow,t.activeSpecies==Q]])),128))],512)}const JLt=ga(ZLt,[["render",YLt],["__scopeId","data-v-5550e1f2"]]);ii.FlatmapVuer=Qb,ii.MultiFlatmapVuer=JLt,ii.Tooltip=hQ,Object.defineProperty(ii,Symbol.toStringTag,{value:"Module"})});